EXP-1196 FIX Fix param block template ordering

changed ordering of template loading relative to constructor setting of params
moved a lot of constructor-set params to template files
reviewed by Leslie
master
Richard Linden 2011-09-06 14:45:11 -07:00
parent 2154bccdc4
commit b183b6f141
84 changed files with 284 additions and 303 deletions

View File

@ -339,7 +339,7 @@ LLAccordionCtrlTab::Params::Params()
,fit_panel("fit_panel",true)
,selection_enabled("selection_enabled", false)
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p)

View File

@ -50,10 +50,7 @@ LLBadge::Params::Params()
, location_percent_vcenter("location_percent_vcenter")
, padding_horiz("padding_horiz")
, padding_vert("padding_vert")
{
// We set a name here so the name isn't necessary in any xml files that use badges
name = "badge";
}
{}
bool LLBadge::Params::equals(const Params& a) const
{

View File

@ -104,8 +104,7 @@ LLButton::Params::Params()
handle_right_mouse("handle_right_mouse")
{
addSynonym(is_toggle, "toggle");
held_down_delay.seconds = 0.5f;
initial_value.set(LLSD(false), false);
changeDefault(initial_value, LLSD(false));
}

View File

@ -54,7 +54,7 @@ public:
persist_time("persist_time", 0.f), // forever
font_size_index("font_size_index")
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
};
protected:

View File

@ -50,7 +50,7 @@ public:
show_label("show_label", FALSE),
display_children("display_children", TRUE)
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
};

View File

@ -51,8 +51,8 @@ public:
drag_highlight_color("drag_highlight_color", LLUIColorTable::instance().getColor("DefaultHighlightLight")),
drag_shadow_color("drag_shadow_color", LLUIColorTable::instance().getColor("DefaultShadowDark"))
{
mouse_opaque(true);
follows.flags(FOLLOWS_ALL);
changeDefault(mouse_opaque, true);
changeDefault(follows.flags, FOLLOWS_ALL);
}
};
void initFromParams(const Params&);

View File

@ -42,12 +42,7 @@ class LLFilterEditor : public LLSearchEditor
{
public:
struct Params : public LLInitParam::Block<Params, LLSearchEditor::Params>
{
Params()
{
name = "filter_editor";
}
};
{};
protected:
LLFilterEditor(const Params&);

View File

@ -182,7 +182,7 @@ LLFloater::Params::Params()
open_callback("open_callback"),
close_callback("close_callback")
{
visible = false;
changeDefault(visible, false);
}

View File

@ -46,7 +46,7 @@ public:
: action_button("action_button"),
allow_text_entry("allow_text_entry")
{
LLComboBox::Params::allow_text_entry = false;
changeDefault(LLComboBox::Params::allow_text_entry, false);
}
};

View File

@ -43,10 +43,7 @@ LLIconCtrl::Params::Params()
color("color"),
use_draw_context_alpha("use_draw_context_alpha", true),
scale_image("scale_image")
{
tab_stop = false;
mouse_opaque = false;
}
{}
LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
: LLUICtrl(p),

View File

@ -115,9 +115,7 @@ LLLayoutStack::Params::Params()
open_time_constant("open_time_constant", 0.02f),
close_time_constant("close_time_constant", 0.03f),
border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0))
{
name="stack";
}
{}
LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p)
: LLView(p),

View File

@ -103,7 +103,7 @@ LLLineEditor::Params::Params()
text_pad_right("text_pad_right"),
default_text("default_text")
{
mouse_opaque = true;
changeDefault(mouse_opaque, true);
addSynonym(select_on_focus, "select_all_on_focus_received");
addSynonym(border, "border");
addSynonym(label, "watermark_text");

View File

@ -90,7 +90,6 @@ const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10;
const S32 MENU_ITEM_PADDING = 4;
const std::string SEPARATOR_NAME("separator");
const std::string SEPARATOR_LABEL( "-----------" );
const std::string VERTICAL_SEPARATOR_LABEL( "|" );
const std::string LLMenuGL::BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK
@ -149,7 +148,7 @@ LLMenuItemGL::Params::Params()
highlight_bg_color("highlight_bg_color"),
highlight_fg_color("highlight_fg_color")
{
mouse_opaque = true;
changeDefault(mouse_opaque, true);
}
// Default constructor
@ -566,8 +565,6 @@ void LLMenuItemGL::handleVisibilityChange(BOOL new_visibility)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LLMenuItemSeparatorGL::Params::Params()
{
name = "separator";
label = SEPARATOR_LABEL;
}
LLMenuItemSeparatorGL::LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p) :
@ -755,30 +752,6 @@ U32 LLMenuItemTearOffGL::getNominalHeight( void ) const
return TEAROFF_SEPARATOR_HEIGHT_PIXELS;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLMenuItemBlankGL
//
// This class represents a blank, non-functioning item.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLMenuItemBlankGL : public LLMenuItemGL
{
public:
struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
{
Params()
{
name="";
enabled = false;
}
};
LLMenuItemBlankGL( const Params& p ) : LLMenuItemGL( p )
{}
virtual void draw( void ) {}
};
///============================================================================
/// Class LLMenuItemCallGL
///============================================================================

