diff options
Diffstat (limited to 'indra/newview/llchatbar.cpp')
-rw-r--r-- | indra/newview/llchatbar.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 705552a5c1..4f90db17c0 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -63,7 +63,7 @@ // // Globals // -const F32 AGENT_TYPING_TIMEOUT = 5.f; // seconds +constexpr F32 AGENT_TYPING_TIMEOUT = 5.f; // seconds LLChatBar *gChatBar = NULL; @@ -89,11 +89,11 @@ LLChatBar::LLChatBar() mInputEditor(NULL), mGestureLabelTimer(), mLastSpecialChatChannel(0), - mIsBuilt(FALSE), + mIsBuilt(false), mGestureCombo(NULL), mObserver(NULL) { - //setIsChrome(TRUE); + //setIsChrome(true); } @@ -105,7 +105,7 @@ LLChatBar::~LLChatBar() // LLView destructor cleans up children } -BOOL LLChatBar::postBuild() +bool LLChatBar::postBuild() { getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1)); @@ -118,18 +118,18 @@ BOOL LLChatBar::postBuild() mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke, this); mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost)); mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus)); - mInputEditor->setCommitOnFocusLost( FALSE ); - mInputEditor->setRevertOnEsc( FALSE ); - mInputEditor->setIgnoreTab(TRUE); - mInputEditor->setPassDelete(TRUE); - mInputEditor->setReplaceNewlinesWithSpaces(FALSE); + mInputEditor->setCommitOnFocusLost( false ); + mInputEditor->setRevertOnEsc( false ); + mInputEditor->setIgnoreTab(true); + mInputEditor->setPassDelete(true); + mInputEditor->setReplaceNewlinesWithSpaces(false); mInputEditor->setMaxTextLength(DB_CHAT_MSG_STR_LEN); - mInputEditor->setEnableLineHistory(TRUE); + mInputEditor->setEnableLineHistory(true); - mIsBuilt = TRUE; + mIsBuilt = true; - return TRUE; + return true; } //----------------------------------------------------------------------- @@ -137,9 +137,9 @@ BOOL LLChatBar::postBuild() //----------------------------------------------------------------------- // virtual -BOOL LLChatBar::handleKeyHere( KEY key, MASK mask ) +bool LLChatBar::handleKeyHere( KEY key, MASK mask ) { - BOOL handled = FALSE; + bool handled = false; if( KEY_RETURN == key ) { @@ -147,13 +147,13 @@ BOOL LLChatBar::handleKeyHere( KEY key, MASK mask ) { // shout sendChat(CHAT_TYPE_SHOUT); - handled = TRUE; + handled = true; } else if (mask == MASK_NONE) { // say sendChat( CHAT_TYPE_NORMAL ); - handled = TRUE; + handled = true; } } // only do this in main chatbar @@ -161,7 +161,7 @@ BOOL LLChatBar::handleKeyHere( KEY key, MASK mask ) { stopChat(); - handled = TRUE; + handled = true; } return handled; @@ -199,7 +199,7 @@ void LLChatBar::refreshGestures() mGestureCombo->clearRows(); // collect list of unique gestures - std::map <std::string, BOOL> unique; + std::map <std::string, bool> unique; LLGestureMgr::item_map_t::const_iterator it; const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures(); for (it = active_gestures.begin(); it != active_gestures.end(); ++it) @@ -209,13 +209,13 @@ void LLChatBar::refreshGestures() { if (!gesture->mTrigger.empty()) { - unique[gesture->mTrigger] = TRUE; + unique[gesture->mTrigger] = true; } } } // add unique gestures - std::map <std::string, BOOL>::iterator it2; + std::map <std::string, bool>::iterator it2; for (it2 = unique.begin(); it2 != unique.end(); ++it2) { mGestureCombo->addSimpleElement((*it2).first); @@ -238,13 +238,13 @@ void LLChatBar::refreshGestures() } // Move the cursor to the correct input field. -void LLChatBar::setKeyboardFocus(BOOL focus) +void LLChatBar::setKeyboardFocus(bool focus) { if (focus) { if (mInputEditor) { - mInputEditor->setFocus(TRUE); + mInputEditor->setFocus(true); mInputEditor->selectAll(); } } @@ -254,13 +254,13 @@ void LLChatBar::setKeyboardFocus(BOOL focus) { mInputEditor->deselect(); } - setFocus(FALSE); + setFocus(false); } } // Ignore arrow keys in chat bar -void LLChatBar::setIgnoreArrowKeys(BOOL b) +void LLChatBar::setIgnoreArrowKeys(bool b) { if (mInputEditor) { @@ -268,7 +268,7 @@ void LLChatBar::setIgnoreArrowKeys(BOOL b) } } -BOOL LLChatBar::inputEditorHasFocus() +bool LLChatBar::inputEditorHasFocus() { return mInputEditor && mInputEditor->hasFocus(); } @@ -409,15 +409,15 @@ void LLChatBar::startChat(const char* line) //TODO* remove DUMMY chat //if(gBottomTray && gBottomTray->getChatBox()) //{ - // gBottomTray->setVisible(TRUE); - // gBottomTray->getChatBox()->setFocus(TRUE); + // gBottomTray->setVisible(true); + // gBottomTray->getChatBox()->setFocus(true); //} // *TODO Vadim: Why was this code commented out? -// gChatBar->setVisible(TRUE); -// gChatBar->setKeyboardFocus(TRUE); -// gSavedSettings.setBOOL("ChatVisible", TRUE); +// gChatBar->setVisible(true); +// gChatBar->setKeyboardFocus(true); +// gSavedSettings.setBOOL("ChatVisible", true); // // if (line && gChatBar->mInputEditor) // { @@ -436,13 +436,13 @@ void LLChatBar::stopChat() //TODO* remove DUMMY chat //if(gBottomTray && gBottomTray->getChatBox()) ///{ - // gBottomTray->getChatBox()->setFocus(FALSE); + // gBottomTray->getChatBox()->setFocus(false); //} // *TODO Vadim: Why was this code commented out? // // In simple UI mode, we never release focus from the chat bar -// gChatBar->setKeyboardFocus(FALSE); +// gChatBar->setKeyboardFocus(false); // // // If we typed a movement key and pressed return during the // // same frame, the keyboard handlers will see the key as having @@ -454,8 +454,8 @@ void LLChatBar::stopChat() // gAgent.stopTyping(); // // // hide chat bar so it doesn't grab focus back -// gChatBar->setVisible(FALSE); -// gSavedSettings.setBOOL("ChatVisible", FALSE); +// gChatBar->setVisible(false); +// gSavedSettings.setBOOL("ChatVisible", false); } // static @@ -470,7 +470,7 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata ) // to eat trailing spaces that might be part of a gesture. LLWStringUtil::trimHead(raw_text); - S32 length = raw_text.length(); + auto length = raw_text.length(); if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences { @@ -518,7 +518,7 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata ) // Select to end of line, starting from the character // after the last one the user typed. - self->mInputEditor->setSelection(length, outlength); + self->mInputEditor->setSelection(static_cast<S32>(length), outlength); } } @@ -557,16 +557,16 @@ void LLChatBar::onClickSay( LLUICtrl* ctrl ) sendChat(chat_type); } -void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate) +void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, bool animate) { sendChatFromViewer(utf8str_to_wstring(utf8text), type, animate); } -void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) +void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, bool animate) { // as soon as we say something, we no longer care about teaching the user // how to chat - gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE); + gWarningSettings.setBOOL("FirstOtherChatBeforeUser", false); // Look for "/20 foo" channel chats. S32 channel = 0; @@ -641,13 +641,13 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl) if (!revised_text.empty()) { // Don't play nodding animation - sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE); + sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, false); } } mGestureLabelTimer.start(); if (mGestureCombo != NULL) { // free focus back to chat bar - mGestureCombo->setFocus(FALSE); + mGestureCombo->setFocus(false); } } |