#include <ugadgets.hpp>
Inheritance diagram for UCombobox:
Public Member Functions | |
UCombobox (class UListbox &list, const UArgs &=UArgs::none) | |
UListbox & | list () |
const class UListbox & | list () const |
UChoice & | choice () |
const class UChoice & | choice () const |
bool | isTextMode () const |
void | setTextMode (bool=true) |
UCombobox & | textMode (bool st=true) |
Friends | |
UCombobox & | ucombobox (class UListbox &list, const UArgs &a=UArgs::none) |
Geometry: Same Geometry and Properties as UTextfield. This gadget keeps its initial size (which is calculated to make the first child of the list entirely visible).
List and Selection management:
Text mode means that the combox box only displays the text of the selected item. Non-text mode (the default) means that the actual content of the selected item is displayed inside the combo box.
Exemple
XXX* obj = ...;
UCombobox& files = ucombobox( ulistbox(uitem(UPix::doc + "~/ubit/") + uitem(UPix::doc + "~/ubit/campus/") + uitem(UPix::doc + "~/ubit/campus/examples/"), // dont forget the comma // this is a callback of the Combobox, not a callback of the Listbox UOn::action / ucall(rem, target, "file:", &XXX::foo) );
void ObjClass::foo(UEvent& e) { if (e.getSource()) { // returns the UCombobox // collates the text enclosed in the UCombobox and copies it to 's' UStr s = e.getSource()->copyText(); cout << s << endl; }