diff options
author | richard <none@none> | 2009-12-17 09:57:43 -0800 |
---|---|---|
committer | richard <none@none> | 2009-12-17 09:57:43 -0800 |
commit | cf63ce4dc1176d9df4fe852821e4a6d32332f7c6 (patch) | |
tree | 8e77e822118f4979759caab99df48975f79994c7 /indra/llui | |
parent | f452c01915be011814d92dcc1a398f450b6ce9c2 (diff) | |
parent | 4dd37a10633c95a9806b608b4db4d0a2d3141a21 (diff) |
merge
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 19 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.h | 5 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 1 | ||||
-rw-r--r-- | indra/llui/llradiogroup.h | 2 | ||||
-rw-r--r-- | indra/llui/llsearcheditor.h | 14 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 79 | ||||
-rw-r--r-- | indra/llui/llui.h | 12 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 5 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 12 | ||||
-rw-r--r-- | indra/llui/lluiimage.cpp | 22 | ||||
-rw-r--r-- | indra/llui/lluiimage.h | 3 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 4 |
13 files changed, 70 insertions, 110 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 74b49b846e..82ec02d2eb 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -26,7 +26,6 @@ include_directories( ) set(llui_SOURCE_FILES - llalertdialog.cpp llbutton.cpp llcheckboxctrl.cpp llclipboard.cpp @@ -112,7 +111,6 @@ set(llui_SOURCE_FILES set(llui_HEADER_FILES CMakeLists.txt - llalertdialog.h llbutton.h llcallbackmap.h llcheckboxctrl.h diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 9c69e4f2b6..9dc7861992 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -38,6 +38,8 @@ //static LLHandle<LLFloater> LLDockableFloater::sInstanceHandle; +static const std::string VOICE_FLOATER("floater_voice_controls"), IM_FLOATER("panel_im"); + //static void LLDockableFloater::init(LLDockableFloater* thiz) { @@ -98,8 +100,15 @@ void LLDockableFloater::toggleInstance(const LLSD& sdname) else if (instance != NULL) { instance->setMinimized(FALSE); - instance->setVisible(TRUE); - gFloaterView->bringToFront(instance); + if (instance->getVisible()) + { + instance->setVisible(FALSE); + } + else + { + instance->setVisible(TRUE); + gFloaterView->bringToFront(instance); + } } } @@ -107,9 +116,11 @@ void LLDockableFloater::resetInstance() { if (mUniqueDocking && sInstanceHandle.get() != this) { - if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked()) + if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked() + && (getName() != VOICE_FLOATER || sInstanceHandle.get()->getName() != IM_FLOATER) + && (getName() != IM_FLOATER || sInstanceHandle.get()->getName() != VOICE_FLOATER)) { - sInstanceHandle.get()->setVisible(FALSE); + sInstanceHandle.get()->setVisible(FALSE); } sInstanceHandle = getHandle(); } diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index c1af428674..abd5436018 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -45,8 +45,9 @@ public: { Optional<std::string> orientation; Optional<S32> border_size; - Optional<bool> animate, - clip; + Optional<bool> animate; + Optional<bool> clip; + // mMinWidth and mMinHeight are calculated, not set in XML Params(); }; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 750b190953..de2b43bf13 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -37,7 +37,6 @@ #define LLPANEL_CPP #include "llpanel.h" -#include "llalertdialog.h" #include "llfocusmgr.h" #include "llfontgl.h" #include "llrect.h" diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index b178bb36ca..2edfd7c2ca 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -56,7 +56,7 @@ public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { Optional<bool> has_border; - Multiple<ItemParams, AtLeast<1> > items; + Multiple<ItemParams, LLInitParam::AtLeast<1> > items; Params(); }; diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index 714aca9337..bd2d595174 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -50,17 +50,15 @@ class LLSearchEditor : public LLUICtrl public: struct Params : public LLInitParam::Block<Params, LLLineEditor::Params> { - Optional<LLButton::Params> search_button, - clear_button; - Optional<bool> search_button_visible, - clear_button_visible; + Optional<LLButton::Params> search_button, clear_button; + Optional<bool> search_button_visible, clear_button_visible; Optional<commit_callback_t> keystroke_callback; Params() - : search_button("search_button"), - search_button_visible("search_button_visible"), - clear_button("clear_button"), - clear_button_visible("clear_button_visible") + : search_button("search_button") + , search_button_visible("search_button_visible") + , clear_button("clear_button") + , clear_button_visible("clear_button_visible") { name = "search_editor"; } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 67d3ed408b..6603887905 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1896,26 +1896,17 @@ namespace LLInitParam control("") {} - void TypedParam<LLUIColor>::setValueFromBlock() const + LLUIColor TypedParam<LLUIColor>::getValueFromBlock() const { if (control.isProvided()) { - mData.mValue = LLUIColorTable::instance().getColor(control); + return LLUIColorTable::instance().getColor(control); } else { - mData.mValue = LLColor4(red, green, blue, alpha); + return LLColor4(red, green, blue, alpha); } } - - void TypedParam<LLUIColor>::setBlockFromValue() - { - LLColor4 color = mData.mValue.get(); - red = color.mV[VRED]; - green = color.mV[VGREEN]; - blue = color.mV[VBLUE]; - alpha = color.mV[VALPHA]; - } void TypeValues<LLUIColor>::declareValues() { @@ -1941,32 +1932,28 @@ namespace LLInitParam addSynonym(name, ""); } - void TypedParam<const LLFontGL*>::setValueFromBlock() const + const LLFontGL* TypedParam<const LLFontGL*>::getValueFromBlock() const { - const LLFontGL* res_fontp = LLFontGL::getFontByName(name); - if (res_fontp) + if (name.isProvided()) { - mData.mValue = res_fontp; - } + const LLFontGL* res_fontp = LLFontGL::getFontByName(name); + if (res_fontp) + { + return res_fontp; + } - U8 fontstyle = 0; - fontstyle = LLFontGL::getStyleFromString(style()); - LLFontDescriptor desc(name(), size(), fontstyle); - const LLFontGL* fontp = LLFontGL::getFont(desc); - if (fontp) - { - mData.mValue = fontp; - } - } - - void TypedParam<const LLFontGL*>::setBlockFromValue() - { - if (mData.mValue) - { - name = LLFontGL::nameFromFont(mData.mValue); - size = LLFontGL::sizeFromFont(mData.mValue); - style = LLFontGL::getStringFromStyle(mData.mValue->getFontDesc().getStyle()); + U8 fontstyle = 0; + fontstyle = LLFontGL::getStyleFromString(style()); + LLFontDescriptor desc(name(), size(), fontstyle); + const LLFontGL* fontp = LLFontGL::getFont(desc); + if (fontp) + { + return fontp; + } } + + // default to current value + return mData.mValue; } TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) @@ -1979,7 +1966,7 @@ namespace LLInitParam height("height") {} - void TypedParam<LLRect>::setValueFromBlock() const + LLRect TypedParam<LLRect>::getValueFromBlock() const { LLRect rect; @@ -2040,17 +2027,7 @@ namespace LLInitParam rect.mBottom = bottom; rect.mTop = top; } - mData.mValue = rect; - } - - void TypedParam<LLRect>::setBlockFromValue() - { - left = mData.mValue.mLeft; - right = mData.mValue.mRight; - bottom = mData.mValue.mBottom; - top = mData.mValue.mTop; - width.setProvided(false); - height.setProvided(false); + return rect; } TypedParam<LLCoordGL>::TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) @@ -2060,15 +2037,9 @@ namespace LLInitParam { } - void TypedParam<LLCoordGL>::setValueFromBlock() const - { - mData.mValue.set(x, y); - } - - void TypedParam<LLCoordGL>::setBlockFromValue() + LLCoordGL TypedParam<LLCoordGL>::getValueFromBlock() const { - x = mData.mValue.mX; - y = mData.mValue.mY; + return LLCoordGL(x, y); } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 5840e76f5c..5ec07f1941 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -379,8 +379,7 @@ namespace LLInitParam TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - void setValueFromBlock() const; - void setBlockFromValue(); + LLRect getValueFromBlock() const; }; template<> @@ -402,8 +401,7 @@ namespace LLInitParam Optional<std::string> control; TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - void setValueFromBlock() const; - void setBlockFromValue(); + LLUIColor getValueFromBlock() const; }; // provide a better default for Optional<const LLFontGL*> than NULL @@ -431,8 +429,7 @@ namespace LLInitParam style; TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - void setValueFromBlock() const; - void setBlockFromValue(); + const LLFontGL* getValueFromBlock() const; }; template<> @@ -470,8 +467,7 @@ namespace LLInitParam y; TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - void setValueFromBlock() const; - void setBlockFromValue(); + LLCoordGL getValueFromBlock() const; }; } diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 01715c2792..53967e4963 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -105,12 +105,9 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); - //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) { - LLFastTimer ft(FTM_CREATE_CHILDREN); if (node.isNull()) return; for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling()) @@ -455,4 +452,4 @@ dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::ty const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_type) { return LLWidgetNameRegistry::instance().getValue(widget_type); -} +}
\ No newline at end of file diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 422a926e49..60f5fe9e1c 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -182,6 +182,9 @@ public: template<typename T> static T* createWidget(typename T::Params& params, LLView* parent = NULL) { + // Apply layout transformations, usually munging rect + T::setupParams(params, parent); + T* widget = NULL; if (!params.validateBlock()) @@ -196,7 +199,7 @@ public: } { LLFastTimer timer(FTM_INIT_FROM_PARAMS); - widget->initFromParams(params); + widget->initFromParams(params); } if (parent) @@ -220,7 +223,7 @@ public: return widget; } - + LLView* createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t&, LLXMLNodePtr output_node ); template<typename T> @@ -306,8 +309,7 @@ fail: output_node, output_params, &default_params); } - // Apply layout transformations, usually munging rect - T::setupParams(params, parent); + params.from_xui = true; if (!params.validateBlock()) { @@ -328,7 +330,7 @@ fail: S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; setCtrlParent(widget, parent, tab_group); } - + typedef typename T::child_registry_t registry_t; createChildren(widget, node, registry_t::instance(), output_node); diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 1dfc281d93..f941f391eb 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -161,32 +161,22 @@ void LLUIImage::onImageLoaded() namespace LLInitParam { - void TypedParam<LLUIImage*>::setValueFromBlock() const + LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() const { // The keyword "none" is specifically requesting a null image // do not default to current value. Used to overwrite template images. if (name() == "none") { - mData.mValue = NULL; + return NULL; } LLUIImage* imagep = LLUI::getUIImage(name()); - if (imagep) + if (!imagep) { - mData.mValue = imagep; - } - } - - void TypedParam<LLUIImage*>::setBlockFromValue() - { - if (mData.mValue == NULL) - { - name = "none"; - } - else - { - name = mData.mValue->getName(); + // default to current value + imagep = mData.mValue; } + return imagep; } diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index bdfc44262d..5fa9610ab2 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -111,8 +111,7 @@ namespace LLInitParam { } - void setValueFromBlock() const; - void setBlockFromValue(); + LLUIImage* getValueFromBlock() const; }; // Need custom comparison function for our test app, which only loads diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9f6fc1f298..7932b749a8 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2501,8 +2501,6 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.layout = parent->getLayout(); } - p.from_xui = true; - if (parent) { LLRect parent_rect = parent->getLocalRect(); @@ -2518,7 +2516,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) } // convert negative or centered coordinates to parent relative values - // Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock() + // Note: some of this logic matches the logic in TypedParam<LLRect>::getValueFromBlock() if (p.center_horiz) { |