summaryrefslogtreecommitdiff
path: root/indra/llui/llbutton.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-07-07 00:53:05 +0000
committerJames Cook <james@lindenlab.com>2009-07-07 00:53:05 +0000
commit52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 (patch)
treed8f5c98644029dd289a97aa0d8b55c5a6200c214 /indra/llui/llbutton.cpp
parent2c722655bd6701a3dc8518c6518c51f538765dcd (diff)
Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files:
lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14
Diffstat (limited to 'indra/llui/llbutton.cpp')
-rw-r--r--indra/llui/llbutton.cpp85
1 files changed, 48 insertions, 37 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index f2aa9c0d4c..9ad27e7c41 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -32,7 +32,6 @@
#include "linden_common.h"
-#define INSTANTIATE_GETCHILD_BUTTON
#include "llbutton.h"
// Linden library includes
@@ -53,7 +52,7 @@
#include "llrender.h"
#include "lluictrlfactory.h"
-static LLDefaultWidgetRegistry::Register<LLButton> r("button");
+static LLDefaultChildRegistry::Register<LLButton> r("button");
// globals loaded from settings.xml
S32 LLBUTTON_H_PAD = 0;
@@ -61,8 +60,6 @@ S32 LLBUTTON_V_PAD = 0;
S32 BTN_HEIGHT_SMALL= 0;
S32 BTN_HEIGHT = 0;
-template LLButton* LLView::getChild<LLButton>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const;
-
LLButton::Params::Params()
: label_selected("label_selected"), // requires is_toggle true
label_dropshadow("label_shadow", true),
@@ -146,7 +143,7 @@ LLButton::LLButton(const LLButton::Params& p)
mFadeWhenDisabled(FALSE)
{
static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
- static Params default_params(LLUICtrlFactory::getDefaultParams<Params>());
+ static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>());
//if we aren't a picture_style button set label as name if not provided
if (!p.picture_style.isProvided() || !p.picture_style)
@@ -328,25 +325,27 @@ BOOL LLButton::handleKeyHere(KEY key, MASK mask )
BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
{
- // Route future Mouse messages here preemptively. (Release on mouse up.)
- gFocusMgr.setMouseCapture( this );
-
- if (hasTabStop() && !getIsChrome())
+ if (!childrenHandleMouseDown(x, y, mask))
{
- setFocus(TRUE);
- }
+ // Route future Mouse messages here preemptively. (Release on mouse up.)
+ gFocusMgr.setMouseCapture( this );
- mMouseDownSignal(this, LLSD());
+ if (hasTabStop() && !getIsChrome())
+ {
+ setFocus(TRUE);
+ }
- mMouseDownTimer.start();
- mMouseDownFrame = (S32) LLFrameTimer::getFrameCount();
- mMouseHeldDownCount = 0;
-
- if (getSoundFlags() & MOUSE_DOWN)
- {
- make_ui_sound("UISndClick");
- }
+ mMouseDownSignal(this, LLSD());
+ mMouseDownTimer.start();
+ mMouseDownFrame = (S32) LLFrameTimer::getFrameCount();
+ mMouseHeldDownCount = 0;
+
+ if (getSoundFlags() & MOUSE_DOWN)
+ {
+ make_ui_sound("UISndClick");
+ }
+ }
return TRUE;
}
@@ -381,20 +380,26 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
LLUICtrl::onCommit();
}
}
+ else
+ {
+ childrenHandleMouseUp(x, y, mask);
+ }
return TRUE;
}
BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
- // Route future Mouse messages here preemptively. (Release on mouse up.)
- gFocusMgr.setMouseCapture( this );
-
- if (hasTabStop() && !getIsChrome())
+ if (!childrenHandleRightMouseDown(x, y, mask))
{
- setFocus(TRUE);
- }
+ // Route future Mouse messages here preemptively. (Release on mouse up.)
+ gFocusMgr.setMouseCapture( this );
+ if (hasTabStop() && !getIsChrome())
+ {
+ setFocus(TRUE);
+ }
+ }
return TRUE;
}
@@ -412,6 +417,10 @@ BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask)
mRightClickSignal(this, getValue());
}
}
+ else
+ {
+ childrenHandleRightMouseUp(x, y, mask);
+ }
return TRUE;
}
@@ -429,21 +438,23 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask)
BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
{
- if (mMouseDownTimer.getStarted())
+ if (!childrenHandleHover(x, y, mask))
{
- F32 elapsed = getHeldDownTime();
- if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= (S32)LLFrameTimer::getFrameCount() - mMouseDownFrame)
+ if (mMouseDownTimer.getStarted())
{
- LLSD param;
- param["count"] = mMouseHeldDownCount++;
- mHeldDownSignal(this, param);
+ F32 elapsed = getHeldDownTime();
+ if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= (S32)LLFrameTimer::getFrameCount() - mMouseDownFrame)
+ {
+ LLSD param;
+ param["count"] = mMouseHeldDownCount++;
+ mHeldDownSignal(this, param);
+ }
}
- }
-
- // We only handle the click if the click both started and ended within us
- getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
+ // We only handle the click if the click both started and ended within us
+ getWindow()->setCursor(UI_CURSOR_ARROW);
+ lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
+ }
return TRUE;
}