author | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
commit | 6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff) | |
tree | 6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/menubutton.cpp | |
parent | d10cddb3c9ce75bc90b14add14bc133737fe35aa (diff) | |
download | opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2 |
Qtopia1-6 merge
still to test
bic changes to be resolved
more changes to be made?
-rw-r--r-- | library/menubutton.cpp | 71 |
1 files changed, 50 insertions, 21 deletions
diff --git a/library/menubutton.cpp b/library/menubutton.cpp index 6b1fa2b..f5c832c 100644 --- a/library/menubutton.cpp +++ b/library/menubutton.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
@@ -27,3 +27,20 @@ | |||
27 | 27 | ||
28 | Similar in function to a QComboBox. | 28 | When the user presses the menubutton's pushbutton, the menu pops up. |
29 | A menu is composed of menu items each of which has a string label, | ||
30 | and optionally an icon. | ||
31 | |||
32 | The index of the item that the user's input device (e.g. stylus) is | ||
33 | pointing at is the currentItem(), whose text is available using | ||
34 | currentText(). | ||
35 | |||
36 | Menu items are inserted with the \link MenuButton::MenuButton() | ||
37 | constructor\endlink, insertItem() or insertItems(). Separators are | ||
38 | inserted with insertSeparator(). All the items in the menu can be | ||
39 | removed by calling clear(). | ||
40 | |||
41 | Items can be selected programmatically using select(). When a menu | ||
42 | item is selected (programmatically or by the user), the selected() | ||
43 | signal is emitted. | ||
44 | |||
45 | \ingroup qtopiaemb | ||
29 | */ | 46 | */ |
@@ -31,5 +48,5 @@ | |||
31 | /*! | 48 | /*! |
32 | \fn void MenuButton::selected(int index) | 49 | \overload void MenuButton::selected(int index) |
33 | 50 | ||
34 | This signal is emitted when the item at \a index is selected. | 51 | This signal is emitted when the item at position \a index is selected. |
35 | */ | 52 | */ |
@@ -39,3 +56,3 @@ | |||
39 | 56 | ||
40 | This signal is emitted when the item with the given \a text is selected. | 57 | This signal is emitted when the item with the label \a text is selected. |
41 | */ | 58 | */ |
@@ -44,4 +61,6 @@ | |||
44 | /*! | 61 | /*! |
45 | Constructs a MenuButton with the given \a items added (see insertItems()). | 62 | Constructs a MenuButton. A menu item is created (see insertItem() |
46 | The standard \a parent an \a name arguments are passed to the base class. | 63 | and insertItems()) for each string in the \a items string list. The |
64 | standard \a parent an \a name arguments are passed to the base | ||
65 | class. | ||
47 | */ | 66 | */ |
@@ -58,3 +77,3 @@ MenuButton::MenuButton( const QStringList& items, QWidget* parent, const char* n | |||
58 | 77 | ||
59 | \sa insertItems() | 78 | \sa insertItem() insertItems() |
60 | */ | 79 | */ |
@@ -77,3 +96,3 @@ void MenuButton::init() | |||
77 | /*! | 96 | /*! |
78 | Removes all items from the button and menu. | 97 | Removes all the menu items from the button and menu. |
79 | */ | 98 | */ |
@@ -86,4 +105,5 @@ void MenuButton::clear() | |||
86 | /*! | 105 | /*! |
87 | Inserts string \a items into the menu. The string "--" represents | 106 | A menu item is created (see insertItem()) for each string in the \a |
88 | a separator. | 107 | items string list. If any string is "--" a separator (see |
108 | insertSeparator()) is inserted in its place. | ||
89 | */ | 109 | */ |
@@ -101,5 +121,8 @@ void MenuButton::insertItems( const QStringList& items ) | |||
101 | /*! | 121 | /*! |
102 | Inserts an \a icon and \a text into the menu. | 122 | Inserts a menu item with the icon \a icon and label \a text into |
123 | the menu. | ||
124 | |||
125 | \sa insertItems() | ||
103 | */ | 126 | */ |
104 | void MenuButton::insertItem( const QIconSet& icon, const QString& text ) | 127 | void MenuButton::insertItem( const QIconSet& icon, const QString& text=QString::null ) |
105 | { | 128 | { |
@@ -110,3 +133,6 @@ void MenuButton::insertItem( const QIconSet& icon, const QString& text ) | |||
110 | /*! | 133 | /*! |
111 | Inserts \a text into the menu. | 134 | \overload |
135 | Inserts a menu item with the label \a text into the menu. | ||
136 | |||
137 | \sa insertItems() | ||
112 | */ | 138 | */ |
@@ -119,3 +145,5 @@ void MenuButton::insertItem( const QString& text ) | |||
119 | /*! | 145 | /*! |
120 | Inserts a visual separator into the menu. | 146 | Inserts a separator into the menu. |
147 | |||
148 | \sa insertItems() | ||
121 | */ | 149 | */ |
@@ -127,3 +155,3 @@ void MenuButton::insertSeparator() | |||
127 | /*! | 155 | /*! |
128 | Selects the items with text \a s. | 156 | Selects the items with label text \a s. |
129 | */ | 157 | */ |
@@ -140,3 +168,4 @@ void MenuButton::select(const QString& s) | |||
140 | /*! | 168 | /*! |
141 | Selects the item at index \a s. | 169 | \overload |
170 | Selects the item at index position \a s. | ||
142 | */ | 171 | */ |
@@ -153,3 +182,3 @@ void MenuButton::select(int s) | |||
153 | /*! | 182 | /*! |
154 | Returns the index of the current item. | 183 | Returns the index position of the current item. |
155 | */ | 184 | */ |
@@ -161,3 +190,3 @@ int MenuButton::currentItem() const | |||
161 | /*! | 190 | /*! |
162 | Returns the text of the current item. | 191 | Returns the label text of the current item. |
163 | */ | 192 | */ |
@@ -169,3 +198,3 @@ QString MenuButton::currentText() const | |||
169 | /*! | 198 | /*! |
170 | Sets the label. If \a label is empty, the | 199 | Sets the menubutton's label. If \a label is empty, the |
171 | current item text is displayed, otherwise \a label should contain | 200 | current item text is displayed, otherwise \a label should contain |