diff options
Diffstat (limited to 'indra/llui/llpanel.cpp')
-rw-r--r-- | indra/llui/llpanel.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index d580566b13..468cdb10fb 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -55,7 +55,7 @@ LLPanel::factory_stack_t LLPanel::sFactoryStack; // Compiler optimization, generate extern template template class LLPanel* LLView::getChild<class LLPanel>( - const std::string& name, BOOL recurse) const; + const std::string& name, bool recurse) const; LLPanel::LocalizedString::LocalizedString() : name("name"), @@ -127,9 +127,9 @@ LLPanel::~LLPanel() } // virtual -BOOL LLPanel::isPanel() const +bool LLPanel::isPanel() const { - return TRUE; + return true; } void LLPanel::addBorder(LLViewBorder::Params p) @@ -167,13 +167,13 @@ void LLPanel::clearCtrls() for (LLPanel::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) { LLUICtrl* ctrl = *ctrl_it; - ctrl->setFocus( FALSE ); - ctrl->setEnabled( FALSE ); + ctrl->setFocus( false ); + ctrl->setEnabled( false ); ctrl->clear(); } } -void LLPanel::setCtrlsEnabled( BOOL b ) +void LLPanel::setCtrlsEnabled( bool b ) { LLPanel::ctrl_list_t ctrls = getCtrlList(); for (LLPanel::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) @@ -247,13 +247,13 @@ void LLPanel::updateDefaultBtn() if (gFocusMgr.childHasKeyboardFocus( this ) && mDefaultBtn->getEnabled()) { LLButton* buttonp = dynamic_cast<LLButton*>(gFocusMgr.getKeyboardFocus()); - BOOL focus_is_child_button = buttonp && buttonp->getCommitOnReturn(); + bool focus_is_child_button = buttonp && buttonp->getCommitOnReturn(); // only enable default button when current focus is not a return-capturing button mDefaultBtn->setBorderEnabled(!focus_is_child_button); } else { - mDefaultBtn->setBorderEnabled(FALSE); + mDefaultBtn->setBorderEnabled(false); } } } @@ -261,19 +261,19 @@ void LLPanel::updateDefaultBtn() void LLPanel::refresh() { // do nothing by default - // but is automatically called in setFocus(TRUE) + // but is automatically called in setFocus(true) } void LLPanel::setDefaultBtn(LLButton* btn) { if (mDefaultBtn && mDefaultBtn->getEnabled()) { - mDefaultBtn->setBorderEnabled(FALSE); + mDefaultBtn->setBorderEnabled(false); } mDefaultBtn = btn; if (mDefaultBtn) { - mDefaultBtn->setBorderEnabled(TRUE); + mDefaultBtn->setBorderEnabled(true); } } @@ -290,17 +290,17 @@ void LLPanel::setDefaultBtn(const std::string& id) } } -BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) +bool LLPanel::handleKeyHere( KEY key, MASK mask ) { - BOOL handled = FALSE; + bool handled = false; LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); // handle user hitting ESC to defocus if (key == KEY_ESCAPE) { - setFocus(FALSE); - return TRUE; + setFocus(false); + return true; } else if( (mask == MASK_SHIFT) && (KEY_TAB == key)) { @@ -310,7 +310,7 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot(); if (focus_root) { - handled = focus_root->focusPrevItem(FALSE); + handled = focus_root->focusPrevItem(false); } } } @@ -322,7 +322,7 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot(); if (focus_root) { - handled = focus_root->focusNextItem(FALSE); + handled = focus_root->focusNextItem(false); } } } @@ -335,38 +335,38 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) { // current focus is a return-capturing button, // let *that* button handle the return key - handled = FALSE; + handled = false; } else if (mDefaultBtn && mDefaultBtn->getVisible() && mDefaultBtn->getEnabled()) { // If we have a default button, click it when return is pressed mDefaultBtn->onCommit(); - handled = TRUE; + handled = true; } else if (cur_focus->acceptsTextInput()) { // call onCommit for text input handling control cur_focus->onCommit(); - handled = TRUE; + handled = true; } } return handled; } -void LLPanel::onVisibilityChange ( BOOL new_visibility ) +void LLPanel::onVisibilityChange ( bool new_visibility ) { LLUICtrl::onVisibilityChange ( new_visibility ); if (mVisibleSignal) - (*mVisibleSignal)(this, LLSD(new_visibility) ); // Pass BOOL as LLSD + (*mVisibleSignal)(this, LLSD(new_visibility) ); // Pass bool as LLSD } -void LLPanel::setFocus(BOOL b) +void LLPanel::setFocus(bool b) { if( b && !hasFocus()) { // give ourselves focus preemptively, to avoid infinite loop - LLUICtrl::setFocus(TRUE); + LLUICtrl::setFocus(true); // then try to pass to first valid child focusFirstItem(); } @@ -376,7 +376,7 @@ void LLPanel::setFocus(BOOL b) } } -void LLPanel::setBorderVisible(BOOL b) +void LLPanel::setBorderVisible(bool b) { if (mBorder) { @@ -504,7 +504,7 @@ static LLTrace::BlockTimerStatHandle FTM_PANEL_SETUP("Panel Setup"); static LLTrace::BlockTimerStatHandle FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); static LLTrace::BlockTimerStatHandle FTM_PANEL_POSTBUILD("Panel PostBuild"); -BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params) +bool LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params) { Params params(default_params); { @@ -533,7 +533,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params); - return TRUE; + return true; } LLUICtrlFactory::instance().pushFileName(xml_filename); @@ -543,7 +543,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu { LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL; - return FALSE; + return false; } parser.readXUI(referenced_xml, params, LLUICtrlFactory::getInstance()->getCurFileName()); @@ -590,7 +590,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu postBuild(); } } - return TRUE; + return true; } bool LLPanel::hasString(const std::string& name) @@ -658,7 +658,7 @@ void LLPanel::childSetEnabled(const std::string& id, bool enabled) } } -void LLPanel::childSetFocus(const std::string& id, BOOL focus) +void LLPanel::childSetFocus(const std::string& id, bool focus) { LLUICtrl* child = findChild<LLUICtrl>(id); if (child) @@ -667,7 +667,7 @@ void LLPanel::childSetFocus(const std::string& id, BOOL focus) } } -BOOL LLPanel::childHasFocus(const std::string& id) +bool LLPanel::childHasFocus(const std::string& id) { LLUICtrl* child = findChild<LLUICtrl>(id); if (child) @@ -676,7 +676,7 @@ BOOL LLPanel::childHasFocus(const std::string& id) } else { - return FALSE; + return false; } } @@ -752,24 +752,24 @@ LLSD LLPanel::childGetValue(const std::string& id) const return LLSD(); } -BOOL LLPanel::childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text) +bool LLPanel::childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->setTextArg(key, text); } - return FALSE; + return false; } -BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text) +bool LLPanel::childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { LLView* child = findChild<LLView>(id); if (child) { return child->setLabelArg(key, text); } - return FALSE; + return false; } void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_type& function) @@ -803,10 +803,10 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t:: //----------------------------------------------------------------------------- // buildPanel() //----------------------------------------------------------------------------- -BOOL LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params& default_params) +bool LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params& default_params) { LL_PROFILE_ZONE_SCOPED; - BOOL didPost = FALSE; + bool didPost = false; LLXMLNodePtr root; if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) |