diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/lluictrl.h | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llui/lluictrl.h')
-rw-r--r-- | linden/indra/llui/lluictrl.h | 132 |
1 files changed, 57 insertions, 75 deletions
diff --git a/linden/indra/llui/lluictrl.h b/linden/indra/llui/lluictrl.h index 55e804c..0c43297 100644 --- a/linden/indra/llui/lluictrl.h +++ b/linden/indra/llui/lluictrl.h | |||
@@ -37,28 +37,13 @@ | |||
37 | #include "llrect.h" | 37 | #include "llrect.h" |
38 | #include "llsd.h" | 38 | #include "llsd.h" |
39 | 39 | ||
40 | // | ||
41 | // Classes | ||
42 | // | ||
43 | class LLFontGL; | ||
44 | class LLButton; | ||
45 | class LLTextBox; | ||
46 | class LLLineEditor; | ||
47 | class LLUICtrl; | ||
48 | class LLPanel; | ||
49 | class LLCtrlSelectionInterface; | ||
50 | class LLCtrlListInterface; | ||
51 | class LLCtrlScrollInterface; | ||
52 | |||
53 | typedef void (*LLUICtrlCallback)(LLUICtrl* ctrl, void* userdata); | ||
54 | typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata); | ||
55 | 40 | ||
56 | class LLFocusableElement | 41 | class LLFocusableElement |
57 | { | 42 | { |
58 | friend class LLFocusMgr; // allow access to focus change handlers | 43 | friend class LLFocusMgr; // allow access to focus change handlers |
59 | public: | 44 | public: |
60 | LLFocusableElement(); | 45 | LLFocusableElement(); |
61 | virtual ~LLFocusableElement() {}; | 46 | virtual ~LLFocusableElement(); |
62 | 47 | ||
63 | virtual void setFocus( BOOL b ); | 48 | virtual void setFocus( BOOL b ); |
64 | virtual BOOL hasFocus() const; | 49 | virtual BOOL hasFocus() const; |
@@ -80,63 +65,74 @@ class LLUICtrl | |||
80 | : public LLView, public LLFocusableElement | 65 | : public LLView, public LLFocusableElement |
81 | { | 66 | { |
82 | public: | 67 | public: |
68 | typedef void (*LLUICtrlCallback)(LLUICtrl* ctrl, void* userdata); | ||
69 | typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata); | ||
70 | |||
83 | LLUICtrl(); | 71 | LLUICtrl(); |
84 | LLUICtrl( const LLString& name, const LLRect& rect, BOOL mouse_opaque, | 72 | LLUICtrl( const LLString& name, const LLRect& rect, BOOL mouse_opaque, |
85 | LLUICtrlCallback callback, | 73 | LLUICtrlCallback callback, |
86 | void* callback_userdata, | 74 | void* callback_userdata, |
87 | U32 reshape=FOLLOWS_NONE); | 75 | U32 reshape=FOLLOWS_NONE); |
88 | virtual ~LLUICtrl(); | 76 | /*virtual*/ ~LLUICtrl(); |
89 | 77 | ||
90 | // LLView interface | 78 | // LLView interface |
91 | //virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | 79 | /*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent); |
92 | virtual void initFromXML(LLXMLNodePtr node, LLView* parent); | 80 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; |
93 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 81 | /*virtual*/ BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); |
94 | 82 | /*virtual*/ void onFocusReceived(); | |
95 | virtual LLSD getValue() const { return LLSD(); } | 83 | /*virtual*/ void onFocusLost(); |
96 | 84 | /*virtual*/ BOOL isCtrl() const; | |
97 | // Defaults to no-op | 85 | /*virtual*/ void setTentative(BOOL b); |
98 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 86 | /*virtual*/ BOOL getTentative() const; |
99 | 87 | ||
100 | // Defaults to no-op | 88 | // From LLFocusableElement |
101 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 89 | /*virtual*/ void setFocus( BOOL b ); |
90 | /*virtual*/ BOOL hasFocus() const; | ||
91 | |||
92 | // New virtuals | ||
102 | 93 | ||
103 | // Defaults to return NULL | 94 | // Return NULL by default (overrride if the class has the appropriate interface) |
104 | virtual LLCtrlSelectionInterface* getSelectionInterface(); | 95 | virtual class LLCtrlSelectionInterface* getSelectionInterface(); |
105 | virtual LLCtrlListInterface* getListInterface(); | 96 | virtual class LLCtrlListInterface* getListInterface(); |
106 | virtual LLCtrlScrollInterface* getScrollInterface(); | 97 | virtual class LLCtrlScrollInterface* getScrollInterface(); |
107 | 98 | ||
108 | virtual void setFocus( BOOL b ); | 99 | virtual LLSD getValue() const; |
109 | virtual BOOL hasFocus() const; | 100 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); |
101 | virtual void setIsChrome(BOOL is_chrome); | ||
110 | 102 | ||
111 | virtual void onFocusReceived(); | 103 | virtual BOOL acceptsTextInput() const; // Defaults to false |
112 | virtual void onFocusLost(); | ||
113 | 104 | ||
105 | // A control is dirty if the user has modified its value. | ||
106 | // Editable controls should override this. | ||
107 | virtual BOOL isDirty() const; // Defauls to false | ||
108 | virtual void resetDirty(); //Defaults to no-op | ||
109 | |||
110 | // Call appropriate callbacks | ||
114 | virtual void onLostTop(); // called when registered as top ctrl and user clicks elsewhere | 111 | virtual void onLostTop(); // called when registered as top ctrl and user clicks elsewhere |
115 | 112 | virtual void onCommit(); | |
116 | virtual void setTabStop( BOOL b ); | 113 | |
117 | virtual BOOL hasTabStop() const; | 114 | // Default to no-op: |
118 | |||
119 | // Defaults to false | ||
120 | virtual BOOL acceptsTextInput() const; | ||
121 | |||
122 | // Default to no-op | ||
123 | virtual void onTabInto(); | 115 | virtual void onTabInto(); |
124 | virtual void clear(); | 116 | virtual void clear(); |
117 | virtual void setDoubleClickCallback( void (*cb)(void*) ); | ||
118 | virtual void setColor(const LLColor4& color); | ||
119 | virtual void setMinValue(LLSD min_value); | ||
120 | virtual void setMaxValue(LLSD max_value); | ||
125 | 121 | ||
126 | virtual void setIsChrome(BOOL is_chrome); | 122 | BOOL focusNextItem(BOOL text_entry_only); |
127 | virtual BOOL getIsChrome() const; | 123 | BOOL focusPrevItem(BOOL text_entry_only); |
128 | 124 | BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); | |
129 | virtual void onCommit(); | 125 | BOOL focusLastItem(BOOL prefer_text_fields = FALSE); |
130 | 126 | ||
131 | virtual BOOL isCtrl() const { return TRUE; } | 127 | // Non Virtuals |
132 | // "Tentative" controls have a proposed value, but haven't committed | 128 | BOOL getIsChrome() const; |
133 | // it yet. This is used when multiple objects are selected and we | 129 | |
134 | // want to display a parameter that differs between the objects. | 130 | void setTabStop( BOOL b ); |
135 | virtual void setTentative(BOOL b); | 131 | BOOL hasTabStop() const; |
136 | virtual BOOL getTentative() const; | ||
137 | 132 | ||
138 | // Returns containing panel/floater or NULL if none found. | 133 | // Returns containing panel/floater or NULL if none found. |
139 | LLPanel* getParentPanel() const; | 134 | class LLPanel* getParentPanel() const; |
135 | class LLUICtrl* getParentUICtrl() const; | ||
140 | 136 | ||
141 | void* getCallbackUserData() const { return mCallbackUserData; } | 137 | void* getCallbackUserData() const { return mCallbackUserData; } |
142 | void setCallbackUserData( void* data ) { mCallbackUserData = data; } | 138 | void setCallbackUserData( void* data ) { mCallbackUserData = data; } |
@@ -144,18 +140,8 @@ public: | |||
144 | void setCommitCallback( void (*cb)(LLUICtrl*, void*) ) { mCommitCallback = cb; } | 140 | void setCommitCallback( void (*cb)(LLUICtrl*, void*) ) { mCommitCallback = cb; } |
145 | void setValidateBeforeCommit( BOOL(*cb)(LLUICtrl*, void*) ) { mValidateCallback = cb; } | 141 | void setValidateBeforeCommit( BOOL(*cb)(LLUICtrl*, void*) ) { mValidateCallback = cb; } |
146 | void setLostTopCallback( void (*cb)(LLUICtrl*, void*) ) { mLostTopCallback = cb; } | 142 | void setLostTopCallback( void (*cb)(LLUICtrl*, void*) ) { mLostTopCallback = cb; } |
147 | 143 | ||
148 | // Defaults to no-op! | 144 | const LLUICtrl* findRootMostFocusRoot() const; |
149 | virtual void setDoubleClickCallback( void (*cb)(void*) ); | ||
150 | |||
151 | // Defaults to no-op | ||
152 | virtual void setColor(const LLColor4& color); | ||
153 | |||
154 | // Defaults to no-op | ||
155 | virtual void setMinValue(LLSD min_value); | ||
156 | virtual void setMaxValue(LLSD max_value); | ||
157 | |||
158 | /*virtual*/ BOOL focusFirstItem(BOOL prefer_text_fields = FALSE ); | ||
159 | 145 | ||
160 | class LLTextInputFilter : public LLQueryFilter, public LLSingleton<LLTextInputFilter> | 146 | class LLTextInputFilter : public LLQueryFilter, public LLSingleton<LLTextInputFilter> |
161 | { | 147 | { |
@@ -165,11 +151,6 @@ public: | |||
165 | } | 151 | } |
166 | }; | 152 | }; |
167 | 153 | ||
168 | // Returns TRUE if the user has modified this control. Editable controls should override this. | ||
169 | virtual BOOL isDirty() const { return FALSE; }; | ||
170 | // Clear the dirty state | ||
171 | virtual void resetDirty() {}; | ||
172 | |||
173 | protected: | 154 | protected: |
174 | 155 | ||
175 | void (*mCommitCallback)( LLUICtrl* ctrl, void* userdata ); | 156 | void (*mCommitCallback)( LLUICtrl* ctrl, void* userdata ); |
@@ -177,13 +158,14 @@ protected: | |||
177 | BOOL (*mValidateCallback)( LLUICtrl* ctrl, void* userdata ); | 158 | BOOL (*mValidateCallback)( LLUICtrl* ctrl, void* userdata ); |
178 | 159 | ||
179 | void* mCallbackUserData; | 160 | void* mCallbackUserData; |
180 | BOOL mTentative; | ||
181 | BOOL mTabStop; | ||
182 | 161 | ||
183 | private: | 162 | private: |
184 | BOOL mIsChrome; | ||
185 | 163 | ||
164 | BOOL mTabStop; | ||
165 | BOOL mIsChrome; | ||
166 | BOOL mTentative; | ||
186 | 167 | ||
168 | class DefaultTabGroupFirstSorter; | ||
187 | }; | 169 | }; |
188 | 170 | ||
189 | #endif // LL_LLUICTRL_H | 171 | #endif // LL_LLUICTRL_H |