#include </home/clem/local/src/opie/library/menubutton.h>
Collaboration diagram for MenuButton:

Public Slots | |
| void | select (int) |
| void | select (const QString &) |
Signals | |
| void | selected (int) |
| void | selected (const QString &) |
Public Member Functions | |
| MenuButton (QWidget *parent, const char *name=0) | |
| MenuButton (const QStringList &items, QWidget *parent, const char *name=0) | |
| void | clear () |
| int | currentItem () const |
| QString | currentText () const |
| void | insertItems (const QStringList &items) |
| void | insertItem (const QIconSet &icon, const QString &text=QString::null) |
| void | insertItem (const QString &text) |
| void | insertSeparator () |
| void | setLabel (const QString &label) |
| int | count () |
| void | remove (int id) |
| QString | text (int id) |
| void | setUseLabel (bool b) |
Private Member Functions | |
| void | init () |
| void | updateLabel () |
Private Attributes | |
| bool | useLabel |
| QStringList | txts |
| QPopupMenu * | pop |
| int | nitems |
| int | cur |
| QString | lab |
When the user presses the menubutton's pushbutton, the menu pops up. A menu is composed of menu items each of which has a string label, and optionally an icon.
The index of the item that the user's input device (e.g. stylus) is pointing at is the currentItem(), whose text is available using currentText().
Menu items are inserted with the constructor, insertItem() or insertItems(). Separators are inserted with insertSeparator(). All the items in the menu can be removed by calling clear().
Items can be selected programmatically using select(). When a menu item is selected (programmatically or by the user), the selected() signal is emitted.
Definition at line 26 of file menubutton.h.
|
||||||||||||
|
Constructs an empty MenuButton. The standard parent an name arguments are passed to the base class.
Definition at line 81 of file menubutton.cpp. References init(). |
|
||||||||||||||||
|
Constructs a MenuButton. A menu item is created (see insertItem() and insertItems()) for each string in the items string list. The standard parent an name arguments are passed to the base class. Definition at line 67 of file menubutton.cpp. References init(), insertItems(), and useLabel. |
|
|
Removes all the menu items from the button and menu. Definition at line 100 of file menubutton.cpp. |
|
|
return count of items in menu Definition at line 234 of file menubutton.cpp. References nitems. |
|
|
Returns the index position of the current item. Definition at line 186 of file menubutton.cpp. References cur. |
|
|
Returns the label text of the current item. Definition at line 194 of file menubutton.cpp. Referenced by select(). |
|
|
Definition at line 87 of file menubutton.cpp. References FALSE, nitems, pop, and select(). Referenced by clear(), and MenuButton(). |
|
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Inserts a menu item with the label text into the menu.
Definition at line 140 of file menubutton.cpp. |
|
||||||||||||
|
Inserts a menu item with the icon icon and label text into the menu.
Definition at line 128 of file menubutton.cpp. Referenced by AdvancedFm::addCustomDir(), AdvancedFm::init(), and insertItems(). |
|
|
A menu item is created (see insertItem()) for each string in the items string list. If any string is "--" a separator (see insertSeparator()) is inserted in its place. Definition at line 111 of file menubutton.cpp. References QValueList< T >::begin(), QValueList< T >::end(), insertItem(), and insertSeparator(). Referenced by AdvancedFm::customDirsToMenu(), and MenuButton(). |
|
|
Inserts a separator into the menu.
Definition at line 151 of file menubutton.cpp. References pop. Referenced by AdvancedFm::init(), and insertItems(). |
|
|
remove item at id Definition at line 225 of file menubutton.cpp. Referenced by AdvancedFm::removeCustomDir(). |
|
|
Selects the items with label text s. Definition at line 159 of file menubutton.cpp. |
|
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Selects the item at index position s. Definition at line 173 of file menubutton.cpp. References cur, currentText(), pop, selected(), and updateLabel(). |
|
|
This signal is emitted when the item with the label text is selected. |
|
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This signal is emitted when the item at position index is selected. Referenced by select(). |
|
|
Sets the menubutton's label. If label is empty, the current item text is displayed, otherwise label should contain "%1", which will be replaced by the current item text. Definition at line 204 of file menubutton.cpp. References lab, and updateLabel(). |
|
|
sets true or false the use of label Definition at line 250 of file menubutton.cpp. References useLabel. Referenced by AdvancedFm::init(). |
|
|
returns text of item id Definition at line 242 of file menubutton.cpp. References pop. |
|
|
Definition at line 210 of file menubutton.cpp. References QString::arg(), cur, QString::isEmpty(), lab, pop, t, and useLabel. Referenced by select(), and setLabel(). |
|
|
Definition at line 63 of file menubutton.h. Referenced by currentItem(), currentText(), select(), and updateLabel(). |
|
|
Definition at line 64 of file menubutton.h. Referenced by setLabel(), and updateLabel(). |
|
|
Definition at line 62 of file menubutton.h. Referenced by count(), init(), insertItem(), remove(), and select(). |
|
|
Definition at line 61 of file menubutton.h. Referenced by clear(), currentText(), init(), insertItem(), insertSeparator(), remove(), select(), text(), and updateLabel(). |
|
|
Definition at line 60 of file menubutton.h. |
|
|
Definition at line 58 of file menubutton.h. Referenced by MenuButton(), setUseLabel(), and updateLabel(). |
1.4.2