diff options
author | McCabe Maxsted | 2011-05-15 14:22:04 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-06-08 23:27:07 -0700 |
commit | b5a1b8fc24b432619f172e276d869577429a7197 (patch) | |
tree | eff1943265b40e820b0e12d7bbf44694e543e019 /linden/indra | |
parent | Added tacky-but-useful button for toggling the AO window in the toolbar (diff) | |
download | meta-impy-b5a1b8fc24b432619f172e276d869577429a7197.zip meta-impy-b5a1b8fc24b432619f172e276d869577429a7197.tar.gz meta-impy-b5a1b8fc24b432619f172e276d869577429a7197.tar.bz2 meta-impy-b5a1b8fc24b432619f172e276d869577429a7197.tar.xz |
Implemented 'label_disabled' and 'label_selected_disabled' XUI for LLButton
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llbutton.cpp | 18 | ||||
-rw-r--r-- | linden/indra/llui/llbutton.h | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 702e34e..6c0891c 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp | |||
@@ -115,7 +115,9 @@ LLButton::LLButton(const std::string& name, const LLRect& rect, | |||
115 | void *callback_data, | 115 | void *callback_data, |
116 | const LLFontGL *font, | 116 | const LLFontGL *font, |
117 | const std::string& unselected_label, | 117 | const std::string& unselected_label, |
118 | const std::string& selected_label ) | 118 | const std::string& selected_label, |
119 | const std::string& disabled_label, | ||
120 | const std::string& disabled_selected_label) | ||
119 | : LLUICtrl(name, rect, TRUE, NULL, NULL), | 121 | : LLUICtrl(name, rect, TRUE, NULL, NULL), |
120 | mClickedCallback( click_callback ), | 122 | mClickedCallback( click_callback ), |
121 | mMouseDownCallback( NULL ), | 123 | mMouseDownCallback( NULL ), |
@@ -148,6 +150,8 @@ LLButton::LLButton(const std::string& name, const LLRect& rect, | |||
148 | { | 150 | { |
149 | mUnselectedLabel = unselected_label; | 151 | mUnselectedLabel = unselected_label; |
150 | mSelectedLabel = selected_label; | 152 | mSelectedLabel = selected_label; |
153 | mDisabledLabel = disabled_label; | ||
154 | mDisabledSelectedLabel = disabled_selected_label; | ||
151 | 155 | ||
152 | // by default, disabled color is same as enabled | 156 | // by default, disabled color is same as enabled |
153 | mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); | 157 | mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); |
@@ -989,6 +993,8 @@ LLXMLNodePtr LLButton::getXML(bool save_children) const | |||
989 | 993 | ||
990 | node->createChild("label", TRUE)->setStringValue(getLabelUnselected()); | 994 | node->createChild("label", TRUE)->setStringValue(getLabelUnselected()); |
991 | node->createChild("label_selected", TRUE)->setStringValue(getLabelSelected()); | 995 | node->createChild("label_selected", TRUE)->setStringValue(getLabelSelected()); |
996 | node->createChild("label_disabled", TRUE)->setStringValue(getLabelDisabled()); | ||
997 | node->createChild("label_selected_disabled", TRUE)->setStringValue(getLabelDisabledSelected()); | ||
992 | node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); | 998 | node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); |
993 | node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); | 999 | node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); |
994 | 1000 | ||
@@ -1029,6 +1035,12 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa | |||
1029 | std::string label_selected = label; | 1035 | std::string label_selected = label; |
1030 | node->getAttributeString("label_selected", label_selected); | 1036 | node->getAttributeString("label_selected", label_selected); |
1031 | 1037 | ||
1038 | std::string label_disabled = label; | ||
1039 | node->getAttributeString("label_disabled", label_disabled); | ||
1040 | |||
1041 | std::string label_disabled_selected = label; | ||
1042 | node->getAttributeString("label_disabled_selected", label_disabled_selected); | ||
1043 | |||
1032 | LLFontGL* font = selectFont(node); | 1044 | LLFontGL* font = selectFont(node); |
1033 | 1045 | ||
1034 | std::string image_unselected; | 1046 | std::string image_unselected; |
@@ -1070,7 +1082,9 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa | |||
1070 | parent, | 1082 | parent, |
1071 | font, | 1083 | font, |
1072 | label, | 1084 | label, |
1073 | label_selected); | 1085 | label_selected, |
1086 | label_disabled, | ||
1087 | label_disabled_selected); | ||
1074 | 1088 | ||
1075 | node->getAttributeS32("pad_right", button->mRightHPad); | 1089 | node->getAttributeS32("pad_right", button->mRightHPad); |
1076 | node->getAttributeS32("pad_left", button->mLeftHPad); | 1090 | node->getAttributeS32("pad_left", button->mLeftHPad); |
diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h index 2174d95..73ac446 100644 --- a/linden/indra/llui/llbutton.h +++ b/linden/indra/llui/llbutton.h | |||
@@ -84,7 +84,9 @@ public: | |||
84 | void *callback_data = NULL, | 84 | void *callback_data = NULL, |
85 | const LLFontGL* mGLFont = NULL, | 85 | const LLFontGL* mGLFont = NULL, |
86 | const std::string& unselected_label = LLStringUtil::null, | 86 | const std::string& unselected_label = LLStringUtil::null, |
87 | const std::string& selected_label = LLStringUtil::null ); | 87 | const std::string& selected_label = LLStringUtil::null, |
88 | const std::string& disabled_label = LLStringUtil::null, | ||
89 | const std::string& disabled_selected_label = LLStringUtil::null); | ||
88 | 90 | ||
89 | virtual ~LLButton(); | 91 | virtual ~LLButton(); |
90 | void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name); | 92 | void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name); |
@@ -133,6 +135,8 @@ public: | |||
133 | 135 | ||
134 | const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } | 136 | const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } |
135 | const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } | 137 | const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } |
138 | const std::string getLabelDisabled() const { return wstring_to_utf8str(mDisabledLabel); } | ||
139 | const std::string getLabelDisabledSelected() const { return wstring_to_utf8str(mDisabledSelectedLabel); } | ||
136 | 140 | ||
137 | void setImageColor(const std::string& color_control); | 141 | void setImageColor(const std::string& color_control); |
138 | void setImageColor(const LLColor4& c); | 142 | void setImageColor(const LLColor4& c); |