View File

@ -381,8 +381,6 @@ public:
{
addSynonym(bg_visible, "opaque");
addSynonym(bg_color, "color");
name = "menu";
}
};
@ -650,7 +648,7 @@ public:
{
Params()
{
visible = false;
changeDefault(visible, false);
}
};
@ -698,16 +696,7 @@ class LLMenuBarGL : public LLMenuGL
{
public:
struct Params : public LLInitParam::Block<Params, LLMenuGL::Params>
{
Params()
{
can_tear_off = false;
keep_fixed_size = true;
horizontal_layout = true;
visible = true;
drop_shadow = false;
}
};
{};
LLMenuBarGL( const Params& p );
virtual ~LLMenuBarGL();
@ -825,13 +814,7 @@ class LLMenuItemTearOffGL : public LLMenuItemGL
{
public:
struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
{
Params()
{
name = "tear off";
label = "~~~~~~~~~~~";
}
};
{};
LLMenuItemTearOffGL( const Params& );

View File

@ -66,11 +66,7 @@ LLMultiSlider::Params::Params()
mouse_up_callback("mouse_up_callback"),
thumb_width("thumb_width"),
sliders("slider")
{
name = "multi_slider_bar";
mouse_opaque(true);
follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
}
{}
LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p)
: LLF32UICtrl(p),

View File

@ -90,7 +90,6 @@ LLPanel::Params::Params()
visible_callback("visible_callback"),
accepts_badge("accepts_badge")
{
name = "panel";
addSynonym(background_visible, "bg_visible");
addSynonym(has_border, "border_visible");
addSynonym(label, "title");

View File

@ -74,9 +74,6 @@ LLRadioGroup::Params::Params()
{
addSynonym(items, "radio_item");
name = "radio_group";
mouse_opaque = true;
follows.flags = FOLLOWS_LEFT | FOLLOWS_TOP;
// radio items are not tabbable until they are selected
tab_stop = false;
}
@ -96,7 +93,10 @@ void LLRadioGroup::initFromParams(const Params& p)
{
LLRadioGroup::ItemParams item_params(*it);
item_params.font.setIfNotProvided(mFont); // apply radio group font by default
if (!item_params.font.isProvided())
{
item_params.font = mFont; // apply radio group font by default
}
item_params.commit_callback.function = boost::bind(&LLRadioGroup::onClickButton, this, _1);
item_params.from_xui = p.from_xui;
if (p.from_xui)

View File

@ -63,9 +63,7 @@ LLScrollbar::Params::Params()
right_button("right_button"),
bg_visible("bg_visible", false),
bg_color("bg_color", LLColor4::black)
{
tab_stop = false;
}
{}
LLScrollbar::LLScrollbar(const Params & p)
: LLUICtrl(p),

View File

@ -74,11 +74,7 @@ LLScrollContainer::Params::Params()
min_auto_scroll_rate("min_auto_scroll_rate", 100),
max_auto_scroll_rate("max_auto_scroll_rate", 1000),
reserve_scroll_corner("reserve_scroll_corner", false)
{
name = "scroll_container";
mouse_opaque(true);
tab_stop(false);
}
{}
// Default constructor

View File

@ -51,12 +51,7 @@ class LLScrollingPanelList : public LLUICtrl
{
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
Params()
{
name = "scrolling_panel_list";
}
};
{};
LLScrollingPanelList(const Params& p)
: LLUICtrl(p)
{}

View File

@ -46,10 +46,7 @@ static LLWidgetNameRegistry::StaticRegistrar sRegisterColumnHeaderParams(&typeid
//---------------------------------------------------------------------------
LLScrollColumnHeader::Params::Params()
: column("column")
{
name = "column_header";
tab_stop(false);
}
{}
LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p)

View File

@ -135,7 +135,7 @@ public:
halign("halign", LLFontGL::LEFT)
{
// default choice to "dynamic_width"
width.dynamic_width = true;
changeDefault(width.dynamic_width, true);
addSynonym(sort_column, "sort");
}

View File

@ -147,12 +147,9 @@ LLScrollListCtrl::Params::Params()
highlighted_color("highlighted_color"),
contents(""),
scroll_bar_bg_visible("scroll_bar_bg_visible"),
scroll_bar_bg_color("scroll_bar_bg_color")
, border("border")
{
name = "scroll_list";
mouse_opaque = true;
}
scroll_bar_bg_color("scroll_bar_bg_color"),
border("border")
{}
LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
: LLUICtrl(p),
@ -2813,7 +2810,10 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS
}
S32 index = columnp->mIndex;
cell_p.width.setIfNotProvided(columnp->getWidth());
if (!cell_p.width.isProvided())
{
cell_p.width = columnp->getWidth();
}
LLScrollListCell* cell = LLScrollListCell::create(cell_p);

View File

@ -55,9 +55,7 @@ public:
search_button_visible("search_button_visible"),
clear_button("clear_button"),
clear_button_visible("clear_button_visible")
{
name = "search_editor";
}
{}
};
void setCommitOnFocusLost(BOOL b) { if (mSearchEditor) mSearchEditor->setCommitOnFocusLost(b); }

View File

@ -54,9 +54,7 @@ LLSlider::Params::Params()
track_highlight_vertical_image("track_highlight_vertical_image"),
mouse_down_callback("mouse_down_callback"),
mouse_up_callback("mouse_up_callback")
{
follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
}
{}
LLSlider::LLSlider(const LLSlider::Params& p)
: LLF32UICtrl(p),

View File

@ -76,8 +76,14 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
}
LLRect label_rect( left, top, label_width, bottom );
LLTextBox::Params params(p.slider_label);
params.rect.setIfNotProvided(label_rect);
params.font.setIfNotProvided(p.font);
if (!params.rect.isProvided())
{
params.rect = label_rect;
}
if (!params.font.isProvided())
{
params.font = p.font;
}
params.initial_value(p.label());
mLabelBox = LLUICtrlFactory::create<LLTextBox> (params);
addChild(mLabelBox);
@ -113,15 +119,33 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
S32 slider_left = label_width ? label_width + sliderctrl_spacing : 0;
LLSlider::Params slider_p(p.slider_bar);
slider_p.name("slider_bar");
slider_p.rect.setIfNotProvided(LLRect(slider_left,top,slider_right,bottom));
slider_p.initial_value.setIfNotProvided(p.initial_value().asReal());
slider_p.min_value.setIfNotProvided(p.min_value);
slider_p.max_value.setIfNotProvided(p.max_value);
slider_p.increment.setIfNotProvided(p.increment);
slider_p.orientation.setIfNotProvided(p.orientation);
if (!slider_p.rect.isProvided())
{
slider_p.rect = LLRect(slider_left,top,slider_right,bottom);
}
if (!slider_p.initial_value.isProvided())
{
slider_p.initial_value = p.initial_value().asReal();
}
if (!slider_p.min_value.isProvided())
{
slider_p.min_value = p.min_value;
}
if (!slider_p.max_value.isProvided())
{
slider_p.max_value = p.max_value;
}
if (!slider_p.increment.isProvided())
{
slider_p.increment = p.increment;
}
if (!slider_p.orientation.isProvided())
{
slider_p.orientation = p.orientation;
}
slider_p.commit_callback.function(&LLSliderCtrl::onSliderCommit);
slider_p.control_name(p.control_name);
slider_p.commit_callback.function = &LLSliderCtrl::onSliderCommit;
slider_p.control_name = p.control_name;
slider_p.mouse_down_callback( p.mouse_down_callback );
slider_p.mouse_up_callback( p.mouse_up_callback );
mSlider = LLUICtrlFactory::create<LLSlider> (slider_p);
@ -134,8 +158,15 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
if( p.can_edit_text() )
{
LLLineEditor::Params line_p(p.value_editor);
line_p.rect.setIfNotProvided(text_rect);
line_p.font.setIfNotProvided(p.font);
if (!line_p.rect.isProvided())
{
line_p.rect = text_rect;
}
if (!line_p.font.isProvided())
{
line_p.font = p.font;
}
line_p.commit_callback.function(&LLSliderCtrl::onEditorCommit);
line_p.prevalidate_callback(&LLTextValidate::validateFloat);
mEditor = LLUICtrlFactory::create<LLLineEditor>(line_p);
@ -149,8 +180,14 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
else
{
LLTextBox::Params text_p(p.value_text);
text_p.rect.setIfNotProvided(text_rect);
text_p.font.setIfNotProvided(p.font);
if (!text_p.rect.isProvided())
{
text_p.rect = text_rect;
}
if (!text_p.font.isProvided())
{
text_p.font = p.font;
}
mTextBox = LLUICtrlFactory::create<LLTextBox>(text_p);
addChild(mTextBox);
}

View File

@ -65,7 +65,7 @@ public:
show_mean("show_mean", TRUE),
stat("stat")
{
follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
}
};
LLStatBar(const Params&);

