diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llbutton.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llcallbackmap.h | 4 | ||||
-rw-r--r-- | indra/llui/lllineeditor.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llmenugl.cpp | 18 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 13 | ||||
-rw-r--r-- | indra/llui/llresmgr.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llresmgr.h | 2 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 34 | ||||
-rw-r--r-- | indra/llui/llui.h | 1 |
9 files changed, 56 insertions, 32 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 65cbcf3634..36ccc32255 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1037,7 +1037,7 @@ void clicked_help(void* data) return; } - LLUI::sHtmlHelp->show(self->getHelpURL()); + LLUI::sHtmlHelp->show(self->getHelpURL(), ""); } // static diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index 0efda5de8c..496d7225f8 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -29,10 +29,6 @@ * $/LicenseInfo$ */ -// llcallbackmap.h -// -// Copyright 2006, Linden Research, Inc. - #ifndef LL_CALLBACK_MAP_H #define LL_CALLBACK_MAP_H diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 9671065ed2..ecdcbc370d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2219,6 +2219,11 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory { line_editor->setHandleEditKeysDirectly(handle_edit_keys_directly); } + BOOL commit_on_focus_lost = TRUE; + if (node->getAttributeBOOL("commit_on_focus_lost", commit_on_focus_lost)) + { + line_editor->setCommitOnFocusLost(commit_on_focus_lost); + } line_editor->setColorParameters(node); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 9b4a2a168c..906b134d2b 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2489,6 +2489,9 @@ void LLMenuGL::cleanupSpilloverBranch() mItems.erase(found_iter); } + delete mSpilloverBranch; + mSpilloverBranch = NULL; + // pop off spillover items while (mSpilloverMenu->getItemCount()) { @@ -2601,6 +2604,8 @@ void LLMenuGL::createJumpKeys() // remove all items on the menu void LLMenuGL::empty( void ) { + cleanupSpilloverBranch(); + mItems.clear(); deleteAllChildren(); @@ -4239,11 +4244,14 @@ void LLMenuBarGL::arrange( void ) for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { LLMenuItemGL* item = *item_iter; - rect.mLeft = pos; - pos += item->getNominalWidth(); - rect.mRight = pos; - item->setRect( rect ); - item->buildDrawLabel(); + if (item->getVisible()) + { + rect.mLeft = pos; + pos += item->getNominalWidth(); + rect.mRight = pos; + item->setRect( rect ); + item->buildDrawLabel(); + } } reshape(rect.mRight, rect.getHeight()); } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 6dc9282ba6..ce33f8a379 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -238,11 +238,6 @@ protected: on_disabled_callback mOnDisabledCallback; public: - - - void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; - void setEnabledCallback(enabled_callback callback) { mEnabledCallback = callback; }; - // normal constructor LLMenuItemCallGL( const LLString& name, menu_callback clicked_cb, @@ -288,7 +283,13 @@ public: void setEnabledControl(LLString enabled_control, LLView *context); void setVisibleControl(LLString enabled_control, LLView *context); - virtual void setUserData(void *userdata) { mUserData = userdata; } + void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; + menu_callback getMenuCallback() const { return mCallback; } + + void setEnabledCallback(enabled_callback callback) { mEnabledCallback = callback; }; + + void setUserData(void *userdata) { mUserData = userdata; } + void* getUserData() const { return mUserData; } // called to rebuild the draw label virtual void buildDrawLabel( void ); diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index e77faa9fc1..0e1b9bfbef 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -247,8 +247,10 @@ char LLResMgr::getMonetaryThousandsSeparator() const // Sets output to a string of integers with monetary separators inserted according to the locale. -void LLResMgr::getMonetaryString( LLString& output, S32 input ) const +std::string LLResMgr::getMonetaryString( S32 input ) const { + std::string output; + LLLocale locale(LLLocale::USER_LOCALE); struct lconv *conv = localeconv(); @@ -295,7 +297,6 @@ void LLResMgr::getMonetaryString( LLString& output, S32 input ) const LLString digits = llformat("%u", abs(input)); if( !grouping || !grouping[0] ) { - output.assign("L$"); if( negative_before ) { output.append( negative_sign ); @@ -305,7 +306,7 @@ void LLResMgr::getMonetaryString( LLString& output, S32 input ) const { output.append( negative_sign ); } - return; + return output; } S32 groupings[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -367,7 +368,6 @@ void LLResMgr::getMonetaryString( LLString& output, S32 input ) const forward_output[ output_pos - 1 - i ] = reversed_output[ i ]; } - output.assign("L$"); if( negative_before ) { output.append( negative_sign ); @@ -377,6 +377,7 @@ void LLResMgr::getMonetaryString( LLString& output, S32 input ) const { output.append( negative_sign ); } + return output; } void LLResMgr::getIntegerString( LLString& output, S32 input ) const diff --git a/indra/llui/llresmgr.h b/indra/llui/llresmgr.h index d9e58bc066..be2a35513f 100644 --- a/indra/llui/llresmgr.h +++ b/indra/llui/llresmgr.h @@ -132,7 +132,7 @@ public: char getMonetaryDecimalPoint() const; char getMonetaryThousandsSeparator() const; - void getMonetaryString( LLString& output, S32 input ) const; + std::string getMonetaryString( S32 input ) const; void getIntegerString( LLString& output, S32 input ) const; // const char* getRes( LLSTR_ID string_id ) const { return mStrings[ string_id ]; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 12ad339886..0184878e45 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -967,17 +967,6 @@ void LLTextEditor::endSelection() mIsSelecting = FALSE; mSelectionEnd = mCursorPos; } - if (mParseHTML && mHTML.length() > 0) - { - //Special handling for slurls - if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) - { - if (mURLcallback!=NULL) (*mURLcallback)(mHTML.c_str()); - - //load_url(url.c_str()); - } - mHTML=""; - } } BOOL LLTextEditor::selectionContainsLineBreaks() @@ -1408,6 +1397,7 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { gFocusMgr.setMouseCapture( NULL ); + handled = TRUE; } @@ -3814,6 +3804,22 @@ void LLTextEditor::findEmbeddedItemSegments() BOOL LLTextEditor::handleMouseUpOverSegment(S32 x, S32 y, MASK mask) { + if ( hasMouseCapture() ) + { + // This mouse up was part of a click. + // Regardless of where the cursor is, see if we recently touched a link + // and launch it if we did. + if (mParseHTML && mHTML.length() > 0) + { + //Special handling for slurls + if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) + { + if (mURLcallback!=NULL) (*mURLcallback)(mHTML.c_str()); + } + mHTML=""; + } + } + return FALSE; } @@ -4245,6 +4251,12 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) strpos = url.find(slurlID); } + if (strpos < 0) + { + slurlID="sl://"; + strpos = url.find(slurlID); + } + if (strpos >= 0) { strpos+=slurlID.length(); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 4d831ca534..a947e61af9 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -225,6 +225,7 @@ typedef enum e_widget_type WIDGET_TYPE_PAD, // used in XML for positioning, not a real widget WIDGET_TYPE_RADIO_GROUP, WIDGET_TYPE_ICON, + WIDGET_TYPE_LANDMARK_PICKER, WIDGET_TYPE_LOCATE, // used in XML for positioning, not a real widget WIDGET_TYPE_VIEW_BORDER, // decorative border WIDGET_TYPE_PANEL, |