summaryrefslogtreecommitdiff
path: root/indra/llui/llbutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llbutton.cpp')
-rw-r--r--indra/llui/llbutton.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 9ef019840a..f34398cb6b 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -56,7 +56,7 @@ static LLDefaultChildRegistry::Register<LLButton> r("button");
// Compiler optimization, generate extern template
template class LLButton* LLView::getChild<class LLButton>(
- const std::string& name, BOOL recurse) const;
+ const std::string& name, bool recurse) const;
// globals loaded from settings.xml
S32 LLBUTTON_H_PAD = 0;
@@ -123,10 +123,10 @@ LLButton::LLButton(const LLButton::Params& p)
LLBadgeOwner(getHandle()),
mMouseDownFrame(0),
mMouseHeldDownCount(0),
- mBorderEnabled( FALSE ),
- mFlashing( FALSE ),
+ mBorderEnabled( false ),
+ mFlashing( false ),
mCurGlowStrength(0.f),
- mNeedsHighlight(FALSE),
+ mNeedsHighlight(false),
mUnselectedLabel(p.label()),
mSelectedLabel(p.label_selected()),
mGLFont(p.font),
@@ -169,7 +169,7 @@ LLButton::LLButton(const LLButton::Params& p)
mHoverGlowStrength(p.hover_glow_amount),
mCommitOnReturn(p.commit_on_return),
mCommitOnCaptureLost(p.commit_on_capture_lost),
- mFadeWhenDisabled(FALSE),
+ mFadeWhenDisabled(false),
mForcePressedState(false),
mDisplayPressedState(p.display_pressed_state),
mLastDrawCharsCount(0),
@@ -222,7 +222,7 @@ LLButton::LLButton(const LLButton::Params& p)
if (p.image_disabled() == default_params.image_disabled() )
{
mImageDisabled = p.image_unselected;
- mFadeWhenDisabled = TRUE;
+ mFadeWhenDisabled = true;
}
if (p.image_pressed_selected == default_params.image_pressed_selected)
@@ -238,7 +238,7 @@ LLButton::LLButton(const LLButton::Params& p)
if (p.image_disabled_selected() == default_params.image_disabled_selected())
{
mImageDisabledSelected = p.image_selected;
- mFadeWhenDisabled = TRUE;
+ mFadeWhenDisabled = true;
}
if (p.image_pressed == default_params.image_pressed)
@@ -386,7 +386,7 @@ boost::signals2::connection LLButton::setHeldDownCallback( button_callback_t cb,
return setHeldDownCallback(boost::bind(cb, data));
}
-BOOL LLButton::postBuild()
+bool LLButton::postBuild()
{
autoResize();
@@ -395,9 +395,9 @@ BOOL LLButton::postBuild()
return LLUICtrl::postBuild();
}
-BOOL LLButton::handleUnicodeCharHere(llwchar uni_char)
+bool LLButton::handleUnicodeCharHere(llwchar uni_char)
{
- BOOL handled = FALSE;
+ bool handled = false;
if(' ' == uni_char
&& !gKeyboard->getKeyRepeated(' '))
{
@@ -408,14 +408,14 @@ BOOL LLButton::handleUnicodeCharHere(llwchar uni_char)
LLUICtrl::onCommit();
- handled = TRUE;
+ handled = true;
}
- return handled;
+ return handled;
}
-BOOL LLButton::handleKeyHere(KEY key, MASK mask )
+bool LLButton::handleKeyHere(KEY key, MASK mask )
{
- BOOL handled = FALSE;
+ bool handled = false;
if( mCommitOnReturn && KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key))
{
if (mIsToggle)
@@ -423,7 +423,7 @@ BOOL LLButton::handleKeyHere(KEY key, MASK mask )
toggleState();
}
- handled = TRUE;
+ handled = true;
LLUICtrl::onCommit();
}
@@ -431,7 +431,7 @@ BOOL LLButton::handleKeyHere(KEY key, MASK mask )
}
-BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
+bool LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (!childrenHandleMouseDown(x, y, mask))
{
@@ -440,7 +440,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
if (hasTabStop() && !getIsChrome())
{
- setFocus(TRUE);
+ setFocus(true);
}
if (!mFunctionName.empty())
@@ -471,11 +471,11 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
make_ui_sound("UISndClick");
}
}
- return TRUE;
+ return true;
}
-BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
+bool LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
{
// We only handle the click if the click both started and ended within us
if( hasMouseCapture() )
@@ -520,10 +520,10 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
childrenHandleMouseUp(x, y, mask);
}
- return TRUE;
+ return true;
}
-BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
+bool LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if (mHandleRightMouse && !childrenHandleRightMouseDown(x, y, mask))
{
@@ -532,7 +532,7 @@ BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
if (hasTabStop() && !getIsChrome())
{
- setFocus(TRUE);
+ setFocus(true);
}
// if (pointInView(x, y))
@@ -545,10 +545,10 @@ BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
// if they are not mouse opaque.
}
- return TRUE;
+ return true;
}
-BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask)
+bool LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
if (mHandleRightMouse)
{
@@ -574,14 +574,14 @@ BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask)
// but this might change the mouse handling of existing buttons in a bad way.
// if they are not mouse opaque.
}
- return TRUE;
+ return true;
}
void LLButton::onMouseLeave(S32 x, S32 y, MASK mask)
{
LLUICtrl::onMouseLeave(x, y, mask);
- mNeedsHighlight = FALSE;
+ mNeedsHighlight = false;
}
void LLButton::setHighlight(bool b)
@@ -589,11 +589,11 @@ void LLButton::setHighlight(bool b)
mNeedsHighlight = b;
}
-BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
+bool LLButton::handleHover(S32 x, S32 y, MASK mask)
{
if (isInEnabledChain()
&& (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() == this))
- mNeedsHighlight = TRUE;
+ mNeedsHighlight = true;
if (!childrenHandleHover(x, y, mask))
{
@@ -612,7 +612,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
getWindow()->setCursor(UI_CURSOR_ARROW);
LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL;
}
- return TRUE;
+ return true;
}
void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
@@ -632,7 +632,7 @@ void LLButton::draw()
static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::getInstance()->mSettingGroups["config"], "EnableButtonFlashing", true);
F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
- bool pressed_by_keyboard = FALSE;
+ bool pressed_by_keyboard = false;
if (hasFocus())
{
pressed_by_keyboard = gKeyboard->getKeyDown(' ') || (mCommitOnReturn && gKeyboard->getKeyDown(KEY_RETURN));
@@ -654,7 +654,7 @@ void LLButton::draw()
|| mForcePressedState;
bool selected = getToggleState();
- bool use_glow_effect = FALSE;
+ bool use_glow_effect = false;
LLColor4 highlighting_color = LLColor4::white;
LLColor4 glow_color = LLColor4::white;
LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA;
@@ -686,7 +686,7 @@ void LLButton::draw()
else
{
imagep = mImageSelected;
- use_glow_effect = TRUE;
+ use_glow_effect = true;
}
}
else
@@ -698,7 +698,7 @@ void LLButton::draw()
else
{
imagep = mImageUnselected;
- use_glow_effect = TRUE;
+ use_glow_effect = true;
}
}
}
@@ -740,7 +740,7 @@ void LLButton::draw()
if (mFlashingTimer)
{
LLColor4 flash_color = mFlashBgColor.get();
- use_glow_effect = TRUE;
+ use_glow_effect = true;
glow_type = LLRender::BT_ALPHA; // blend the glow
if (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress())
@@ -761,7 +761,7 @@ void LLButton::draw()
if (mNeedsHighlight && !imagep)
{
- use_glow_effect = TRUE;
+ use_glow_effect = true;
}
// Figure out appropriate color for the text
@@ -849,7 +849,7 @@ void LLButton::draw()
// no image
LL_DEBUGS() << "No image for button " << getName() << LL_ENDL;
// draw it in pink so we can find it
- gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1 % alpha, FALSE);
+ gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1 % alpha, false);
}
// let overlay image and text play well together
@@ -983,12 +983,12 @@ void LLButton::drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size)
}
}
-BOOL LLButton::getToggleState() const
+bool LLButton::getToggleState() const
{
return getValue().asBoolean();
}
-void LLButton::setToggleState(BOOL b)
+void LLButton::setToggleState(bool b)
{
if( b != getToggleState() )
{
@@ -1015,7 +1015,7 @@ void LLButton::setFlashing(bool b, bool force_flashing/* = false */)
}
}
-BOOL LLButton::toggleState()
+bool LLButton::toggleState()
{
bool flipped = ! getToggleState();
setToggleState(flipped);
@@ -1040,11 +1040,11 @@ void LLButton::setLabel( const LLStringExplicit& label )
}
//virtual
-BOOL LLButton::setLabelArg( const std::string& key, const LLStringExplicit& text )
+bool LLButton::setLabelArg( const std::string& key, const LLStringExplicit& text )
{
mUnselectedLabel.setArg(key, text);
mSelectedLabel.setArg(key, text);
- return TRUE;
+ return true;
}
void LLButton::setLabelUnselected( const LLStringExplicit& label )
@@ -1142,14 +1142,14 @@ void LLButton::setImageDisabled(LLPointer<LLUIImage> image)
{
mImageDisabled = image;
mDisabledImageColor = mImageColor;
- mFadeWhenDisabled = TRUE;
+ mFadeWhenDisabled = true;
}
void LLButton::setImageDisabledSelected(LLPointer<LLUIImage> image)
{
mImageDisabledSelected = image;
mDisabledImageColor = mImageColor;
- mFadeWhenDisabled = TRUE;
+ mFadeWhenDisabled = true;
}
void LLButton::setImagePressed(LLPointer<LLUIImage> image)
@@ -1242,11 +1242,11 @@ void LLButton::addImageAttributeToXML(LLXMLNodePtr node,
{
if( !image_name.empty() )
{
- node->createChild(xml_tag_name.c_str(), TRUE)->setStringValue(image_name);
+ node->createChild(xml_tag_name.c_str(), true)->setStringValue(image_name);
}
else if( image_id != LLUUID::null )
{
- node->createChild((xml_tag_name + "_id").c_str(), TRUE)->setUUIDValue(image_id);
+ node->createChild((xml_tag_name + "_id").c_str(), true)->setUUIDValue(image_id);
}
}
@@ -1313,7 +1313,7 @@ void LLButton::resetMouseDownTimer()
mMouseDownTimer.reset();
}
-BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask)
+bool LLButton::handleDoubleClick(S32 x, S32 y, MASK mask)
{
// just treat a double click as a second click
return handleMouseDown(x, y, mask);