View File

@ -46,7 +46,7 @@ public:
Params()
: setting("setting")
{
follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
}
};

View File

@ -217,10 +217,7 @@ LLTabContainer::Params::Params()
tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0),
use_ellipses("use_ellipses"),
font_halign("halign")
{
name(std::string("tab_container"));
mouse_opaque = false;
}
{}
LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
: LLPanel(p),

View File

@ -55,7 +55,7 @@ static LLDefaultChildRegistry::Register<LLToolTipView> register_tooltip_view("to
LLToolTipView::Params::Params()
{
mouse_opaque = false;
changeDefault(mouse_opaque, false);
}
LLToolTipView::LLToolTipView(const LLToolTipView::Params& p)
@ -156,7 +156,7 @@ LLToolTip::Params::Params()
web_based_media("web_based_media", false),
media_playing("media_playing", false)
{
chrome = true;
changeDefault(chrome, true);
}
LLToolTip::LLToolTip(const LLToolTip::Params& p)
@ -402,12 +402,12 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params)
LLToolTip::Params tooltip_params(params);
// block mouse events if there is a click handler registered (specifically, hover)
if (params.click_callback.isProvided())
if (params.click_callback.isProvided() && !params.mouse_opaque.isProvided())
{
// set mouse_opaque to true if it wasn't already set to something else
// this prevents mouse down from going "through" the tooltip and ultimately
// causing the tooltip to disappear
tooltip_params.mouse_opaque.setIfNotProvided(true);
tooltip_params.mouse_opaque = true;
}
tooltip_params.rect = LLRect (0, 1, 1, 0);

