aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llpanel.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/llpanel.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h
index e0f48ca..c7627ff 100644
--- a/linden/indra/llui/llpanel.h
+++ b/linden/indra/llui/llpanel.h
@@ -82,13 +82,12 @@ public:
82 /*virtual*/ ~LLPanel(); 82 /*virtual*/ ~LLPanel();
83 83
84 // LLView interface 84 // LLView interface
85 /*virtual*/ EWidgetType getWidgetType() const;
86 /*virtual*/ LLString getWidgetTag() const;
87 /*virtual*/ BOOL isPanel() const; 85 /*virtual*/ BOOL isPanel() const;
88 /*virtual*/ void draw(); 86 /*virtual*/ void draw();
89 /*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); 87 /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
90 /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent );
91 /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; 88 /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
89 // Override to set not found list:
90 virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
92 91
93 // From LLFocusableElement 92 // From LLFocusableElement
94 /*virtual*/ void setFocus( BOOL b ); 93 /*virtual*/ void setFocus( BOOL b );
@@ -106,8 +105,21 @@ public:
106 BOOL hasBorder() const { return mBorder != NULL; } 105 BOOL hasBorder() const { return mBorder != NULL; }
107 void setBorderVisible( BOOL b ); 106 void setBorderVisible( BOOL b );
108 107
109 void requires(LLString name, EWidgetType type = WIDGET_TYPE_DONTCARE); 108 template <class T> void requires(LLString name)
110 BOOL checkRequirements() const; 109 {
110 // check for widget with matching type and name
111 if (LLView::getChild<T>(name) == NULL)
112 {
113 mRequirementsError += name + "\n";
114 }
115 }
116
117 // requires LLView by default
118 void requires(LLString name)
119 {
120 requires<LLView>(name);
121 }
122 BOOL checkRequirements();
111 123
112 void setBackgroundColor( const LLColor4& color ) { mBgColorOpaque = color; } 124 void setBackgroundColor( const LLColor4& color ) { mBgColorOpaque = color; }
113 const LLColor4& getBackgroundColor() const { return mBgColorOpaque; } 125 const LLColor4& getBackgroundColor() const { return mBgColorOpaque; }
@@ -133,8 +145,6 @@ public:
133 145
134 S32 getLastTabGroup() const { return mLastTabGroup; } 146 S32 getLastTabGroup() const { return mLastTabGroup; }
135 147
136 LLUICtrl* getCtrlByNameAndType(const LLString& name, EWidgetType type) const;
137
138 const LLCallbackMap::map_t& getFactoryMap() const { return mFactoryMap; } 148 const LLCallbackMap::map_t& getFactoryMap() const { return mFactoryMap; }
139 149
140 BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 150 BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
@@ -226,9 +236,6 @@ protected:
226 LLButton* getDefaultButton() { return mDefaultBtn; } 236 LLButton* getDefaultButton() { return mDefaultBtn; }
227 LLCallbackMap::map_t mFactoryMap; 237 LLCallbackMap::map_t mFactoryMap;
228 238
229 // Override to set not found list:
230 virtual LLView* getChildByName(const LLString& name, BOOL recurse = FALSE) const;
231
232private: 239private:
233 // common construction logic 240 // common construction logic
234 void init(); 241 void init();
@@ -257,8 +264,7 @@ private:
257 typedef std::map<LLString, LLUIString> ui_string_map_t; 264 typedef std::map<LLString, LLUIString> ui_string_map_t;
258 ui_string_map_t mUIStrings; 265 ui_string_map_t mUIStrings;
259 266
260 typedef std::map<LLString, EWidgetType> requirements_map_t; 267 LLString mRequirementsError;
261 requirements_map_t mRequirements;
262 268
263 typedef std::queue<LLAlertInfo> alert_queue_t; 269 typedef std::queue<LLAlertInfo> alert_queue_t;
264 static alert_queue_t sAlertQueue; 270 static alert_queue_t sAlertQueue;
@@ -281,9 +287,6 @@ public:
281 /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; 287 /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
282 /*virtual*/ void removeCtrl(LLUICtrl* ctrl); 288 /*virtual*/ void removeCtrl(LLUICtrl* ctrl);
283 289
284 virtual EWidgetType getWidgetType() const;
285 virtual LLString getWidgetTag() const;
286
287 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 290 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
288 291
289 S32 getMinWidth() const { return mMinWidth; } 292 S32 getMinWidth() const { return mMinWidth; }
@@ -291,16 +294,17 @@ public:
291 294
292 void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, S32 index = S32_MAX); 295 void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, S32 index = S32_MAX);
293 void removePanel(LLPanel* panel); 296 void removePanel(LLPanel* panel);
294 void updateLayout(BOOL force_resize = FALSE);
295 297
296private: 298private:
299 struct LLEmbeddedPanel;
300
301 void updateLayout(BOOL force_resize = FALSE);
297 void calcMinExtents(); 302 void calcMinExtents();
298 S32 getDefaultHeight(S32 cur_height); 303 S32 getDefaultHeight(S32 cur_height);
299 S32 getDefaultWidth(S32 cur_width); 304 S32 getDefaultWidth(S32 cur_width);
300 305
301 const eLayoutOrientation mOrientation; 306 const eLayoutOrientation mOrientation;
302 307
303 struct LLEmbeddedPanel;
304 typedef std::vector<LLEmbeddedPanel*> e_panel_list_t; 308 typedef std::vector<LLEmbeddedPanel*> e_panel_list_t;
305 e_panel_list_t mPanels; 309 e_panel_list_t mPanels;
306 LLEmbeddedPanel* findEmbeddedPanel(LLPanel* panelp) const; 310 LLEmbeddedPanel* findEmbeddedPanel(LLPanel* panelp) const;