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/llradiogroup.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 '')
-rw-r--r-- | linden/indra/llui/llradiogroup.h | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/linden/indra/llui/llradiogroup.h b/linden/indra/llui/llradiogroup.h index aed8de2..87591a4 100644 --- a/linden/indra/llui/llradiogroup.h +++ b/linden/indra/llui/llradiogroup.h | |||
@@ -29,10 +29,6 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | // An invisible view containing multiple mutually exclusive toggling | ||
33 | // buttons (usually radio buttons). Automatically handles the mutex | ||
34 | // condition by highlighting only one button at a time. | ||
35 | |||
36 | #ifndef LL_LLRADIOGROUP_H | 32 | #ifndef LL_LLRADIOGROUP_H |
37 | #define LL_LLRADIOGROUP_H | 33 | #define LL_LLRADIOGROUP_H |
38 | 34 | ||
@@ -40,21 +36,30 @@ | |||
40 | #include "llcheckboxctrl.h" | 36 | #include "llcheckboxctrl.h" |
41 | #include "llctrlselectioninterface.h" | 37 | #include "llctrlselectioninterface.h" |
42 | 38 | ||
43 | class LLFontGL; | ||
44 | 39 | ||
45 | // Radio controls are checkbox controls with use_radio_style true | 40 | /* |
41 | * A checkbox control with use_radio_style == true. | ||
42 | */ | ||
46 | class LLRadioCtrl : public LLCheckBoxCtrl | 43 | class LLRadioCtrl : public LLCheckBoxCtrl |
47 | { | 44 | { |
48 | public: | 45 | public: |
49 | LLRadioCtrl(const LLString& name, const LLRect& rect, const LLString& label, | 46 | LLRadioCtrl(const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font = NULL, |
50 | const LLFontGL* font = NULL, | 47 | void (*commit_callback)(LLUICtrl*, void*) = NULL, void* callback_userdata = NULL) : |
51 | void (*commit_callback)(LLUICtrl*, void*) = NULL, | 48 | LLCheckBoxCtrl(name, rect, label, font, commit_callback, callback_userdata, FALSE, RADIO_STYLE) |
52 | void* callback_userdata = NULL); | 49 | { |
50 | setTabStop(FALSE); | ||
51 | } | ||
53 | /*virtual*/ ~LLRadioCtrl(); | 52 | /*virtual*/ ~LLRadioCtrl(); |
54 | 53 | ||
55 | /*virtual*/ void setValue(const LLSD& value); | 54 | /*virtual*/ void setValue(const LLSD& value); |
56 | }; | 55 | }; |
57 | 56 | ||
57 | |||
58 | /* | ||
59 | * An invisible view containing multiple mutually exclusive toggling | ||
60 | * buttons (usually radio buttons). Automatically handles the mutex | ||
61 | * condition by highlighting only one button at a time. | ||
62 | */ | ||
58 | class LLRadioGroup | 63 | class LLRadioGroup |
59 | : public LLUICtrl, public LLCtrlSelectionInterface | 64 | : public LLUICtrl, public LLCtrlSelectionInterface |
60 | { | 65 | { |
@@ -88,7 +93,7 @@ public: | |||
88 | void setIndexEnabled(S32 index, BOOL enabled); | 93 | void setIndexEnabled(S32 index, BOOL enabled); |
89 | 94 | ||
90 | // return the index value of the selected item | 95 | // return the index value of the selected item |
91 | S32 getSelectedIndex() const; | 96 | S32 getSelectedIndex() const { return mSelectedIndex; } |
92 | 97 | ||
93 | // set the index value programatically | 98 | // set the index value programatically |
94 | BOOL setSelectedIndex(S32 index, BOOL from_event = FALSE); | 99 | BOOL setSelectedIndex(S32 index, BOOL from_event = FALSE); |
@@ -97,8 +102,7 @@ public: | |||
97 | virtual void setValue(const LLSD& value ); | 102 | virtual void setValue(const LLSD& value ); |
98 | virtual LLSD getValue() const; | 103 | virtual LLSD getValue() const; |
99 | 104 | ||
100 | // Draw the group, but also fix the highlighting based on the | 105 | // Draw the group, but also fix the highlighting based on the control. |
101 | // control. | ||
102 | void draw(); | 106 | void draw(); |
103 | 107 | ||
104 | // You must use this method to add buttons to a radio group. | 108 | // You must use this method to add buttons to a radio group. |
@@ -106,8 +110,7 @@ public: | |||
106 | // correctly. | 110 | // correctly. |
107 | LLRadioCtrl* addRadioButton(const LLString& name, const LLString& label, const LLRect& rect, const LLFontGL* font); | 111 | LLRadioCtrl* addRadioButton(const LLString& name, const LLString& label, const LLRect& rect, const LLFontGL* font); |
108 | LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } | 112 | LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } |
109 | // Update the control as needed. Userdata must be a pointer to the | 113 | // Update the control as needed. Userdata must be a pointer to the button. |
110 | // button. | ||
111 | static void onClickButton(LLUICtrl* radio, void* userdata); | 114 | static void onClickButton(LLUICtrl* radio, void* userdata); |
112 | 115 | ||
113 | //======================================================================== | 116 | //======================================================================== |
@@ -121,14 +124,14 @@ public: | |||
121 | /*virtual*/ BOOL selectItemRange( S32 first, S32 last ) { return setSelectedIndex(first); } | 124 | /*virtual*/ BOOL selectItemRange( S32 first, S32 last ) { return setSelectedIndex(first); } |
122 | /*virtual*/ S32 getFirstSelectedIndex() const { return getSelectedIndex(); } | 125 | /*virtual*/ S32 getFirstSelectedIndex() const { return getSelectedIndex(); } |
123 | /*virtual*/ BOOL setCurrentByID( const LLUUID& id ); | 126 | /*virtual*/ BOOL setCurrentByID( const LLUUID& id ); |
124 | /*virtual*/ LLUUID getCurrentID(); // LLUUID::null if no items in menu | 127 | /*virtual*/ LLUUID getCurrentID() const; // LLUUID::null if no items in menu |
125 | /*virtual*/ BOOL setSelectedByValue(LLSD value, BOOL selected); | 128 | /*virtual*/ BOOL setSelectedByValue(const LLSD& value, BOOL selected); |
126 | /*virtual*/ LLSD getSelectedValue(); | 129 | /*virtual*/ LLSD getSelectedValue(); |
127 | /*virtual*/ BOOL isSelected(LLSD value); | 130 | /*virtual*/ BOOL isSelected(const LLSD& value) const; |
128 | /*virtual*/ BOOL operateOnSelection(EOperation op); | 131 | /*virtual*/ BOOL operateOnSelection(EOperation op); |
129 | /*virtual*/ BOOL operateOnAll(EOperation op); | 132 | /*virtual*/ BOOL operateOnAll(EOperation op); |
130 | 133 | ||
131 | protected: | 134 | private: |
132 | // protected function shared by the two constructors. | 135 | // protected function shared by the two constructors. |
133 | void init(BOOL border); | 136 | void init(BOOL border); |
134 | 137 | ||