View File

@ -104,14 +104,17 @@ private:
public:
ParamDefaults()
{
// recursively initialize from base class param block
((typename PARAM_BLOCK::base_block_t&)mPrototype).fillFrom(ParamDefaults<typename PARAM_BLOCK::base_block_t, DUMMY>::instance().get());
// after initializing base classes, look up template file for this param block
// look up template file for this param block...
const std::string* param_block_tag = getWidgetTag(&typeid(PARAM_BLOCK));
if (param_block_tag)
{
LLUICtrlFactory::loadWidgetTemplate(*param_block_tag, mPrototype);
{ // ...and if it exists, back fill values using the most specific template first
PARAM_BLOCK params;
LLUICtrlFactory::loadWidgetTemplate(*param_block_tag, params);
mPrototype.fillFrom(params);
}
// recursively fill from base class param block
((typename PARAM_BLOCK::base_block_t&)mPrototype).fillFrom(ParamDefaults<typename PARAM_BLOCK::base_block_t, DUMMY>::instance().get());
}
const PARAM_BLOCK& get() { return mPrototype; }

View File

@ -2485,7 +2485,7 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
{
LLRect parent_rect = parent->getLocalRect();
// overwrite uninitialized rect params, using context
LLRect last_rect = parent->getLocalRect();
LLRect default_rect = parent->getLocalRect();
bool layout_topleft = (p.layout() == "topleft");
@ -2509,15 +2509,13 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
p.rect.height = MIN_WIDGET_HEIGHT;
}
last_rect.translate(0, last_rect.getHeight());
default_rect.translate(0, default_rect.getHeight());
// If there was a recently constructed child, use its rectangle
get_last_child_rect(parent, &last_rect);
get_last_child_rect(parent, &default_rect);
if (layout_topleft)
{
p.bottom_delta.setIfNotProvided(0, false);
// Invert the sense of bottom_delta for topleft layout
if (p.bottom_delta.isProvided())
{
@ -2530,33 +2528,44 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
else if (p.top_delta.isProvided())
{
p.bottom_delta =
-(p.top_delta + p.rect.height - last_rect.getHeight());
-(p.top_delta + p.rect.height - default_rect.getHeight());
}
else if (!p.bottom_delta.isProvided()
&& !p.left_delta.isProvided()
&& !p.top_pad.isProvided()
else if (!p.left_delta.isProvided()
&& !p.left_pad.isProvided())
{
// set default position is just below last rect
p.bottom_delta.set(-(p.rect.height + VPAD), false);
}
else
{
p.bottom_delta.set(0, false);
}
// default to same left edge
p.left_delta.setIfNotProvided(0, false);
if (!p.left_delta.isProvided())
{
p.left_delta.set(0, false);
}
if (p.left_pad.isProvided())
{
// left_pad is based on prior widget's right edge
p.left_delta.set(p.left_pad + last_rect.getWidth(), false);
}
last_rect.translate(p.left_delta, p.bottom_delta);
default_rect.translate(p.left_delta, p.bottom_delta);
}
else
{
// set default position is just below last rect
p.bottom_delta.setIfNotProvided(-(p.rect.height + VPAD), false);
p.left_delta.setIfNotProvided(0, false);
last_rect.translate(p.left_delta, p.bottom_delta);
if (!p.bottom_delta.isProvided())
{
p.bottom_delta.set(-(p.rect.height + VPAD), false);
}
if (!p.left_delta.isProvided())
{
p.left_delta.set(0, false);
}
default_rect.translate(p.left_delta, p.bottom_delta);
}
// this handles case where *both* x and x_delta are provided
@ -2567,12 +2576,30 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
// selectively apply rectangle defaults, making sure that
// params are not flagged as having been "provided"
// as rect params are overconstrained and rely on provided flags
p.rect.left.setIfNotProvided(last_rect.mLeft, false);
p.rect.bottom.setIfNotProvided(last_rect.mBottom, false);
p.rect.top.setIfNotProvided(last_rect.mTop, false);
p.rect.right.setIfNotProvided(last_rect.mRight, false);
p.rect.width.setIfNotProvided(last_rect.getWidth(), false);
p.rect.height.setIfNotProvided(last_rect.getHeight(), false);
if (!p.rect.left.isProvided())
{
p.rect.left.set(default_rect.mLeft, false);
}
if (!p.rect.bottom.isProvided())
{
p.rect.bottom.set(default_rect.mBottom, false);
}
if (!p.rect.top.isProvided())
{
p.rect.top.set(default_rect.mTop, false);
}
if (!p.rect.right.isProvided())
{
p.rect.right.set(default_rect.mRight, false);
}
if (!p.rect.width.isProvided())
{
p.rect.width.set(default_rect.getWidth(), false);
}
if (!p.rect.height.isProvided())
{
p.rect.height.set(default_rect.getHeight(), false);
}
}
}

View File

@ -57,9 +57,6 @@ LLViewBorder::Params::Params()
{
addSynonym(border_thickness, "thickness");
addSynonym(render_style, "style");
name = "view_border";
mouse_opaque = false;
follows.flags = FOLLOWS_ALL;
}

View File

@ -43,7 +43,7 @@ LLWindowShade::Params::Params()
text_color("text_color"),
can_close("can_close", true)
{
mouse_opaque = false;
changeDefault(mouse_opaque, false);
}
LLWindowShade::LLWindowShade(const LLWindowShade::Params& params)

View File

@ -717,14 +717,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
{
if (!isProvided())
{
set(val, flag_as_provided);
}
}
// implicit conversion
operator value_assignment_t() const { return param_value_t::getValue(); }
// explicit conversion
@ -869,14 +861,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
{
if (!isProvided())
{
set(val, flag_as_provided);
}
}
// propagate changed status up to enclosing block
/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
{
@ -1033,15 +1017,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
{
if (!isProvided())
{
set(val, flag_as_provided);
}
}
value_t& add()
{
mValues.push_back(param_value_t(value_t()));
@ -1232,14 +1207,6 @@ namespace LLInitParam
Param::enclosingBlock().paramChanged(*this, flag_as_provided);
}
void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
{
if (!isProvided())
{
set(val, flag_as_provided);
}
}
value_t& add()
{
mValues.push_back(value_t());
@ -1719,6 +1686,17 @@ namespace LLInitParam
static BlockDescriptor sBlockDescriptor;
return sBlockDescriptor;
}
template <typename T, typename NAME_VALUE_LOOKUP, bool multiple, bool is_block>
void changeDefault(TypedParam<T, NAME_VALUE_LOOKUP, multiple, is_block>& param,
typename TypedParam<T, NAME_VALUE_LOOKUP, multiple, is_block>::value_assignment_t value)
{
if (!param.isProvided())
{
param.set(value, false);
}
}
};
template<typename T>

View File

@ -141,7 +141,6 @@ LLAvatarIconCtrl::Params::Params()
draw_tooltip("draw_tooltip", true),
default_icon_name("default_icon_name")
{
name = "avatar_icon";
}

View File

@ -43,7 +43,7 @@ namespace LLNotificationsUI
*/
class LLChannelManager : public LLSingleton<LLChannelManager>
{
public:
public:
struct Params
{
LLUUID id;
@ -51,7 +51,8 @@ public:
EToastAlignment toast_align;
EChannelAlignment channel_align;
Params(): id(LLUUID("")), display_toasts_always(false), toast_align(NA_BOTTOM), channel_align(CA_LEFT)
Params()
: id(LLUUID("")), display_toasts_always(false), toast_align(NA_BOTTOM), channel_align(CA_LEFT)
{}
};

View File

@ -70,7 +70,7 @@ private:
LLChatMsgBox::Params::Params() :
block_spacing("block_spacing", 10)
{
line_spacing.pixels = 4;
changeDefault(line_spacing.pixels, 4);
}
LLChatMsgBox::LLChatMsgBox(const Params& p) :

View File

@ -126,9 +126,9 @@ LLSysWellChiclet::Params::Params()
, unread_notifications("unread_notifications")
, max_displayed_count("max_displayed_count", 99)
{
button.name("button");
button.tab_stop(FALSE);
button.label(LLStringUtil::null);
button.name = "button";
button.tab_stop = FALSE;
button.label = LLStringUtil::null;
}
LLSysWellChiclet::LLSysWellChiclet(const Params& p)

View File

@ -107,9 +107,9 @@ public:
{
Params()
{
draw_tooltip(FALSE);
mouse_opaque(FALSE);
default_icon_name("Generic_Person");
changeDefault(draw_tooltip, FALSE);
changeDefault(mouse_opaque, FALSE);
changeDefault(default_icon_name, "Generic_Person");
};
};
@ -131,9 +131,8 @@ public:
Optional<std::string> default_icon;
Params()
: default_icon("default_icon", "Generic_Group")
{
};
: default_icon("default_icon", "Generic_Group")
{}
};
/**
@ -162,9 +161,9 @@ public:
Optional<std::string> default_icon;
Params()
: default_icon("default_icon", "Generic_Object_Small")
: default_icon("default_icon", "Generic_Object_Small")
{
avatar_id = LLUUID::null;
changeDefault(avatar_id, LLUUID::null);
};
};
@ -314,9 +313,7 @@ public:
TYPE_AD_HOC
};
struct Params : public LLInitParam::Block<Params, LLChiclet::Params>
{
Params(){}
};
{};
virtual ~LLIMChiclet() {};

View File

@ -57,7 +57,6 @@ LLColorSwatchCtrl::Params::Params()
caption_text("caption_text"),
border("border")
{
name = "colorswatch";
}
LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p)

View File

@ -48,7 +48,7 @@ public:
{
Params()
{
mouse_opaque = false;
changeDefault(mouse_opaque, false);
}
};
LLDebugView(const Params&);

View File

@ -101,10 +101,7 @@ LLFolderViewItem::Params::Params()
item_height("item_height"),
item_top_pad("item_top_pad"),
creation_date()
{
mouse_opaque(true);
follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT);
}
{}
// Default constructor
LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)

View File

@ -57,7 +57,7 @@ public:
Params()
: quadrant("quadrant", JQ_ORIGIN)
{
label = "";
changeDefault(label, "");
}
};
LLJoystick(const Params&);
@ -137,7 +137,7 @@ public:
{
Params()
{
held_down_delay.seconds(0.0);
changeDefault(held_down_delay.seconds, 0.0);
}
};

View File

@ -79,7 +79,6 @@ LLMediaCtrl::Params::Params()
trusted_content("trusted_content", false),
focus_on_click("focus_on_click", true)
{
tab_stop(false);
}
LLMediaCtrl::LLMediaCtrl( const Params& p) :

View File

@ -38,8 +38,8 @@ public:
{
Params()
{
mouse_opaque = true;
visible = false;
changeDefault(mouse_opaque, true);
changeDefault(visible, false);
}
};
LLMemoryView(const LLMemoryView::Params&);

View File

@ -40,8 +40,8 @@ public:
{
Params()
{
mouse_opaque(false);
follows.flags(FOLLOWS_ALL);
changeDefault(mouse_opaque, false);
changeDefault(follows.flags, FOLLOWS_ALL);
}
};
LLMorphView(const LLMorphView::Params&);

View File

@ -57,7 +57,6 @@ LLNameListCtrl::Params::Params()
allow_calling_card_drop("allow_calling_card_drop", false),
short_names("short_names", false)
{
name = "name_list";
}
LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)

View File

@ -66,8 +66,8 @@ public:
Params()
: agent_id("agent_id")
{
mouse_opaque(false);
follows.flags(FOLLOWS_ALL);
changeDefault(mouse_opaque, false);
changeDefault(follows.flags, FOLLOWS_ALL);
}
};

View File

@ -82,8 +82,8 @@ public:
: panel("panel"),
group_id("group_id")
{
mouse_opaque(false);
follows.flags(FOLLOWS_ALL);
changeDefault(mouse_opaque, false);
changeDefault(follows.flags, FOLLOWS_ALL);
}
};
LLGroupDropTarget(const Params&);

View File

@ -37,9 +37,7 @@ class LLPanelMarketplaceInbox : public LLPanel, public LLSideTrayTabBadgeDriver
public:
struct Params : public LLInitParam::Block<Params, LLPanel::Params>
{
Params() {}
};
{};
LOG_CLASS(LLPanelMarketplaceInbox);

View File

@ -41,9 +41,7 @@ class LLInboxInventoryPanel : public LLInventoryPanel
{
public:
struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
{
Params() {}
};
{};
LLInboxInventoryPanel(const Params& p);
~LLInboxInventoryPanel();

View File

@ -40,9 +40,7 @@ class LLPanelMarketplaceOutbox : public LLPanel
public:
struct Params : public LLInitParam::Block<Params, LLPanel::Params>
{
Params() {}
};
{};
LOG_CLASS(LLPanelMarketplaceOutbox);

View File

@ -52,10 +52,9 @@ protected:
};
LLSearchComboBox::Params::Params()
: search_button("search_button")
, dropdown_button_visible("dropdown_button_visible", false)
{
}
: search_button("search_button"),
dropdown_button_visible("dropdown_button_visible", false)
{}
LLSearchComboBox::LLSearchComboBox(const Params&p)
: LLComboBox(p)

View File

@ -32,10 +32,10 @@ static LLDefaultChildRegistry::Register<LLSideTrayPanelContainer> r2("panel_cont
std::string LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME = "sub_panel_name";
LLSideTrayPanelContainer::Params::Params()
: default_panel_name("default_panel_name")
: default_panel_name("default_panel_name")
{
// Always hide tabs.
hide_tabs(true);
changeDefault(hide_tabs, true);
}
LLSideTrayPanelContainer::LLSideTrayPanelContainer(const Params& p)

View File

@ -47,12 +47,10 @@ static LLDefaultChildRegistry::Register<LLSpeakButton> t1("talk_button");
//////////////////////////////////////////////////////////////////////////
LLSpeakButton::Params::Params()
: speak_button("speak_button")
, show_button("show_button")
, monitor("monitor")
{
// See widgets/talk_button.xml
}
: speak_button("speak_button"),
show_button("show_button"),
monitor("monitor")
{}
LLSpeakButton::LLSpeakButton(const Params& p)
: LLUICtrl(p)

View File

@ -92,11 +92,7 @@ public:
multiselect_text("multiselect_text"),
caption_text("caption_text"),
border("border")
{
name = "texture picker";
mouse_opaque(true);
follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);
}
{}
};
protected:
LLTextureCtrl(const Params&);

View File

@ -94,7 +94,7 @@ public:
Params()
: texture_view("texture_view")
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
};
LLTextureBar(const Params& p)
@ -387,7 +387,7 @@ public:
: texture_view("texture_view")
{
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
rect(LLRect(0,0,100,line_height * 4));
changeDefault(rect, LLRect(0,0,100,line_height * 4));
}
};
@ -486,7 +486,7 @@ public:
: texture_view("texture_view")
{
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
rect(LLRect(0,0,100,line_height * 4));
changeDefault(rect, LLRect(0,0,100,line_height * 4));
}
};

View File

@ -36,12 +36,7 @@ class LLViewerTextEditor : public LLTextEditor
{
public:
struct Params : public LLInitParam::Block<Params, LLTextEditor::Params>
{
Params()
{
name = "text_editor";
}
};
{};
protected:
LLViewerTextEditor(const Params&);

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Additional attributes:
-->
<badge border_image="Badge_Border"
<badge name="badge"
border_image="Badge_Border"
border_color="BadgeBorderColor"
font="SansSerifSmall"
image="Badge_Background"

View File

@ -26,5 +26,6 @@
height="23"
scale_image="true"
handle_right_mouse="true"
use_draw_context_alpha="true">
use_draw_context_alpha="true"
held_down_delay.seconds="0.5">
</button>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<color_swatch alpha_background_image="color_swatch_alpha.tga"
border_color="ColorSwatchBorderColor"
name="color_swatch">
name="colorswatch">
<color_swatch.caption_text name="caption"
halign="center"
follows="left|right|bottom"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<filter_editor
name="filter_editor"
clear_button_visible="true"
search_button_visible="false"
text_pad_left="7"

View File

@ -5,4 +5,6 @@
item_height="20"
item_top_pad="4"
selection_image="Rounded_Square"
mouse_opaque="true"
follows="left|top|right"
/>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Global settings for all widgets ("UI Controls") -->
<!-- The params in this file aren't currently getting loaded in OSX -->
<layout_stack name="stack"/>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<menu_bar
can_tear_off = "false"
keep_fixed_size = "true"
horizontal_layout = "true"
visible = "true"
drop_shadow = "false"/>

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<menu_item_separator enabled_color="MenuItemEnabledColor"
disabled_color="MenuItemDisabledColor"
highlight_bg_color="MenuItemHighlightBgColor"
highlight_fg_color="MenuItemHighlightFgColor">
name="separator"
disabled_color="MenuItemDisabledColor"
highlight_bg_color="MenuItemHighlightBgColor"
highlight_fg_color="MenuItemHighlightFgColor"
label="-----------">
</menu_item_separator>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Use "disabled color" to make it look like menu separators -->
<menu_item_tear_off enabled_color="MenuItemDisabledColor"
disabled_color="MenuItemDisabledColor"
highlight_bg_color="MenuItemHighlightBgColor"
highlight_fg_color="MenuItemHighlightFgColor">
</menu_item_tear_off>
name="tear_off"
label = "~~~~~~~~~~~"
disabled_color="MenuItemDisabledColor"
highlight_bg_color="MenuItemHighlightBgColor"
highlight_fg_color="MenuItemHighlightFgColor"/>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<multi_slider text_color="LabelTextColor"
text_disabled_color="LabelDisabledColor"
draw_track="true"
use_triangle="false"
font="SansSerifSmall"/>
mouse_opaque="true"
text_disabled_color="LabelDisabledColor"
draw_track="true"
use_triangle="false"
font="SansSerifSmall"/>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<multi_slider_bar track_color="MultiSliderTrackColor"
<multi_slider_bar name="multi_slider_bar"
track_color="MultiSliderTrackColor"
thumb_disabled_color="MultiSliderDisabledThumbColor"
thumb_outline_color="MultiSliderThumbOutlineColor"
thumb_center_color="MultiSliderThumbCenterColor"
@ -7,4 +8,6 @@
triangle_color="MultiSliderTriangleColor"
draw_track="true"
use_triangle="false"
thumb_width="8"/>
thumb_width="8"
mouse_opaque="true"
follows="left|top"/>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<name_list name="name_list"
/>

View File

@ -4,7 +4,8 @@
bg_opaque_image - image name for "in-front" panel look
bg_alpha_image - image name for "in-back" or transparent panel look
-->
<panel bg_opaque_color="PanelFocusBackgroundColor"
<panel name="panel"
bg_opaque_color="PanelFocusBackgroundColor"
bg_alpha_color="PanelDefaultBackgroundColor"
bg_opaque_image_overlay="White"
bg_alpha_image_overlay="White"

View File

@ -5,7 +5,8 @@
track_image_horizontal ="ScrollTrack_Horiz"
track_color="ScrollbarTrackColor"
thumb_color="ScrollbarThumbColor"
thickness="15">
thickness="15"
tab_stop="false">
<up_button name="up_button"
image_unselected="ScrollArrow_Up"
image_selected="ScrollArrow_Up"

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<scroll_column_header
image_unselected="SegmentedBtn_Middle_Selected"
<scroll_column_header name="column_header"
image_unselected="SegmentedBtn_Middle_Selected"
image_selected="SegmentedBtn_Middle_Selected"
image_pressed="SegmentedBtn_Middle_Selected_Press"
image_pressed="SegmentedBtn_Middle_Selected_Press"
image_disabled="SegmentedBtn_Middle_Disabled"
image_disabled_selected="SegmentedBtn_Middle_Selected_Disabled"
image_overlay="DisclosureArrow_Opened_Off"
image_overlay_alignment="right"
halign="left"
tab_stop="false"
scale_image="true" />

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<scroll_container color="black"
<scroll_container name="scroll_container"
color="black"
opaque="false"
mouse_opaque="true"
tab_stop="false"
min_auto_scroll_rate="120"
max_auto_scroll_rate="500"/>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<scroll_list fg_unselected_color="ScrollUnselectedColor"
<scroll_list name="scroll_list"
fg_unselected_color="ScrollUnselectedColor"
fg_selected_color="ScrollSelectedFGColor"
bg_selected_color="ScrollSelectedBGColor"
fg_disable_color="ScrollDisabledColor"
@ -13,6 +14,7 @@
scroll_bar_bg_visible="false"
scroll_bar_bg_color="black"
mouse_wheel_opaque="false"
mouse_opaque="true"
background_visible="true"
heading_height="23"
draw_border="false"

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<scrolling_panel_list name="scrolling_panel_list"/>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<search_editor
name="search_editor"
clear_button_visible="false"
search_button_visible="true"
text_pad_left="6"

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!--All horizontal sliders are configured to have no highlighted track. See EXT-5939. -->
<slider_bar track_color="SliderTrackColor"
<slider_bar follows="left|top"
track_color="SliderTrackColor"
thumb_outline_color="SliderThumbOutlineColor"
thumb_center_color="SliderThumbCenterColor"
thumb_image="SliderThumb_Off"

View File

@ -3,7 +3,9 @@
label_pad_bottom - vertical padding under tab button labels
label_pad_left - padding to the left of tab button labels
-->
<tab_container tab_min_width="60"
<tab_container name="tab_container"
mouse_opaque="false"
tab_min_width="60"
tab_max_width="150"
use_custom_icon_ctrl="false"
halign="center"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Core parameters are in simple_text_editor.xml -->
<text_editor
name="text_editor"
parse_urls="false"
show_context_menu="true"/>

View File

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<texture_picker border_color="DefaultHighlightLight">
<texture_picker border_color="DefaultHighlightLight"
name="texture picker"
mouse_opaque="true"
follows="left|top"
>
<multiselect_text font="SansSerifSmall"/>
<caption_text text="Multiple"
halign="center"

View File

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<view_border highlight_light_color="DefaultHighlightLight"
<view_border name="view_border"
highlight_light_color="DefaultHighlightLight"
highlight_dark_color="DefaultHighlightDark"
shadow_light_color="DefaultShadowLight"
shadow_dark_color="DefaultShadowDark"
border_thickness="1"
border_style="line"
bevel_style="out"/>
bevel_style="out"
mouse_opaque="false"
follows="all"/>

View File

@ -1,2 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<web_browser border_visible="true"/>
<web_browser border_visible="true"
tab_stop="false"
/>