summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-04-03 19:21:14 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-04-03 19:21:14 +0000
commitb5936a4b1d8780b5b8cd425998eacd2c64ffa693 (patch)
treec1581bcf34e96a897c6e1d9a4aed95f353713baa /indra/llui
parent55c25229b79b1755c989e5996c8e8d118f369721 (diff)
1.19.1 Viewer merge: QAR_367, QAR-374, QAR-408, QAR-426
QAR_367 (RC1) - merge Branch_1-19-1-Viewer -r 81609 : 81993 -> release QAR-374 (RC2) - merge Branch_1-19-1-Viewer -r 81993 : 82589 -> release QAR-408 (RC3) - merge Branch_1-19-1-Viewer -r 82589 : 83128 -> release QAR-426 (rc4) - merge Branch_1-19-1-Viewer -r 83125 : 83719 -> release (Actual merge: release@83793 Branch_1-19-1-Viewer-merge@83953 -> release)
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcheckboxctrl.h2
-rw-r--r--indra/llui/lldraghandle.h1
-rw-r--r--indra/llui/llfloater.cpp28
-rw-r--r--indra/llui/llfloater.h8
-rw-r--r--indra/llui/llmenugl.cpp28
-rw-r--r--indra/llui/llmenugl.h12
-rw-r--r--indra/llui/llmodaldialog.h2
-rw-r--r--indra/llui/llmultisliderctrl.cpp2
-rw-r--r--indra/llui/llmultisliderctrl.h2
-rw-r--r--indra/llui/llpanel.cpp12
-rw-r--r--indra/llui/llscrollcontainer.h2
-rw-r--r--indra/llui/llscrolllistctrl.cpp3
-rw-r--r--indra/llui/lltabcontainer.h2
-rw-r--r--indra/llui/lltexteditor.h2
-rw-r--r--indra/llui/llui.cpp7
-rw-r--r--indra/llui/llui.h6
-rw-r--r--indra/llui/llview.cpp4
-rw-r--r--indra/llui/llview.h8
18 files changed, 72 insertions, 59 deletions
diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h
index 2921e837c4..6e1ab322af 100644
--- a/indra/llui/llcheckboxctrl.h
+++ b/indra/llui/llcheckboxctrl.h
@@ -82,7 +82,7 @@ public:
virtual void setEnabled( BOOL b );
virtual void draw();
- virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
+ virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
// LLUICtrl interface
virtual void setValue(const LLSD& value );
diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h
index 6215142e6f..3635409ec8 100644
--- a/indra/llui/lldraghandle.h
+++ b/indra/llui/lldraghandle.h
@@ -57,7 +57,6 @@ public:
virtual void setTitle( const LLString& title ) = 0;
virtual const LLString& getTitle() const = 0;
- virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) = 0;
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index a6c35b67a8..b69ac30e9c 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -154,7 +154,7 @@ LLFloater::LLFloater(const LLString& name)
mButtons[i] = NULL;
}
LLString title; // null string
- init(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults
+ initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults
}
@@ -173,7 +173,7 @@ LLFloater::LLFloater(const LLString& name, const LLRect& rect, const LLString& t
mButtonsEnabled[i] = FALSE;
mButtons[i] = NULL;
}
- init( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
+ initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
}
LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const LLString& title,
@@ -191,12 +191,12 @@ LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const L
mButtonsEnabled[i] = FALSE;
mButtons[i] = NULL;
}
- init( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
+ initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
}
// Note: Floaters constructed from XML call init() twice!
-void LLFloater::init(const LLString& title,
+void LLFloater::initFloater(const LLString& title,
BOOL resizable, S32 min_width, S32 min_height,
BOOL drag_on_left, BOOL minimizable, BOOL close_btn)
{
@@ -576,6 +576,11 @@ void LLFloater::close(bool app_quitting)
}
}
+/*virtual*/
+void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+ LLPanel::reshape(width, height, called_from_parent);
+}
void LLFloater::releaseFocus()
{
@@ -777,8 +782,6 @@ void LLFloater::setMinimized(BOOL minimize)
{
mExpandedRect = getRect();
- reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE);
-
// If the floater has been dragged while minimized in the
// past, then locate it at its previous minimized location.
// Otherwise, ask the view for a minimize position.
@@ -833,6 +836,9 @@ void LLFloater::setMinimized(BOOL minimize)
}
mMinimized = TRUE;
+
+ // Reshape *after* setting mMinimized
+ reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE);
}
else
{
@@ -845,7 +851,6 @@ void LLFloater::setMinimized(BOOL minimize)
mPreviousMinimizedBottom = currentRect.mBottom;
}
- reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom );
if (mButtonsEnabled[BUTTON_RESTORE])
@@ -874,6 +879,9 @@ void LLFloater::setMinimized(BOOL minimize)
}
mMinimized = FALSE;
+
+ // Reshape *after* setting mMinimized
+ reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
}
make_ui_sound("UISndWindowClose");
updateButtons();
@@ -1639,11 +1647,11 @@ LLFloaterView::LLFloaterView( const LLString& name, const LLRect& rect )
// By default, adjust vertical.
void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
{
- reshape(width, height, called_from_parent, ADJUST_VERTICAL_YES);
+ reshapeFloater(width, height, called_from_parent, ADJUST_VERTICAL_YES);
}
// When reshaping this view, make the floaters follow their closest edge.
-void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical)
+void LLFloaterView::reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical)
{
S32 old_width = getRect().getWidth();
S32 old_height = getRect().getHeight();
@@ -2910,7 +2918,7 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
setRect(rect);
setName(name);
- init(title,
+ initFloater(title,
resizable,
min_width,
min_height,
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index e722d5ad07..280789d64c 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -119,7 +119,7 @@ public:
// Can be called multiple times to reset floater parameters.
// Deletes all children of the floater.
- virtual void init(const LLString& title, BOOL resizable,
+ virtual void initFloater(const LLString& title, BOOL resizable,
S32 min_width, S32 min_height, BOOL drag_on_left,
BOOL minimizable, BOOL close_btn);
@@ -128,6 +128,8 @@ public:
// If allowed, close the floater cleanly, releasing focus.
// app_quitting is passed to onClose() below.
virtual void close(bool app_quitting = false);
+
+ /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
// Release keyboard and mouse focus
void releaseFocus();
@@ -300,8 +302,8 @@ class LLFloaterView : public LLUICtrl
public:
LLFloaterView( const LLString& name, const LLRect& rect );
- /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
- void reshape(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical);
+ /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
+ void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical);
/*virtual*/ void draw();
/*virtual*/ LLRect getSnapRect() const;
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index b52de24bb5..8ae44fbfd5 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -2965,8 +2965,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
class LLPieMenuBranch : public LLMenuItemGL
{
public:
- LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch,
- enabled_callback ecb, void* user_data);
+ LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch);
// called to rebuild the draw label
virtual void buildDrawLabel( void );
@@ -2978,19 +2977,13 @@ public:
protected:
LLPieMenu* mBranch;
- enabled_callback mEnabledCallback;
- void* mUserData;
};
LLPieMenuBranch::LLPieMenuBranch(const LLString& name,
const LLString& label,
- LLPieMenu* branch,
- enabled_callback ecb,
- void* user_data)
+ LLPieMenu* branch)
: LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ),
- mBranch( branch ),
- mEnabledCallback( ecb ),
- mUserData(user_data)
+ mBranch( branch )
{
mBranch->hide(FALSE);
mBranch->setParentMenuItem(this);
@@ -2999,12 +2992,6 @@ LLPieMenuBranch::LLPieMenuBranch(const LLString& name,
// called to rebuild the draw label
void LLPieMenuBranch::buildDrawLabel( void )
{
- if(mEnabledCallback)
- {
- setEnabled(mEnabledCallback(mUserData));
- setDrawTextDisabled(FALSE);
- }
- else
{
// default enablement is this -- if any of the subitems are
// enabled, this item is enabled. JC
@@ -3097,7 +3084,7 @@ void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *fac
child->getAttributeString("label", label);
LLPieMenu *submenu = new LLPieMenu(name, label);
- appendMenu(submenu);
+ appendPieMenu(submenu);
submenu->initXML(child, context, factory);
}
else
@@ -3479,17 +3466,14 @@ BOOL LLPieMenu::appendSeparator(const LLString &separator_name)
}
-// virtual
-BOOL LLPieMenu::appendMenu(LLPieMenu *menu,
- enabled_callback enabled_cb,
- void* user_data)
+BOOL LLPieMenu::appendPieMenu(LLPieMenu *menu)
{
if (menu == this)
{
llerrs << "Can't attach a pie menu to itself" << llendl;
}
LLPieMenuBranch *item;
- item = new LLPieMenuBranch(menu->getName(), menu->getLabel(), menu, enabled_cb, user_data);
+ item = new LLPieMenuBranch(menu->getName(), menu->getLabel(), menu);
getParent()->addChild(item->getBranch());
item->setFont( LLFontGL::sSansSerifSmall );
return append( item );
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 3166290307..77998be880 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -512,8 +512,6 @@ public:
static void setKeyboardMode(BOOL mode) { sKeyboardMode = mode; }
static BOOL getKeyboardMode() { return sKeyboardMode; }
- static void onFocusLost(LLView* old_focus);
-
static class LLMenuHolderGL* sMenuContainer;
protected:
@@ -646,12 +644,8 @@ public:
virtual BOOL append(LLMenuItemGL* item);
virtual BOOL appendSeparator( const LLString &separator_name = "separator" );
- // the enabled callback is meant for the submenu. The api works
- // this way because the menu branch item responsible for the pie
- // submenu is constructed here.
- virtual BOOL appendMenu(LLPieMenu *menu,
- enabled_callback enabled_cb = NULL,
- void* user_data = NULL );
+ BOOL appendPieMenu(LLPieMenu *menu);
+
virtual void arrange( void );
// Display the menu centered on this point on the screen.
@@ -737,7 +731,7 @@ public:
virtual ~LLMenuHolderGL() {}
virtual BOOL hideMenus();
- void reshape(S32 width, S32 height, BOOL called_from_parent);
+ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
void setCanHide(BOOL can_hide) { mCanHide = can_hide; }
// LLView functionality
diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h
index a5e6e9a490..887239b18d 100644
--- a/indra/llui/llmodaldialog.h
+++ b/indra/llui/llmodaldialog.h
@@ -49,7 +49,7 @@ public:
/*virtual*/ void open(); /* Flawfinder: ignore */
- /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = 1);
+ /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ void startModal();
/*virtual*/ void stopModal();
diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp
index 641b88de9a..e2b1e410fa 100644
--- a/indra/llui/llmultisliderctrl.cpp
+++ b/indra/llui/llmultisliderctrl.cpp
@@ -185,7 +185,7 @@ void LLMultiSliderCtrl::setCurSlider(const LLString& name)
mCurValue = mMultiSlider->getCurSliderValue();
}
-BOOL LLMultiSliderCtrl::setLabelArg( const LLString& key, const LLString& text )
+BOOL LLMultiSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text )
{
BOOL res = FALSE;
if (mLabelBox)
diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h
index a3a602c2b2..bbc3955f58 100644
--- a/indra/llui/llmultisliderctrl.h
+++ b/indra/llui/llmultisliderctrl.h
@@ -79,7 +79,7 @@ public:
virtual void setValue(const LLSD& value );
virtual LLSD getValue() const { return mMultiSlider->getValue(); }
- virtual BOOL setLabelArg( const LLString& key, const LLString& text );
+ virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text );
const LLString& getCurSlider() const { return mMultiSlider->getCurSlider(); }
F32 getCurSliderValue() const { return mCurValue; }
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index fa48ebebe9..875f114ce3 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -618,7 +618,17 @@ LLString LLPanel::getString(const LLString& name, const LLString::format_map_t&
formatted_string.setArgList(args);
return formatted_string.getString();
}
- llerrs << "Failed to find string " << name << " in panel " << getName() << llendl;
+ LLString err_str("Failed to find string " + name + " in panel " + getName());
+ // *TODO: once the QAR-369 ui-cleanup work on settings is in we need to change the following line to be
+ //if(LLUI::sConfigGroup->getBOOL("QAMode"))
+ if(LLUI::sQAMode)
+ {
+ llerrs << err_str << llendl;
+ }
+ else
+ {
+ llwarns << err_str << llendl;
+ }
return LLString::null;
}
diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h
index db6d7d6198..64be2169ad 100644
--- a/indra/llui/llscrollcontainer.h
+++ b/indra/llui/llscrollcontainer.h
@@ -87,7 +87,7 @@ public:
BOOL needsToScroll(S32 x, S32 y, SCROLL_ORIENTATION axis) const;
// LLView functionality
- virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
+ virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
virtual BOOL handleKeyHere(KEY key, MASK mask);
virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index a4ea08bd5d..87929b10b4 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -901,6 +901,9 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
return not_too_big;
}
+// NOTE: This is *very* expensive for large lists, especially when we are dirtying the list every frame
+// while receiving a long list of names.
+// *TODO: Use bookkeeping to make this an incramental cost with item additions
void LLScrollListCtrl::calcColumnWidths()
{
const S32 HEADING_TEXT_PADDING = 30;
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index 20d04cbf86..f4da5e5aed 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -63,7 +63,7 @@ public:
// from LLView
/*virtual*/ void setValue(const LLSD& value);
- /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
+ /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ void draw();
/*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
/*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask );
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index d48a162830..00dc70ba92 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -92,7 +92,7 @@ public:
virtual void onMouseCaptureLost();
// view overrides
- virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
+ virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
virtual void draw();
virtual void onFocusReceived();
virtual void onFocusLost();
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 4866a4b309..d88f4ee7c1 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -81,6 +81,7 @@ LLWindow* LLUI::sWindow = NULL;
LLHtmlHelp* LLUI::sHtmlHelp = NULL;
BOOL LLUI::sShowXUINames = FALSE;
std::stack<LLRect> LLScreenClipRect::sClipRectStack;
+BOOL LLUI::sQAMode = FALSE;
//
// Functions
@@ -1747,6 +1748,12 @@ void LLUI::setHtmlHelp(LLHtmlHelp* html_help)
LLUI::sHtmlHelp = html_help;
}
+//static
+void LLUI::setQAMode(BOOL b)
+{
+ LLUI::sQAMode = b;
+}
+
LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled) : mScissorState(GL_SCISSOR_TEST), mEnabled(enabled)
{
if (mEnabled)
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index b5a64e7533..ab45e36175 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -198,6 +198,12 @@ public:
static BOOL sShowXUINames;
static LLHtmlHelp* sHtmlHelp;
+ // *TODO: remove the following when QAR-369 settings clean-up work is in.
+ // Also remove the call to this method which will then be obsolete.
+ // Search for QAR-369 below to enable the proper accessing of this feature. -MG
+ static void setQAMode(BOOL b);
+ static BOOL sQAMode;
+
};
// FactoryPolicy is a static class that controls the creation and lookup of UI elements,
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index b49ee4338f..9db667bb51 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -644,13 +644,13 @@ void LLView::translate(S32 x, S32 y)
}
// virtual
-BOOL LLView::canSnapTo(const LLView* other_view) const
+BOOL LLView::canSnapTo(const LLView* other_view)
{
return other_view != this && other_view->getVisible();
}
// virtual
-void LLView::snappedTo(LLView* snap_view)
+void LLView::snappedTo(const LLView* snap_view)
{
}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 6c5bcc5470..94811adaa5 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -106,9 +106,9 @@ virtual void userSetShape(const LLRect& new_rect);
virtual LLView* findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding = 0);
virtual LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding = 0);
LLScrollListCtrl
-virtual BOOL canSnapTo(const LLView* other_view) const { return other_view != this && other_view->getVisible(); }
+virtual BOOL canSnapTo(const LLView* other_view) { return other_view != this && other_view->getVisible(); }
LLFloater
-virtual void snappedTo(LLView* snap_view) {}
+virtual void snappedTo(const LLView* snap_view) {}
LLFloater
virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
*
@@ -393,9 +393,9 @@ public:
virtual LLView* findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding = 0);
virtual LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding = 0);
- virtual BOOL canSnapTo(const LLView* other_view) const;
+ virtual BOOL canSnapTo(const LLView* other_view);
- virtual void snappedTo(LLView* snap_view);
+ virtual void snappedTo(const LLView* snap_view);
virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);