diff options
Diffstat (limited to 'linden/indra/llui/llcombobox.h')
-rw-r--r-- | linden/indra/llui/llcombobox.h | 61 |
1 files changed, 47 insertions, 14 deletions
diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h index 6e5e4ab..2a70db2 100644 --- a/linden/indra/llui/llcombobox.h +++ b/linden/indra/llui/llcombobox.h | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -80,6 +80,7 @@ public: | |||
80 | 80 | ||
81 | virtual void draw(); | 81 | virtual void draw(); |
82 | virtual void onFocusLost(); | 82 | virtual void onFocusLost(); |
83 | virtual void onLostTop(); | ||
83 | 84 | ||
84 | virtual void setEnabled(BOOL enabled); | 85 | virtual void setEnabled(BOOL enabled); |
85 | 86 | ||
@@ -107,21 +108,22 @@ public: | |||
107 | void setAllowTextEntry(BOOL allow, S32 max_chars = 50, BOOL make_tentative = TRUE); | 108 | void setAllowTextEntry(BOOL allow, S32 max_chars = 50, BOOL make_tentative = TRUE); |
108 | void setTextEntry(const LLStringExplicit& text); | 109 | void setTextEntry(const LLStringExplicit& text); |
109 | 110 | ||
110 | void add(const LLString& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu | 111 | LLScrollListItem* add(const LLString& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu |
111 | void add(const LLString& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); | 112 | LLScrollListItem* add(const LLString& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); |
112 | void add(const LLString& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); | 113 | LLScrollListItem* add(const LLString& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); |
113 | void add(const LLString& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); | 114 | LLScrollListItem* add(const LLString& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); |
115 | LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM); | ||
114 | BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed | 116 | BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed |
115 | void removeall() { clearRows(); } | 117 | void removeall() { clearRows(); } |
116 | 118 | ||
117 | void sortByName(); // Sort the entries in the combobox by name | 119 | void sortByName(); // Sort the entries in the combobox by name |
118 | 120 | ||
119 | // Select current item by name using selectSimpleItem. Returns FALSE if not found. | 121 | // Select current item by name using selectItemByLabel. Returns FALSE if not found. |
120 | BOOL setSimple(const LLStringExplicit& name); | 122 | BOOL setSimple(const LLStringExplicit& name); |
121 | // Get name of current item. Returns an empty string if not found. | 123 | // Get name of current item. Returns an empty string if not found. |
122 | const LLString& getSimple() const; | 124 | const LLString getSimple() const; |
123 | // Get contents of column x of selected row | 125 | // Get contents of column x of selected row |
124 | const LLString& getSimpleSelectedItem(S32 column = 0) const; | 126 | const LLString getSelectedItemLabel(S32 column = 0) const; |
125 | 127 | ||
126 | // Sets the label, which doesn't have to exist in the label. | 128 | // Sets the label, which doesn't have to exist in the label. |
127 | // This is probably a UI abuse. | 129 | // This is probably a UI abuse. |
@@ -132,6 +134,8 @@ public: | |||
132 | BOOL setCurrentByIndex( S32 index ); | 134 | BOOL setCurrentByIndex( S32 index ); |
133 | S32 getCurrentIndex() const; | 135 | S32 getCurrentIndex() const; |
134 | 136 | ||
137 | virtual void updateLayout(); | ||
138 | |||
135 | //======================================================================== | 139 | //======================================================================== |
136 | LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; }; | 140 | LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; }; |
137 | LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)this; }; | 141 | LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)this; }; |
@@ -156,7 +160,7 @@ public: | |||
156 | virtual BOOL setCurrentByID( const LLUUID& id ); | 160 | virtual BOOL setCurrentByID( const LLUUID& id ); |
157 | virtual LLUUID getCurrentID(); // LLUUID::null if no items in menu | 161 | virtual LLUUID getCurrentID(); // LLUUID::null if no items in menu |
158 | virtual BOOL setSelectedByValue(LLSD value, BOOL selected); | 162 | virtual BOOL setSelectedByValue(LLSD value, BOOL selected); |
159 | virtual LLSD getSimpleSelectedValue(); | 163 | virtual LLSD getSelectedValue(); |
160 | virtual BOOL isSelected(LLSD value); | 164 | virtual BOOL isSelected(LLSD value); |
161 | virtual BOOL operateOnSelection(EOperation op); | 165 | virtual BOOL operateOnSelection(EOperation op); |
162 | virtual BOOL operateOnAll(EOperation op); | 166 | virtual BOOL operateOnAll(EOperation op); |
@@ -172,7 +176,6 @@ public: | |||
172 | 176 | ||
173 | static void onButtonDown(void *userdata); | 177 | static void onButtonDown(void *userdata); |
174 | static void onItemSelected(LLUICtrl* item, void *userdata); | 178 | static void onItemSelected(LLUICtrl* item, void *userdata); |
175 | static void onListFocusChanged(LLUICtrl* item, void *userdata); | ||
176 | static void onTextEntry(LLLineEditor* line_editor, void* user_data); | 179 | static void onTextEntry(LLLineEditor* line_editor, void* user_data); |
177 | static void onTextCommit(LLUICtrl* caller, void* user_data); | 180 | static void onTextCommit(LLUICtrl* caller, void* user_data); |
178 | 181 | ||
@@ -183,12 +186,10 @@ public: | |||
183 | protected: | 186 | protected: |
184 | LLButton* mButton; | 187 | LLButton* mButton; |
185 | LLScrollListCtrl* mList; | 188 | LLScrollListCtrl* mList; |
189 | S32 mButtonPadding; | ||
186 | LLViewBorder* mBorder; | 190 | LLViewBorder* mBorder; |
187 | BOOL mKeyboardFocusOnClick; | ||
188 | BOOL mDrawArrow; | ||
189 | LLLineEditor* mTextEntry; | 191 | LLLineEditor* mTextEntry; |
190 | LLPointer<LLImageGL> mArrowImage; | 192 | LLPointer<LLImageGL> mArrowImage; |
191 | S32 mArrowImageWidth; | ||
192 | BOOL mAllowTextEntry; | 193 | BOOL mAllowTextEntry; |
193 | S32 mMaxChars; | 194 | S32 mMaxChars; |
194 | BOOL mTextEntryTentative; | 195 | BOOL mTextEntryTentative; |
@@ -197,4 +198,36 @@ protected: | |||
197 | void (*mTextEntryCallback)(LLLineEditor*, void*); | 198 | void (*mTextEntryCallback)(LLLineEditor*, void*); |
198 | }; | 199 | }; |
199 | 200 | ||
201 | class LLFlyoutButton : public LLComboBox | ||
202 | { | ||
203 | public: | ||
204 | LLFlyoutButton( | ||
205 | const LLString& name, | ||
206 | const LLRect &rect, | ||
207 | const LLString& label, | ||
208 | void (*commit_callback)(LLUICtrl*, void*) = NULL, | ||
209 | void *callback_userdata = NULL); | ||
210 | |||
211 | virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_FLYOUT_BUTTON; } | ||
212 | virtual LLString getWidgetTag() const { return LL_FLYOUT_BUTTON_TAG; } | ||
213 | |||
214 | virtual void updateLayout(); | ||
215 | virtual void draw(); | ||
216 | virtual void setEnabled(BOOL enabled); | ||
217 | |||
218 | void setToggleState(BOOL state); | ||
219 | |||
220 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | ||
221 | static void onActionButtonClick(void *userdata); | ||
222 | static void onSelectAction(LLUICtrl* ctrl, void *userdata); | ||
223 | |||
224 | protected: | ||
225 | LLButton* mActionButton; | ||
226 | LLPointer<LLUIImage> mActionButtonImage; | ||
227 | LLPointer<LLUIImage> mExpanderButtonImage; | ||
228 | LLPointer<LLUIImage> mActionButtonImageSelected; | ||
229 | LLPointer<LLUIImage> mExpanderButtonImageSelected; | ||
230 | BOOL mToggleState; | ||
231 | }; | ||
232 | |||
200 | #endif | 233 | #endif |