aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llpanel.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llui/llpanel.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llui/llpanel.h')
-rw-r--r--linden/indra/llui/llpanel.h126
1 files changed, 63 insertions, 63 deletions
diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h
index c7627ff..46cde5b 100644
--- a/linden/indra/llui/llpanel.h
+++ b/linden/indra/llui/llpanel.h
@@ -51,10 +51,10 @@ const BOOL BORDER_NO = FALSE;
51 51
52struct LLAlertInfo 52struct LLAlertInfo
53{ 53{
54 LLString mLabel; 54 std::string mLabel;
55 LLString::format_map_t mArgs; 55 LLStringUtil::format_map_t mArgs;
56 56
57 LLAlertInfo(LLString label, LLString::format_map_t args) : mLabel(label), mArgs(args) { } 57 LLAlertInfo(std::string label, LLStringUtil::format_map_t args) : mLabel(label), mArgs(args) { }
58 LLAlertInfo(){} 58 LLAlertInfo(){}
59}; 59};
60 60
@@ -71,13 +71,13 @@ public:
71 71
72 // minimal constructor for data-driven initialization 72 // minimal constructor for data-driven initialization
73 LLPanel(); 73 LLPanel();
74 LLPanel(const LLString& name); 74 LLPanel(const std::string& name);
75 75
76 // Position and size not saved 76 // Position and size not saved
77 LLPanel(const LLString& name, const LLRect& rect, BOOL bordered = TRUE); 77 LLPanel(const std::string& name, const LLRect& rect, BOOL bordered = TRUE);
78 78
79 // Position and size are saved to rect_control 79 // Position and size are saved to rect_control
80 LLPanel(const LLString& name, const LLString& rect_control, BOOL bordered = TRUE); 80 LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered = TRUE);
81 81
82 /*virtual*/ ~LLPanel(); 82 /*virtual*/ ~LLPanel();
83 83
@@ -87,7 +87,7 @@ public:
87 /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); 87 /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
88 /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; 88 /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
89 // Override to set not found list: 89 // Override to set not found list:
90 virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; 90 virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
91 91
92 // From LLFocusableElement 92 // From LLFocusableElement
93 /*virtual*/ void setFocus( BOOL b ); 93 /*virtual*/ void setFocus( BOOL b );
@@ -105,7 +105,7 @@ public:
105 BOOL hasBorder() const { return mBorder != NULL; } 105 BOOL hasBorder() const { return mBorder != NULL; }
106 void setBorderVisible( BOOL b ); 106 void setBorderVisible( BOOL b );
107 107
108 template <class T> void requires(LLString name) 108 template <class T> void requires(const std::string& name)
109 { 109 {
110 // check for widget with matching type and name 110 // check for widget with matching type and name
111 if (LLView::getChild<T>(name) == NULL) 111 if (LLView::getChild<T>(name) == NULL)
@@ -115,7 +115,7 @@ public:
115 } 115 }
116 116
117 // requires LLView by default 117 // requires LLView by default
118 void requires(LLString name) 118 void requires(const std::string& name)
119 { 119 {
120 requires<LLView>(name); 120 requires<LLView>(name);
121 } 121 }
@@ -130,13 +130,13 @@ public:
130 void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } 130 void setBackgroundOpaque(BOOL b) { mBgOpaque = b; }
131 BOOL isBackgroundOpaque() const { return mBgOpaque; } 131 BOOL isBackgroundOpaque() const { return mBgOpaque; }
132 void setDefaultBtn(LLButton* btn = NULL); 132 void setDefaultBtn(LLButton* btn = NULL);
133 void setDefaultBtn(const LLString& id); 133 void setDefaultBtn(const std::string& id);
134 void updateDefaultBtn(); 134 void updateDefaultBtn();
135 void setLabel(const LLStringExplicit& label) { mLabel = label; } 135 void setLabel(const LLStringExplicit& label) { mLabel = label; }
136 LLString getLabel() const { return mLabel; } 136 std::string getLabel() const { return mLabel; }
137 137
138 void setRectControl(const LLString& rect_control) { mRectControl.assign(rect_control); } 138 void setRectControl(const std::string& rect_control) { mRectControl.assign(rect_control); }
139 const LLString& getRectControl() const { return mRectControl; } 139 const std::string& getRectControl() const { return mRectControl; }
140 void storeRectControl(); 140 void storeRectControl();
141 141
142 void setCtrlsEnabled(BOOL b); 142 void setCtrlsEnabled(BOOL b);
@@ -151,83 +151,83 @@ public:
151 void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory); 151 void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory);
152 void setPanelParameters(LLXMLNodePtr node, LLView *parentp); 152 void setPanelParameters(LLXMLNodePtr node, LLView *parentp);
153 153
154 LLString getString(const LLString& name, const LLString::format_map_t& args = LLUIString::sNullArgs) const; 154 std::string getString(const std::string& name, const LLStringUtil::format_map_t& args = LLUIString::sNullArgs) const;
155 LLUIString getUIString(const LLString& name) const; 155 LLUIString getUIString(const std::string& name) const;
156 156
157 // ** Wrappers for setting child properties by name ** -TomY 157 // ** Wrappers for setting child properties by name ** -TomY
158 158
159 // LLView 159 // LLView
160 void childSetVisible(const LLString& name, bool visible); 160 void childSetVisible(const std::string& name, bool visible);
161 void childShow(const LLString& name) { childSetVisible(name, true); } 161 void childShow(const std::string& name) { childSetVisible(name, true); }
162 void childHide(const LLString& name) { childSetVisible(name, false); } 162 void childHide(const std::string& name) { childSetVisible(name, false); }
163 bool childIsVisible(const LLString& id) const; 163 bool childIsVisible(const std::string& id) const;
164 void childSetTentative(const LLString& name, bool tentative); 164 void childSetTentative(const std::string& name, bool tentative);
165 165
166 void childSetEnabled(const LLString& name, bool enabled); 166 void childSetEnabled(const std::string& name, bool enabled);
167 void childEnable(const LLString& name) { childSetEnabled(name, true); } 167 void childEnable(const std::string& name) { childSetEnabled(name, true); }
168 void childDisable(const LLString& name) { childSetEnabled(name, false); }; 168 void childDisable(const std::string& name) { childSetEnabled(name, false); };
169 bool childIsEnabled(const LLString& id) const; 169 bool childIsEnabled(const std::string& id) const;
170 170
171 void childSetToolTip(const LLString& id, const LLString& msg); 171 void childSetToolTip(const std::string& id, const std::string& msg);
172 void childSetRect(const LLString& id, const LLRect &rect); 172 void childSetRect(const std::string& id, const LLRect &rect);
173 bool childGetRect(const LLString& id, LLRect& rect) const; 173 bool childGetRect(const std::string& id, LLRect& rect) const;
174 174
175 // LLUICtrl 175 // LLUICtrl
176 void childSetFocus(const LLString& id, BOOL focus = TRUE); 176 void childSetFocus(const std::string& id, BOOL focus = TRUE);
177 BOOL childHasFocus(const LLString& id); 177 BOOL childHasFocus(const std::string& id);
178 void childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL); 178 void childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL);
179 179
180 void childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); 180 void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL );
181 void childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), void* userdata = NULL ); 181 void childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void* userdata = NULL );
182 void childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*) ); 182 void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) );
183 void childSetUserData(const LLString& id, void* userdata); 183 void childSetUserData(const std::string& id, void* userdata);
184 184
185 void childSetColor(const LLString& id, const LLColor4& color); 185 void childSetColor(const std::string& id, const LLColor4& color);
186 186
187 LLCtrlSelectionInterface* childGetSelectionInterface(const LLString& id) const; 187 LLCtrlSelectionInterface* childGetSelectionInterface(const std::string& id) const;
188 LLCtrlListInterface* childGetListInterface(const LLString& id) const; 188 LLCtrlListInterface* childGetListInterface(const std::string& id) const;
189 LLCtrlScrollInterface* childGetScrollInterface(const LLString& id) const; 189 LLCtrlScrollInterface* childGetScrollInterface(const std::string& id) const;
190 190
191 // This is the magic bullet for data-driven UI 191 // This is the magic bullet for data-driven UI
192 void childSetValue(const LLString& id, LLSD value); 192 void childSetValue(const std::string& id, LLSD value);
193 LLSD childGetValue(const LLString& id) const; 193 LLSD childGetValue(const std::string& id) const;
194 194
195 // For setting text / label replacement params, e.g. "Hello [NAME]" 195 // For setting text / label replacement params, e.g. "Hello [NAME]"
196 // Not implemented for all types, defaults to noop, returns FALSE if not applicaple 196 // Not implemented for all types, defaults to noop, returns FALSE if not applicaple
197 BOOL childSetTextArg(const LLString& id, const LLString& key, const LLStringExplicit& text); 197 BOOL childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
198 BOOL childSetLabelArg(const LLString& id, const LLString& key, const LLStringExplicit& text); 198 BOOL childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
199 BOOL childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text); 199 BOOL childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
200 200
201 // LLSlider / LLMultiSlider / LLSpinCtrl 201 // LLSlider / LLMultiSlider / LLSpinCtrl
202 void childSetMinValue(const LLString& id, LLSD min_value); 202 void childSetMinValue(const std::string& id, LLSD min_value);
203 void childSetMaxValue(const LLString& id, LLSD max_value); 203 void childSetMaxValue(const std::string& id, LLSD max_value);
204 204
205 // LLTabContainer 205 // LLTabContainer
206 void childShowTab(const LLString& id, const LLString& tabname, bool visible = true); 206 void childShowTab(const std::string& id, const std::string& tabname, bool visible = true);
207 LLPanel *childGetVisibleTab(const LLString& id) const; 207 LLPanel *childGetVisibleTab(const std::string& id) const;
208 void childSetTabChangeCallback(const LLString& id, const LLString& tabname, void (*on_tab_clicked)(void*, bool), void *userdata); 208 void childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata);
209 209
210 // LLTextBox 210 // LLTextBox
211 void childSetWrappedText(const LLString& id, const LLString& text, bool visible = true); 211 void childSetWrappedText(const std::string& id, const std::string& text, bool visible = true);
212 212
213 // LLTextBox/LLTextEditor/LLLineEditor 213 // LLTextBox/LLTextEditor/LLLineEditor
214 void childSetText(const LLString& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } 214 void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); }
215 LLString childGetText(const LLString& id) const { return childGetValue(id).asString(); } 215 std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); }
216 216
217 // LLLineEditor 217 // LLLineEditor
218 void childSetKeystrokeCallback(const LLString& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data); 218 void childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data);
219 void childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWString &) ); 219 void childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) );
220 220
221 // LLButton 221 // LLButton
222 void childSetAction(const LLString& id, void(*function)(void*), void* value); 222 void childSetAction(const std::string& id, void(*function)(void*), void* value);
223 void childSetActionTextbox(const LLString& id, void(*function)(void*)); 223 void childSetActionTextbox(const std::string& id, void(*function)(void*));
224 void childSetControlName(const LLString& id, const LLString& control_name); 224 void childSetControlName(const std::string& id, const std::string& control_name);
225 225
226 // Error reporting 226 // Error reporting
227 void childNotFound(const LLString& id) const; 227 void childNotFound(const std::string& id) const;
228 void childDisplayNotFound(); 228 void childDisplayNotFound();
229 229
230 static void alertXml(LLString label, LLString::format_map_t args = LLString::format_map_t()); 230 static void alertXml(const std::string& label, LLStringUtil::format_map_t args = LLStringUtil::format_map_t());
231 static BOOL nextAlert(LLAlertInfo &alert); 231 static BOOL nextAlert(LLAlertInfo &alert);
232 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 232 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
233 233
@@ -245,11 +245,11 @@ private:
245 virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); 245 virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group);
246 246
247 // Unified error reporting for the child* functions 247 // Unified error reporting for the child* functions
248 typedef std::set<LLString> expected_members_list_t; 248 typedef std::set<std::string> expected_members_list_t;
249 mutable expected_members_list_t mExpectedMembers; 249 mutable expected_members_list_t mExpectedMembers;
250 mutable expected_members_list_t mNewExpectedMembers; 250 mutable expected_members_list_t mNewExpectedMembers;
251 251
252 LLString mRectControl; 252 std::string mRectControl;
253 LLColor4 mBgColorAlpha; 253 LLColor4 mBgColorAlpha;
254 LLColor4 mBgColorOpaque; 254 LLColor4 mBgColorOpaque;
255 LLColor4 mDefaultBtnHighlight; 255 LLColor4 mDefaultBtnHighlight;
@@ -257,14 +257,14 @@ private:
257 BOOL mBgOpaque; 257 BOOL mBgOpaque;
258 LLViewBorder* mBorder; 258 LLViewBorder* mBorder;
259 LLButton* mDefaultBtn; 259 LLButton* mDefaultBtn;
260 LLString mLabel; 260 std::string mLabel;
261 S32 mLastTabGroup; 261 S32 mLastTabGroup;
262 LLRootHandle<LLPanel> mPanelHandle; 262 LLRootHandle<LLPanel> mPanelHandle;
263 263
264 typedef std::map<LLString, LLUIString> ui_string_map_t; 264 typedef std::map<std::string, LLUIString> ui_string_map_t;
265 ui_string_map_t mUIStrings; 265 ui_string_map_t mUIStrings;
266 266
267 LLString mRequirementsError; 267 std::string mRequirementsError;
268 268
269 typedef std::queue<LLAlertInfo> alert_queue_t; 269 typedef std::queue<LLAlertInfo> alert_queue_t;
270 static alert_queue_t sAlertQueue; 270 static alert_queue_t sAlertQueue;