diff options
Diffstat (limited to 'linden/indra/llui')
84 files changed, 2040 insertions, 3412 deletions
diff --git a/linden/indra/llui/CMakeLists.txt b/linden/indra/llui/CMakeLists.txt new file mode 100644 index 0000000..77efec5 --- /dev/null +++ b/linden/indra/llui/CMakeLists.txt | |||
@@ -0,0 +1,133 @@ | |||
1 | # -*- cmake -*- | ||
2 | |||
3 | project(llui) | ||
4 | |||
5 | include(00-Common) | ||
6 | include(LLAudio) | ||
7 | include(LLCommon) | ||
8 | include(LLImage) | ||
9 | include(LLMath) | ||
10 | include(LLMessage) | ||
11 | include(LLRender) | ||
12 | include(LLWindow) | ||
13 | include(LLVFS) | ||
14 | include(LLXML) | ||
15 | |||
16 | include_directories( | ||
17 | ${LLAUDIO_INCLUDE_DIRS} | ||
18 | ${LLCOMMON_INCLUDE_DIRS} | ||
19 | ${LLIMAGE_INCLUDE_DIRS} | ||
20 | ${LLMATH_INCLUDE_DIRS} | ||
21 | ${LLMESSAGE_INCLUDE_DIRS} | ||
22 | ${LLRENDER_INCLUDE_DIRS} | ||
23 | ${LLWINDOW_INCLUDE_DIRS} | ||
24 | ${LLVFS_INCLUDE_DIRS} | ||
25 | ${LLXML_INCLUDE_DIRS} | ||
26 | ) | ||
27 | |||
28 | set(llui_SOURCE_FILES | ||
29 | llalertdialog.cpp | ||
30 | llbutton.cpp | ||
31 | llcheckboxctrl.cpp | ||
32 | llclipboard.cpp | ||
33 | llcombobox.cpp | ||
34 | llctrlselectioninterface.cpp | ||
35 | lldraghandle.cpp | ||
36 | lleditmenuhandler.cpp | ||
37 | llfloater.cpp | ||
38 | llfocusmgr.cpp | ||
39 | lliconctrl.cpp | ||
40 | llkeywords.cpp | ||
41 | lllineeditor.cpp | ||
42 | llmenugl.cpp | ||
43 | llmodaldialog.cpp | ||
44 | llmultislider.cpp | ||
45 | llmultisliderctrl.cpp | ||
46 | llpanel.cpp | ||
47 | llradiogroup.cpp | ||
48 | llresizebar.cpp | ||
49 | llresizehandle.cpp | ||
50 | llresmgr.cpp | ||
51 | llrootview.cpp | ||
52 | llscrollbar.cpp | ||
53 | llscrollcontainer.cpp | ||
54 | llscrollingpanellist.cpp | ||
55 | llscrolllistctrl.cpp | ||
56 | llslider.cpp | ||
57 | llsliderctrl.cpp | ||
58 | llspinctrl.cpp | ||
59 | llstyle.cpp | ||
60 | lltabcontainer.cpp | ||
61 | lltabcontainervertical.cpp | ||
62 | lltextbox.cpp | ||
63 | lltexteditor.cpp | ||
64 | llui.cpp | ||
65 | lluictrl.cpp | ||
66 | lluictrlfactory.cpp | ||
67 | lluistring.cpp | ||
68 | llundo.cpp | ||
69 | llviewborder.cpp | ||
70 | llview.cpp | ||
71 | llviewquery.cpp | ||
72 | ) | ||
73 | |||
74 | set(llui_HEADER_FILES | ||
75 | CMakeLists.txt | ||
76 | |||
77 | llalertdialog.h | ||
78 | llbutton.h | ||
79 | llcallbackmap.h | ||
80 | llcheckboxctrl.h | ||
81 | llclipboard.h | ||
82 | llcombobox.h | ||
83 | llctrlselectioninterface.h | ||
84 | lldraghandle.h | ||
85 | lleditmenuhandler.h | ||
86 | llfloater.h | ||
87 | llfocusmgr.h | ||
88 | llhtmlhelp.h | ||
89 | lliconctrl.h | ||
90 | llkeywords.h | ||
91 | lllineeditor.h | ||
92 | llmemberlistener.h | ||
93 | llmenugl.h | ||
94 | llmodaldialog.h | ||
95 | llmultisliderctrl.h | ||
96 | llmultislider.h | ||
97 | llpanel.h | ||
98 | llradiogroup.h | ||
99 | llresizebar.h | ||
100 | llresizehandle.h | ||
101 | llresmgr.h | ||
102 | llrootview.h | ||
103 | llscrollbar.h | ||
104 | llscrollcontainer.h | ||
105 | llscrollingpanellist.h | ||
106 | llscrolllistctrl.h | ||
107 | llsliderctrl.h | ||
108 | llslider.h | ||
109 | llspinctrl.h | ||
110 | llstyle.h | ||
111 | lltabcontainer.h | ||
112 | lltabcontainervertical.h | ||
113 | lltextbox.h | ||
114 | lltexteditor.h | ||
115 | lluiconstants.h | ||
116 | lluictrlfactory.h | ||
117 | lluictrl.h | ||
118 | lluifwd.h | ||
119 | llui.h | ||
120 | lluistring.h | ||
121 | lluixmltags.h | ||
122 | llundo.h | ||
123 | llviewborder.h | ||
124 | llview.h | ||
125 | llviewquery.h | ||
126 | ) | ||
127 | |||
128 | set_source_files_properties(${llui_HEADER_FILES} | ||
129 | PROPERTIES HEADER_FILE_ONLY TRUE) | ||
130 | |||
131 | list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES}) | ||
132 | |||
133 | add_library (llui ${llui_SOURCE_FILES}) | ||
diff --git a/linden/indra/llui/files.lst b/linden/indra/llui/files.lst deleted file mode 100644 index 56bc2c3..0000000 --- a/linden/indra/llui/files.lst +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | llui/llalertdialog.cpp | ||
2 | llui/llbutton.cpp | ||
3 | llui/llcheckboxctrl.cpp | ||
4 | llui/llclipboard.cpp | ||
5 | llui/llcombobox.cpp | ||
6 | llui/llctrlselectioninterface.cpp | ||
7 | llui/lldraghandle.cpp | ||
8 | llui/lleditmenuhandler.cpp | ||
9 | llui/llfloater.cpp | ||
10 | llui/llfocusmgr.cpp | ||
11 | llui/lliconctrl.cpp | ||
12 | llui/llkeywords.cpp | ||
13 | llui/lllineeditor.cpp | ||
14 | llui/llmenugl.cpp | ||
15 | llui/llmodaldialog.cpp | ||
16 | llui/llmultislider.cpp | ||
17 | llui/llmultisliderctrl.cpp | ||
18 | llui/llpanel.cpp | ||
19 | llui/llradiogroup.cpp | ||
20 | llui/llresizebar.cpp | ||
21 | llui/llresizehandle.cpp | ||
22 | llui/llresmgr.cpp | ||
23 | llui/llrootview.cpp | ||
24 | llui/llscrollbar.cpp | ||
25 | llui/llscrollcontainer.cpp | ||
26 | llui/llscrollingpanellist.cpp | ||
27 | llui/llscrolllistctrl.cpp | ||
28 | llui/llslider.cpp | ||
29 | llui/llsliderctrl.cpp | ||
30 | llui/llspinctrl.cpp | ||
31 | llui/llstyle.cpp | ||
32 | llui/lltabcontainer.cpp | ||
33 | llui/lltabcontainervertical.cpp | ||
34 | llui/lltextbox.cpp | ||
35 | llui/lltexteditor.cpp | ||
36 | llui/llui.cpp | ||
37 | llui/lluictrl.cpp | ||
38 | llui/lluictrlfactory.cpp | ||
39 | llui/lluistring.cpp | ||
40 | llui/llundo.cpp | ||
41 | llui/llview.cpp | ||
42 | llui/llviewborder.cpp | ||
43 | llui/llviewquery.cpp | ||
44 | llui/llmultislider.cpp | ||
45 | llui/llmultisliderctrl.cpp | ||
46 | |||
diff --git a/linden/indra/llui/llalertdialog.cpp b/linden/indra/llui/llalertdialog.cpp index 4ca9dc8..4be07e9 100644 --- a/linden/indra/llui/llalertdialog.cpp +++ b/linden/indra/llui/llalertdialog.cpp | |||
@@ -55,23 +55,23 @@ const S32 MSG_PAD = 8; | |||
55 | /*static*/ LLAlertDialog::template_map_t LLAlertDialog::sAlertTemplates; | 55 | /*static*/ LLAlertDialog::template_map_t LLAlertDialog::sAlertTemplates; |
56 | /*static*/ LLAlertDialog::template_map_t LLAlertDialog::sIgnorableTemplates; | 56 | /*static*/ LLAlertDialog::template_map_t LLAlertDialog::sIgnorableTemplates; |
57 | /*static*/ LLControlGroup* LLAlertDialog::sSettings = NULL; | 57 | /*static*/ LLControlGroup* LLAlertDialog::sSettings = NULL; |
58 | /*static*/ std::map<LLString,LLAlertDialog*> LLAlertDialog::sUniqueActiveMap; | 58 | /*static*/ std::map<std::string,LLAlertDialog*> LLAlertDialog::sUniqueActiveMap; |
59 | /*static*/ LLAlertDialog::display_callback_t LLAlertDialog::sDisplayCallback; | 59 | /*static*/ LLAlertDialog::display_callback_t LLAlertDialog::sDisplayCallback; |
60 | /*static*/ LLString LLAlertDialog::sStringSkipNextTime("Skip this dialog next time"); | 60 | /*static*/ std::string LLAlertDialog::sStringSkipNextTime("Skip this dialog next time"); |
61 | /*static*/ LLString LLAlertDialog::sStringAlwaysChoose("Always choose this option"); | 61 | /*static*/ std::string LLAlertDialog::sStringAlwaysChoose("Always choose this option"); |
62 | /*static*/ LLAlertDialog::URLLoader* LLAlertDialog::sURLLoader; | 62 | /*static*/ LLAlertDialog::URLLoader* LLAlertDialog::sURLLoader; |
63 | 63 | ||
64 | 64 | ||
65 | //static | 65 | //static |
66 | LLAlertDialog* LLAlertDialog::createXml( const LLString& xml_desc, | 66 | LLAlertDialog* LLAlertDialog::createXml( const std::string& xml_desc, |
67 | alert_callback_t callback, void *user_data) | 67 | alert_callback_t callback, void *user_data) |
68 | { | 68 | { |
69 | LLString::format_map_t args; | 69 | LLStringUtil::format_map_t args; |
70 | return createXml(xml_desc, args, callback, user_data); | 70 | return createXml(xml_desc, args, callback, user_data); |
71 | } | 71 | } |
72 | 72 | ||
73 | //static | 73 | //static |
74 | LLAlertDialog* LLAlertDialog::createXml( const LLString& xml_desc, const LLString::format_map_t& args, | 74 | LLAlertDialog* LLAlertDialog::createXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args, |
75 | alert_callback_t callback, void *user_data) | 75 | alert_callback_t callback, void *user_data) |
76 | { | 76 | { |
77 | template_map_t::iterator iter = sAlertTemplates.find(xml_desc); | 77 | template_map_t::iterator iter = sAlertTemplates.find(xml_desc); |
@@ -85,7 +85,7 @@ LLAlertDialog* LLAlertDialog::createXml( const LLString& xml_desc, const LLStrin | |||
85 | } | 85 | } |
86 | else | 86 | else |
87 | { | 87 | { |
88 | LLString::format_map_t args; | 88 | LLStringUtil::format_map_t args; |
89 | args["[ALERT_NAME]"] = xml_desc; | 89 | args["[ALERT_NAME]"] = xml_desc; |
90 | llwarns << "Missing Alert: [" << xml_desc << "]" << llendl; | 90 | llwarns << "Missing Alert: [" << xml_desc << "]" << llendl; |
91 | LLAlertDialog* dialogp = LLAlertDialog::showXml("MissingAlert", args); | 91 | LLAlertDialog* dialogp = LLAlertDialog::showXml("MissingAlert", args); |
@@ -98,15 +98,15 @@ LLAlertDialog* LLAlertDialog::createXml( const LLString& xml_desc, const LLStrin | |||
98 | } | 98 | } |
99 | 99 | ||
100 | //static | 100 | //static |
101 | LLAlertDialog* LLAlertDialog::showXml( const LLString& xml_desc, | 101 | LLAlertDialog* LLAlertDialog::showXml( const std::string& xml_desc, |
102 | alert_callback_t callback, void *user_data) | 102 | alert_callback_t callback, void *user_data) |
103 | { | 103 | { |
104 | LLString::format_map_t args; | 104 | LLStringUtil::format_map_t args; |
105 | return showXml(xml_desc, args, callback, user_data); | 105 | return showXml(xml_desc, args, callback, user_data); |
106 | } | 106 | } |
107 | 107 | ||
108 | //static | 108 | //static |
109 | LLAlertDialog* LLAlertDialog::showXml( const LLString& xml_desc, const LLString::format_map_t& args, | 109 | LLAlertDialog* LLAlertDialog::showXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args, |
110 | alert_callback_t callback, void *user_data) | 110 | alert_callback_t callback, void *user_data) |
111 | { | 111 | { |
112 | LLAlertDialog* dialog = createXml(xml_desc, args, callback, user_data); | 112 | LLAlertDialog* dialog = createXml(xml_desc, args, callback, user_data); |
@@ -114,10 +114,10 @@ LLAlertDialog* LLAlertDialog::showXml( const LLString& xml_desc, const LLString: | |||
114 | } | 114 | } |
115 | 115 | ||
116 | //static | 116 | //static |
117 | LLAlertDialog* LLAlertDialog::showCritical( const LLString& desc, alert_callback_t callback, void *user_data) | 117 | LLAlertDialog* LLAlertDialog::showCritical( const std::string& desc, alert_callback_t callback, void *user_data) |
118 | { | 118 | { |
119 | LLAlertDialogTemplate xml_template; | 119 | LLAlertDialogTemplate xml_template; |
120 | LLString::format_map_t args; | 120 | LLStringUtil::format_map_t args; |
121 | xml_template.mTitle = "Critical Error"; | 121 | xml_template.mTitle = "Critical Error"; |
122 | xml_template.mMessage = desc; | 122 | xml_template.mMessage = desc; |
123 | xml_template.mModal = TRUE; | 123 | xml_template.mModal = TRUE; |
@@ -135,7 +135,7 @@ static const S32 BTN_HPAD = 8; | |||
135 | static const LLFONT_ID font_name = LLFONT_SANSSERIF; | 135 | static const LLFONT_ID font_name = LLFONT_SANSSERIF; |
136 | 136 | ||
137 | LLAlertDialog::LLAlertDialog( const LLAlertDialogTemplate* xml_template, | 137 | LLAlertDialog::LLAlertDialog( const LLAlertDialogTemplate* xml_template, |
138 | const LLString::format_map_t& args, | 138 | const LLStringUtil::format_map_t& args, |
139 | alert_callback_t callback, void *user_data) | 139 | alert_callback_t callback, void *user_data) |
140 | : LLModalDialog( xml_template->mTitle, 100, 100, xml_template->mModal ), // dummy size. Will reshape below. | 140 | : LLModalDialog( xml_template->mTitle, 100, 100, xml_template->mModal ), // dummy size. Will reshape below. |
141 | mCallback( callback ), | 141 | mCallback( callback ), |
@@ -156,7 +156,7 @@ LLAlertDialog::LLAlertDialog( const LLAlertDialogTemplate* xml_template, | |||
156 | { | 156 | { |
157 | mURL = xml_template->mURL; | 157 | mURL = xml_template->mURL; |
158 | mURLOption = xml_template->mURLOption; | 158 | mURLOption = xml_template->mURLOption; |
159 | createDialog(&(xml_template->mOptions), xml_template->mDefaultOption, | 159 | createDialog(xml_template->mOptions, xml_template->mDefaultOption, |
160 | xml_template->mMessage, args, | 160 | xml_template->mMessage, args, |
161 | xml_template->mEditLineText); | 161 | xml_template->mEditLineText); |
162 | setTitle(xml_template->mTitle); | 162 | setTitle(xml_template->mTitle); |
@@ -226,7 +226,7 @@ bool LLAlertDialog::show() | |||
226 | // Check to see if we are already displaying the alert | 226 | // Check to see if we are already displaying the alert |
227 | if (mUnique) | 227 | if (mUnique) |
228 | { | 228 | { |
229 | std::map<LLString,LLAlertDialog*>::iterator iter = sUniqueActiveMap.find(mLabel); | 229 | std::map<std::string,LLAlertDialog*>::iterator iter = sUniqueActiveMap.find(mLabel); |
230 | if (iter != sUniqueActiveMap.end()) | 230 | if (iter != sUniqueActiveMap.end()) |
231 | { | 231 | { |
232 | gFloaterView->bringToFront(iter->second); | 232 | gFloaterView->bringToFront(iter->second); |
@@ -254,18 +254,18 @@ bool LLAlertDialog::show() | |||
254 | return true; | 254 | return true; |
255 | } | 255 | } |
256 | 256 | ||
257 | void LLAlertDialog::format(LLString& msg, const LLString::format_map_t& args) | 257 | void LLAlertDialog::format(std::string& msg, const LLStringUtil::format_map_t& args) |
258 | { | 258 | { |
259 | // XUI:translate! | 259 | // XUI:translate! |
260 | LLString::format_map_t targs = args; | 260 | LLStringUtil::format_map_t targs = args; |
261 | targs["[SECOND_LIFE]"] = "Second Life"; | 261 | targs["[SECOND_LIFE]"] = "Second Life"; |
262 | targs["[_URL]"] = mURL; | 262 | targs["[_URL]"] = mURL; |
263 | LLString::format(msg, targs); | 263 | LLStringUtil::format(msg, targs); |
264 | } | 264 | } |
265 | 265 | ||
266 | void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 default_option, | 266 | void LLAlertDialog::createDialog(const options_list_t& options_in, S32 default_option, |
267 | const LLString& msg_in, const LLString::format_map_t& args, | 267 | const std::string& msg_in, const LLStringUtil::format_map_t& args, |
268 | const LLString& edit_text) | 268 | const std::string& edit_text) |
269 | { | 269 | { |
270 | setBackgroundVisible(TRUE); | 270 | setBackgroundVisible(TRUE); |
271 | setBackgroundOpaque(TRUE); | 271 | setBackgroundOpaque(TRUE); |
@@ -274,9 +274,11 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
274 | const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f); | 274 | const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f); |
275 | const S32 EDITOR_HEIGHT = 20; | 275 | const S32 EDITOR_HEIGHT = 20; |
276 | 276 | ||
277 | const options_list_t* optionsp = &options_in; | ||
278 | |||
277 | // Buttons | 279 | // Buttons |
278 | std::vector<LLString> default_option_list; | 280 | options_list_t default_option_list; |
279 | mNumOptions = optionsp->size(); | 281 | mNumOptions = options_in.size(); |
280 | if( 0 == mNumOptions ) | 282 | if( 0 == mNumOptions ) |
281 | { | 283 | { |
282 | default_option_list.push_back("Close"); | 284 | default_option_list.push_back("Close"); |
@@ -285,12 +287,13 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
285 | mNumOptions = 1; | 287 | mNumOptions = 1; |
286 | } | 288 | } |
287 | 289 | ||
288 | const std::vector<LLString>& options = *optionsp; | 290 | const options_list_t& options= *optionsp; |
291 | |||
289 | mButtonData = new ButtonData[mNumOptions]; | 292 | mButtonData = new ButtonData[mNumOptions]; |
290 | 293 | ||
291 | // Calc total width of buttons | 294 | // Calc total width of buttons |
292 | S32 button_width = 0; | 295 | S32 button_width = 0; |
293 | S32 sp = font->getWidth("OO"); | 296 | S32 sp = font->getWidth(std::string("OO")); |
294 | for( S32 i = 0; i < mNumOptions; i++ ) | 297 | for( S32 i = 0; i < mNumOptions; i++ ) |
295 | { | 298 | { |
296 | S32 w = S32(font->getWidth( options[i] ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; | 299 | S32 w = S32(font->getWidth( options[i] ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; |
@@ -304,10 +307,10 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
304 | 307 | ||
305 | // Message: create text box using raw string, as text has been structure deliberately | 308 | // Message: create text box using raw string, as text has been structure deliberately |
306 | // Use size of created text box to generate dialog box size | 309 | // Use size of created text box to generate dialog box size |
307 | LLString msg = msg_in; | 310 | std::string msg = msg_in; |
308 | format( msg, args ); | 311 | format( msg, args ); |
309 | llwarns << "Alert: " << msg << llendl; | 312 | llwarns << "Alert: " << msg << llendl; |
310 | LLTextBox* msg_box = new LLTextBox( "Alert message", msg, (F32)MAX_ALLOWED_MSG_WIDTH, font ); | 313 | LLTextBox* msg_box = new LLTextBox( std::string("Alert message"), msg, (F32)MAX_ALLOWED_MSG_WIDTH, font ); |
311 | 314 | ||
312 | const LLRect& text_rect = msg_box->getRect(); | 315 | const LLRect& text_rect = msg_box->getRect(); |
313 | S32 dialog_width = llmax( btn_total_width, text_rect.getWidth() ) + 2 * HPAD; | 316 | S32 dialog_width = llmax( btn_total_width, text_rect.getWidth() ) + 2 * HPAD; |
@@ -339,7 +342,7 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
339 | 342 | ||
340 | if (mCaution) | 343 | if (mCaution) |
341 | { | 344 | { |
342 | LLIconCtrl* icon = new LLIconCtrl("icon", LLRect(msg_x, msg_y, msg_x+32, msg_y-32), "notify_caution_icon.tga"); | 345 | LLIconCtrl* icon = new LLIconCtrl(std::string("icon"), LLRect(msg_x, msg_y, msg_x+32, msg_y-32), std::string("notify_caution_icon.tga")); |
343 | icon->setMouseOpaque(FALSE); | 346 | icon->setMouseOpaque(FALSE); |
344 | addChild(icon); | 347 | addChild(icon); |
345 | msg_x += 32 + HPAD; | 348 | msg_x += 32 + HPAD; |
@@ -362,13 +365,12 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
362 | LLRect button_rect; | 365 | LLRect button_rect; |
363 | button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ); | 366 | button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ); |
364 | 367 | ||
365 | LLButton* btn = new LLButton( | 368 | LLButton* btn = new LLButton(std::string("btn"), button_rect, |
366 | "btn", button_rect, | 369 | LLStringUtil::null, LLStringUtil::null, LLStringUtil::null, |
367 | "","", "", | 370 | &LLAlertDialog::onButtonPressed, (void*)(&mButtonData[i]), |
368 | &LLAlertDialog::onButtonPressed, (void*)(&mButtonData[i]), | 371 | font, |
369 | font, | 372 | options[i], |
370 | options[i], | 373 | options[i]); |
371 | options[i]); | ||
372 | 374 | ||
373 | mButtonData[i].mSelf = this; | 375 | mButtonData[i].mSelf = this; |
374 | mButtonData[i].mButton = btn; | 376 | mButtonData[i].mButton = btn; |
@@ -388,7 +390,7 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
388 | if (edit_text.size() > 0) | 390 | if (edit_text.size() > 0) |
389 | { | 391 | { |
390 | S32 y = VPAD + BTN_HEIGHT + VPAD/2; | 392 | S32 y = VPAD + BTN_HEIGHT + VPAD/2; |
391 | mLineEditor = new LLLineEditor("lineeditor", | 393 | mLineEditor = new LLLineEditor(std::string("lineeditor"), |
392 | LLRect( HPAD, y+EDITOR_HEIGHT, dialog_width-HPAD, y), | 394 | LLRect( HPAD, y+EDITOR_HEIGHT, dialog_width-HPAD, y), |
393 | edit_text, | 395 | edit_text, |
394 | LLFontGL::sSansSerif, | 396 | LLFontGL::sSansSerif, |
@@ -397,7 +399,7 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa | |||
397 | } | 399 | } |
398 | } | 400 | } |
399 | 401 | ||
400 | bool LLAlertDialog::setCheckBox( const LLString& check_title, const LLString& check_control ) | 402 | bool LLAlertDialog::setCheckBox( const std::string& check_title, const std::string& check_control ) |
401 | { | 403 | { |
402 | const LLFontGL* font = LLResMgr::getInstance()->getRes( font_name ); | 404 | const LLFontGL* font = LLResMgr::getInstance()->getRes( font_name ); |
403 | const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f); | 405 | const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f); |
@@ -420,7 +422,7 @@ bool LLAlertDialog::setCheckBox( const LLString& check_title, const LLString& ch | |||
420 | check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, | 422 | check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, |
421 | max_msg_width, LINE_HEIGHT); | 423 | max_msg_width, LINE_HEIGHT); |
422 | 424 | ||
423 | mCheck = new LLCheckboxCtrl("check", check_rect, check_title, font); | 425 | mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font); |
424 | addChild(mCheck); | 426 | addChild(mCheck); |
425 | 427 | ||
426 | // mCheck is sometimes "show again" and sometimes "hide" :-( | 428 | // mCheck is sometimes "show again" and sometimes "hide" :-( |
@@ -508,7 +510,7 @@ void LLAlertDialog::handleCallbacks() | |||
508 | } | 510 | } |
509 | BOOL LLAlertDialog::hasTitleBar() const | 511 | BOOL LLAlertDialog::hasTitleBar() const |
510 | { | 512 | { |
511 | return (getTitle() != "" && getTitle() != " ") // has title | 513 | return (getCurrentTitle() != "" && getCurrentTitle() != " ") // has title |
512 | || isMinimizeable() | 514 | || isMinimizeable() |
513 | || isCloseable(); | 515 | || isCloseable(); |
514 | } | 516 | } |
@@ -586,11 +588,11 @@ void LLAlertDialog::setEditTextCallback(alert_text_callback_t callback, void *us | |||
586 | } | 588 | } |
587 | } | 589 | } |
588 | 590 | ||
589 | void LLAlertDialog::setEditTextArgs(const LLString::format_map_t& edit_args) | 591 | void LLAlertDialog::setEditTextArgs(const LLStringUtil::format_map_t& edit_args) |
590 | { | 592 | { |
591 | if (mLineEditor) | 593 | if (mLineEditor) |
592 | { | 594 | { |
593 | LLString msg = mLineEditor->getText(); | 595 | std::string msg = mLineEditor->getText(); |
594 | format(msg, edit_args); | 596 | format(msg, edit_args); |
595 | mLineEditor->setText(msg); | 597 | mLineEditor->setText(msg); |
596 | } | 598 | } |
@@ -625,7 +627,7 @@ void LLAlertDialog::onButtonPressed( void* userdata ) | |||
625 | //============================================================================= | 627 | //============================================================================= |
626 | 628 | ||
627 | //static | 629 | //static |
628 | const LLString& LLAlertDialog::getTemplateMessage(const LLString& xml_desc) | 630 | const std::string& LLAlertDialog::getTemplateMessage(const std::string& xml_desc) |
629 | { | 631 | { |
630 | template_map_t::iterator iter = sAlertTemplates.find(xml_desc); | 632 | template_map_t::iterator iter = sAlertTemplates.find(xml_desc); |
631 | if (iter != sAlertTemplates.end()) | 633 | if (iter != sAlertTemplates.end()) |
@@ -639,7 +641,7 @@ const LLString& LLAlertDialog::getTemplateMessage(const LLString& xml_desc) | |||
639 | } | 641 | } |
640 | 642 | ||
641 | //static | 643 | //static |
642 | bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* settings, BOOL settings_only) | 644 | bool LLAlertDialog::parseAlerts(const std::string& xml_filename, LLControlGroup* settings, BOOL settings_only) |
643 | { | 645 | { |
644 | LLXMLNodePtr root; | 646 | LLXMLNodePtr root; |
645 | BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root); | 647 | BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root); |
@@ -663,7 +665,7 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se | |||
663 | { | 665 | { |
664 | if (alert->hasName("global")) | 666 | if (alert->hasName("global")) |
665 | { | 667 | { |
666 | LLString global_name; | 668 | std::string global_name; |
667 | if (alert->getAttributeString("name", global_name)) | 669 | if (alert->getAttributeString("name", global_name)) |
668 | { | 670 | { |
669 | if (global_name == "skipnexttime") | 671 | if (global_name == "skipnexttime") |
@@ -686,7 +688,7 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se | |||
686 | LLAlertDialogTemplate* xml_template = settings_only ? NULL : new LLAlertDialogTemplate; | 688 | LLAlertDialogTemplate* xml_template = settings_only ? NULL : new LLAlertDialogTemplate; |
687 | 689 | ||
688 | // name= | 690 | // name= |
689 | LLString alert_name; | 691 | std::string alert_name; |
690 | if (alert->getAttributeString("name", alert_name)) | 692 | if (alert->getAttributeString("name", alert_name)) |
691 | { | 693 | { |
692 | if (xml_template) | 694 | if (xml_template) |
@@ -701,7 +703,7 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se | |||
701 | continue; | 703 | continue; |
702 | } | 704 | } |
703 | // title= | 705 | // title= |
704 | LLString title; | 706 | std::string title; |
705 | if (alert->getAttributeString("title", title)) | 707 | if (alert->getAttributeString("title", title)) |
706 | { | 708 | { |
707 | if (xml_template) | 709 | if (xml_template) |
@@ -767,10 +769,10 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se | |||
767 | // <option> | 769 | // <option> |
768 | if (child->hasName("option")) | 770 | if (child->hasName("option")) |
769 | { | 771 | { |
770 | LLString label = child->getTextContents(); | 772 | std::string label = child->getTextContents(); |
771 | BOOL is_default = FALSE; | 773 | BOOL is_default = FALSE; |
772 | child->getAttributeBOOL("default", is_default); | 774 | child->getAttributeBOOL("default", is_default); |
773 | LLString ignore_text; | 775 | std::string ignore_text; |
774 | if (!child->getAttributeString("ignore", ignore_text)) | 776 | if (!child->getAttributeString("ignore", ignore_text)) |
775 | { | 777 | { |
776 | ignore_text = label; | 778 | ignore_text = label; |
@@ -802,9 +804,9 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se | |||
802 | // <ignore> | 804 | // <ignore> |
803 | if (child->hasName("ignore")) | 805 | if (child->hasName("ignore")) |
804 | { | 806 | { |
805 | LLString ignore_text = child->getTextContents(); | 807 | std::string ignore_text = child->getTextContents(); |
806 | // label= | 808 | // label= |
807 | LLString name; | 809 | std::string name; |
808 | child->getAttributeString("name", name); | 810 | child->getAttributeString("name", name); |
809 | 811 | ||
810 | //always set to alert_name for the sake of i18n | 812 | //always set to alert_name for the sake of i18n |
@@ -839,7 +841,7 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se | |||
839 | } | 841 | } |
840 | if (add_settings) | 842 | if (add_settings) |
841 | { | 843 | { |
842 | settings->declareS32("Default" + name, default_option, "Default option number for this alert dialog"); | 844 | settings->declareS32(std::string("Default") + name, default_option, std::string("Default option number for this alert dialog")); |
843 | } | 845 | } |
844 | } | 846 | } |
845 | } | 847 | } |
diff --git a/linden/indra/llui/llalertdialog.h b/linden/indra/llui/llalertdialog.h index 8633164..fc3bdea 100644 --- a/linden/indra/llui/llalertdialog.h +++ b/linden/indra/llui/llalertdialog.h | |||
@@ -47,8 +47,10 @@ class LLAlertDialog : public LLModalDialog | |||
47 | { | 47 | { |
48 | public: | 48 | public: |
49 | typedef void (*alert_callback_t)(S32 option, void* user_data); | 49 | typedef void (*alert_callback_t)(S32 option, void* user_data); |
50 | typedef void (*alert_text_callback_t)(S32 option, const LLString& text, void* user_data); | 50 | typedef void (*alert_text_callback_t)(S32 option, const std::string& text, void* user_data); |
51 | typedef bool (*display_callback_t)(S32 modal); | 51 | typedef bool (*display_callback_t)(S32 modal); |
52 | typedef std::vector<std::string> options_list_t; | ||
53 | |||
52 | enum { IGNORE_USE_DEFAULT=1, IGNORE_USE_SAVED=2, IGNORE_SHOW_AGAIN=3 }; | 54 | enum { IGNORE_USE_DEFAULT=1, IGNORE_USE_SAVED=2, IGNORE_SHOW_AGAIN=3 }; |
53 | 55 | ||
54 | class URLLoader | 56 | class URLLoader |
@@ -65,7 +67,7 @@ public: | |||
65 | 67 | ||
66 | public: | 68 | public: |
67 | // User's responsibility to call show() after creating these. | 69 | // User's responsibility to call show() after creating these. |
68 | LLAlertDialog( const LLAlertDialogTemplate* xml_template, const LLString::format_map_t& args, | 70 | LLAlertDialog( const LLAlertDialogTemplate* xml_template, const LLStringUtil::format_map_t& args, |
69 | alert_callback_t callback = NULL, void *user_data = NULL); | 71 | alert_callback_t callback = NULL, void *user_data = NULL); |
70 | 72 | ||
71 | virtual BOOL handleKeyHere(KEY key, MASK mask ); | 73 | virtual BOOL handleKeyHere(KEY key, MASK mask ); |
@@ -74,13 +76,13 @@ public: | |||
74 | virtual void setVisible( BOOL visible ); | 76 | virtual void setVisible( BOOL visible ); |
75 | virtual void onClose(bool app_quitting); | 77 | virtual void onClose(bool app_quitting); |
76 | 78 | ||
77 | bool setCheckBox( const LLString&, const LLString& ); | 79 | bool setCheckBox( const std::string&, const std::string& ); |
78 | void setOptionEnabled( S32 option, BOOL enable ); | 80 | void setOptionEnabled( S32 option, BOOL enable ); |
79 | void setCaution(BOOL val = TRUE) { mCaution = val; } | 81 | void setCaution(BOOL val = TRUE) { mCaution = val; } |
80 | // If mUnique==TRUE only one copy of this message should exist | 82 | // If mUnique==TRUE only one copy of this message should exist |
81 | void setUnique(BOOL val = TRUE) { mUnique = val; } | 83 | void setUnique(BOOL val = TRUE) { mUnique = val; } |
82 | void setEditTextCallback(alert_text_callback_t callback, void *user_data); | 84 | void setEditTextCallback(alert_text_callback_t callback, void *user_data); |
83 | void setEditTextArgs(const LLString::format_map_t& edit_args); | 85 | void setEditTextArgs(const LLStringUtil::format_map_t& edit_args); |
84 | void setDrawAsterixes(BOOL enable); | 86 | void setDrawAsterixes(BOOL enable); |
85 | 87 | ||
86 | bool show(); // May instantly destroy the message if it is unique (returns false) | 88 | bool show(); // May instantly destroy the message if it is unique (returns false) |
@@ -88,44 +90,45 @@ public: | |||
88 | //statics | 90 | //statics |
89 | static void onButtonPressed(void* userdata); | 91 | static void onButtonPressed(void* userdata); |
90 | 92 | ||
91 | static LLAlertDialog* createXml( const LLString& xml_desc, | 93 | static LLAlertDialog* createXml( const std::string& xml_desc, |
92 | alert_callback_t callback = NULL, void *user_data = NULL); | 94 | alert_callback_t callback = NULL, void *user_data = NULL); |
93 | static LLAlertDialog* createXml( const LLString& xml_desc, const LLString::format_map_t& args, | 95 | static LLAlertDialog* createXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args, |
94 | alert_callback_t callback = NULL, void *user_data = NULL); | 96 | alert_callback_t callback = NULL, void *user_data = NULL); |
95 | 97 | ||
96 | static LLAlertDialog* showXml( const LLString& xml_desc, | 98 | static LLAlertDialog* showXml( const std::string& xml_desc, |
97 | alert_callback_t callback = NULL, void *user_data = NULL); | 99 | alert_callback_t callback = NULL, void *user_data = NULL); |
98 | static LLAlertDialog* showXml( const LLString& xml_desc, const LLString::format_map_t& args, | 100 | static LLAlertDialog* showXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args, |
99 | alert_callback_t callback = NULL, void *user_data = NULL); | 101 | alert_callback_t callback = NULL, void *user_data = NULL); |
100 | 102 | ||
101 | static LLAlertDialog* showCritical( const LLString& msg, alert_callback_t callback = NULL, void *user_data = NULL); | 103 | static LLAlertDialog* showCritical( const std::string& msg, alert_callback_t callback = NULL, void *user_data = NULL); |
102 | 104 | ||
103 | static bool parseAlerts(const LLString& xml_filename, LLControlGroup* settings = NULL, BOOL settings_only = FALSE); | 105 | static bool parseAlerts(const std::string& xml_filename, LLControlGroup* settings = NULL, BOOL settings_only = FALSE); |
104 | static const LLString& getTemplateMessage(const LLString& xml_desc); | 106 | static const std::string& getTemplateMessage(const std::string& xml_desc); |
105 | 107 | ||
106 | static void setDisplayCallback(display_callback_t callback) { sDisplayCallback = callback; } | 108 | static void setDisplayCallback(display_callback_t callback) { sDisplayCallback = callback; } |
107 | 109 | ||
108 | void format(LLString& msg, const LLString::format_map_t& args); | 110 | private: |
111 | void format(std::string& msg, const LLStringUtil::format_map_t& args); | ||
109 | 112 | ||
113 | public: | ||
110 | static LLControlGroup* sSettings; | 114 | static LLControlGroup* sSettings; |
111 | 115 | ||
112 | // use LLPointer so they delete themselves when sTemplates is destroyed | 116 | // use LLPointer so they delete themselves when sTemplates is destroyed |
113 | typedef std::map<LLString, LLPointer<LLAlertDialogTemplate> > template_map_t; | 117 | typedef std::map<std::string, LLPointer<LLAlertDialogTemplate> > template_map_t; |
114 | static template_map_t sAlertTemplates; // by mLabel | 118 | static template_map_t sAlertTemplates; // by mLabel |
115 | static template_map_t sIgnorableTemplates; // by mIgnoreLabel | 119 | static template_map_t sIgnorableTemplates; // by mIgnoreLabel |
116 | 120 | ||
117 | |||
118 | private: | 121 | private: |
119 | 122 | ||
120 | static std::map<LLString, LLAlertDialog*> sUniqueActiveMap; | 123 | static std::map<std::string, LLAlertDialog*> sUniqueActiveMap; |
121 | static display_callback_t sDisplayCallback; | 124 | static display_callback_t sDisplayCallback; |
122 | 125 | ||
123 | static LLString sStringSkipNextTime; | 126 | static std::string sStringSkipNextTime; |
124 | static LLString sStringAlwaysChoose; | 127 | static std::string sStringAlwaysChoose; |
125 | 128 | ||
126 | void createDialog(const std::vector<LLString>* options, S32 default_option, | 129 | void createDialog(const options_list_t& options_in, S32 default_option, |
127 | const LLString& msg, const LLString::format_map_t& args, | 130 | const std::string& msg, const LLStringUtil::format_map_t& args, |
128 | const LLString& edit_text); | 131 | const std::string& edit_text); |
129 | 132 | ||
130 | virtual ~LLAlertDialog(); | 133 | virtual ~LLAlertDialog(); |
131 | void handleCallbacks(); | 134 | void handleCallbacks(); |
@@ -150,14 +153,14 @@ private: | |||
150 | BOOL mCaution; | 153 | BOOL mCaution; |
151 | BOOL mUnique; | 154 | BOOL mUnique; |
152 | S32 mIgnorable; | 155 | S32 mIgnorable; |
153 | LLString mLabel; | 156 | std::string mLabel; |
154 | LLString mIgnoreLabel; | 157 | std::string mIgnoreLabel; |
155 | LLFrameTimer mDefaultBtnTimer; | 158 | LLFrameTimer mDefaultBtnTimer; |
156 | // For Dialogs that take a line as text as input: | 159 | // For Dialogs that take a line as text as input: |
157 | LLLineEditor* mLineEditor; | 160 | LLLineEditor* mLineEditor; |
158 | alert_text_callback_t mTextCallback; | 161 | alert_text_callback_t mTextCallback; |
159 | // For Dialogs linked to a URL | 162 | // For Dialogs linked to a URL |
160 | LLString mURL; // Some alerts will direct the resident to a URL | 163 | std::string mURL; // Some alerts will direct the resident to a URL |
161 | S32 mURLOption; | 164 | S32 mURLOption; |
162 | 165 | ||
163 | private: | 166 | private: |
@@ -171,7 +174,7 @@ class LLAlertDialogTemplate : public LLRefCount | |||
171 | public: | 174 | public: |
172 | LLAlertDialogTemplate() : mTitle(), mURLOption(0), mModal(FALSE), mCaution(FALSE), mUnique(FALSE), mIgnorable(0), mDefaultOption(0) {} | 175 | LLAlertDialogTemplate() : mTitle(), mURLOption(0), mModal(FALSE), mCaution(FALSE), mUnique(FALSE), mIgnorable(0), mDefaultOption(0) {} |
173 | 176 | ||
174 | void addOption(const LLString& label, const LLString& ignore_text, BOOL is_default = FALSE) | 177 | void addOption(const std::string& label, const std::string& ignore_text, BOOL is_default = FALSE) |
175 | { | 178 | { |
176 | if (is_default) | 179 | if (is_default) |
177 | { | 180 | { |
@@ -203,21 +206,21 @@ public: | |||
203 | 206 | ||
204 | 207 | ||
205 | public: | 208 | public: |
206 | LLString mLabel; // Handle for access from code, etc | 209 | std::string mLabel; // Handle for access from code, etc |
207 | LLString mTitle; // (optional) text to display in title bar | 210 | std::string mTitle; // (optional) text to display in title bar |
208 | LLString mMessage; // Message to display | 211 | std::string mMessage; // Message to display |
209 | LLString mIgnoreListText; // Text to display in enable/disable dialog (if mIgnorable == TRUE) | 212 | std::string mIgnoreListText; // Text to display in enable/disable dialog (if mIgnorable == TRUE) |
210 | LLString mIgnoreLabel; // Handle for ignore variable (may be shared by multiple templates) | 213 | std::string mIgnoreLabel; // Handle for ignore variable (may be shared by multiple templates) |
211 | LLString mURL; // Some alerts will direct the resident to a URL | 214 | std::string mURL; // Some alerts will direct the resident to a URL |
212 | S32 mURLOption; | 215 | S32 mURLOption; |
213 | BOOL mModal; | 216 | BOOL mModal; |
214 | BOOL mCaution; | 217 | BOOL mCaution; |
215 | BOOL mUnique; | 218 | BOOL mUnique; |
216 | S32 mIgnorable; // 0 = Never Ignore, 1 = Do default option, 2 = Do saved option | 219 | S32 mIgnorable; // 0 = Never Ignore, 1 = Do default option, 2 = Do saved option |
217 | std::vector<LLString> mOptions; | 220 | LLAlertDialog::options_list_t mOptions; |
218 | std::vector<LLString> mOptionDefaultText; | 221 | LLAlertDialog::options_list_t mOptionDefaultText; |
219 | S32 mDefaultOption; | 222 | S32 mDefaultOption; |
220 | LLString mEditLineText; | 223 | std::string mEditLineText; |
221 | }; | 224 | }; |
222 | 225 | ||
223 | #endif // LL_ALERTDIALOG_H | 226 | #endif // LL_ALERTDIALOG_H |
diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 3eead67..508500a 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp | |||
@@ -39,13 +39,10 @@ | |||
39 | 39 | ||
40 | // Project includes | 40 | // Project includes |
41 | #include "llkeyboard.h" | 41 | #include "llkeyboard.h" |
42 | #include "llgl.h" | ||
43 | #include "llui.h" | 42 | #include "llui.h" |
44 | #include "lluiconstants.h" | 43 | #include "lluiconstants.h" |
45 | //#include "llcallbacklist.h" | ||
46 | #include "llresmgr.h" | 44 | #include "llresmgr.h" |
47 | #include "llcriticaldamp.h" | 45 | #include "llcriticaldamp.h" |
48 | #include "llglheaders.h" | ||
49 | #include "llfocusmgr.h" | 46 | #include "llfocusmgr.h" |
50 | #include "llwindow.h" | 47 | #include "llwindow.h" |
51 | #include "llrender.h" | 48 | #include "llrender.h" |
@@ -62,7 +59,7 @@ S32 BTN_HEIGHT = 0; | |||
62 | S32 BTN_GRID = 12; | 59 | S32 BTN_GRID = 12; |
63 | S32 BORDER_SIZE = 1; | 60 | S32 BORDER_SIZE = 1; |
64 | 61 | ||
65 | LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& control_name, void (*click_callback)(void*), void *callback_data) | 62 | LLButton::LLButton( const std::string& name, const LLRect& rect, const std::string& control_name, void (*click_callback)(void*), void *callback_data) |
66 | : LLUICtrl(name, rect, TRUE, NULL, NULL), | 63 | : LLUICtrl(name, rect, TRUE, NULL, NULL), |
67 | mClickedCallback( click_callback ), | 64 | mClickedCallback( click_callback ), |
68 | mMouseDownCallback( NULL ), | 65 | mMouseDownCallback( NULL ), |
@@ -96,10 +93,10 @@ LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& co | |||
96 | mUnselectedLabel = name; | 93 | mUnselectedLabel = name; |
97 | mSelectedLabel = name; | 94 | mSelectedLabel = name; |
98 | 95 | ||
99 | setImageUnselected("button_enabled_32x128.tga"); | 96 | setImageUnselected(std::string("button_enabled_32x128.tga")); |
100 | setImageSelected("button_enabled_selected_32x128.tga"); | 97 | setImageSelected(std::string("button_enabled_selected_32x128.tga")); |
101 | setImageDisabled("button_disabled_32x128.tga"); | 98 | setImageDisabled(std::string("button_disabled_32x128.tga")); |
102 | setImageDisabledSelected("button_disabled_32x128.tga"); | 99 | setImageDisabledSelected(std::string("button_disabled_32x128.tga")); |
103 | 100 | ||
104 | mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); | 101 | mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); |
105 | mDisabledImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); | 102 | mDisabledImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); |
@@ -108,15 +105,15 @@ LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& co | |||
108 | } | 105 | } |
109 | 106 | ||
110 | 107 | ||
111 | LLButton::LLButton(const LLString& name, const LLRect& rect, | 108 | LLButton::LLButton(const std::string& name, const LLRect& rect, |
112 | const LLString &unselected_image_name, | 109 | const std::string &unselected_image_name, |
113 | const LLString &selected_image_name, | 110 | const std::string &selected_image_name, |
114 | const LLString& control_name, | 111 | const std::string& control_name, |
115 | void (*click_callback)(void*), | 112 | void (*click_callback)(void*), |
116 | void *callback_data, | 113 | void *callback_data, |
117 | const LLFontGL *font, | 114 | const LLFontGL *font, |
118 | const LLString& unselected_label, | 115 | const std::string& unselected_label, |
119 | const LLString& selected_label ) | 116 | const std::string& selected_label ) |
120 | : LLUICtrl(name, rect, TRUE, NULL, NULL), | 117 | : LLUICtrl(name, rect, TRUE, NULL, NULL), |
121 | mClickedCallback( click_callback ), | 118 | mClickedCallback( click_callback ), |
122 | mMouseDownCallback( NULL ), | 119 | mMouseDownCallback( NULL ), |
@@ -165,8 +162,8 @@ LLButton::LLButton(const LLString& name, const LLRect& rect, | |||
165 | } | 162 | } |
166 | else | 163 | else |
167 | { | 164 | { |
168 | setImageUnselected("button_enabled_32x128.tga"); | 165 | setImageUnselected(std::string("button_enabled_32x128.tga")); |
169 | setImageDisabled("button_disabled_32x128.tga"); | 166 | setImageDisabled(std::string("button_disabled_32x128.tga")); |
170 | } | 167 | } |
171 | 168 | ||
172 | if( selected_image_name != "" ) | 169 | if( selected_image_name != "" ) |
@@ -180,19 +177,19 @@ LLButton::LLButton(const LLString& name, const LLRect& rect, | |||
180 | } | 177 | } |
181 | else | 178 | else |
182 | { | 179 | { |
183 | setImageSelected("button_enabled_selected_32x128.tga"); | 180 | setImageSelected(std::string("button_enabled_selected_32x128.tga")); |
184 | setImageDisabledSelected("button_disabled_32x128.tga"); | 181 | setImageDisabledSelected(std::string("button_disabled_32x128.tga")); |
185 | } | 182 | } |
186 | 183 | ||
187 | init(click_callback, callback_data, font, control_name); | 184 | init(click_callback, callback_data, font, control_name); |
188 | } | 185 | } |
189 | 186 | ||
190 | void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const LLString& control_name) | 187 | void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name) |
191 | { | 188 | { |
192 | mGLFont = ( font ? font : LLFontGL::sSansSerif); | 189 | mGLFont = ( font ? font : LLFontGL::sSansSerif); |
193 | 190 | ||
194 | // Hack to make sure there is space for at least one character | 191 | // Hack to make sure there is space for at least one character |
195 | if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(" ")) | 192 | if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) |
196 | { | 193 | { |
197 | // Use old defaults | 194 | // Use old defaults |
198 | mLeftHPad = LLBUTTON_ORIG_H_PAD; | 195 | mLeftHPad = LLBUTTON_ORIG_H_PAD; |
@@ -211,6 +208,7 @@ void LLButton::init(void (*click_callback)(void*), void *callback_data, const LL | |||
211 | mHighlightColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedFgColor" ) ); | 208 | mHighlightColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedFgColor" ) ); |
212 | mUnselectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedBgColor" ) ); | 209 | mUnselectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedBgColor" ) ); |
213 | mSelectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonSelectedBgColor" ) ); | 210 | mSelectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonSelectedBgColor" ) ); |
211 | mFlashBgColor = ( LLUI::sColorsGroup->getColor( "ButtonFlashBgColor" ) ); | ||
214 | 212 | ||
215 | mImageOverlayAlignment = LLFontGL::HCENTER; | 213 | mImageOverlayAlignment = LLFontGL::HCENTER; |
216 | mImageOverlayColor = LLColor4::white; | 214 | mImageOverlayColor = LLColor4::white; |
@@ -324,7 +322,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) | |||
324 | } | 322 | } |
325 | 323 | ||
326 | mMouseDownTimer.start(); | 324 | mMouseDownTimer.start(); |
327 | mMouseDownFrame = LLFrameTimer::getFrameCount(); | 325 | mMouseDownFrame = (S32) LLFrameTimer::getFrameCount(); |
328 | 326 | ||
329 | if (getSoundFlags() & MOUSE_DOWN) | 327 | if (getSoundFlags() & MOUSE_DOWN) |
330 | { | 328 | { |
@@ -388,7 +386,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) | |||
388 | if (mMouseDownTimer.getStarted() && NULL != mHeldDownCallback) | 386 | if (mMouseDownTimer.getStarted() && NULL != mHeldDownCallback) |
389 | { | 387 | { |
390 | F32 elapsed = getHeldDownTime(); | 388 | F32 elapsed = getHeldDownTime(); |
391 | if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= LLFrameTimer::getFrameCount() - mMouseDownFrame) | 389 | if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= (S32)LLFrameTimer::getFrameCount() - mMouseDownFrame) |
392 | { | 390 | { |
393 | mHeldDownCallback( mCallbackUserData ); | 391 | mHeldDownCallback( mCallbackUserData ); |
394 | } | 392 | } |
@@ -436,7 +434,9 @@ void LLButton::draw() | |||
436 | || mToggleState; | 434 | || mToggleState; |
437 | 435 | ||
438 | BOOL use_glow_effect = FALSE; | 436 | BOOL use_glow_effect = FALSE; |
439 | if ( mNeedsHighlight || flash ) | 437 | LLColor4 glow_color = LLColor4::white; |
438 | LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; | ||
439 | if ( mNeedsHighlight ) | ||
440 | { | 440 | { |
441 | if (pressed) | 441 | if (pressed) |
442 | { | 442 | { |
@@ -472,6 +472,16 @@ void LLButton::draw() | |||
472 | mImagep = mImageUnselected; | 472 | mImagep = mImageUnselected; |
473 | } | 473 | } |
474 | 474 | ||
475 | if (mFlashing) | ||
476 | { | ||
477 | use_glow_effect = TRUE; | ||
478 | glow_type = LLRender::BT_ALPHA; // blend the glow | ||
479 | if (mNeedsHighlight) // highlighted AND flashing | ||
480 | glow_color = (glow_color*0.5f + mFlashBgColor*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity | ||
481 | else | ||
482 | glow_color = mFlashBgColor; | ||
483 | } | ||
484 | |||
475 | // Override if more data is available | 485 | // Override if more data is available |
476 | // HACK: Use gray checked state to mean either: | 486 | // HACK: Use gray checked state to mean either: |
477 | // enabled and tentative | 487 | // enabled and tentative |
@@ -558,7 +568,10 @@ void LLButton::draw() | |||
558 | 568 | ||
559 | if (use_glow_effect) | 569 | if (use_glow_effect) |
560 | { | 570 | { |
561 | mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); | 571 | mCurGlowStrength = lerp(mCurGlowStrength, |
572 | mFlashing ? (flash? 1.0 : 0.0) | ||
573 | : mHoverGlowStrength, | ||
574 | LLCriticalDamp::getInterpolant(0.05f)); | ||
562 | } | 575 | } |
563 | else | 576 | else |
564 | { | 577 | { |
@@ -574,8 +587,8 @@ void LLButton::draw() | |||
574 | mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); | 587 | mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); |
575 | if (mCurGlowStrength > 0.01f) | 588 | if (mCurGlowStrength > 0.01f) |
576 | { | 589 | { |
577 | gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); | 590 | gGL.setSceneBlendType(glow_type); |
578 | mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); | 591 | mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), glow_color % mCurGlowStrength); |
579 | gGL.setSceneBlendType(LLRender::BT_ALPHA); | 592 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
580 | } | 593 | } |
581 | } | 594 | } |
@@ -584,8 +597,8 @@ void LLButton::draw() | |||
584 | mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); | 597 | mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); |
585 | if (mCurGlowStrength > 0.01f) | 598 | if (mCurGlowStrength > 0.01f) |
586 | { | 599 | { |
587 | gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); | 600 | gGL.setSceneBlendType(glow_type); |
588 | mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); | 601 | mImagep->drawSolid(0, 0, glow_color % mCurGlowStrength); |
589 | gGL.setSceneBlendType(LLRender::BT_ALPHA); | 602 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
590 | } | 603 | } |
591 | } | 604 | } |
@@ -670,7 +683,7 @@ void LLButton::draw() | |||
670 | // Draw label | 683 | // Draw label |
671 | if( !label.empty() ) | 684 | if( !label.empty() ) |
672 | { | 685 | { |
673 | LLWString::trim(label); | 686 | LLWStringUtil::trim(label); |
674 | 687 | ||
675 | S32 x; | 688 | S32 x; |
676 | switch( mHAlign ) | 689 | switch( mHAlign ) |
@@ -777,7 +790,7 @@ void LLButton::setLabel( const LLStringExplicit& label ) | |||
777 | } | 790 | } |
778 | 791 | ||
779 | //virtual | 792 | //virtual |
780 | BOOL LLButton::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 793 | BOOL LLButton::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
781 | { | 794 | { |
782 | mUnselectedLabel.setArg(key, text); | 795 | mUnselectedLabel.setArg(key, text); |
783 | mSelectedLabel.setArg(key, text); | 796 | mSelectedLabel.setArg(key, text); |
@@ -809,7 +822,7 @@ void LLButton::setImageUnselected(LLPointer<LLUIImage> image) | |||
809 | mImageUnselected = image; | 822 | mImageUnselected = image; |
810 | } | 823 | } |
811 | 824 | ||
812 | void LLButton::setImages( const LLString &image_name, const LLString &selected_name ) | 825 | void LLButton::setImages( const std::string &image_name, const std::string &selected_name ) |
813 | { | 826 | { |
814 | setImageUnselected(image_name); | 827 | setImageUnselected(image_name); |
815 | setImageSelected(selected_name); | 828 | setImageSelected(selected_name); |
@@ -846,7 +859,7 @@ void LLButton::setImageDisabledSelected(LLPointer<LLUIImage> image) | |||
846 | mDisabledImageColor.mV[VALPHA] *= 0.5f; | 859 | mDisabledImageColor.mV[VALPHA] *= 0.5f; |
847 | } | 860 | } |
848 | 861 | ||
849 | void LLButton::setDisabledImages( const LLString &image_name, const LLString &selected_name, const LLColor4& c ) | 862 | void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name, const LLColor4& c ) |
850 | { | 863 | { |
851 | setImageDisabled(image_name); | 864 | setImageDisabled(image_name); |
852 | setImageDisabledSelected(selected_name); | 865 | setImageDisabledSelected(selected_name); |
@@ -858,7 +871,7 @@ void LLButton::setImageHoverSelected(LLPointer<LLUIImage> image) | |||
858 | mImageHoverSelected = image; | 871 | mImageHoverSelected = image; |
859 | } | 872 | } |
860 | 873 | ||
861 | void LLButton::setDisabledImages( const LLString &image_name, const LLString &selected_name) | 874 | void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name) |
862 | { | 875 | { |
863 | LLColor4 clr = mImageColor; | 876 | LLColor4 clr = mImageColor; |
864 | clr.mV[VALPHA] *= .5f; | 877 | clr.mV[VALPHA] *= .5f; |
@@ -870,13 +883,13 @@ void LLButton::setImageHoverUnselected(LLPointer<LLUIImage> image) | |||
870 | mImageHoverUnselected = image; | 883 | mImageHoverUnselected = image; |
871 | } | 884 | } |
872 | 885 | ||
873 | void LLButton::setHoverImages( const LLString& image_name, const LLString& selected_name ) | 886 | void LLButton::setHoverImages( const std::string& image_name, const std::string& selected_name ) |
874 | { | 887 | { |
875 | setImageHoverUnselected(image_name); | 888 | setImageHoverUnselected(image_name); |
876 | setImageHoverSelected(selected_name); | 889 | setImageHoverSelected(selected_name); |
877 | } | 890 | } |
878 | 891 | ||
879 | void LLButton::setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment, const LLColor4& color) | 892 | void LLButton::setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment, const LLColor4& color) |
880 | { | 893 | { |
881 | if (image_name.empty()) | 894 | if (image_name.empty()) |
882 | { | 895 | { |
@@ -915,54 +928,54 @@ S32 round_up(S32 grid, S32 value) | |||
915 | } | 928 | } |
916 | } | 929 | } |
917 | 930 | ||
918 | void LLButton::setImageUnselected(const LLString &image_name) | 931 | void LLButton::setImageUnselected(const std::string &image_name) |
919 | { | 932 | { |
920 | setImageUnselected(LLUI::getUIImage(image_name)); | 933 | setImageUnselected(LLUI::getUIImage(image_name)); |
921 | mImageUnselectedName = image_name; | 934 | mImageUnselectedName = image_name; |
922 | } | 935 | } |
923 | 936 | ||
924 | void LLButton::setImageSelected(const LLString &image_name) | 937 | void LLButton::setImageSelected(const std::string &image_name) |
925 | { | 938 | { |
926 | setImageSelected(LLUI::getUIImage(image_name)); | 939 | setImageSelected(LLUI::getUIImage(image_name)); |
927 | mImageSelectedName = image_name; | 940 | mImageSelectedName = image_name; |
928 | } | 941 | } |
929 | 942 | ||
930 | void LLButton::setImageHoverSelected(const LLString &image_name) | 943 | void LLButton::setImageHoverSelected(const std::string &image_name) |
931 | { | 944 | { |
932 | setImageHoverSelected(LLUI::getUIImage(image_name)); | 945 | setImageHoverSelected(LLUI::getUIImage(image_name)); |
933 | mImageHoverSelectedName = image_name; | 946 | mImageHoverSelectedName = image_name; |
934 | } | 947 | } |
935 | 948 | ||
936 | void LLButton::setImageHoverUnselected(const LLString &image_name) | 949 | void LLButton::setImageHoverUnselected(const std::string &image_name) |
937 | { | 950 | { |
938 | setImageHoverUnselected(LLUI::getUIImage(image_name)); | 951 | setImageHoverUnselected(LLUI::getUIImage(image_name)); |
939 | mImageHoverUnselectedName = image_name; | 952 | mImageHoverUnselectedName = image_name; |
940 | } | 953 | } |
941 | 954 | ||
942 | void LLButton::setImageDisabled(const LLString &image_name) | 955 | void LLButton::setImageDisabled(const std::string &image_name) |
943 | { | 956 | { |
944 | setImageDisabled(LLUI::getUIImage(image_name)); | 957 | setImageDisabled(LLUI::getUIImage(image_name)); |
945 | mImageDisabledName = image_name; | 958 | mImageDisabledName = image_name; |
946 | } | 959 | } |
947 | 960 | ||
948 | void LLButton::setImageDisabledSelected(const LLString &image_name) | 961 | void LLButton::setImageDisabledSelected(const std::string &image_name) |
949 | { | 962 | { |
950 | setImageDisabledSelected(LLUI::getUIImage(image_name)); | 963 | setImageDisabledSelected(LLUI::getUIImage(image_name)); |
951 | mImageDisabledSelectedName = image_name; | 964 | mImageDisabledSelectedName = image_name; |
952 | } | 965 | } |
953 | 966 | ||
954 | void LLButton::addImageAttributeToXML(LLXMLNodePtr node, | 967 | void LLButton::addImageAttributeToXML(LLXMLNodePtr node, |
955 | const LLString& image_name, | 968 | const std::string& image_name, |
956 | const LLUUID& image_id, | 969 | const LLUUID& image_id, |
957 | const LLString& xml_tag_name) const | 970 | const std::string& xml_tag_name) const |
958 | { | 971 | { |
959 | if( !image_name.empty() ) | 972 | if( !image_name.empty() ) |
960 | { | 973 | { |
961 | node->createChild(xml_tag_name, TRUE)->setStringValue(image_name); | 974 | node->createChild(xml_tag_name.c_str(), TRUE)->setStringValue(image_name); |
962 | } | 975 | } |
963 | else if( image_id != LLUUID::null ) | 976 | else if( image_id != LLUUID::null ) |
964 | { | 977 | { |
965 | node->createChild(xml_tag_name + "_id", TRUE)->setUUIDValue(image_id); | 978 | node->createChild((xml_tag_name + "_id").c_str(), TRUE)->setUUIDValue(image_id); |
966 | } | 979 | } |
967 | } | 980 | } |
968 | 981 | ||
@@ -976,12 +989,12 @@ LLXMLNodePtr LLButton::getXML(bool save_children) const | |||
976 | node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); | 989 | node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); |
977 | node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); | 990 | node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); |
978 | 991 | ||
979 | addImageAttributeToXML(node,mImageUnselectedName,mImageUnselectedID,"image_unselected"); | 992 | addImageAttributeToXML(node,mImageUnselectedName,mImageUnselectedID,std::string("image_unselected")); |
980 | addImageAttributeToXML(node,mImageSelectedName,mImageSelectedID,"image_selected"); | 993 | addImageAttributeToXML(node,mImageSelectedName,mImageSelectedID,std::string("image_selected")); |
981 | addImageAttributeToXML(node,mImageHoverSelectedName,mImageHoverSelectedID,"image_hover_selected"); | 994 | addImageAttributeToXML(node,mImageHoverSelectedName,mImageHoverSelectedID,std::string("image_hover_selected")); |
982 | addImageAttributeToXML(node,mImageHoverUnselectedName,mImageHoverUnselectedID,"image_hover_unselected"); | 995 | addImageAttributeToXML(node,mImageHoverUnselectedName,mImageHoverUnselectedID,std::string("image_hover_unselected")); |
983 | addImageAttributeToXML(node,mImageDisabledName,mImageDisabledID,"image_disabled"); | 996 | addImageAttributeToXML(node,mImageDisabledName,mImageDisabledID,std::string("image_disabled")); |
984 | addImageAttributeToXML(node,mImageDisabledSelectedName,mImageDisabledSelectedID,"image_disabled_selected"); | 997 | addImageAttributeToXML(node,mImageDisabledSelectedName,mImageDisabledSelectedID,std::string("image_disabled_selected")); |
985 | 998 | ||
986 | node->createChild("scale_image", TRUE)->setBoolValue(mScaleImage); | 999 | node->createChild("scale_image", TRUE)->setBoolValue(mScaleImage); |
987 | 1000 | ||
@@ -1004,40 +1017,40 @@ void clicked_help(void* data) | |||
1004 | // static | 1017 | // static |
1005 | LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 1018 | LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
1006 | { | 1019 | { |
1007 | LLString name("button"); | 1020 | std::string name("button"); |
1008 | node->getAttributeString("name", name); | 1021 | node->getAttributeString("name", name); |
1009 | 1022 | ||
1010 | LLString label = name; | 1023 | std::string label = name; |
1011 | node->getAttributeString("label", label); | 1024 | node->getAttributeString("label", label); |
1012 | 1025 | ||
1013 | LLString label_selected = label; | 1026 | std::string label_selected = label; |
1014 | node->getAttributeString("label_selected", label_selected); | 1027 | node->getAttributeString("label_selected", label_selected); |
1015 | 1028 | ||
1016 | LLFontGL* font = selectFont(node); | 1029 | LLFontGL* font = selectFont(node); |
1017 | 1030 | ||
1018 | LLString image_unselected; | 1031 | std::string image_unselected; |
1019 | if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); | 1032 | if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); |
1020 | 1033 | ||
1021 | LLString image_selected; | 1034 | std::string image_selected; |
1022 | if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); | 1035 | if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); |
1023 | 1036 | ||
1024 | LLString image_hover_selected; | 1037 | std::string image_hover_selected; |
1025 | if (node->hasAttribute("image_hover_selected")) node->getAttributeString("image_hover_selected",image_hover_selected); | 1038 | if (node->hasAttribute("image_hover_selected")) node->getAttributeString("image_hover_selected",image_hover_selected); |
1026 | 1039 | ||
1027 | LLString image_hover_unselected; | 1040 | std::string image_hover_unselected; |
1028 | if (node->hasAttribute("image_hover_unselected")) node->getAttributeString("image_hover_unselected",image_hover_unselected); | 1041 | if (node->hasAttribute("image_hover_unselected")) node->getAttributeString("image_hover_unselected",image_hover_unselected); |
1029 | 1042 | ||
1030 | LLString image_disabled_selected; | 1043 | std::string image_disabled_selected; |
1031 | if (node->hasAttribute("image_disabled_selected")) node->getAttributeString("image_disabled_selected",image_disabled_selected); | 1044 | if (node->hasAttribute("image_disabled_selected")) node->getAttributeString("image_disabled_selected",image_disabled_selected); |
1032 | 1045 | ||
1033 | LLString image_disabled; | 1046 | std::string image_disabled; |
1034 | if (node->hasAttribute("image_disabled")) node->getAttributeString("image_disabled",image_disabled); | 1047 | if (node->hasAttribute("image_disabled")) node->getAttributeString("image_disabled",image_disabled); |
1035 | 1048 | ||
1036 | LLString image_overlay; | 1049 | std::string image_overlay; |
1037 | node->getAttributeString("image_overlay", image_overlay); | 1050 | node->getAttributeString("image_overlay", image_overlay); |
1038 | 1051 | ||
1039 | LLFontGL::HAlign image_overlay_alignment = LLFontGL::HCENTER; | 1052 | LLFontGL::HAlign image_overlay_alignment = LLFontGL::HCENTER; |
1040 | LLString image_overlay_alignment_string; | 1053 | std::string image_overlay_alignment_string; |
1041 | if (node->hasAttribute("image_overlay_alignment")) | 1054 | if (node->hasAttribute("image_overlay_alignment")) |
1042 | { | 1055 | { |
1043 | node->getAttributeString("image_overlay_alignment", image_overlay_alignment_string); | 1056 | node->getAttributeString("image_overlay_alignment", image_overlay_alignment_string); |
@@ -1049,7 +1062,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa | |||
1049 | LLRect(), | 1062 | LLRect(), |
1050 | image_unselected, | 1063 | image_unselected, |
1051 | image_selected, | 1064 | image_selected, |
1052 | "", | 1065 | LLStringUtil::null, |
1053 | NULL, | 1066 | NULL, |
1054 | parent, | 1067 | parent, |
1055 | font, | 1068 | font, |
@@ -1063,15 +1076,15 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa | |||
1063 | node->getAttributeBOOL("toggle", is_toggle); | 1076 | node->getAttributeBOOL("toggle", is_toggle); |
1064 | button->setIsToggle(is_toggle); | 1077 | button->setIsToggle(is_toggle); |
1065 | 1078 | ||
1066 | if(image_hover_selected != LLString::null) button->setImageHoverSelected(image_hover_selected); | 1079 | if(image_hover_selected != LLStringUtil::null) button->setImageHoverSelected(image_hover_selected); |
1067 | 1080 | ||
1068 | if(image_hover_unselected != LLString::null) button->setImageHoverUnselected(image_hover_unselected); | 1081 | if(image_hover_unselected != LLStringUtil::null) button->setImageHoverUnselected(image_hover_unselected); |
1069 | 1082 | ||
1070 | if(image_disabled_selected != LLString::null) button->setImageDisabledSelected(image_disabled_selected ); | 1083 | if(image_disabled_selected != LLStringUtil::null) button->setImageDisabledSelected(image_disabled_selected ); |
1071 | 1084 | ||
1072 | if(image_disabled != LLString::null) button->setImageDisabled(image_disabled); | 1085 | if(image_disabled != LLStringUtil::null) button->setImageDisabled(image_disabled); |
1073 | 1086 | ||
1074 | if(image_overlay != LLString::null) button->setImageOverlay(image_overlay, image_overlay_alignment); | 1087 | if(image_overlay != LLStringUtil::null) button->setImageOverlay(image_overlay, image_overlay_alignment); |
1075 | 1088 | ||
1076 | if (node->hasAttribute("halign")) | 1089 | if (node->hasAttribute("halign")) |
1077 | { | 1090 | { |
@@ -1097,7 +1110,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa | |||
1097 | 1110 | ||
1098 | if (node->hasAttribute("help_url")) | 1111 | if (node->hasAttribute("help_url")) |
1099 | { | 1112 | { |
1100 | LLString help_url; | 1113 | std::string help_url; |
1101 | node->getAttributeString("help_url",help_url); | 1114 | node->getAttributeString("help_url",help_url); |
1102 | button->setHelpURLCallback(help_url); | 1115 | button->setHelpURLCallback(help_url); |
1103 | } | 1116 | } |
@@ -1107,7 +1120,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa | |||
1107 | return button; | 1120 | return button; |
1108 | } | 1121 | } |
1109 | 1122 | ||
1110 | void LLButton::setHelpURLCallback(const LLString &help_url) | 1123 | void LLButton::setHelpURLCallback(const std::string &help_url) |
1111 | { | 1124 | { |
1112 | mHelpURL = help_url; | 1125 | mHelpURL = help_url; |
1113 | setClickedCallback(clicked_help,this); | 1126 | setClickedCallback(clicked_help,this); |
diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h index a101a3c..e9497bd 100644 --- a/linden/indra/llui/llbutton.h +++ b/linden/indra/llui/llbutton.h | |||
@@ -72,25 +72,25 @@ class LLButton | |||
72 | { | 72 | { |
73 | public: | 73 | public: |
74 | // simple button with text label | 74 | // simple button with text label |
75 | LLButton(const LLString& name, const LLRect &rect, const LLString& control_name = LLString(), | 75 | LLButton(const std::string& name, const LLRect &rect, const std::string& control_name = std::string(), |
76 | void (*on_click)(void*) = NULL, void *data = NULL); | 76 | void (*on_click)(void*) = NULL, void *data = NULL); |
77 | 77 | ||
78 | LLButton(const LLString& name, const LLRect& rect, | 78 | LLButton(const std::string& name, const LLRect& rect, |
79 | const LLString &unselected_image, | 79 | const std::string &unselected_image, |
80 | const LLString &selected_image, | 80 | const std::string &selected_image, |
81 | const LLString& control_name, | 81 | const std::string& control_name, |
82 | void (*click_callback)(void*), | 82 | void (*click_callback)(void*), |
83 | void *callback_data = NULL, | 83 | void *callback_data = NULL, |
84 | const LLFontGL* mGLFont = NULL, | 84 | const LLFontGL* mGLFont = NULL, |
85 | const LLString& unselected_label = LLString::null, | 85 | const std::string& unselected_label = LLStringUtil::null, |
86 | const LLString& selected_label = LLString::null ); | 86 | const std::string& selected_label = LLStringUtil::null ); |
87 | 87 | ||
88 | virtual ~LLButton(); | 88 | virtual ~LLButton(); |
89 | void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const LLString& control_name); | 89 | void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name); |
90 | 90 | ||
91 | 91 | ||
92 | void addImageAttributeToXML(LLXMLNodePtr node, const LLString& imageName, | 92 | void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName, |
93 | const LLUUID& imageID,const LLString& xmlTagName) const; | 93 | const LLUUID& imageID,const std::string& xmlTagName) const; |
94 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 94 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
95 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 95 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
96 | 96 | ||
@@ -130,24 +130,24 @@ public: | |||
130 | void setLeftHPad( S32 pad ) { mLeftHPad = pad; } | 130 | void setLeftHPad( S32 pad ) { mLeftHPad = pad; } |
131 | void setRightHPad( S32 pad ) { mRightHPad = pad; } | 131 | void setRightHPad( S32 pad ) { mRightHPad = pad; } |
132 | 132 | ||
133 | const LLString getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } | 133 | const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } |
134 | const LLString getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } | 134 | const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } |
135 | 135 | ||
136 | void setImageColor(const LLString& color_control); | 136 | void setImageColor(const std::string& color_control); |
137 | void setImageColor(const LLColor4& c); | 137 | void setImageColor(const LLColor4& c); |
138 | virtual void setColor(const LLColor4& c); | 138 | virtual void setColor(const LLColor4& c); |
139 | 139 | ||
140 | void setImages(const LLString &image_name, const LLString &selected_name); | 140 | void setImages(const std::string &image_name, const std::string &selected_name); |
141 | void setDisabledImages(const LLString &image_name, const LLString &selected_name); | 141 | void setDisabledImages(const std::string &image_name, const std::string &selected_name); |
142 | void setDisabledImages(const LLString &image_name, const LLString &selected_name, const LLColor4& c); | 142 | void setDisabledImages(const std::string &image_name, const std::string &selected_name, const LLColor4& c); |
143 | 143 | ||
144 | void setHoverImages(const LLString &image_name, const LLString &selected_name); | 144 | void setHoverImages(const std::string &image_name, const std::string &selected_name); |
145 | 145 | ||
146 | void setDisabledImageColor(const LLColor4& c) { mDisabledImageColor = c; } | 146 | void setDisabledImageColor(const LLColor4& c) { mDisabledImageColor = c; } |
147 | 147 | ||
148 | void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; } | 148 | void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; } |
149 | 149 | ||
150 | void setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); | 150 | void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); |
151 | LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; } | 151 | LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; } |
152 | 152 | ||
153 | 153 | ||
@@ -155,7 +155,7 @@ public: | |||
155 | virtual LLSD getValue() const; | 155 | virtual LLSD getValue() const; |
156 | 156 | ||
157 | void setLabel( const LLStringExplicit& label); | 157 | void setLabel( const LLStringExplicit& label); |
158 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 158 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
159 | void setLabelUnselected(const LLStringExplicit& label); | 159 | void setLabelUnselected(const LLStringExplicit& label); |
160 | void setLabelSelected(const LLStringExplicit& label); | 160 | void setLabelSelected(const LLStringExplicit& label); |
161 | void setDisabledLabel(const LLStringExplicit& disabled_label); | 161 | void setDisabledLabel(const LLStringExplicit& disabled_label); |
@@ -175,14 +175,14 @@ public: | |||
175 | 175 | ||
176 | void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } | 176 | void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } |
177 | 177 | ||
178 | void setImageUnselected(const LLString &image_name); | 178 | void setImageUnselected(const std::string &image_name); |
179 | const LLString& getImageUnselectedName() const { return mImageUnselectedName; } | 179 | const std::string& getImageUnselectedName() const { return mImageUnselectedName; } |
180 | void setImageSelected(const LLString &image_name); | 180 | void setImageSelected(const std::string &image_name); |
181 | const LLString& getImageSelectedName() const { return mImageSelectedName; } | 181 | const std::string& getImageSelectedName() const { return mImageSelectedName; } |
182 | void setImageHoverSelected(const LLString &image_name); | 182 | void setImageHoverSelected(const std::string &image_name); |
183 | void setImageHoverUnselected(const LLString &image_name); | 183 | void setImageHoverUnselected(const std::string &image_name); |
184 | void setImageDisabled(const LLString &image_name); | 184 | void setImageDisabled(const std::string &image_name); |
185 | void setImageDisabledSelected(const LLString &image_name); | 185 | void setImageDisabledSelected(const std::string &image_name); |
186 | 186 | ||
187 | void setImageUnselected(LLPointer<LLUIImage> image); | 187 | void setImageUnselected(LLPointer<LLUIImage> image); |
188 | void setImageSelected(LLPointer<LLUIImage> image); | 188 | void setImageSelected(LLPointer<LLUIImage> image); |
@@ -194,8 +194,8 @@ public: | |||
194 | void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } | 194 | void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } |
195 | BOOL getCommitOnReturn() const { return mCommitOnReturn; } | 195 | BOOL getCommitOnReturn() const { return mCommitOnReturn; } |
196 | 196 | ||
197 | void setHelpURLCallback(const LLString &help_url); | 197 | void setHelpURLCallback(const std::string &help_url); |
198 | const LLString& getHelpURL() const { return mHelpURL; } | 198 | const std::string& getHelpURL() const { return mHelpURL; } |
199 | 199 | ||
200 | protected: | 200 | protected: |
201 | 201 | ||
@@ -257,16 +257,17 @@ private: | |||
257 | LLUUID mImageHoverUnselectedID; | 257 | LLUUID mImageHoverUnselectedID; |
258 | LLUUID mImageDisabledID; | 258 | LLUUID mImageDisabledID; |
259 | LLUUID mImageDisabledSelectedID; | 259 | LLUUID mImageDisabledSelectedID; |
260 | LLString mImageUnselectedName; | 260 | std::string mImageUnselectedName; |
261 | LLString mImageSelectedName; | 261 | std::string mImageSelectedName; |
262 | LLString mImageHoverSelectedName; | 262 | std::string mImageHoverSelectedName; |
263 | LLString mImageHoverUnselectedName; | 263 | std::string mImageHoverUnselectedName; |
264 | LLString mImageDisabledName; | 264 | std::string mImageDisabledName; |
265 | LLString mImageDisabledSelectedName; | 265 | std::string mImageDisabledSelectedName; |
266 | 266 | ||
267 | LLColor4 mHighlightColor; | 267 | LLColor4 mHighlightColor; |
268 | LLColor4 mUnselectedBgColor; | 268 | LLColor4 mUnselectedBgColor; |
269 | LLColor4 mSelectedBgColor; | 269 | LLColor4 mSelectedBgColor; |
270 | LLColor4 mFlashBgColor; | ||
270 | 271 | ||
271 | LLColor4 mImageColor; | 272 | LLColor4 mImageColor; |
272 | LLColor4 mDisabledImageColor; | 273 | LLColor4 mDisabledImageColor; |
@@ -291,7 +292,7 @@ private: | |||
291 | BOOL mNeedsHighlight; | 292 | BOOL mNeedsHighlight; |
292 | BOOL mCommitOnReturn; | 293 | BOOL mCommitOnReturn; |
293 | 294 | ||
294 | LLString mHelpURL; | 295 | std::string mHelpURL; |
295 | 296 | ||
296 | LLPointer<LLUIImage> mImagep; | 297 | LLPointer<LLUIImage> mImagep; |
297 | 298 | ||
diff --git a/linden/indra/llui/llcallbackmap.h b/linden/indra/llui/llcallbackmap.h index 9241751..6f2d3bf 100644 --- a/linden/indra/llui/llcallbackmap.h +++ b/linden/indra/llui/llcallbackmap.h | |||
@@ -41,7 +41,7 @@ public: | |||
41 | // callback definition. | 41 | // callback definition. |
42 | typedef void* (*callback_t)(void* data); | 42 | typedef void* (*callback_t)(void* data); |
43 | 43 | ||
44 | typedef std::map<LLString, LLCallbackMap> map_t; | 44 | typedef std::map<std::string, LLCallbackMap> map_t; |
45 | typedef map_t::iterator map_iter_t; | 45 | typedef map_t::iterator map_iter_t; |
46 | typedef map_t::const_iterator map_const_iter_t; | 46 | typedef map_t::const_iterator map_const_iter_t; |
47 | 47 | ||
diff --git a/linden/indra/llui/llcheckboxctrl.cpp b/linden/indra/llui/llcheckboxctrl.cpp index 33de4da..d383640 100644 --- a/linden/indra/llui/llcheckboxctrl.cpp +++ b/linden/indra/llui/llcheckboxctrl.cpp | |||
@@ -51,14 +51,14 @@ const U32 MAX_STRING_LENGTH = 10; | |||
51 | static LLRegisterWidget<LLCheckBoxCtrl> r("check_box"); | 51 | static LLRegisterWidget<LLCheckBoxCtrl> r("check_box"); |
52 | 52 | ||
53 | 53 | ||
54 | LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | 54 | LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect, |
55 | const LLString& label, | 55 | const std::string& label, |
56 | const LLFontGL* font, | 56 | const LLFontGL* font, |
57 | void (*commit_callback)(LLUICtrl* ctrl, void* userdata), | 57 | void (*commit_callback)(LLUICtrl* ctrl, void* userdata), |
58 | void* callback_user_data, | 58 | void* callback_user_data, |
59 | BOOL initial_value, | 59 | BOOL initial_value, |
60 | BOOL use_radio_style, | 60 | BOOL use_radio_style, |
61 | const LLString& control_which) | 61 | const std::string& control_which) |
62 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP), | 62 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP), |
63 | mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), | 63 | mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), |
64 | mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), | 64 | mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), |
@@ -93,13 +93,13 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | |||
93 | 93 | ||
94 | // *HACK Get rid of this with SL-55508... | 94 | // *HACK Get rid of this with SL-55508... |
95 | // this allows blank check boxes and radio boxes for now | 95 | // this allows blank check boxes and radio boxes for now |
96 | LLString local_label = label; | 96 | std::string local_label = label; |
97 | if(local_label.empty()) | 97 | if(local_label.empty()) |
98 | { | 98 | { |
99 | local_label = " "; | 99 | local_label = " "; |
100 | } | 100 | } |
101 | 101 | ||
102 | mLabel = new LLTextBox( "CheckboxCtrl Label", label_rect, local_label.c_str(), mFont ); | 102 | mLabel = new LLTextBox( std::string("CheckboxCtrl Label"), label_rect, local_label, mFont ); |
103 | mLabel->setFollowsLeft(); | 103 | mLabel->setFollowsLeft(); |
104 | mLabel->setFollowsBottom(); | 104 | mLabel->setFollowsBottom(); |
105 | addChild(mLabel); | 105 | addChild(mLabel); |
@@ -112,18 +112,17 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | |||
112 | LLCHECKBOXCTRL_VPAD, | 112 | LLCHECKBOXCTRL_VPAD, |
113 | LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING + text_width + LLCHECKBOXCTRL_HPAD, | 113 | LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING + text_width + LLCHECKBOXCTRL_HPAD, |
114 | llmax( text_height, LLCHECKBOXCTRL_BTN_SIZE ) + LLCHECKBOXCTRL_VPAD); | 114 | llmax( text_height, LLCHECKBOXCTRL_BTN_SIZE ) + LLCHECKBOXCTRL_VPAD); |
115 | LLString active_true_id, active_false_id; | 115 | std::string active_true_id, active_false_id; |
116 | LLString inactive_true_id, inactive_false_id; | 116 | std::string inactive_true_id, inactive_false_id; |
117 | if (mRadioStyle) | 117 | if (mRadioStyle) |
118 | { | 118 | { |
119 | active_true_id = "UIImgRadioActiveSelectedUUID"; | 119 | active_true_id = "UIImgRadioActiveSelectedUUID"; |
120 | active_false_id = "UIImgRadioActiveUUID"; | 120 | active_false_id = "UIImgRadioActiveUUID"; |
121 | inactive_true_id = "UIImgRadioInactiveSelectedUUID"; | 121 | inactive_true_id = "UIImgRadioInactiveSelectedUUID"; |
122 | inactive_false_id = "UIImgRadioInactiveUUID"; | 122 | inactive_false_id = "UIImgRadioInactiveUUID"; |
123 | mButton = new LLButton( | 123 | mButton = new LLButton(std::string("Radio control button"), btn_rect, |
124 | "Radio control button", btn_rect, | 124 | active_false_id, active_true_id, control_which, |
125 | active_false_id, active_true_id, control_which, | 125 | &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); |
126 | &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); | ||
127 | mButton->setDisabledImages( inactive_false_id, inactive_true_id ); | 126 | mButton->setDisabledImages( inactive_false_id, inactive_true_id ); |
128 | mButton->setHoverGlowStrength(0.35f); | 127 | mButton->setHoverGlowStrength(0.35f); |
129 | } | 128 | } |
@@ -133,10 +132,9 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | |||
133 | active_true_id = "UIImgCheckboxActiveSelectedUUID"; | 132 | active_true_id = "UIImgCheckboxActiveSelectedUUID"; |
134 | inactive_true_id = "UIImgCheckboxInactiveSelectedUUID"; | 133 | inactive_true_id = "UIImgCheckboxInactiveSelectedUUID"; |
135 | inactive_false_id = "UIImgCheckboxInactiveUUID"; | 134 | inactive_false_id = "UIImgCheckboxInactiveUUID"; |
136 | mButton = new LLButton( | 135 | mButton = new LLButton(std::string("Checkbox control button"), btn_rect, |
137 | "Checkbox control button", btn_rect, | 136 | active_false_id, active_true_id, control_which, |
138 | active_false_id, active_true_id, control_which, | 137 | &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); |
139 | &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::sSansSerif ); | ||
140 | mButton->setDisabledImages( inactive_false_id, inactive_true_id ); | 138 | mButton->setDisabledImages( inactive_false_id, inactive_true_id ); |
141 | mButton->setHoverGlowStrength(0.35f); | 139 | mButton->setHoverGlowStrength(0.35f); |
142 | } | 140 | } |
@@ -253,12 +251,12 @@ void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label ) | |||
253 | reshape(getRect().getWidth(), getRect().getHeight(), FALSE); | 251 | reshape(getRect().getWidth(), getRect().getHeight(), FALSE); |
254 | } | 252 | } |
255 | 253 | ||
256 | LLString LLCheckBoxCtrl::getLabel() const | 254 | std::string LLCheckBoxCtrl::getLabel() const |
257 | { | 255 | { |
258 | return mLabel->getText(); | 256 | return mLabel->getText(); |
259 | } | 257 | } |
260 | 258 | ||
261 | BOOL LLCheckBoxCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 259 | BOOL LLCheckBoxCtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
262 | { | 260 | { |
263 | BOOL res = mLabel->setTextArg(key, text); | 261 | BOOL res = mLabel->setTextArg(key, text); |
264 | reshape(getRect().getWidth(), getRect().getHeight(), FALSE); | 262 | reshape(getRect().getWidth(), getRect().getHeight(), FALSE); |
@@ -266,13 +264,13 @@ BOOL LLCheckBoxCtrl::setLabelArg( const LLString& key, const LLStringExplicit& t | |||
266 | } | 264 | } |
267 | 265 | ||
268 | //virtual | 266 | //virtual |
269 | LLString LLCheckBoxCtrl::getControlName() const | 267 | std::string LLCheckBoxCtrl::getControlName() const |
270 | { | 268 | { |
271 | return mButton->getControlName(); | 269 | return mButton->getControlName(); |
272 | } | 270 | } |
273 | 271 | ||
274 | // virtual | 272 | // virtual |
275 | void LLCheckBoxCtrl::setControlName(const LLString& control_name, LLView* context) | 273 | void LLCheckBoxCtrl::setControlName(const std::string& control_name, LLView* context) |
276 | { | 274 | { |
277 | mButton->setControlName(control_name, context); | 275 | mButton->setControlName(control_name, context); |
278 | } | 276 | } |
@@ -307,7 +305,7 @@ LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const | |||
307 | 305 | ||
308 | node->createChild("label", TRUE)->setStringValue(mLabel->getText()); | 306 | node->createChild("label", TRUE)->setStringValue(mLabel->getText()); |
309 | 307 | ||
310 | LLString control_name = mButton->getControlName(); | 308 | std::string control_name = mButton->getControlName(); |
311 | 309 | ||
312 | node->createChild("initial_value", TRUE)->setBoolValue(mInitialValue); | 310 | node->createChild("initial_value", TRUE)->setBoolValue(mInitialValue); |
313 | 311 | ||
@@ -321,10 +319,10 @@ LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const | |||
321 | // static | 319 | // static |
322 | LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 320 | LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
323 | { | 321 | { |
324 | LLString name("checkbox"); | 322 | std::string name("checkbox"); |
325 | node->getAttributeString("name", name); | 323 | node->getAttributeString("name", name); |
326 | 324 | ||
327 | LLString label(""); | 325 | std::string label(""); |
328 | node->getAttributeString("label", label); | 326 | node->getAttributeString("label", label); |
329 | 327 | ||
330 | LLFontGL* font = LLView::selectFont(node); | 328 | LLFontGL* font = LLView::selectFont(node); |
diff --git a/linden/indra/llui/llcheckboxctrl.h b/linden/indra/llui/llcheckboxctrl.h index 6518272..659ba82 100644 --- a/linden/indra/llui/llcheckboxctrl.h +++ b/linden/indra/llui/llcheckboxctrl.h | |||
@@ -65,13 +65,13 @@ class LLCheckBoxCtrl | |||
65 | : public LLUICtrl | 65 | : public LLUICtrl |
66 | { | 66 | { |
67 | public: | 67 | public: |
68 | LLCheckBoxCtrl(const LLString& name, const LLRect& rect, const LLString& label, | 68 | LLCheckBoxCtrl(const std::string& name, const LLRect& rect, const std::string& label, |
69 | const LLFontGL* font = NULL, | 69 | const LLFontGL* font = NULL, |
70 | void (*commit_callback)(LLUICtrl*, void*) = NULL, | 70 | void (*commit_callback)(LLUICtrl*, void*) = NULL, |
71 | void* callback_userdata = NULL, | 71 | void* callback_userdata = NULL, |
72 | BOOL initial_value = FALSE, | 72 | BOOL initial_value = FALSE, |
73 | BOOL use_radio_style = FALSE, // if true, draw radio button style icons | 73 | BOOL use_radio_style = FALSE, // if true, draw radio button style icons |
74 | const LLString& control_which = LLString::null); | 74 | const std::string& control_which = LLStringUtil::null); |
75 | virtual ~LLCheckBoxCtrl(); | 75 | virtual ~LLCheckBoxCtrl(); |
76 | 76 | ||
77 | // LLView interface | 77 | // LLView interface |
@@ -93,7 +93,7 @@ public: | |||
93 | virtual void setTentative(BOOL b) { mButton->setTentative(b); } | 93 | virtual void setTentative(BOOL b) { mButton->setTentative(b); } |
94 | virtual BOOL getTentative() const { return mButton->getTentative(); } | 94 | virtual BOOL getTentative() const { return mButton->getTentative(); } |
95 | 95 | ||
96 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 96 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
97 | 97 | ||
98 | virtual void clear(); | 98 | virtual void clear(); |
99 | virtual void onCommit(); | 99 | virtual void onCommit(); |
@@ -105,10 +105,10 @@ public: | |||
105 | void setDisabledColor( const LLColor4 &color ) { mTextDisabledColor = color; } | 105 | void setDisabledColor( const LLColor4 &color ) { mTextDisabledColor = color; } |
106 | 106 | ||
107 | void setLabel( const LLStringExplicit& label ); | 107 | void setLabel( const LLStringExplicit& label ); |
108 | LLString getLabel() const; | 108 | std::string getLabel() const; |
109 | 109 | ||
110 | virtual void setControlName(const LLString& control_name, LLView* context); | 110 | virtual void setControlName(const std::string& control_name, LLView* context); |
111 | virtual LLString getControlName() const; | 111 | virtual std::string getControlName() const; |
112 | 112 | ||
113 | static void onButtonPress(void *userdata); | 113 | static void onButtonPress(void *userdata); |
114 | 114 | ||
diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index d5edba7..48050db 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp | |||
@@ -59,7 +59,7 @@ S32 MAX_COMBO_WIDTH = 500; | |||
59 | 59 | ||
60 | static LLRegisterWidget<LLComboBox> r1("combo_box"); | 60 | static LLRegisterWidget<LLComboBox> r1("combo_box"); |
61 | 61 | ||
62 | LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, | 62 | LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::string& label, |
63 | void (*commit_callback)(LLUICtrl*,void*), | 63 | void (*commit_callback)(LLUICtrl*,void*), |
64 | void *callback_userdata | 64 | void *callback_userdata |
65 | ) | 65 | ) |
@@ -78,12 +78,12 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString | |||
78 | // Text label button | 78 | // Text label button |
79 | mButton = new LLButton(label, | 79 | mButton = new LLButton(label, |
80 | LLRect(), | 80 | LLRect(), |
81 | LLString::null, | 81 | LLStringUtil::null, |
82 | NULL, this); | 82 | NULL, this); |
83 | mButton->setImageUnselected("square_btn_32x128.tga"); | 83 | mButton->setImageUnselected(std::string("square_btn_32x128.tga")); |
84 | mButton->setImageSelected("square_btn_selected_32x128.tga"); | 84 | mButton->setImageSelected(std::string("square_btn_selected_32x128.tga")); |
85 | mButton->setImageDisabled("square_btn_32x128.tga"); | 85 | mButton->setImageDisabled(std::string("square_btn_32x128.tga")); |
86 | mButton->setImageDisabledSelected("square_btn_selected_32x128.tga"); | 86 | mButton->setImageDisabledSelected(std::string("square_btn_selected_32x128.tga")); |
87 | mButton->setScaleImage(TRUE); | 87 | mButton->setScaleImage(TRUE); |
88 | 88 | ||
89 | mButton->setMouseDownCallback(onButtonDown); | 89 | mButton->setMouseDownCallback(onButtonDown); |
@@ -94,9 +94,8 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString | |||
94 | addChild(mButton); | 94 | addChild(mButton); |
95 | 95 | ||
96 | // disallow multiple selection | 96 | // disallow multiple selection |
97 | mList = new LLScrollListCtrl( | 97 | mList = new LLScrollListCtrl(std::string("ComboBox"), LLRect(), |
98 | "ComboBox", LLRect(), | 98 | &LLComboBox::onItemSelected, this, FALSE); |
99 | &LLComboBox::onItemSelected, this, FALSE); | ||
100 | mList->setVisible(FALSE); | 99 | mList->setVisible(FALSE); |
101 | mList->setBgWriteableColor( LLColor4(1,1,1,1) ); | 100 | mList->setBgWriteableColor( LLColor4(1,1,1,1) ); |
102 | mList->setCommitOnKeyboardMovement(FALSE); | 101 | mList->setCommitOnKeyboardMovement(FALSE); |
@@ -149,10 +148,10 @@ LLXMLNodePtr LLComboBox::getXML(bool save_children) const | |||
149 | // static | 148 | // static |
150 | LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 149 | LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
151 | { | 150 | { |
152 | LLString name("combo_box"); | 151 | std::string name("combo_box"); |
153 | node->getAttributeString("name", name); | 152 | node->getAttributeString("name", name); |
154 | 153 | ||
155 | LLString label(""); | 154 | std::string label(""); |
156 | node->getAttributeString("label", label); | 155 | node->getAttributeString("label", label); |
157 | 156 | ||
158 | LLRect rect; | 157 | LLRect rect; |
@@ -175,7 +174,7 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * | |||
175 | 174 | ||
176 | combo_box->initFromXML(node, parent); | 175 | combo_box->initFromXML(node, parent); |
177 | 176 | ||
178 | const LLString& contents = node->getValue(); | 177 | const std::string& contents = node->getValue(); |
179 | 178 | ||
180 | if (contents.find_first_not_of(" \n\t") != contents.npos) | 179 | if (contents.find_first_not_of(" \n\t") != contents.npos) |
181 | { | 180 | { |
@@ -188,9 +187,9 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * | |||
188 | { | 187 | { |
189 | if (child->hasName("combo_item")) | 188 | if (child->hasName("combo_item")) |
190 | { | 189 | { |
191 | LLString label = child->getTextContents(); | 190 | std::string label = child->getTextContents(); |
192 | 191 | ||
193 | LLString value = label; | 192 | std::string value = label; |
194 | child->getAttributeString("value", value); | 193 | child->getAttributeString("value", value); |
195 | 194 | ||
196 | combo_box->add(label, LLSD(value) ); | 195 | combo_box->add(label, LLSD(value) ); |
@@ -213,12 +212,12 @@ void LLComboBox::clear() | |||
213 | { | 212 | { |
214 | if (mTextEntry) | 213 | if (mTextEntry) |
215 | { | 214 | { |
216 | mTextEntry->setText(LLString::null); | 215 | mTextEntry->setText(LLStringUtil::null); |
217 | } | 216 | } |
218 | mButton->setLabelSelected(LLString::null); | 217 | mButton->setLabelSelected(LLStringUtil::null); |
219 | mButton->setLabelUnselected(LLString::null); | 218 | mButton->setLabelUnselected(LLStringUtil::null); |
220 | mButton->setDisabledLabel(LLString::null); | 219 | mButton->setDisabledLabel(LLStringUtil::null); |
221 | mButton->setDisabledSelectedLabel(LLString::null); | 220 | mButton->setDisabledSelectedLabel(LLStringUtil::null); |
222 | mList->deselectAllItems(); | 221 | mList->deselectAllItems(); |
223 | } | 222 | } |
224 | 223 | ||
@@ -256,7 +255,7 @@ void LLComboBox::resetDirty() | |||
256 | 255 | ||
257 | 256 | ||
258 | // add item "name" to menu | 257 | // add item "name" to menu |
259 | LLScrollListItem* LLComboBox::add(const LLString& name, EAddPosition pos, BOOL enabled) | 258 | LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOOL enabled) |
260 | { | 259 | { |
261 | LLScrollListItem* item = mList->addSimpleElement(name, pos); | 260 | LLScrollListItem* item = mList->addSimpleElement(name, pos); |
262 | item->setEnabled(enabled); | 261 | item->setEnabled(enabled); |
@@ -265,7 +264,7 @@ LLScrollListItem* LLComboBox::add(const LLString& name, EAddPosition pos, BOOL e | |||
265 | } | 264 | } |
266 | 265 | ||
267 | // add item "name" with a unique id to menu | 266 | // add item "name" with a unique id to menu |
268 | LLScrollListItem* LLComboBox::add(const LLString& name, const LLUUID& id, EAddPosition pos, BOOL enabled ) | 267 | LLScrollListItem* LLComboBox::add(const std::string& name, const LLUUID& id, EAddPosition pos, BOOL enabled ) |
269 | { | 268 | { |
270 | LLScrollListItem* item = mList->addSimpleElement(name, pos, id); | 269 | LLScrollListItem* item = mList->addSimpleElement(name, pos, id); |
271 | item->setEnabled(enabled); | 270 | item->setEnabled(enabled); |
@@ -274,7 +273,7 @@ LLScrollListItem* LLComboBox::add(const LLString& name, const LLUUID& id, EAddPo | |||
274 | } | 273 | } |
275 | 274 | ||
276 | // add item "name" with attached userdata | 275 | // add item "name" with attached userdata |
277 | LLScrollListItem* LLComboBox::add(const LLString& name, void* userdata, EAddPosition pos, BOOL enabled ) | 276 | LLScrollListItem* LLComboBox::add(const std::string& name, void* userdata, EAddPosition pos, BOOL enabled ) |
278 | { | 277 | { |
279 | LLScrollListItem* item = mList->addSimpleElement(name, pos); | 278 | LLScrollListItem* item = mList->addSimpleElement(name, pos); |
280 | item->setEnabled(enabled); | 279 | item->setEnabled(enabled); |
@@ -284,7 +283,7 @@ LLScrollListItem* LLComboBox::add(const LLString& name, void* userdata, EAddPosi | |||
284 | } | 283 | } |
285 | 284 | ||
286 | // add item "name" with attached generic data | 285 | // add item "name" with attached generic data |
287 | LLScrollListItem* LLComboBox::add(const LLString& name, LLSD value, EAddPosition pos, BOOL enabled ) | 286 | LLScrollListItem* LLComboBox::add(const std::string& name, LLSD value, EAddPosition pos, BOOL enabled ) |
288 | { | 287 | { |
289 | LLScrollListItem* item = mList->addSimpleElement(name, pos, value); | 288 | LLScrollListItem* item = mList->addSimpleElement(name, pos, value); |
290 | item->setEnabled(enabled); | 289 | item->setEnabled(enabled); |
@@ -299,7 +298,7 @@ LLScrollListItem* LLComboBox::addSeparator(EAddPosition pos) | |||
299 | 298 | ||
300 | void LLComboBox::sortByName() | 299 | void LLComboBox::sortByName() |
301 | { | 300 | { |
302 | mList->sortByColumn(0, TRUE); | 301 | mList->sortByColumnIndex(0, TRUE); |
303 | } | 302 | } |
304 | 303 | ||
305 | 304 | ||
@@ -331,9 +330,9 @@ void LLComboBox::setValue(const LLSD& value) | |||
331 | } | 330 | } |
332 | } | 331 | } |
333 | 332 | ||
334 | const LLString LLComboBox::getSimple() const | 333 | const std::string LLComboBox::getSimple() const |
335 | { | 334 | { |
336 | const LLString res = mList->getSelectedItemLabel(); | 335 | const std::string res = mList->getSelectedItemLabel(); |
337 | if (res.empty() && mAllowTextEntry) | 336 | if (res.empty() && mAllowTextEntry) |
338 | { | 337 | { |
339 | return mTextEntry->getText(); | 338 | return mTextEntry->getText(); |
@@ -344,7 +343,7 @@ const LLString LLComboBox::getSimple() const | |||
344 | } | 343 | } |
345 | } | 344 | } |
346 | 345 | ||
347 | const LLString LLComboBox::getSelectedItemLabel(S32 column) const | 346 | const std::string LLComboBox::getSelectedItemLabel(S32 column) const |
348 | { | 347 | { |
349 | return mList->getSelectedItemLabel(column); | 348 | return mList->getSelectedItemLabel(column); |
350 | } | 349 | } |
@@ -392,7 +391,7 @@ void LLComboBox::setLabel(const LLStringExplicit& name) | |||
392 | } | 391 | } |
393 | 392 | ||
394 | 393 | ||
395 | BOOL LLComboBox::remove(const LLString& name) | 394 | BOOL LLComboBox::remove(const std::string& name) |
396 | { | 395 | { |
397 | BOOL found = mList->selectItemByLabel(name); | 396 | BOOL found = mList->selectItemByLabel(name); |
398 | 397 | ||
@@ -495,10 +494,10 @@ void LLComboBox::updateLayout() | |||
495 | LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); | 494 | LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); |
496 | text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); | 495 | text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); |
497 | // clear label on button | 496 | // clear label on button |
498 | LLString cur_label = mButton->getLabelSelected(); | 497 | std::string cur_label = mButton->getLabelSelected(); |
499 | mTextEntry = new LLLineEditor("combo_text_entry", | 498 | mTextEntry = new LLLineEditor(std::string("combo_text_entry"), |
500 | text_entry_rect, | 499 | text_entry_rect, |
501 | "", | 500 | LLStringUtil::null, |
502 | LLFontGL::sSansSerifSmall, | 501 | LLFontGL::sSansSerifSmall, |
503 | mMaxChars, | 502 | mMaxChars, |
504 | onTextCommit, | 503 | onTextCommit, |
@@ -520,7 +519,7 @@ void LLComboBox::updateLayout() | |||
520 | } | 519 | } |
521 | 520 | ||
522 | // clear label on button | 521 | // clear label on button |
523 | setLabel(LLString::null); | 522 | setLabel(LLStringUtil::null); |
524 | 523 | ||
525 | mButton->setFollows(FOLLOWS_BOTTOM | FOLLOWS_TOP | FOLLOWS_RIGHT); | 524 | mButton->setFollows(FOLLOWS_BOTTOM | FOLLOWS_TOP | FOLLOWS_RIGHT); |
526 | } | 525 | } |
@@ -647,7 +646,7 @@ void LLComboBox::showList() | |||
647 | void LLComboBox::hideList() | 646 | void LLComboBox::hideList() |
648 | { | 647 | { |
649 | //*HACK: store the original value explicitly somewhere, not just in label | 648 | //*HACK: store the original value explicitly somewhere, not just in label |
650 | LLString orig_selection = mAllowTextEntry ? mTextEntry->getText() : mButton->getLabelSelected(); | 649 | std::string orig_selection = mAllowTextEntry ? mTextEntry->getText() : mButton->getLabelSelected(); |
651 | 650 | ||
652 | // assert selection in list | 651 | // assert selection in list |
653 | mList->selectItemByLabel(orig_selection, FALSE); | 652 | mList->selectItemByLabel(orig_selection, FALSE); |
@@ -712,7 +711,7 @@ void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata) | |||
712 | // Note: item is the LLScrollListCtrl | 711 | // Note: item is the LLScrollListCtrl |
713 | LLComboBox *self = (LLComboBox *) userdata; | 712 | LLComboBox *self = (LLComboBox *) userdata; |
714 | 713 | ||
715 | const LLString name = self->mList->getSelectedItemLabel(); | 714 | const std::string name = self->mList->getSelectedItemLabel(); |
716 | 715 | ||
717 | S32 cur_id = self->getCurrentIndex(); | 716 | S32 cur_id = self->getCurrentIndex(); |
718 | if (cur_id != -1) | 717 | if (cur_id != -1) |
@@ -733,9 +732,9 @@ void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata) | |||
733 | self->onCommit(); | 732 | self->onCommit(); |
734 | } | 733 | } |
735 | 734 | ||
736 | BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) | 735 | BOOL LLComboBox::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) |
737 | { | 736 | { |
738 | LLString tool_tip; | 737 | std::string tool_tip; |
739 | 738 | ||
740 | if(LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen)) | 739 | if(LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen)) |
741 | { | 740 | { |
@@ -775,6 +774,12 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) | |||
775 | BOOL result = FALSE; | 774 | BOOL result = FALSE; |
776 | if (hasFocus()) | 775 | if (hasFocus()) |
777 | { | 776 | { |
777 | if (mList->getVisible() | ||
778 | && key == KEY_ESCAPE && mask == MASK_NONE) | ||
779 | { | ||
780 | hideList(); | ||
781 | return TRUE; | ||
782 | } | ||
778 | //give list a chance to pop up and handle key | 783 | //give list a chance to pop up and handle key |
779 | LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); | 784 | LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); |
780 | if (last_selected_item) | 785 | if (last_selected_item) |
@@ -925,7 +930,7 @@ void LLComboBox::updateSelection() | |||
925 | // user-entered portion of string, based on assumption that any selected | 930 | // user-entered portion of string, based on assumption that any selected |
926 | // text was a result of auto-completion | 931 | // text was a result of auto-completion |
927 | LLWString user_wstring = mTextEntry->hasSelection() ? left_wstring : mTextEntry->getWText(); | 932 | LLWString user_wstring = mTextEntry->hasSelection() ? left_wstring : mTextEntry->getWText(); |
928 | LLString full_string = mTextEntry->getText(); | 933 | std::string full_string = mTextEntry->getText(); |
929 | 934 | ||
930 | // go ahead and arrange drop down list on first typed character, even | 935 | // go ahead and arrange drop down list on first typed character, even |
931 | // though we aren't showing it... some code relies on prearrange | 936 | // though we aren't showing it... some code relies on prearrange |
@@ -963,7 +968,7 @@ void LLComboBox::updateSelection() | |||
963 | void LLComboBox::onTextCommit(LLUICtrl* caller, void* user_data) | 968 | void LLComboBox::onTextCommit(LLUICtrl* caller, void* user_data) |
964 | { | 969 | { |
965 | LLComboBox* self = (LLComboBox*)user_data; | 970 | LLComboBox* self = (LLComboBox*)user_data; |
966 | LLString text = self->mTextEntry->getText(); | 971 | std::string text = self->mTextEntry->getText(); |
967 | self->setSimple(text); | 972 | self->setSimple(text); |
968 | self->onCommit(); | 973 | self->onCommit(); |
969 | self->mTextEntry->selectAll(); | 974 | self->mTextEntry->selectAll(); |
@@ -1002,7 +1007,7 @@ void LLComboBox::clearColumns() | |||
1002 | mList->clearColumns(); | 1007 | mList->clearColumns(); |
1003 | } | 1008 | } |
1004 | 1009 | ||
1005 | void LLComboBox::setColumnLabel(const LLString& column, const LLString& label) | 1010 | void LLComboBox::setColumnLabel(const std::string& column, const std::string& label) |
1006 | { | 1011 | { |
1007 | mList->setColumnLabel(column, label); | 1012 | mList->setColumnLabel(column, label); |
1008 | } | 1013 | } |
@@ -1012,7 +1017,7 @@ LLScrollListItem* LLComboBox::addElement(const LLSD& value, EAddPosition pos, vo | |||
1012 | return mList->addElement(value, pos, userdata); | 1017 | return mList->addElement(value, pos, userdata); |
1013 | } | 1018 | } |
1014 | 1019 | ||
1015 | LLScrollListItem* LLComboBox::addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) | 1020 | LLScrollListItem* LLComboBox::addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) |
1016 | { | 1021 | { |
1017 | return mList->addSimpleElement(value, pos, id); | 1022 | return mList->addSimpleElement(value, pos, id); |
1018 | } | 1023 | } |
@@ -1022,8 +1027,9 @@ void LLComboBox::clearRows() | |||
1022 | mList->clearRows(); | 1027 | mList->clearRows(); |
1023 | } | 1028 | } |
1024 | 1029 | ||
1025 | void LLComboBox::sortByColumn(LLString name, BOOL ascending) | 1030 | void LLComboBox::sortByColumn(const std::string& name, BOOL ascending) |
1026 | { | 1031 | { |
1032 | mList->sortByColumn(name, ascending); | ||
1027 | } | 1033 | } |
1028 | 1034 | ||
1029 | //============================================================================ | 1035 | //============================================================================ |
@@ -1100,19 +1106,19 @@ static LLRegisterWidget<LLFlyoutButton> r2("flyout_button"); | |||
1100 | const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; | 1106 | const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; |
1101 | 1107 | ||
1102 | LLFlyoutButton::LLFlyoutButton( | 1108 | LLFlyoutButton::LLFlyoutButton( |
1103 | const LLString& name, | 1109 | const std::string& name, |
1104 | const LLRect &rect, | 1110 | const LLRect &rect, |
1105 | const LLString& label, | 1111 | const std::string& label, |
1106 | void (*commit_callback)(LLUICtrl*, void*) , | 1112 | void (*commit_callback)(LLUICtrl*, void*) , |
1107 | void *callback_userdata) | 1113 | void *callback_userdata) |
1108 | : LLComboBox(name, rect, LLString::null, commit_callback, callback_userdata), | 1114 | : LLComboBox(name, rect, LLStringUtil::null, commit_callback, callback_userdata), |
1109 | mToggleState(FALSE), | 1115 | mToggleState(FALSE), |
1110 | mActionButton(NULL) | 1116 | mActionButton(NULL) |
1111 | { | 1117 | { |
1112 | // Always use text box | 1118 | // Always use text box |
1113 | // Text label button | 1119 | // Text label button |
1114 | mActionButton = new LLButton(label, | 1120 | mActionButton = new LLButton(label, |
1115 | LLRect(), LLString::null, NULL, this); | 1121 | LLRect(), LLStringUtil::null, NULL, this); |
1116 | mActionButton->setScaleImage(TRUE); | 1122 | mActionButton->setScaleImage(TRUE); |
1117 | 1123 | ||
1118 | mActionButton->setClickedCallback(onActionButtonClick); | 1124 | mActionButton->setClickedCallback(onActionButtonClick); |
@@ -1145,10 +1151,10 @@ LLFlyoutButton::LLFlyoutButton( | |||
1145 | //static | 1151 | //static |
1146 | LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 1152 | LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
1147 | { | 1153 | { |
1148 | LLString name = "flyout_button"; | 1154 | std::string name = "flyout_button"; |
1149 | node->getAttributeString("name", name); | 1155 | node->getAttributeString("name", name); |
1150 | 1156 | ||
1151 | LLString label(""); | 1157 | std::string label(""); |
1152 | node->getAttributeString("label", label); | 1158 | node->getAttributeString("label", label); |
1153 | 1159 | ||
1154 | LLRect rect; | 1160 | LLRect rect; |
@@ -1162,7 +1168,7 @@ LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
1162 | callback, | 1168 | callback, |
1163 | NULL); | 1169 | NULL); |
1164 | 1170 | ||
1165 | LLString list_position; | 1171 | std::string list_position; |
1166 | node->getAttributeString("list_position", list_position); | 1172 | node->getAttributeString("list_position", list_position); |
1167 | if (list_position == "below") | 1173 | if (list_position == "below") |
1168 | { | 1174 | { |
@@ -1181,9 +1187,9 @@ LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
1181 | { | 1187 | { |
1182 | if (child->hasName("flyout_button_item")) | 1188 | if (child->hasName("flyout_button_item")) |
1183 | { | 1189 | { |
1184 | LLString label = child->getTextContents(); | 1190 | std::string label = child->getTextContents(); |
1185 | 1191 | ||
1186 | LLString value = label; | 1192 | std::string value = label; |
1187 | child->getAttributeString("value", value); | 1193 | child->getAttributeString("value", value); |
1188 | 1194 | ||
1189 | flyout_button->add(label, LLSD(value) ); | 1195 | flyout_button->add(label, LLSD(value) ); |
@@ -1225,7 +1231,7 @@ void LLFlyoutButton::draw() | |||
1225 | 1231 | ||
1226 | //FIXME: this should be an attribute of comboboxes, whether they have a distinct label or | 1232 | //FIXME: this should be an attribute of comboboxes, whether they have a distinct label or |
1227 | // the label reflects the last selected item, for now we have to manually remove the label | 1233 | // the label reflects the last selected item, for now we have to manually remove the label |
1228 | mButton->setLabel(LLString::null); | 1234 | mButton->setLabel(LLStringUtil::null); |
1229 | LLComboBox::draw(); | 1235 | LLComboBox::draw(); |
1230 | } | 1236 | } |
1231 | 1237 | ||
diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h index b35d078..a9dc1c1 100644 --- a/linden/indra/llui/llcombobox.h +++ b/linden/indra/llui/llcombobox.h | |||
@@ -64,9 +64,9 @@ public: | |||
64 | } EPreferredPosition; | 64 | } EPreferredPosition; |
65 | 65 | ||
66 | LLComboBox( | 66 | LLComboBox( |
67 | const LLString& name, | 67 | const std::string& name, |
68 | const LLRect &rect, | 68 | const LLRect &rect, |
69 | const LLString& label, | 69 | const std::string& label, |
70 | void (*commit_callback)(LLUICtrl*, void*) = NULL, | 70 | void (*commit_callback)(LLUICtrl*, void*) = NULL, |
71 | void *callback_userdata = NULL | 71 | void *callback_userdata = NULL |
72 | ); | 72 | ); |
@@ -83,7 +83,7 @@ public: | |||
83 | 83 | ||
84 | virtual void setEnabled(BOOL enabled); | 84 | virtual void setEnabled(BOOL enabled); |
85 | 85 | ||
86 | virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | 86 | virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); |
87 | virtual BOOL handleKeyHere(KEY key, MASK mask); | 87 | virtual BOOL handleKeyHere(KEY key, MASK mask); |
88 | virtual BOOL handleUnicodeCharHere(llwchar uni_char); | 88 | virtual BOOL handleUnicodeCharHere(llwchar uni_char); |
89 | 89 | ||
@@ -107,10 +107,10 @@ public: | |||
107 | void setAllowTextEntry(BOOL allow, S32 max_chars = 50, BOOL make_tentative = TRUE); | 107 | void setAllowTextEntry(BOOL allow, S32 max_chars = 50, BOOL make_tentative = TRUE); |
108 | void setTextEntry(const LLStringExplicit& text); | 108 | void setTextEntry(const LLStringExplicit& text); |
109 | 109 | ||
110 | LLScrollListItem* add(const LLString& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu | 110 | LLScrollListItem* add(const std::string& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu |
111 | LLScrollListItem* add(const LLString& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); | 111 | LLScrollListItem* add(const std::string& name, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); |
112 | LLScrollListItem* add(const LLString& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); | 112 | LLScrollListItem* add(const std::string& name, void* userdata, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); |
113 | LLScrollListItem* add(const LLString& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); | 113 | LLScrollListItem* add(const std::string& name, LLSD value, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); |
114 | LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM); | 114 | LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM); |
115 | BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed | 115 | BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed |
116 | void removeall() { clearRows(); } | 116 | void removeall() { clearRows(); } |
@@ -120,15 +120,15 @@ public: | |||
120 | // Select current item by name using selectItemByLabel. Returns FALSE if not found. | 120 | // Select current item by name using selectItemByLabel. Returns FALSE if not found. |
121 | BOOL setSimple(const LLStringExplicit& name); | 121 | BOOL setSimple(const LLStringExplicit& name); |
122 | // Get name of current item. Returns an empty string if not found. | 122 | // Get name of current item. Returns an empty string if not found. |
123 | const LLString getSimple() const; | 123 | const std::string getSimple() const; |
124 | // Get contents of column x of selected row | 124 | // Get contents of column x of selected row |
125 | const LLString getSelectedItemLabel(S32 column = 0) const; | 125 | const std::string getSelectedItemLabel(S32 column = 0) const; |
126 | 126 | ||
127 | // Sets the label, which doesn't have to exist in the label. | 127 | // Sets the label, which doesn't have to exist in the label. |
128 | // This is probably a UI abuse. | 128 | // This is probably a UI abuse. |
129 | void setLabel(const LLStringExplicit& name); | 129 | void setLabel(const LLStringExplicit& name); |
130 | 130 | ||
131 | BOOL remove(const LLString& name); // remove item "name", return TRUE if found and removed | 131 | BOOL remove(const std::string& name); // remove item "name", return TRUE if found and removed |
132 | 132 | ||
133 | BOOL setCurrentByIndex( S32 index ); | 133 | BOOL setCurrentByIndex( S32 index ); |
134 | S32 getCurrentIndex() const; | 134 | S32 getCurrentIndex() const; |
@@ -145,11 +145,11 @@ public: | |||
145 | // Overwrites the default column (See LLScrollListCtrl for format) | 145 | // Overwrites the default column (See LLScrollListCtrl for format) |
146 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); | 146 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); |
147 | virtual void clearColumns(); | 147 | virtual void clearColumns(); |
148 | virtual void setColumnLabel(const LLString& column, const LLString& label); | 148 | virtual void setColumnLabel(const std::string& column, const std::string& label); |
149 | virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); | 149 | virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); |
150 | virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); | 150 | virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); |
151 | virtual void clearRows(); | 151 | virtual void clearRows(); |
152 | virtual void sortByColumn(LLString name, BOOL ascending); | 152 | virtual void sortByColumn(const std::string& name, BOOL ascending); |
153 | 153 | ||
154 | // LLCtrlSelectionInterface functions | 154 | // LLCtrlSelectionInterface functions |
155 | virtual BOOL getCanSelect() const { return TRUE; } | 155 | virtual BOOL getCanSelect() const { return TRUE; } |
@@ -203,9 +203,9 @@ class LLFlyoutButton : public LLComboBox | |||
203 | { | 203 | { |
204 | public: | 204 | public: |
205 | LLFlyoutButton( | 205 | LLFlyoutButton( |
206 | const LLString& name, | 206 | const std::string& name, |
207 | const LLRect &rect, | 207 | const LLRect &rect, |
208 | const LLString& label, | 208 | const std::string& label, |
209 | void (*commit_callback)(LLUICtrl*, void*) = NULL, | 209 | void (*commit_callback)(LLUICtrl*, void*) = NULL, |
210 | void *callback_userdata = NULL); | 210 | void *callback_userdata = NULL); |
211 | 211 | ||
diff --git a/linden/indra/llui/llctrlselectioninterface.cpp b/linden/indra/llui/llctrlselectioninterface.cpp index 996f5b3..3ef0f83 100644 --- a/linden/indra/llui/llctrlselectioninterface.cpp +++ b/linden/indra/llui/llctrlselectioninterface.cpp | |||
@@ -53,12 +53,12 @@ BOOL LLCtrlSelectionInterface::deselectByValue(LLSD value) | |||
53 | LLCtrlListInterface::~LLCtrlListInterface() | 53 | LLCtrlListInterface::~LLCtrlListInterface() |
54 | { } | 54 | { } |
55 | 55 | ||
56 | LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value) | 56 | LLScrollListItem* LLCtrlListInterface::addSimpleElement(const std::string& value) |
57 | { | 57 | { |
58 | return addSimpleElement(value, ADD_BOTTOM, LLSD()); | 58 | return addSimpleElement(value, ADD_BOTTOM, LLSD()); |
59 | } | 59 | } |
60 | 60 | ||
61 | LLScrollListItem* LLCtrlListInterface::addSimpleElement(const LLString& value, EAddPosition pos) | 61 | LLScrollListItem* LLCtrlListInterface::addSimpleElement(const std::string& value, EAddPosition pos) |
62 | { | 62 | { |
63 | return addSimpleElement(value, pos, LLSD()); | 63 | return addSimpleElement(value, pos, LLSD()); |
64 | } | 64 | } |
diff --git a/linden/indra/llui/llctrlselectioninterface.h b/linden/indra/llui/llctrlselectioninterface.h index f303861..67743de 100644 --- a/linden/indra/llui/llctrlselectioninterface.h +++ b/linden/indra/llui/llctrlselectioninterface.h | |||
@@ -84,16 +84,16 @@ public: | |||
84 | 84 | ||
85 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0; | 85 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0; |
86 | virtual void clearColumns() = 0; | 86 | virtual void clearColumns() = 0; |
87 | virtual void setColumnLabel(const LLString& column, const LLString& label) = 0; | 87 | virtual void setColumnLabel(const std::string& column, const std::string& label) = 0; |
88 | // TomY TODO: Document this | 88 | // TomY TODO: Document this |
89 | virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0; | 89 | virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0; |
90 | 90 | ||
91 | LLScrollListItem* addSimpleElement(const LLString& value); // defaults to bottom | 91 | LLScrollListItem* addSimpleElement(const std::string& value); // defaults to bottom |
92 | LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos); // defaults to no LLSD() id | 92 | LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos); // defaults to no LLSD() id |
93 | virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) = 0; | 93 | virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) = 0; |
94 | 94 | ||
95 | virtual void clearRows() = 0; | 95 | virtual void clearRows() = 0; |
96 | virtual void sortByColumn(LLString name, BOOL ascending) = 0; | 96 | virtual void sortByColumn(const std::string& name, BOOL ascending) = 0; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | class LLCtrlScrollInterface | 99 | class LLCtrlScrollInterface |
diff --git a/linden/indra/llui/lldraghandle.cpp b/linden/indra/llui/lldraghandle.cpp index f033371..bec2da5 100644 --- a/linden/indra/llui/lldraghandle.cpp +++ b/linden/indra/llui/lldraghandle.cpp | |||
@@ -55,7 +55,7 @@ const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize | |||
55 | 55 | ||
56 | S32 LLDragHandle::sSnapMargin = 5; | 56 | S32 LLDragHandle::sSnapMargin = 5; |
57 | 57 | ||
58 | LLDragHandle::LLDragHandle( const LLString& name, const LLRect& rect, const LLString& title ) | 58 | LLDragHandle::LLDragHandle( const std::string& name, const LLRect& rect, const std::string& title ) |
59 | : LLView( name, rect, TRUE ), | 59 | : LLView( name, rect, TRUE ), |
60 | mDragLastScreenX( 0 ), | 60 | mDragLastScreenX( 0 ), |
61 | mDragLastScreenY( 0 ), | 61 | mDragLastScreenY( 0 ), |
@@ -94,27 +94,27 @@ void LLDragHandle::setTitleBox(LLTextBox* titlebox) | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | LLDragHandleTop::LLDragHandleTop(const LLString& name, const LLRect &rect, const LLString& title) | 97 | LLDragHandleTop::LLDragHandleTop(const std::string& name, const LLRect &rect, const std::string& title) |
98 | : LLDragHandle(name, rect, title) | 98 | : LLDragHandle(name, rect, title) |
99 | { | 99 | { |
100 | setFollowsAll(); | 100 | setFollowsAll(); |
101 | setTitle( title ); | 101 | setTitle( title ); |
102 | } | 102 | } |
103 | 103 | ||
104 | LLDragHandleLeft::LLDragHandleLeft(const LLString& name, const LLRect &rect, const LLString& title) | 104 | LLDragHandleLeft::LLDragHandleLeft(const std::string& name, const LLRect &rect, const std::string& title) |
105 | : LLDragHandle(name, rect, title) | 105 | : LLDragHandle(name, rect, title) |
106 | { | 106 | { |
107 | setFollowsAll(); | 107 | setFollowsAll(); |
108 | setTitle( title ); | 108 | setTitle( title ); |
109 | } | 109 | } |
110 | 110 | ||
111 | void LLDragHandleTop::setTitle(const LLString& title) | 111 | void LLDragHandleTop::setTitle(const std::string& title) |
112 | { | 112 | { |
113 | LLString trimmed_title = title; | 113 | std::string trimmed_title = title; |
114 | LLString::trim(trimmed_title); | 114 | LLStringUtil::trim(trimmed_title); |
115 | 115 | ||
116 | const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); | 116 | const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); |
117 | LLTextBox* titlebox = new LLTextBox( "Drag Handle Title", getRect(), trimmed_title, font ); | 117 | LLTextBox* titlebox = new LLTextBox( std::string("Drag Handle Title"), getRect(), trimmed_title, font ); |
118 | titlebox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); | 118 | titlebox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); |
119 | titlebox->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); | 119 | titlebox->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); |
120 | 120 | ||
@@ -123,22 +123,22 @@ void LLDragHandleTop::setTitle(const LLString& title) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | const LLString& LLDragHandleTop::getTitle() const | 126 | const std::string& LLDragHandleTop::getTitle() const |
127 | { | 127 | { |
128 | return getTitleBox() == NULL ? LLString::null : getTitleBox()->getText(); | 128 | return getTitleBox() == NULL ? LLStringUtil::null : getTitleBox()->getText(); |
129 | } | 129 | } |
130 | 130 | ||
131 | 131 | ||
132 | void LLDragHandleLeft::setTitle(const LLString& ) | 132 | void LLDragHandleLeft::setTitle(const std::string& ) |
133 | { | 133 | { |
134 | setTitleBox(NULL); | 134 | setTitleBox(NULL); |
135 | /* no title on left edge */ | 135 | /* no title on left edge */ |
136 | } | 136 | } |
137 | 137 | ||
138 | 138 | ||
139 | const LLString& LLDragHandleLeft::getTitle() const | 139 | const std::string& LLDragHandleLeft::getTitle() const |
140 | { | 140 | { |
141 | return LLString::null; | 141 | return LLStringUtil::null; |
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
diff --git a/linden/indra/llui/lldraghandle.h b/linden/indra/llui/lldraghandle.h index fc10639..6882c7f 100644 --- a/linden/indra/llui/lldraghandle.h +++ b/linden/indra/llui/lldraghandle.h | |||
@@ -44,7 +44,7 @@ class LLTextBox; | |||
44 | class LLDragHandle : public LLView | 44 | class LLDragHandle : public LLView |
45 | { | 45 | { |
46 | public: | 46 | public: |
47 | LLDragHandle(const LLString& name, const LLRect& rect, const LLString& title ); | 47 | LLDragHandle(const std::string& name, const LLRect& rect, const std::string& title ); |
48 | virtual ~LLDragHandle() { setTitleBox(NULL); } | 48 | virtual ~LLDragHandle() { setTitleBox(NULL); } |
49 | 49 | ||
50 | virtual void setValue(const LLSD& value); | 50 | virtual void setValue(const LLSD& value); |
@@ -55,8 +55,8 @@ public: | |||
55 | S32 getMaxTitleWidth() const { return mMaxTitleWidth; } | 55 | S32 getMaxTitleWidth() const { return mMaxTitleWidth; } |
56 | void setTitleVisible(BOOL visible); | 56 | void setTitleVisible(BOOL visible); |
57 | 57 | ||
58 | virtual void setTitle( const LLString& title ) = 0; | 58 | virtual void setTitle( const std::string& title ) = 0; |
59 | virtual const LLString& getTitle() const = 0; | 59 | virtual const std::string& getTitle() const = 0; |
60 | 60 | ||
61 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | 61 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); |
62 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); | 62 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); |
@@ -88,10 +88,10 @@ class LLDragHandleTop | |||
88 | : public LLDragHandle | 88 | : public LLDragHandle |
89 | { | 89 | { |
90 | public: | 90 | public: |
91 | LLDragHandleTop(const LLString& name, const LLRect& rect, const LLString& title ); | 91 | LLDragHandleTop(const std::string& name, const LLRect& rect, const std::string& title ); |
92 | 92 | ||
93 | virtual void setTitle( const LLString& title ); | 93 | virtual void setTitle( const std::string& title ); |
94 | virtual const LLString& getTitle() const; | 94 | virtual const std::string& getTitle() const; |
95 | virtual void draw(); | 95 | virtual void draw(); |
96 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 96 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
97 | 97 | ||
@@ -105,10 +105,10 @@ class LLDragHandleLeft | |||
105 | : public LLDragHandle | 105 | : public LLDragHandle |
106 | { | 106 | { |
107 | public: | 107 | public: |
108 | LLDragHandleLeft(const LLString& name, const LLRect& rect, const LLString& title ); | 108 | LLDragHandleLeft(const std::string& name, const LLRect& rect, const std::string& title ); |
109 | 109 | ||
110 | virtual void setTitle( const LLString& title ); | 110 | virtual void setTitle( const std::string& title ); |
111 | virtual const LLString& getTitle() const; | 111 | virtual const std::string& getTitle() const; |
112 | virtual void draw(); | 112 | virtual void draw(); |
113 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 113 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
114 | 114 | ||
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 759fae0..e795ad2 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp | |||
@@ -56,14 +56,12 @@ | |||
56 | #include "lltabcontainer.h" | 56 | #include "lltabcontainer.h" |
57 | #include "v2math.h" | 57 | #include "v2math.h" |
58 | 58 | ||
59 | extern BOOL gNoRender; | ||
60 | |||
61 | const S32 MINIMIZED_WIDTH = 160; | 59 | const S32 MINIMIZED_WIDTH = 160; |
62 | const S32 CLOSE_BOX_FROM_TOP = 1; | 60 | const S32 CLOSE_BOX_FROM_TOP = 1; |
63 | // use this to control "jumping" behavior when Ctrl-Tabbing | 61 | // use this to control "jumping" behavior when Ctrl-Tabbing |
64 | const S32 TABBED_FLOATER_OFFSET = 0; | 62 | const S32 TABBED_FLOATER_OFFSET = 0; |
65 | 63 | ||
66 | LLString LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = | 64 | std::string LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = |
67 | { | 65 | { |
68 | "UIImgBtnCloseActiveUUID", //BUTTON_CLOSE | 66 | "UIImgBtnCloseActiveUUID", //BUTTON_CLOSE |
69 | "UIImgBtnRestoreActiveUUID", //BUTTON_RESTORE | 67 | "UIImgBtnRestoreActiveUUID", //BUTTON_RESTORE |
@@ -72,7 +70,7 @@ LLString LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = | |||
72 | "UIImgBtnCloseActiveUUID", //BUTTON_EDIT | 70 | "UIImgBtnCloseActiveUUID", //BUTTON_EDIT |
73 | }; | 71 | }; |
74 | 72 | ||
75 | LLString LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = | 73 | std::string LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = |
76 | { | 74 | { |
77 | "UIImgBtnCloseInactiveUUID", //BUTTON_CLOSE | 75 | "UIImgBtnCloseInactiveUUID", //BUTTON_CLOSE |
78 | "UIImgBtnRestoreInactiveUUID", //BUTTON_RESTORE | 76 | "UIImgBtnRestoreInactiveUUID", //BUTTON_RESTORE |
@@ -81,7 +79,7 @@ LLString LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = | |||
81 | "UIImgBtnCloseInactiveUUID", //BUTTON_EDIT | 79 | "UIImgBtnCloseInactiveUUID", //BUTTON_EDIT |
82 | }; | 80 | }; |
83 | 81 | ||
84 | LLString LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = | 82 | std::string LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = |
85 | { | 83 | { |
86 | "UIImgBtnClosePressedUUID", //BUTTON_CLOSE | 84 | "UIImgBtnClosePressedUUID", //BUTTON_CLOSE |
87 | "UIImgBtnRestorePressedUUID", //BUTTON_RESTORE | 85 | "UIImgBtnRestorePressedUUID", //BUTTON_RESTORE |
@@ -90,7 +88,7 @@ LLString LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = | |||
90 | "UIImgBtnClosePressedUUID", //BUTTON_EDIT | 88 | "UIImgBtnClosePressedUUID", //BUTTON_EDIT |
91 | }; | 89 | }; |
92 | 90 | ||
93 | LLString LLFloater::sButtonNames[BUTTON_COUNT] = | 91 | std::string LLFloater::sButtonNames[BUTTON_COUNT] = |
94 | { | 92 | { |
95 | "llfloater_close_btn", //BUTTON_CLOSE | 93 | "llfloater_close_btn", //BUTTON_CLOSE |
96 | "llfloater_restore_btn", //BUTTON_RESTORE | 94 | "llfloater_restore_btn", //BUTTON_RESTORE |
@@ -99,7 +97,7 @@ LLString LLFloater::sButtonNames[BUTTON_COUNT] = | |||
99 | "llfloater_edit_btn", //BUTTON_EDIT | 97 | "llfloater_edit_btn", //BUTTON_EDIT |
100 | }; | 98 | }; |
101 | 99 | ||
102 | LLString LLFloater::sButtonToolTips[BUTTON_COUNT] = | 100 | std::string LLFloater::sButtonToolTips[BUTTON_COUNT] = |
103 | { | 101 | { |
104 | #ifdef LL_DARWIN | 102 | #ifdef LL_DARWIN |
105 | "Close (Cmd-W)", //BUTTON_CLOSE | 103 | "Close (Cmd-W)", //BUTTON_CLOSE |
@@ -145,7 +143,7 @@ LLFloater::LLFloater() : | |||
145 | mHandle.bind(this); | 143 | mHandle.bind(this); |
146 | } | 144 | } |
147 | 145 | ||
148 | LLFloater::LLFloater(const LLString& name) | 146 | LLFloater::LLFloater(const std::string& name) |
149 | : LLPanel(name), mAutoFocus(TRUE) // automatically take focus when opened | 147 | : LLPanel(name), mAutoFocus(TRUE) // automatically take focus when opened |
150 | { | 148 | { |
151 | for (S32 i = 0; i < BUTTON_COUNT; i++) | 149 | for (S32 i = 0; i < BUTTON_COUNT; i++) |
@@ -153,12 +151,12 @@ LLFloater::LLFloater(const LLString& name) | |||
153 | mButtonsEnabled[i] = FALSE; | 151 | mButtonsEnabled[i] = FALSE; |
154 | mButtons[i] = NULL; | 152 | mButtons[i] = NULL; |
155 | } | 153 | } |
156 | LLString title; // null string | 154 | std::string title; // null string |
157 | initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults | 155 | initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults |
158 | } | 156 | } |
159 | 157 | ||
160 | 158 | ||
161 | LLFloater::LLFloater(const LLString& name, const LLRect& rect, const LLString& title, | 159 | LLFloater::LLFloater(const std::string& name, const LLRect& rect, const std::string& title, |
162 | BOOL resizable, | 160 | BOOL resizable, |
163 | S32 min_width, | 161 | S32 min_width, |
164 | S32 min_height, | 162 | S32 min_height, |
@@ -176,7 +174,7 @@ LLFloater::LLFloater(const LLString& name, const LLRect& rect, const LLString& t | |||
176 | initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); | 174 | initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); |
177 | } | 175 | } |
178 | 176 | ||
179 | LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const LLString& title, | 177 | LLFloater::LLFloater(const std::string& name, const std::string& rect_control, const std::string& title, |
180 | BOOL resizable, | 178 | BOOL resizable, |
181 | S32 min_width, | 179 | S32 min_width, |
182 | S32 min_height, | 180 | S32 min_height, |
@@ -196,7 +194,7 @@ LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const L | |||
196 | 194 | ||
197 | 195 | ||
198 | // Note: Floaters constructed from XML call init() twice! | 196 | // Note: Floaters constructed from XML call init() twice! |
199 | void LLFloater::initFloater(const LLString& title, | 197 | void LLFloater::initFloater(const std::string& title, |
200 | BOOL resizable, S32 min_width, S32 min_height, | 198 | BOOL resizable, S32 min_width, S32 min_height, |
201 | BOOL drag_on_left, BOOL minimizable, BOOL close_btn) | 199 | BOOL drag_on_left, BOOL minimizable, BOOL close_btn) |
202 | { | 200 | { |
@@ -291,12 +289,12 @@ void LLFloater::initFloater(const LLString& title, | |||
291 | 0, 0, | 289 | 0, 0, |
292 | DRAG_HANDLE_WIDTH, | 290 | DRAG_HANDLE_WIDTH, |
293 | getRect().getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); | 291 | getRect().getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); |
294 | mDragHandle = new LLDragHandleLeft("drag", drag_handle_rect, title ); | 292 | mDragHandle = new LLDragHandleLeft(std::string("drag"), drag_handle_rect, title ); |
295 | } | 293 | } |
296 | else // drag on top | 294 | else // drag on top |
297 | { | 295 | { |
298 | LLRect drag_handle_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); | 296 | LLRect drag_handle_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); |
299 | mDragHandle = new LLDragHandleTop( "Drag Handle", drag_handle_rect, title ); | 297 | mDragHandle = new LLDragHandleTop( std::string("Drag Handle"), drag_handle_rect, title ); |
300 | } | 298 | } |
301 | addChild(mDragHandle); | 299 | addChild(mDragHandle); |
302 | 300 | ||
@@ -310,28 +308,28 @@ void LLFloater::initFloater(const LLString& title, | |||
310 | // Resize bars (sides) | 308 | // Resize bars (sides) |
311 | const S32 RESIZE_BAR_THICKNESS = 3; | 309 | const S32 RESIZE_BAR_THICKNESS = 3; |
312 | mResizeBar[LLResizeBar::LEFT] = new LLResizeBar( | 310 | mResizeBar[LLResizeBar::LEFT] = new LLResizeBar( |
313 | "resizebar_left", | 311 | std::string("resizebar_left"), |
314 | this, | 312 | this, |
315 | LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), | 313 | LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), |
316 | min_width, S32_MAX, LLResizeBar::LEFT ); | 314 | min_width, S32_MAX, LLResizeBar::LEFT ); |
317 | addChild( mResizeBar[0] ); | 315 | addChild( mResizeBar[0] ); |
318 | 316 | ||
319 | mResizeBar[LLResizeBar::TOP] = new LLResizeBar( | 317 | mResizeBar[LLResizeBar::TOP] = new LLResizeBar( |
320 | "resizebar_top", | 318 | std::string("resizebar_top"), |
321 | this, | 319 | this, |
322 | LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), | 320 | LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), |
323 | min_height, S32_MAX, LLResizeBar::TOP ); | 321 | min_height, S32_MAX, LLResizeBar::TOP ); |
324 | addChild( mResizeBar[1] ); | 322 | addChild( mResizeBar[1] ); |
325 | 323 | ||
326 | mResizeBar[LLResizeBar::RIGHT] = new LLResizeBar( | 324 | mResizeBar[LLResizeBar::RIGHT] = new LLResizeBar( |
327 | "resizebar_right", | 325 | std::string("resizebar_right"), |
328 | this, | 326 | this, |
329 | LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), | 327 | LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), |
330 | min_width, S32_MAX, LLResizeBar::RIGHT ); | 328 | min_width, S32_MAX, LLResizeBar::RIGHT ); |
331 | addChild( mResizeBar[2] ); | 329 | addChild( mResizeBar[2] ); |
332 | 330 | ||
333 | mResizeBar[LLResizeBar::BOTTOM] = new LLResizeBar( | 331 | mResizeBar[LLResizeBar::BOTTOM] = new LLResizeBar( |
334 | "resizebar_bottom", | 332 | std::string("resizebar_bottom"), |
335 | this, | 333 | this, |
336 | LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), | 334 | LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), |
337 | min_height, S32_MAX, LLResizeBar::BOTTOM ); | 335 | min_height, S32_MAX, LLResizeBar::BOTTOM ); |
@@ -340,28 +338,29 @@ void LLFloater::initFloater(const LLString& title, | |||
340 | 338 | ||
341 | // Resize handles (corners) | 339 | // Resize handles (corners) |
342 | mResizeHandle[0] = new LLResizeHandle( | 340 | mResizeHandle[0] = new LLResizeHandle( |
343 | "Resize Handle", | 341 | std::string("Resize Handle"), |
344 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), | 342 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), |
345 | min_width, | 343 | min_width, |
346 | min_height, | 344 | min_height, |
347 | LLResizeHandle::RIGHT_BOTTOM); | 345 | LLResizeHandle::RIGHT_BOTTOM); |
348 | addChild(mResizeHandle[0]); | 346 | addChild(mResizeHandle[0]); |
349 | 347 | ||
350 | mResizeHandle[1] = new LLResizeHandle( "resize", | 348 | mResizeHandle[1] = new LLResizeHandle( |
349 | std::string("resize"), | ||
351 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), | 350 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), |
352 | min_width, | 351 | min_width, |
353 | min_height, | 352 | min_height, |
354 | LLResizeHandle::RIGHT_TOP ); | 353 | LLResizeHandle::RIGHT_TOP ); |
355 | addChild(mResizeHandle[1]); | 354 | addChild(mResizeHandle[1]); |
356 | 355 | ||
357 | mResizeHandle[2] = new LLResizeHandle( "resize", | 356 | mResizeHandle[2] = new LLResizeHandle( std::string("resize"), |
358 | LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), | 357 | LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), |
359 | min_width, | 358 | min_width, |
360 | min_height, | 359 | min_height, |
361 | LLResizeHandle::LEFT_BOTTOM ); | 360 | LLResizeHandle::LEFT_BOTTOM ); |
362 | addChild(mResizeHandle[2]); | 361 | addChild(mResizeHandle[2]); |
363 | 362 | ||
364 | mResizeHandle[3] = new LLResizeHandle( "resize", | 363 | mResizeHandle[3] = new LLResizeHandle( std::string("resize"), |
365 | LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), | 364 | LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), |
366 | min_width, | 365 | min_width, |
367 | min_height, | 366 | min_height, |
@@ -650,31 +649,62 @@ void LLFloater::applyRectControl() | |||
650 | } | 649 | } |
651 | } | 650 | } |
652 | 651 | ||
653 | void LLFloater::setTitle( const LLString& title ) | 652 | void LLFloater::applyTitle() |
654 | { | 653 | { |
655 | if (gNoRender) | 654 | if (gNoRender) |
656 | { | 655 | { |
657 | return; | 656 | return; |
658 | } | 657 | } |
659 | if (mDragHandle) | 658 | |
660 | mDragHandle->setTitle( title ); | 659 | if (!mDragHandle) |
660 | { | ||
661 | return; | ||
662 | } | ||
663 | |||
664 | if (isMinimized() && !mShortTitle.empty()) | ||
665 | { | ||
666 | mDragHandle->setTitle( mShortTitle ); | ||
667 | } | ||
668 | else | ||
669 | { | ||
670 | mDragHandle->setTitle ( mTitle ); | ||
671 | } | ||
672 | } | ||
673 | |||
674 | const std::string& LLFloater::getCurrentTitle() const | ||
675 | { | ||
676 | return mDragHandle ? mDragHandle->getTitle() : LLStringUtil::null; | ||
661 | } | 677 | } |
662 | 678 | ||
663 | const LLString& LLFloater::getTitle() const | 679 | void LLFloater::setTitle( const std::string& title ) |
664 | { | 680 | { |
665 | return mDragHandle ? mDragHandle->getTitle() : LLString::null; | 681 | mTitle = title; |
682 | applyTitle(); | ||
666 | } | 683 | } |
667 | 684 | ||
668 | void LLFloater::setShortTitle( const LLString& short_title ) | 685 | std::string LLFloater::getTitle() |
686 | { | ||
687 | if (mTitle.empty()) | ||
688 | { | ||
689 | return mDragHandle ? mDragHandle->getTitle() : LLStringUtil::null; | ||
690 | } | ||
691 | else | ||
692 | { | ||
693 | return mTitle; | ||
694 | } | ||
695 | } | ||
696 | |||
697 | void LLFloater::setShortTitle( const std::string& short_title ) | ||
669 | { | 698 | { |
670 | mShortTitle = short_title; | 699 | mShortTitle = short_title; |
700 | applyTitle(); | ||
671 | } | 701 | } |
672 | 702 | ||
673 | LLString LLFloater::getShortTitle() | 703 | std::string LLFloater::getShortTitle() |
674 | { | 704 | { |
675 | if (mShortTitle.empty()) | 705 | if (mShortTitle.empty()) |
676 | { | 706 | { |
677 | return mDragHandle ? mDragHandle->getTitle() : LLString::null; | 707 | return mDragHandle ? mDragHandle->getTitle() : LLStringUtil::null; |
678 | } | 708 | } |
679 | else | 709 | else |
680 | { | 710 | { |
@@ -841,7 +871,7 @@ void LLFloater::setMinimized(BOOL minimize) | |||
841 | mResizeHandle[i]->setEnabled(FALSE); | 871 | mResizeHandle[i]->setEnabled(FALSE); |
842 | } | 872 | } |
843 | } | 873 | } |
844 | 874 | ||
845 | mMinimized = TRUE; | 875 | mMinimized = TRUE; |
846 | 876 | ||
847 | // Reshape *after* setting mMinimized | 877 | // Reshape *after* setting mMinimized |
@@ -890,12 +920,15 @@ void LLFloater::setMinimized(BOOL minimize) | |||
890 | mResizeHandle[i]->setEnabled(isResizable()); | 920 | mResizeHandle[i]->setEnabled(isResizable()); |
891 | } | 921 | } |
892 | } | 922 | } |
893 | 923 | ||
894 | mMinimized = FALSE; | 924 | mMinimized = FALSE; |
895 | 925 | ||
896 | // Reshape *after* setting mMinimized | 926 | // Reshape *after* setting mMinimized |
897 | reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); | 927 | reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); |
898 | } | 928 | } |
929 | |||
930 | applyTitle (); | ||
931 | |||
899 | make_ui_sound("UISndWindowClose"); | 932 | make_ui_sound("UISndWindowClose"); |
900 | updateButtons(); | 933 | updateButtons(); |
901 | } | 934 | } |
@@ -1083,38 +1116,37 @@ void LLFloater::removeDependentFloater(LLFloater* floaterp) | |||
1083 | floaterp->mDependeeHandle = LLHandle<LLFloater>(); | 1116 | floaterp->mDependeeHandle = LLHandle<LLFloater>(); |
1084 | } | 1117 | } |
1085 | 1118 | ||
1086 | // virtual | 1119 | BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index) |
1087 | BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask) | ||
1088 | { | 1120 | { |
1089 | if( mMinimized ) | 1121 | if( mButtonsEnabled[index] ) |
1090 | { | 1122 | { |
1091 | // Offer the click to the close button. | 1123 | LLButton* my_butt = mButtons[index]; |
1092 | if( mButtonsEnabled[BUTTON_CLOSE] ) | 1124 | S32 local_x = x - my_butt->getRect().mLeft; |
1093 | { | 1125 | S32 local_y = y - my_butt->getRect().mBottom; |
1094 | S32 local_x = x - mButtons[BUTTON_CLOSE]->getRect().mLeft; | ||
1095 | S32 local_y = y - mButtons[BUTTON_CLOSE]->getRect().mBottom; | ||
1096 | |||
1097 | if (mButtons[BUTTON_CLOSE]->pointInView(local_x, local_y) | ||
1098 | && mButtons[BUTTON_CLOSE]->handleMouseDown(local_x, local_y, mask)) | ||
1099 | { | ||
1100 | // close button handled it, return | ||
1101 | return TRUE; | ||
1102 | } | ||
1103 | } | ||
1104 | 1126 | ||
1105 | // Offer the click to the restore button. | 1127 | if ( |
1106 | if( mButtonsEnabled[BUTTON_RESTORE] ) | 1128 | my_butt->pointInView(local_x, local_y) && |
1129 | my_butt->handleMouseDown(local_x, local_y, mask)) | ||
1107 | { | 1130 | { |
1108 | S32 local_x = x - mButtons[BUTTON_RESTORE]->getRect().mLeft; | 1131 | // the button handled it |
1109 | S32 local_y = y - mButtons[BUTTON_RESTORE]->getRect().mBottom; | 1132 | return TRUE; |
1110 | |||
1111 | if (mButtons[BUTTON_RESTORE]->pointInView(local_x, local_y) | ||
1112 | && mButtons[BUTTON_RESTORE]->handleMouseDown(local_x, local_y, mask)) | ||
1113 | { | ||
1114 | // restore button handled it, return | ||
1115 | return TRUE; | ||
1116 | } | ||
1117 | } | 1133 | } |
1134 | } | ||
1135 | return FALSE; | ||
1136 | } | ||
1137 | |||
1138 | // virtual | ||
1139 | BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask) | ||
1140 | { | ||
1141 | if( mMinimized ) | ||
1142 | { | ||
1143 | // Offer the click to titlebar buttons. | ||
1144 | // Note: this block and the offerClickToButton helper method can be removed | ||
1145 | // because the parent container will handle it for us but we'll keep it here | ||
1146 | // for safety until after reworking the panel code to manage hidden children. | ||
1147 | if(offerClickToButton(x, y, mask, BUTTON_CLOSE)) return TRUE; | ||
1148 | if(offerClickToButton(x, y, mask, BUTTON_RESTORE)) return TRUE; | ||
1149 | if(offerClickToButton(x, y, mask, BUTTON_TEAR_OFF)) return TRUE; | ||
1118 | 1150 | ||
1119 | // Otherwise pass to drag handle for movement | 1151 | // Otherwise pass to drag handle for movement |
1120 | return mDragHandle->handleMouseDown(x, y, mask); | 1152 | return mDragHandle->handleMouseDown(x, y, mask); |
@@ -1249,6 +1281,7 @@ void LLFloater::onClickTearOff(void *userdata) | |||
1249 | LLMultiFloater* new_host = (LLMultiFloater*)self->mLastHostHandle.get(); | 1281 | LLMultiFloater* new_host = (LLMultiFloater*)self->mLastHostHandle.get(); |
1250 | if (new_host) | 1282 | if (new_host) |
1251 | { | 1283 | { |
1284 | self->setMinimized(FALSE); // to reenable minimize button if it was minimized | ||
1252 | new_host->showFloater(self); | 1285 | new_host->showFloater(self); |
1253 | // make sure host is visible | 1286 | // make sure host is visible |
1254 | new_host->open(); | 1287 | new_host->open(); |
@@ -1341,7 +1374,7 @@ void LLFloater::draw() | |||
1341 | gl_rect_2d( left, top, right, bottom, getTransparentColor() ); | 1374 | gl_rect_2d( left, top, right, bottom, getTransparentColor() ); |
1342 | } | 1375 | } |
1343 | 1376 | ||
1344 | if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getTitle().empty()) | 1377 | if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getCurrentTitle().empty()) |
1345 | { | 1378 | { |
1346 | // draw highlight on title bar to indicate focus. RDW | 1379 | // draw highlight on title bar to indicate focus. RDW |
1347 | const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); | 1380 | const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); |
@@ -1421,31 +1454,15 @@ void LLFloater::draw() | |||
1421 | 1454 | ||
1422 | void LLFloater::setCanMinimize(BOOL can_minimize) | 1455 | void LLFloater::setCanMinimize(BOOL can_minimize) |
1423 | { | 1456 | { |
1424 | // removing minimize/restore button programmatically, | 1457 | // if removing minimize/restore button programmatically, |
1425 | // go ahead and uniminimize floater | 1458 | // go ahead and unminimize floater |
1426 | if (!can_minimize) | 1459 | if (!can_minimize) |
1427 | { | 1460 | { |
1428 | setMinimized(FALSE); | 1461 | setMinimized(FALSE); |
1429 | } | 1462 | } |
1430 | 1463 | ||
1431 | if (can_minimize) | 1464 | mButtonsEnabled[BUTTON_MINIMIZE] = can_minimize && !isMinimized(); |
1432 | { | 1465 | mButtonsEnabled[BUTTON_RESTORE] = can_minimize && isMinimized(); |
1433 | if (isMinimized()) | ||
1434 | { | ||
1435 | mButtonsEnabled[BUTTON_MINIMIZE] = FALSE; | ||
1436 | mButtonsEnabled[BUTTON_RESTORE] = TRUE; | ||
1437 | } | ||
1438 | else | ||
1439 | { | ||
1440 | mButtonsEnabled[BUTTON_MINIMIZE] = TRUE; | ||
1441 | mButtonsEnabled[BUTTON_RESTORE] = FALSE; | ||
1442 | } | ||
1443 | } | ||
1444 | else | ||
1445 | { | ||
1446 | mButtonsEnabled[BUTTON_MINIMIZE] = FALSE; | ||
1447 | mButtonsEnabled[BUTTON_RESTORE] = FALSE; | ||
1448 | } | ||
1449 | 1466 | ||
1450 | updateButtons(); | 1467 | updateButtons(); |
1451 | } | 1468 | } |
@@ -1484,28 +1501,28 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1484 | // Resize bars (sides) | 1501 | // Resize bars (sides) |
1485 | const S32 RESIZE_BAR_THICKNESS = 3; | 1502 | const S32 RESIZE_BAR_THICKNESS = 3; |
1486 | mResizeBar[0] = new LLResizeBar( | 1503 | mResizeBar[0] = new LLResizeBar( |
1487 | "resizebar_left", | 1504 | std::string("resizebar_left"), |
1488 | this, | 1505 | this, |
1489 | LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), | 1506 | LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), |
1490 | mMinWidth, S32_MAX, LLResizeBar::LEFT ); | 1507 | mMinWidth, S32_MAX, LLResizeBar::LEFT ); |
1491 | addChild( mResizeBar[0] ); | 1508 | addChild( mResizeBar[0] ); |
1492 | 1509 | ||
1493 | mResizeBar[1] = new LLResizeBar( | 1510 | mResizeBar[1] = new LLResizeBar( |
1494 | "resizebar_top", | 1511 | std::string("resizebar_top"), |
1495 | this, | 1512 | this, |
1496 | LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), | 1513 | LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), |
1497 | mMinHeight, S32_MAX, LLResizeBar::TOP ); | 1514 | mMinHeight, S32_MAX, LLResizeBar::TOP ); |
1498 | addChild( mResizeBar[1] ); | 1515 | addChild( mResizeBar[1] ); |
1499 | 1516 | ||
1500 | mResizeBar[2] = new LLResizeBar( | 1517 | mResizeBar[2] = new LLResizeBar( |
1501 | "resizebar_right", | 1518 | std::string("resizebar_right"), |
1502 | this, | 1519 | this, |
1503 | LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), | 1520 | LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), |
1504 | mMinWidth, S32_MAX, LLResizeBar::RIGHT ); | 1521 | mMinWidth, S32_MAX, LLResizeBar::RIGHT ); |
1505 | addChild( mResizeBar[2] ); | 1522 | addChild( mResizeBar[2] ); |
1506 | 1523 | ||
1507 | mResizeBar[3] = new LLResizeBar( | 1524 | mResizeBar[3] = new LLResizeBar( |
1508 | "resizebar_bottom", | 1525 | std::string("resizebar_bottom"), |
1509 | this, | 1526 | this, |
1510 | LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), | 1527 | LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), |
1511 | mMinHeight, S32_MAX, LLResizeBar::BOTTOM ); | 1528 | mMinHeight, S32_MAX, LLResizeBar::BOTTOM ); |
@@ -1514,28 +1531,28 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1514 | 1531 | ||
1515 | // Resize handles (corners) | 1532 | // Resize handles (corners) |
1516 | mResizeHandle[0] = new LLResizeHandle( | 1533 | mResizeHandle[0] = new LLResizeHandle( |
1517 | "Resize Handle", | 1534 | std::string("Resize Handle"), |
1518 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), | 1535 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), |
1519 | mMinWidth, | 1536 | mMinWidth, |
1520 | mMinHeight, | 1537 | mMinHeight, |
1521 | LLResizeHandle::RIGHT_BOTTOM); | 1538 | LLResizeHandle::RIGHT_BOTTOM); |
1522 | addChild(mResizeHandle[0]); | 1539 | addChild(mResizeHandle[0]); |
1523 | 1540 | ||
1524 | mResizeHandle[1] = new LLResizeHandle( "resize", | 1541 | mResizeHandle[1] = new LLResizeHandle( std::string("resize"), |
1525 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), | 1542 | LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), |
1526 | mMinWidth, | 1543 | mMinWidth, |
1527 | mMinHeight, | 1544 | mMinHeight, |
1528 | LLResizeHandle::RIGHT_TOP ); | 1545 | LLResizeHandle::RIGHT_TOP ); |
1529 | addChild(mResizeHandle[1]); | 1546 | addChild(mResizeHandle[1]); |
1530 | 1547 | ||
1531 | mResizeHandle[2] = new LLResizeHandle( "resize", | 1548 | mResizeHandle[2] = new LLResizeHandle( std::string("resize"), |
1532 | LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), | 1549 | LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), |
1533 | mMinWidth, | 1550 | mMinWidth, |
1534 | mMinHeight, | 1551 | mMinHeight, |
1535 | LLResizeHandle::LEFT_BOTTOM ); | 1552 | LLResizeHandle::LEFT_BOTTOM ); |
1536 | addChild(mResizeHandle[2]); | 1553 | addChild(mResizeHandle[2]); |
1537 | 1554 | ||
1538 | mResizeHandle[3] = new LLResizeHandle( "resize", | 1555 | mResizeHandle[3] = new LLResizeHandle( std::string("resize"), |
1539 | LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), | 1556 | LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), |
1540 | mMinWidth, | 1557 | mMinWidth, |
1541 | mMinHeight, | 1558 | mMinHeight, |
@@ -1633,7 +1650,7 @@ void LLFloater::buildButtons() | |||
1633 | btn_rect, | 1650 | btn_rect, |
1634 | sButtonActiveImageNames[i], | 1651 | sButtonActiveImageNames[i], |
1635 | sButtonPressedImageNames[i], | 1652 | sButtonPressedImageNames[i], |
1636 | "", | 1653 | LLStringUtil::null, |
1637 | sButtonCallbacks[i], | 1654 | sButtonCallbacks[i], |
1638 | this, | 1655 | this, |
1639 | LLFontGL::sSansSerif); | 1656 | LLFontGL::sSansSerif); |
@@ -1657,7 +1674,7 @@ void LLFloater::buildButtons() | |||
1657 | ///////////////////////////////////////////////////// | 1674 | ///////////////////////////////////////////////////// |
1658 | // LLFloaterView | 1675 | // LLFloaterView |
1659 | 1676 | ||
1660 | LLFloaterView::LLFloaterView( const LLString& name, const LLRect& rect ) | 1677 | LLFloaterView::LLFloaterView( const std::string& name, const LLRect& rect ) |
1661 | : LLUICtrl( name, rect, FALSE, NULL, NULL, FOLLOWS_ALL ), | 1678 | : LLUICtrl( name, rect, FALSE, NULL, NULL, FOLLOWS_ALL ), |
1662 | mFocusCycleMode(FALSE), | 1679 | mFocusCycleMode(FALSE), |
1663 | mSnapOffsetBottom(0) | 1680 | mSnapOffsetBottom(0) |
@@ -2377,7 +2394,7 @@ LLMultiFloater::LLMultiFloater(LLTabContainer::TabPosition tab_pos) : | |||
2377 | 2394 | ||
2378 | } | 2395 | } |
2379 | 2396 | ||
2380 | LLMultiFloater::LLMultiFloater(const LLString &name) : | 2397 | LLMultiFloater::LLMultiFloater(const std::string &name) : |
2381 | LLFloater(name), | 2398 | LLFloater(name), |
2382 | mTabContainer(NULL), | 2399 | mTabContainer(NULL), |
2383 | mTabPos(LLTabContainer::TOP), | 2400 | mTabPos(LLTabContainer::TOP), |
@@ -2388,7 +2405,7 @@ LLMultiFloater::LLMultiFloater(const LLString &name) : | |||
2388 | } | 2405 | } |
2389 | 2406 | ||
2390 | LLMultiFloater::LLMultiFloater( | 2407 | LLMultiFloater::LLMultiFloater( |
2391 | const LLString& name, | 2408 | const std::string& name, |
2392 | const LLRect& rect, | 2409 | const LLRect& rect, |
2393 | LLTabContainer::TabPosition tab_pos, | 2410 | LLTabContainer::TabPosition tab_pos, |
2394 | BOOL auto_resize) : | 2411 | BOOL auto_resize) : |
@@ -2399,7 +2416,7 @@ LLMultiFloater::LLMultiFloater( | |||
2399 | mOrigMinWidth(0), | 2416 | mOrigMinWidth(0), |
2400 | mOrigMinHeight(0) | 2417 | mOrigMinHeight(0) |
2401 | { | 2418 | { |
2402 | mTabContainer = new LLTabContainer("Preview Tabs", | 2419 | mTabContainer = new LLTabContainer(std::string("Preview Tabs"), |
2403 | LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), | 2420 | LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), |
2404 | mTabPos, | 2421 | mTabPos, |
2405 | FALSE, | 2422 | FALSE, |
@@ -2414,8 +2431,8 @@ LLMultiFloater::LLMultiFloater( | |||
2414 | } | 2431 | } |
2415 | 2432 | ||
2416 | LLMultiFloater::LLMultiFloater( | 2433 | LLMultiFloater::LLMultiFloater( |
2417 | const LLString& name, | 2434 | const std::string& name, |
2418 | const LLString& rect_control, | 2435 | const std::string& rect_control, |
2419 | LLTabContainer::TabPosition tab_pos, | 2436 | LLTabContainer::TabPosition tab_pos, |
2420 | BOOL auto_resize) : | 2437 | BOOL auto_resize) : |
2421 | LLFloater(name, rect_control, name), | 2438 | LLFloater(name, rect_control, name), |
@@ -2425,7 +2442,7 @@ LLMultiFloater::LLMultiFloater( | |||
2425 | mOrigMinWidth(0), | 2442 | mOrigMinWidth(0), |
2426 | mOrigMinHeight(0) | 2443 | mOrigMinHeight(0) |
2427 | { | 2444 | { |
2428 | mTabContainer = new LLTabContainer("Preview Tabs", | 2445 | mTabContainer = new LLTabContainer(std::string("Preview Tabs"), |
2429 | LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), | 2446 | LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), |
2430 | mTabPos, | 2447 | mTabPos, |
2431 | FALSE, | 2448 | FALSE, |
@@ -2863,7 +2880,7 @@ LLXMLNodePtr LLFloater::getXML(bool save_children) const | |||
2863 | { | 2880 | { |
2864 | LLXMLNodePtr node = LLPanel::getXML(); | 2881 | LLXMLNodePtr node = LLPanel::getXML(); |
2865 | 2882 | ||
2866 | node->createChild("title", TRUE)->setStringValue(getTitle()); | 2883 | node->createChild("title", TRUE)->setStringValue(getCurrentTitle()); |
2867 | 2884 | ||
2868 | node->createChild("can_resize", TRUE)->setBoolValue(isResizable()); | 2885 | node->createChild("can_resize", TRUE)->setBoolValue(isResizable()); |
2869 | 2886 | ||
@@ -2885,12 +2902,12 @@ LLXMLNodePtr LLFloater::getXML(bool save_children) const | |||
2885 | // static | 2902 | // static |
2886 | LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 2903 | LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
2887 | { | 2904 | { |
2888 | LLString name("floater"); | 2905 | std::string name("floater"); |
2889 | node->getAttributeString("name", name); | 2906 | node->getAttributeString("name", name); |
2890 | 2907 | ||
2891 | LLFloater *floaterp = new LLFloater(name); | 2908 | LLFloater *floaterp = new LLFloater(name); |
2892 | 2909 | ||
2893 | LLString filename; | 2910 | std::string filename; |
2894 | node->getAttributeString("filename", filename); | 2911 | node->getAttributeString("filename", filename); |
2895 | 2912 | ||
2896 | if (filename.empty()) | 2913 | if (filename.empty()) |
@@ -2909,10 +2926,10 @@ LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f | |||
2909 | 2926 | ||
2910 | void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open) /* Flawfinder: ignore */ | 2927 | void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open) /* Flawfinder: ignore */ |
2911 | { | 2928 | { |
2912 | LLString name(getName()); | 2929 | std::string name(getName()); |
2913 | LLString title(getTitle()); | 2930 | std::string title(getCurrentTitle()); |
2914 | LLString short_title(getShortTitle()); | 2931 | std::string short_title(getShortTitle()); |
2915 | LLString rect_control(""); | 2932 | std::string rect_control(""); |
2916 | BOOL resizable = isResizable(); | 2933 | BOOL resizable = isResizable(); |
2917 | S32 min_width = getMinWidth(); | 2934 | S32 min_width = getMinWidth(); |
2918 | S32 min_height = getMinHeight(); | 2935 | S32 min_height = getMinHeight(); |
@@ -2950,6 +2967,9 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor | |||
2950 | minimizable, | 2967 | minimizable, |
2951 | close_btn); | 2968 | close_btn); |
2952 | 2969 | ||
2970 | setTitle(title); | ||
2971 | applyTitle (); | ||
2972 | |||
2953 | setShortTitle(short_title); | 2973 | setShortTitle(short_title); |
2954 | 2974 | ||
2955 | BOOL can_tear_off; | 2975 | BOOL can_tear_off; |
diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index 7b4e003..636125e 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h | |||
@@ -86,8 +86,8 @@ public: | |||
86 | }; | 86 | }; |
87 | 87 | ||
88 | LLFloater(); | 88 | LLFloater(); |
89 | LLFloater(const LLString& name); //simple constructor for data-driven initialization | 89 | LLFloater(const std::string& name); //simple constructor for data-driven initialization |
90 | LLFloater( const LLString& name, const LLRect& rect, const LLString& title, | 90 | LLFloater( const std::string& name, const LLRect& rect, const std::string& title, |
91 | BOOL resizable = FALSE, | 91 | BOOL resizable = FALSE, |
92 | S32 min_width = DEFAULT_MIN_WIDTH, | 92 | S32 min_width = DEFAULT_MIN_WIDTH, |
93 | S32 min_height = DEFAULT_MIN_HEIGHT, | 93 | S32 min_height = DEFAULT_MIN_HEIGHT, |
@@ -96,7 +96,7 @@ public: | |||
96 | BOOL close_btn = TRUE, | 96 | BOOL close_btn = TRUE, |
97 | BOOL bordered = BORDER_NO); | 97 | BOOL bordered = BORDER_NO); |
98 | 98 | ||
99 | LLFloater( const LLString& name, const LLString& rect_control, const LLString& title, | 99 | LLFloater( const std::string& name, const std::string& rect_control, const std::string& title, |
100 | BOOL resizable = FALSE, | 100 | BOOL resizable = FALSE, |
101 | S32 min_width = DEFAULT_MIN_WIDTH, | 101 | S32 min_width = DEFAULT_MIN_WIDTH, |
102 | S32 min_height = DEFAULT_MIN_HEIGHT, | 102 | S32 min_height = DEFAULT_MIN_HEIGHT, |
@@ -119,7 +119,7 @@ public: | |||
119 | 119 | ||
120 | // Can be called multiple times to reset floater parameters. | 120 | // Can be called multiple times to reset floater parameters. |
121 | // Deletes all children of the floater. | 121 | // Deletes all children of the floater. |
122 | virtual void initFloater(const LLString& title, BOOL resizable, | 122 | virtual void initFloater(const std::string& title, BOOL resizable, |
123 | S32 min_width, S32 min_height, BOOL drag_on_left, | 123 | S32 min_width, S32 min_height, BOOL drag_on_left, |
124 | BOOL minimizable, BOOL close_btn); | 124 | BOOL minimizable, BOOL close_btn); |
125 | 125 | ||
@@ -142,17 +142,19 @@ public: | |||
142 | 142 | ||
143 | LLMultiFloater* getHost() { return (LLMultiFloater*)mHostHandle.get(); } | 143 | LLMultiFloater* getHost() { return (LLMultiFloater*)mHostHandle.get(); } |
144 | 144 | ||
145 | void setTitle( const LLString& title ); | 145 | void applyTitle(); |
146 | const LLString& getTitle() const; | 146 | const std::string& getCurrentTitle() const; |
147 | void setShortTitle( const LLString& short_title ); | 147 | void setTitle( const std::string& title); |
148 | LLString getShortTitle(); | 148 | std::string getTitle(); |
149 | void setShortTitle( const std::string& short_title ); | ||
150 | std::string getShortTitle(); | ||
149 | void setTitleVisible(bool visible); | 151 | void setTitleVisible(bool visible); |
150 | virtual void setMinimized(BOOL b); | 152 | virtual void setMinimized(BOOL b); |
151 | void moveResizeHandlesToFront(); | 153 | void moveResizeHandlesToFront(); |
152 | void addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE); | 154 | void addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE); |
153 | void addDependentFloater(LLHandle<LLFloater> dependent_handle, BOOL reposition = TRUE); | 155 | void addDependentFloater(LLHandle<LLFloater> dependent_handle, BOOL reposition = TRUE); |
154 | LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); } | 156 | LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); } |
155 | void removeDependentFloater(LLFloater* dependent); | 157 | void removeDependentFloater(LLFloater* dependent); |
156 | BOOL isMinimized() { return mMinimized; } | 158 | BOOL isMinimized() { return mMinimized; } |
157 | BOOL isFrontmost(); | 159 | BOOL isFrontmost(); |
158 | BOOL isDependent() { return !mDependeeHandle.isDead(); } | 160 | BOOL isDependent() { return !mDependeeHandle.isDead(); } |
@@ -221,8 +223,8 @@ protected: | |||
221 | virtual void bringToFront(S32 x, S32 y); | 223 | virtual void bringToFront(S32 x, S32 y); |
222 | virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE); | 224 | virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE); |
223 | 225 | ||
224 | void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized | 226 | void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized |
225 | const LLRect& getExpandedRect() const { return mExpandedRect; } | 227 | const LLRect& getExpandedRect() const { return mExpandedRect; } |
226 | 228 | ||
227 | void setAutoFocus(BOOL focus) { mAutoFocus = focus; } // whether to automatically take focus when opened | 229 | void setAutoFocus(BOOL focus) { mAutoFocus = focus; } // whether to automatically take focus when opened |
228 | LLDragHandle* getDragHandle() const { return mDragHandle; } | 230 | LLDragHandle* getDragHandle() const { return mDragHandle; } |
@@ -236,17 +238,19 @@ private: | |||
236 | void createMinimizeButton(); | 238 | void createMinimizeButton(); |
237 | void updateButtons(); | 239 | void updateButtons(); |
238 | void buildButtons(); | 240 | void buildButtons(); |
241 | BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index); | ||
239 | 242 | ||
240 | LLRect mExpandedRect; | 243 | LLRect mExpandedRect; |
241 | LLDragHandle* mDragHandle; | 244 | LLDragHandle* mDragHandle; |
242 | LLResizeBar* mResizeBar[4]; | 245 | LLResizeBar* mResizeBar[4]; |
243 | LLResizeHandle* mResizeHandle[4]; | 246 | LLResizeHandle* mResizeHandle[4]; |
244 | LLButton *mMinimizeButton; | 247 | LLButton *mMinimizeButton; |
245 | BOOL mCanTearOff; | 248 | BOOL mCanTearOff; |
246 | BOOL mMinimized; | 249 | BOOL mMinimized; |
247 | BOOL mForeground; | 250 | BOOL mForeground; |
248 | LLHandle<LLFloater> mDependeeHandle; | 251 | LLHandle<LLFloater> mDependeeHandle; |
249 | LLString mShortTitle; | 252 | std::string mTitle; |
253 | std::string mShortTitle; | ||
250 | 254 | ||
251 | BOOL mFirstLook; // TRUE if the _next_ time this floater is visible will be the first time in the session that it is visible. | 255 | BOOL mFirstLook; // TRUE if the _next_ time this floater is visible will be the first time in the session that it is visible. |
252 | 256 | ||
@@ -259,7 +263,7 @@ private: | |||
259 | typedef std::set<LLHandle<LLFloater> > handle_set_t; | 263 | typedef std::set<LLHandle<LLFloater> > handle_set_t; |
260 | typedef std::set<LLHandle<LLFloater> >::iterator handle_set_iter_t; | 264 | typedef std::set<LLHandle<LLFloater> >::iterator handle_set_iter_t; |
261 | handle_set_t mDependents; | 265 | handle_set_t mDependents; |
262 | bool mDragOnLeft; | 266 | bool mDragOnLeft; |
263 | 267 | ||
264 | BOOL mButtonsEnabled[BUTTON_COUNT]; | 268 | BOOL mButtonsEnabled[BUTTON_COUNT]; |
265 | LLButton* mButtons[BUTTON_COUNT]; | 269 | LLButton* mButtons[BUTTON_COUNT]; |
@@ -272,11 +276,11 @@ private: | |||
272 | 276 | ||
273 | static LLMultiFloater* sHostp; | 277 | static LLMultiFloater* sHostp; |
274 | static BOOL sEditModeEnabled; | 278 | static BOOL sEditModeEnabled; |
275 | static LLString sButtonActiveImageNames[BUTTON_COUNT]; | 279 | static std::string sButtonActiveImageNames[BUTTON_COUNT]; |
276 | static LLString sButtonInactiveImageNames[BUTTON_COUNT]; | 280 | static std::string sButtonInactiveImageNames[BUTTON_COUNT]; |
277 | static LLString sButtonPressedImageNames[BUTTON_COUNT]; | 281 | static std::string sButtonPressedImageNames[BUTTON_COUNT]; |
278 | static LLString sButtonNames[BUTTON_COUNT]; | 282 | static std::string sButtonNames[BUTTON_COUNT]; |
279 | static LLString sButtonToolTips[BUTTON_COUNT]; | 283 | static std::string sButtonToolTips[BUTTON_COUNT]; |
280 | typedef void (*click_callback)(void *); | 284 | typedef void (*click_callback)(void *); |
281 | static click_callback sButtonCallbacks[BUTTON_COUNT]; | 285 | static click_callback sButtonCallbacks[BUTTON_COUNT]; |
282 | 286 | ||
@@ -301,7 +305,7 @@ private: | |||
301 | class LLFloaterView : public LLUICtrl | 305 | class LLFloaterView : public LLUICtrl |
302 | { | 306 | { |
303 | public: | 307 | public: |
304 | LLFloaterView( const LLString& name, const LLRect& rect ); | 308 | LLFloaterView( const std::string& name, const LLRect& rect ); |
305 | 309 | ||
306 | /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 310 | /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
307 | void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); | 311 | void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); |
@@ -361,9 +365,9 @@ class LLMultiFloater : public LLFloater | |||
361 | public: | 365 | public: |
362 | LLMultiFloater(); | 366 | LLMultiFloater(); |
363 | LLMultiFloater(LLTabContainer::TabPosition tab_pos); | 367 | LLMultiFloater(LLTabContainer::TabPosition tab_pos); |
364 | LLMultiFloater(const LLString& name); | 368 | LLMultiFloater(const std::string& name); |
365 | LLMultiFloater(const LLString& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); | 369 | LLMultiFloater(const std::string& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); |
366 | LLMultiFloater(const LLString& name, const LLString& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); | 370 | LLMultiFloater(const std::string& name, const std::string& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); |
367 | virtual ~LLMultiFloater() {}; | 371 | virtual ~LLMultiFloater() {}; |
368 | 372 | ||
369 | virtual BOOL postBuild(); | 373 | virtual BOOL postBuild(); |
@@ -387,8 +391,8 @@ public: | |||
387 | virtual void selectNextFloater(); | 391 | virtual void selectNextFloater(); |
388 | virtual void selectPrevFloater(); | 392 | virtual void selectPrevFloater(); |
389 | 393 | ||
390 | virtual LLFloater* getActiveFloater(); | 394 | virtual LLFloater* getActiveFloater(); |
391 | virtual BOOL isFloaterFlashing(LLFloater* floaterp); | 395 | virtual BOOL isFloaterFlashing(LLFloater* floaterp); |
392 | virtual S32 getFloaterCount(); | 396 | virtual S32 getFloaterCount(); |
393 | 397 | ||
394 | virtual void setFloaterFlashing(LLFloater* floaterp, BOOL flashing); | 398 | virtual void setFloaterFlashing(LLFloater* floaterp, BOOL flashing); |
diff --git a/linden/indra/llui/llfocusmgr.cpp b/linden/indra/llui/llfocusmgr.cpp index e2d1f46..517e148 100644 --- a/linden/indra/llui/llfocusmgr.cpp +++ b/linden/indra/llui/llfocusmgr.cpp | |||
@@ -120,7 +120,7 @@ void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystroke | |||
120 | mFocusTimer.reset(); | 120 | mFocusTimer.reset(); |
121 | 121 | ||
122 | #ifdef _DEBUG | 122 | #ifdef _DEBUG |
123 | mKeyboardFocusName = new_focus ? new_focus->getName() : "none"; | 123 | mKeyboardFocusName = new_focus ? new_focus->getName() : std::string("none"); |
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | // If we've got a default keyboard focus, and the caller is | 126 | // If we've got a default keyboard focus, and the caller is |
@@ -202,7 +202,7 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLView* focus ) | |||
202 | { | 202 | { |
203 | mKeyboardFocus = NULL; | 203 | mKeyboardFocus = NULL; |
204 | #ifdef _DEBUG | 204 | #ifdef _DEBUG |
205 | mKeyboardFocusName = "none"; | 205 | mKeyboardFocusName = std::string("none"); |
206 | #endif | 206 | #endif |
207 | } | 207 | } |
208 | } | 208 | } |
@@ -243,7 +243,7 @@ void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) | |||
243 | } | 243 | } |
244 | 244 | ||
245 | #ifdef _DEBUG | 245 | #ifdef _DEBUG |
246 | mMouseCaptorName = new_captor ? new_captor->getName() : "none"; | 246 | mMouseCaptorName = new_captor ? new_captor->getName() : std::string("none"); |
247 | #endif | 247 | #endif |
248 | } | 248 | } |
249 | } | 249 | } |
@@ -258,7 +258,7 @@ void LLFocusMgr::removeMouseCaptureWithoutCallback( const LLMouseHandler* captor | |||
258 | { | 258 | { |
259 | mMouseCaptor = NULL; | 259 | mMouseCaptor = NULL; |
260 | #ifdef _DEBUG | 260 | #ifdef _DEBUG |
261 | mMouseCaptorName = "none"; | 261 | mMouseCaptorName = std::string("none"); |
262 | #endif | 262 | #endif |
263 | } | 263 | } |
264 | } | 264 | } |
@@ -289,7 +289,7 @@ void LLFocusMgr::setTopCtrl( LLUICtrl* new_top ) | |||
289 | mTopCtrl = new_top; | 289 | mTopCtrl = new_top; |
290 | 290 | ||
291 | #ifdef _DEBUG | 291 | #ifdef _DEBUG |
292 | mTopCtrlName = new_top ? new_top->getName() : "none"; | 292 | mTopCtrlName = new_top ? new_top->getName() : std::string("none"); |
293 | #endif | 293 | #endif |
294 | 294 | ||
295 | if (old_top) | 295 | if (old_top) |
@@ -305,7 +305,7 @@ void LLFocusMgr::removeTopCtrlWithoutCallback( const LLUICtrl* top_view ) | |||
305 | { | 305 | { |
306 | mTopCtrl = NULL; | 306 | mTopCtrl = NULL; |
307 | #ifdef _DEBUG | 307 | #ifdef _DEBUG |
308 | mTopCtrlName = "none"; | 308 | mTopCtrlName = std::string("none"); |
309 | #endif | 309 | #endif |
310 | } | 310 | } |
311 | } | 311 | } |
diff --git a/linden/indra/llui/llfocusmgr.h b/linden/indra/llui/llfocusmgr.h index 49aba93..e1b3d88 100644 --- a/linden/indra/llui/llfocusmgr.h +++ b/linden/indra/llui/llfocusmgr.h | |||
@@ -114,9 +114,9 @@ private: | |||
114 | focus_history_map_t mFocusHistory; | 114 | focus_history_map_t mFocusHistory; |
115 | 115 | ||
116 | #ifdef _DEBUG | 116 | #ifdef _DEBUG |
117 | LLString mMouseCaptorName; | 117 | std::string mMouseCaptorName; |
118 | LLString mKeyboardFocusName; | 118 | std::string mKeyboardFocusName; |
119 | LLString mTopCtrlName; | 119 | std::string mTopCtrlName; |
120 | #endif | 120 | #endif |
121 | }; | 121 | }; |
122 | 122 | ||
diff --git a/linden/indra/llui/lliconctrl.cpp b/linden/indra/llui/lliconctrl.cpp index f35de85..6d1a678 100644 --- a/linden/indra/llui/lliconctrl.cpp +++ b/linden/indra/llui/lliconctrl.cpp | |||
@@ -44,7 +44,7 @@ const F32 RESOLUTION_BUMP = 1.f; | |||
44 | 44 | ||
45 | static LLRegisterWidget<LLIconCtrl> r("icon"); | 45 | static LLRegisterWidget<LLIconCtrl> r("icon"); |
46 | 46 | ||
47 | LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &image_id) | 47 | LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id) |
48 | : LLUICtrl(name, | 48 | : LLUICtrl(name, |
49 | rect, | 49 | rect, |
50 | FALSE, // mouse opaque | 50 | FALSE, // mouse opaque |
@@ -56,7 +56,7 @@ LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &i | |||
56 | setTabStop(FALSE); | 56 | setTabStop(FALSE); |
57 | } | 57 | } |
58 | 58 | ||
59 | LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLString &image_name) | 59 | LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name) |
60 | : LLUICtrl(name, | 60 | : LLUICtrl(name, |
61 | rect, | 61 | rect, |
62 | FALSE, // mouse opaque | 62 | FALSE, // mouse opaque |
@@ -76,7 +76,7 @@ LLIconCtrl::~LLIconCtrl() | |||
76 | } | 76 | } |
77 | 77 | ||
78 | 78 | ||
79 | void LLIconCtrl::setImage(const LLString& image_name) | 79 | void LLIconCtrl::setImage(const std::string& image_name) |
80 | { | 80 | { |
81 | //RN: support UUIDs masquerading as strings | 81 | //RN: support UUIDs masquerading as strings |
82 | if (LLUUID::validate(image_name)) | 82 | if (LLUUID::validate(image_name)) |
@@ -148,13 +148,13 @@ LLXMLNodePtr LLIconCtrl::getXML(bool save_children) const | |||
148 | 148 | ||
149 | LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 149 | LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
150 | { | 150 | { |
151 | LLString name("icon"); | 151 | std::string name("icon"); |
152 | node->getAttributeString("name", name); | 152 | node->getAttributeString("name", name); |
153 | 153 | ||
154 | LLRect rect; | 154 | LLRect rect; |
155 | createRect(node, rect, parent, LLRect()); | 155 | createRect(node, rect, parent, LLRect()); |
156 | 156 | ||
157 | LLString image_name; | 157 | std::string image_name; |
158 | if (node->hasAttribute("image_name")) | 158 | if (node->hasAttribute("image_name")) |
159 | { | 159 | { |
160 | node->getAttributeString("image_name", image_name); | 160 | node->getAttributeString("image_name", image_name); |
diff --git a/linden/indra/llui/lliconctrl.h b/linden/indra/llui/lliconctrl.h index 055b504..5cb8e98 100644 --- a/linden/indra/llui/lliconctrl.h +++ b/linden/indra/llui/lliconctrl.h | |||
@@ -48,17 +48,17 @@ class LLIconCtrl | |||
48 | : public LLUICtrl | 48 | : public LLUICtrl |
49 | { | 49 | { |
50 | public: | 50 | public: |
51 | LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &image_id); | 51 | LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id); |
52 | LLIconCtrl(const LLString& name, const LLRect &rect, const LLString &image_name); | 52 | LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name); |
53 | virtual ~LLIconCtrl(); | 53 | virtual ~LLIconCtrl(); |
54 | 54 | ||
55 | // llview overrides | 55 | // llview overrides |
56 | virtual void draw(); | 56 | virtual void draw(); |
57 | 57 | ||
58 | void setImage(const LLString& image_name); | 58 | void setImage(const std::string& image_name); |
59 | void setImage(const LLUUID& image_name); | 59 | void setImage(const LLUUID& image_name); |
60 | const LLUUID &getImage() const { return mImageID; } | 60 | const LLUUID &getImage() const { return mImageID; } |
61 | LLString getImageName() const { return mImageName; } | 61 | std::string getImageName() const { return mImageName; } |
62 | 62 | ||
63 | // Takes a UUID, wraps get/setImage | 63 | // Takes a UUID, wraps get/setImage |
64 | virtual void setValue(const LLSD& value ); | 64 | virtual void setValue(const LLSD& value ); |
@@ -71,7 +71,7 @@ public: | |||
71 | 71 | ||
72 | private: | 72 | private: |
73 | LLColor4 mColor; | 73 | LLColor4 mColor; |
74 | LLString mImageName; | 74 | std::string mImageName; |
75 | LLUUID mImageID; | 75 | LLUUID mImageID; |
76 | LLPointer<LLUIImage> mImagep; | 76 | LLPointer<LLUIImage> mImagep; |
77 | }; | 77 | }; |
diff --git a/linden/indra/llui/llkeywords.cpp b/linden/indra/llui/llkeywords.cpp index d5d0d23..35f032a 100644 --- a/linden/indra/llui/llkeywords.cpp +++ b/linden/indra/llui/llkeywords.cpp | |||
@@ -69,7 +69,7 @@ LLKeywords::~LLKeywords() | |||
69 | std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer()); | 69 | std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer()); |
70 | } | 70 | } |
71 | 71 | ||
72 | BOOL LLKeywords::loadFromFile( const LLString& filename ) | 72 | BOOL LLKeywords::loadFromFile( const std::string& filename ) |
73 | { | 73 | { |
74 | mLoaded = FALSE; | 74 | mLoaded = FALSE; |
75 | 75 | ||
@@ -80,7 +80,7 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) | |||
80 | char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */ | 80 | char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */ |
81 | 81 | ||
82 | llifstream file; | 82 | llifstream file; |
83 | file.open(filename.c_str()); /* Flawfinder: ignore */ | 83 | file.open(filename); /* Flawfinder: ignore */ |
84 | if( file.fail() ) | 84 | if( file.fail() ) |
85 | { | 85 | { |
86 | llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl; | 86 | llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl; |
@@ -106,52 +106,51 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) | |||
106 | } | 106 | } |
107 | 107 | ||
108 | // start of line (SOL) | 108 | // start of line (SOL) |
109 | const char SOL_COMMENT[] = "#"; | 109 | std::string SOL_COMMENT("#"); |
110 | const char SOL_WORD[] = "[word "; | 110 | std::string SOL_WORD("[word "); |
111 | const char SOL_LINE[] = "[line "; | 111 | std::string SOL_LINE("[line "); |
112 | const char SOL_ONE_SIDED_DELIMITER[] = "[one_sided_delimiter "; | 112 | std::string SOL_ONE_SIDED_DELIMITER("[one_sided_delimiter "); |
113 | const char SOL_TWO_SIDED_DELIMITER[] = "[two_sided_delimiter "; | 113 | std::string SOL_TWO_SIDED_DELIMITER("[two_sided_delimiter "); |
114 | 114 | ||
115 | LLColor3 cur_color( 1, 0, 0 ); | 115 | LLColor3 cur_color( 1, 0, 0 ); |
116 | LLKeywordToken::TOKEN_TYPE cur_type = LLKeywordToken::WORD; | 116 | LLKeywordToken::TOKEN_TYPE cur_type = LLKeywordToken::WORD; |
117 | 117 | ||
118 | while (!file.eof()) | 118 | while (!file.eof()) |
119 | { | 119 | { |
120 | buffer[0] = 0; | ||
120 | file.getline( buffer, BUFFER_SIZE ); | 121 | file.getline( buffer, BUFFER_SIZE ); |
121 | if( !strncmp( buffer, SOL_COMMENT, strlen(SOL_COMMENT) ) ) /* Flawfinder: ignore */ | 122 | std::string line(buffer); |
123 | if( line.find(SOL_COMMENT) == 0 ) | ||
122 | { | 124 | { |
123 | continue; | 125 | continue; |
124 | } | 126 | } |
125 | else | 127 | else if( line.find(SOL_WORD) == 0 ) |
126 | if( !strncmp( buffer, SOL_WORD, strlen(SOL_WORD) ) ) /* Flawfinder: ignore */ | ||
127 | { | 128 | { |
128 | cur_color = readColor( buffer + strlen(SOL_WORD) ); /* Flawfinder: ignore */ | 129 | cur_color = readColor( line.substr(SOL_WORD.size()) ); |
129 | cur_type = LLKeywordToken::WORD; | 130 | cur_type = LLKeywordToken::WORD; |
130 | continue; | 131 | continue; |
131 | } | 132 | } |
132 | else | 133 | else if( line.find(SOL_LINE) == 0 ) |
133 | if( !strncmp( buffer, SOL_LINE, strlen(SOL_LINE) ) ) /* Flawfinder: ignore */ | ||
134 | { | 134 | { |
135 | cur_color = readColor( buffer + strlen(SOL_LINE) ); /* Flawfinder: ignore */ | 135 | cur_color = readColor( line.substr(SOL_LINE.size()) ); |
136 | cur_type = LLKeywordToken::LINE; | 136 | cur_type = LLKeywordToken::LINE; |
137 | continue; | 137 | continue; |
138 | } | 138 | } |
139 | else | 139 | else if( line.find(SOL_TWO_SIDED_DELIMITER) == 0 ) |
140 | if( !strncmp( buffer, SOL_TWO_SIDED_DELIMITER, strlen(SOL_TWO_SIDED_DELIMITER) ) ) /* Flawfinder: ignore */ | ||
141 | { | 140 | { |
142 | cur_color = readColor( buffer + strlen(SOL_TWO_SIDED_DELIMITER) ); /* Flawfinder: ignore */ | 141 | cur_color = readColor( line.substr(SOL_TWO_SIDED_DELIMITER.size()) ); |
143 | cur_type = LLKeywordToken::TWO_SIDED_DELIMITER; | 142 | cur_type = LLKeywordToken::TWO_SIDED_DELIMITER; |
144 | continue; | 143 | continue; |
145 | } | 144 | } |
146 | if( !strncmp( buffer, SOL_ONE_SIDED_DELIMITER, strlen(SOL_ONE_SIDED_DELIMITER) ) ) /* Flawfinder: ignore */ | 145 | else if( line.find(SOL_ONE_SIDED_DELIMITER) == 0 ) |
147 | { | 146 | { |
148 | cur_color = readColor( buffer + strlen(SOL_ONE_SIDED_DELIMITER) ); /* Flawfinder: ignore */ | 147 | cur_color = readColor( line.substr(SOL_ONE_SIDED_DELIMITER.size()) ); |
149 | cur_type = LLKeywordToken::ONE_SIDED_DELIMITER; | 148 | cur_type = LLKeywordToken::ONE_SIDED_DELIMITER; |
150 | continue; | 149 | continue; |
151 | } | 150 | } |
152 | 151 | ||
153 | LLString token_buffer( buffer ); | 152 | std::string token_buffer( line ); |
154 | LLString::trim(token_buffer); | 153 | LLStringUtil::trim(token_buffer); |
155 | 154 | ||
156 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 155 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; |
157 | boost::char_separator<char> sep_word("", " \t"); | 156 | boost::char_separator<char> sep_word("", " \t"); |
@@ -161,26 +160,26 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) | |||
161 | if( !token_buffer.empty() && token_word_iter != word_tokens.end() ) | 160 | if( !token_buffer.empty() && token_word_iter != word_tokens.end() ) |
162 | { | 161 | { |
163 | // first word is keyword | 162 | // first word is keyword |
164 | LLString keyword = (*token_word_iter); | 163 | std::string keyword = (*token_word_iter); |
165 | LLString::trim(keyword); | 164 | LLStringUtil::trim(keyword); |
166 | 165 | ||
167 | // following words are tooltip | 166 | // following words are tooltip |
168 | LLString tool_tip; | 167 | std::string tool_tip; |
169 | while (++token_word_iter != word_tokens.end()) | 168 | while (++token_word_iter != word_tokens.end()) |
170 | { | 169 | { |
171 | tool_tip += (*token_word_iter); | 170 | tool_tip += (*token_word_iter); |
172 | } | 171 | } |
173 | LLString::trim(tool_tip); | 172 | LLStringUtil::trim(tool_tip); |
174 | 173 | ||
175 | if( !tool_tip.empty() ) | 174 | if( !tool_tip.empty() ) |
176 | { | 175 | { |
177 | // Replace : with \n for multi-line tool tips. | 176 | // Replace : with \n for multi-line tool tips. |
178 | LLString::replaceChar( tool_tip, ':', '\n' ); | 177 | LLStringUtil::replaceChar( tool_tip, ':', '\n' ); |
179 | addToken(cur_type, keyword, cur_color, tool_tip ); | 178 | addToken(cur_type, keyword, cur_color, tool_tip ); |
180 | } | 179 | } |
181 | else | 180 | else |
182 | { | 181 | { |
183 | addToken(cur_type, keyword, cur_color, NULL ); | 182 | addToken(cur_type, keyword, cur_color, LLStringUtil::null ); |
184 | } | 183 | } |
185 | } | 184 | } |
186 | } | 185 | } |
@@ -193,9 +192,9 @@ BOOL LLKeywords::loadFromFile( const LLString& filename ) | |||
193 | 192 | ||
194 | // Add the token as described | 193 | // Add the token as described |
195 | void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type, | 194 | void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type, |
196 | const LLString& key_in, | 195 | const std::string& key_in, |
197 | const LLColor3& color, | 196 | const LLColor3& color, |
198 | const LLString& tool_tip_in ) | 197 | const std::string& tool_tip_in ) |
199 | { | 198 | { |
200 | LLWString key = utf8str_to_wstring(key_in); | 199 | LLWString key = utf8str_to_wstring(key_in); |
201 | LLWString tool_tip = utf8str_to_wstring(tool_tip_in); | 200 | LLWString tool_tip = utf8str_to_wstring(tool_tip_in); |
@@ -219,7 +218,7 @@ void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type, | |||
219 | } | 218 | } |
220 | } | 219 | } |
221 | 220 | ||
222 | LLColor3 LLKeywords::readColor( const LLString& s ) | 221 | LLColor3 LLKeywords::readColor( const std::string& s ) |
223 | { | 222 | { |
224 | F32 r, g, b; | 223 | F32 r, g, b; |
225 | r = g = b = 0.0f; | 224 | r = g = b = 0.0f; |
@@ -296,7 +295,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS | |||
296 | } | 295 | } |
297 | S32 seg_end = cur - base; | 296 | S32 seg_end = cur - base; |
298 | 297 | ||
299 | //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start) << "]" << llendl; | ||
300 | LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end ); | 298 | LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end ); |
301 | text_segment->setToken( cur_token ); | 299 | text_segment->setToken( cur_token ); |
302 | insertSegment( seg_list, text_segment, text_len, defaultColor); | 300 | insertSegment( seg_list, text_segment, text_len, defaultColor); |
@@ -406,7 +404,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS | |||
406 | } | 404 | } |
407 | 405 | ||
408 | 406 | ||
409 | //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start ) << "]" << llendl; | ||
410 | LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end ); | 407 | LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end ); |
411 | text_segment->setToken( cur_delimiter ); | 408 | text_segment->setToken( cur_delimiter ); |
412 | insertSegment( seg_list, text_segment, text_len, defaultColor); | 409 | insertSegment( seg_list, text_segment, text_len, defaultColor); |
@@ -518,7 +515,7 @@ void LLKeywordToken::dump() | |||
518 | mColor.mV[VX] << ", " << | 515 | mColor.mV[VX] << ", " << |
519 | mColor.mV[VY] << ", " << | 516 | mColor.mV[VY] << ", " << |
520 | mColor.mV[VZ] << "] [" << | 517 | mColor.mV[VZ] << "] [" << |
521 | mToken.c_str() << "]" << | 518 | wstring_to_utf8str(mToken) << "]" << |
522 | llendl; | 519 | llendl; |
523 | } | 520 | } |
524 | 521 | ||
diff --git a/linden/indra/llui/llkeywords.h b/linden/indra/llui/llkeywords.h index 61c3c57..e3361f6 100644 --- a/linden/indra/llui/llkeywords.h +++ b/linden/indra/llui/llkeywords.h | |||
@@ -80,16 +80,16 @@ public: | |||
80 | LLKeywords(); | 80 | LLKeywords(); |
81 | ~LLKeywords(); | 81 | ~LLKeywords(); |
82 | 82 | ||
83 | BOOL loadFromFile(const LLString& filename); | 83 | BOOL loadFromFile(const std::string& filename); |
84 | BOOL isLoaded() const { return mLoaded; } | 84 | BOOL isLoaded() const { return mLoaded; } |
85 | 85 | ||
86 | void findSegments(std::vector<LLTextSegment *> *seg_list, const LLWString& text, const LLColor4 &defaultColor ); | 86 | void findSegments(std::vector<LLTextSegment *> *seg_list, const LLWString& text, const LLColor4 &defaultColor ); |
87 | 87 | ||
88 | // Add the token as described | 88 | // Add the token as described |
89 | void addToken(LLKeywordToken::TOKEN_TYPE type, | 89 | void addToken(LLKeywordToken::TOKEN_TYPE type, |
90 | const LLString& key, | 90 | const std::string& key, |
91 | const LLColor3& color, | 91 | const LLColor3& color, |
92 | const LLString& tool_tip = LLString::null); | 92 | const std::string& tool_tip = LLStringUtil::null); |
93 | 93 | ||
94 | typedef std::map<LLWString, LLKeywordToken*> word_token_map_t; | 94 | typedef std::map<LLWString, LLKeywordToken*> word_token_map_t; |
95 | typedef word_token_map_t::const_iterator keyword_iterator_t; | 95 | typedef word_token_map_t::const_iterator keyword_iterator_t; |
@@ -101,7 +101,7 @@ public: | |||
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | private: | 103 | private: |
104 | LLColor3 readColor(const LLString& s); | 104 | LLColor3 readColor(const std::string& s); |
105 | void insertSegment(std::vector<LLTextSegment *> *seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor); | 105 | void insertSegment(std::vector<LLTextSegment *> *seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor); |
106 | 106 | ||
107 | BOOL mLoaded; | 107 | BOOL mLoaded; |
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index a12c9d8..12d1929 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp | |||
@@ -39,7 +39,6 @@ | |||
39 | #include "llmath.h" | 39 | #include "llmath.h" |
40 | #include "llfontgl.h" | 40 | #include "llfontgl.h" |
41 | #include "llgl.h" | 41 | #include "llgl.h" |
42 | #include "sound_ids.h" | ||
43 | #include "lltimer.h" | 42 | #include "lltimer.h" |
44 | 43 | ||
45 | //#include "llclipboard.h" | 44 | //#include "llclipboard.h" |
@@ -88,8 +87,8 @@ static LLRegisterWidget<LLLineEditor> r1("line_editor"); | |||
88 | // Member functions | 87 | // Member functions |
89 | // | 88 | // |
90 | 89 | ||
91 | LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, | 90 | LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect, |
92 | const LLString& default_text, const LLFontGL* font, | 91 | const std::string& default_text, const LLFontGL* font, |
93 | S32 max_length_bytes, | 92 | S32 max_length_bytes, |
94 | void (*commit_callback)(LLUICtrl* caller, void* user_data ), | 93 | void (*commit_callback)(LLUICtrl* caller, void* user_data ), |
95 | void (*keystroke_callback)(LLLineEditor* caller, void* user_data ), | 94 | void (*keystroke_callback)(LLLineEditor* caller, void* user_data ), |
@@ -167,7 +166,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, | |||
167 | // Scalable UI somehow made these rectangles off-by-one. | 166 | // Scalable UI somehow made these rectangles off-by-one. |
168 | // I don't know why. JC | 167 | // I don't know why. JC |
169 | LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0); | 168 | LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0); |
170 | mBorder = new LLViewBorder( "line ed border", border_rect, border_bevel, border_style, mBorderThickness ); | 169 | mBorder = new LLViewBorder( std::string("line ed border"), border_rect, border_bevel, border_style, mBorderThickness ); |
171 | addChild( mBorder ); | 170 | addChild( mBorder ); |
172 | mBorder->setFollows(FOLLOWS_LEFT|FOLLOWS_RIGHT|FOLLOWS_TOP|FOLLOWS_BOTTOM); | 171 | mBorder->setFollows(FOLLOWS_LEFT|FOLLOWS_RIGHT|FOLLOWS_TOP|FOLLOWS_BOTTOM); |
173 | 172 | ||
@@ -299,7 +298,7 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) | |||
299 | // also consider entire string selected when mSelectAllonFocusReceived is set on an empty, focused line editor | 298 | // also consider entire string selected when mSelectAllonFocusReceived is set on an empty, focused line editor |
300 | all_selected = all_selected || (len == 0 && hasFocus() && mSelectAllonFocusReceived); | 299 | all_selected = all_selected || (len == 0 && hasFocus() && mSelectAllonFocusReceived); |
301 | 300 | ||
302 | LLString truncated_utf8 = new_text; | 301 | std::string truncated_utf8 = new_text; |
303 | if (truncated_utf8.size() > (U32)mMaxLengthBytes) | 302 | if (truncated_utf8.size() > (U32)mMaxLengthBytes) |
304 | { | 303 | { |
305 | truncated_utf8 = utf8str_truncate(new_text, mMaxLengthBytes); | 304 | truncated_utf8 = utf8str_truncate(new_text, mMaxLengthBytes); |
@@ -960,9 +959,9 @@ void LLLineEditor::paste() | |||
960 | 959 | ||
961 | // Clean up string (replace tabs and returns and remove characters that our fonts don't support.) | 960 | // Clean up string (replace tabs and returns and remove characters that our fonts don't support.) |
962 | LLWString clean_string(paste); | 961 | LLWString clean_string(paste); |
963 | LLWString::replaceTabsWithSpaces(clean_string, 1); | 962 | LLWStringUtil::replaceTabsWithSpaces(clean_string, 1); |
964 | //clean_string = wstring_detabify(paste, 1); | 963 | //clean_string = wstring_detabify(paste, 1); |
965 | LLWString::replaceChar(clean_string, '\n', mReplaceNewlinesWithSpaces ? ' ' : 182); // 182 == paragraph character | 964 | LLWStringUtil::replaceChar(clean_string, '\n', mReplaceNewlinesWithSpaces ? ' ' : 182); // 182 == paragraph character |
966 | 965 | ||
967 | // Insert the string | 966 | // Insert the string |
968 | 967 | ||
@@ -1396,11 +1395,11 @@ void LLLineEditor::draw() | |||
1396 | { | 1395 | { |
1397 | S32 text_len = mText.length(); | 1396 | S32 text_len = mText.length(); |
1398 | 1397 | ||
1399 | LLString saved_text; | 1398 | std::string saved_text; |
1400 | if (mDrawAsterixes) | 1399 | if (mDrawAsterixes) |
1401 | { | 1400 | { |
1402 | saved_text = mText.getString(); | 1401 | saved_text = mText.getString(); |
1403 | LLString text; | 1402 | std::string text; |
1404 | for (S32 i = 0; i < mText.length(); i++) | 1403 | for (S32 i = 0; i < mText.length(); i++) |
1405 | { | 1404 | { |
1406 | text += '*'; | 1405 | text += '*'; |
@@ -1595,7 +1594,7 @@ void LLLineEditor::draw() | |||
1595 | S32 cursor_right = cursor_left + UI_LINEEDITOR_CURSOR_THICKNESS; | 1594 | S32 cursor_right = cursor_left + UI_LINEEDITOR_CURSOR_THICKNESS; |
1596 | if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) | 1595 | if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) |
1597 | { | 1596 | { |
1598 | const LLWString space(utf8str_to_wstring(LLString(" "))); | 1597 | const LLWString space(utf8str_to_wstring(std::string(" "))); |
1599 | S32 wswidth = mGLFont->getWidth(space.c_str()); | 1598 | S32 wswidth = mGLFont->getWidth(space.c_str()); |
1600 | S32 width = mGLFont->getWidth(mText.getWString().c_str(), getCursor(), 1) + 1; | 1599 | S32 width = mGLFont->getWidth(mText.getWString().c_str(), getCursor(), 1) + 1; |
1601 | cursor_right = cursor_left + llmax(wswidth, width); | 1600 | cursor_right = cursor_left + llmax(wswidth, width); |
@@ -1623,6 +1622,23 @@ void LLLineEditor::draw() | |||
1623 | } | 1622 | } |
1624 | } | 1623 | } |
1625 | 1624 | ||
1625 | //draw label if no text is provided | ||
1626 | //but we should draw it in a different color | ||
1627 | //to give indication that it is not text you typed in | ||
1628 | if (0 == mText.length() && mReadOnly) | ||
1629 | { | ||
1630 | mGLFont->render(mLabel.getWString(), 0, | ||
1631 | mMinHPixels, (F32)text_bottom, | ||
1632 | label_color, | ||
1633 | LLFontGL::LEFT, | ||
1634 | LLFontGL::BOTTOM, | ||
1635 | LLFontGL::NORMAL, | ||
1636 | S32_MAX, | ||
1637 | mMaxHPixels - llround(rendered_pixels_right), | ||
1638 | &rendered_pixels_right, FALSE); | ||
1639 | } | ||
1640 | |||
1641 | |||
1626 | // Draw children (border) | 1642 | // Draw children (border) |
1627 | //mBorder->setVisible(TRUE); | 1643 | //mBorder->setVisible(TRUE); |
1628 | mBorder->setKeyboardFocusHighlight( TRUE ); | 1644 | mBorder->setKeyboardFocusHighlight( TRUE ); |
@@ -1635,10 +1651,11 @@ void LLLineEditor::draw() | |||
1635 | // draw label if no text provided | 1651 | // draw label if no text provided |
1636 | if (0 == mText.length()) | 1652 | if (0 == mText.length()) |
1637 | { | 1653 | { |
1638 | mGLFont->render(mLabel.getWString(), 0, | 1654 | mGLFont->render(mLabel.getWString(), 0, |
1639 | mMinHPixels, (F32)text_bottom, | 1655 | mMinHPixels, (F32)text_bottom, |
1640 | label_color, | 1656 | label_color, |
1641 | LLFontGL::LEFT, LLFontGL::BOTTOM, | 1657 | LLFontGL::LEFT, |
1658 | LLFontGL::BOTTOM, | ||
1642 | LLFontGL::NORMAL, | 1659 | LLFontGL::NORMAL, |
1643 | S32_MAX, | 1660 | S32_MAX, |
1644 | mMaxHPixels - llround(rendered_pixels_right), | 1661 | mMaxHPixels - llround(rendered_pixels_right), |
@@ -1772,7 +1789,7 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) | |||
1772 | 1789 | ||
1773 | BOOL success = TRUE; | 1790 | BOOL success = TRUE; |
1774 | LLWString trimmed = str; | 1791 | LLWString trimmed = str; |
1775 | LLWString::trim(trimmed); | 1792 | LLWStringUtil::trim(trimmed); |
1776 | S32 len = trimmed.length(); | 1793 | S32 len = trimmed.length(); |
1777 | if( 0 < len ) | 1794 | if( 0 < len ) |
1778 | { | 1795 | { |
@@ -1804,7 +1821,7 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) | |||
1804 | BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } | 1821 | BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } |
1805 | 1822 | ||
1806 | // static | 1823 | // static |
1807 | BOOL LLLineEditor::postvalidateFloat(const LLString &str) | 1824 | BOOL LLLineEditor::postvalidateFloat(const std::string &str) |
1808 | { | 1825 | { |
1809 | LLLocale locale(LLLocale::USER_LOCALE); | 1826 | LLLocale locale(LLLocale::USER_LOCALE); |
1810 | 1827 | ||
@@ -1813,7 +1830,7 @@ BOOL LLLineEditor::postvalidateFloat(const LLString &str) | |||
1813 | BOOL has_digit = FALSE; | 1830 | BOOL has_digit = FALSE; |
1814 | 1831 | ||
1815 | LLWString trimmed = utf8str_to_wstring(str); | 1832 | LLWString trimmed = utf8str_to_wstring(str); |
1816 | LLWString::trim(trimmed); | 1833 | LLWStringUtil::trim(trimmed); |
1817 | S32 len = trimmed.length(); | 1834 | S32 len = trimmed.length(); |
1818 | if( 0 < len ) | 1835 | if( 0 < len ) |
1819 | { | 1836 | { |
@@ -1873,7 +1890,7 @@ BOOL LLLineEditor::prevalidateInt(const LLWString &str) | |||
1873 | 1890 | ||
1874 | BOOL success = TRUE; | 1891 | BOOL success = TRUE; |
1875 | LLWString trimmed = str; | 1892 | LLWString trimmed = str; |
1876 | LLWString::trim(trimmed); | 1893 | LLWStringUtil::trim(trimmed); |
1877 | S32 len = trimmed.length(); | 1894 | S32 len = trimmed.length(); |
1878 | if( 0 < len ) | 1895 | if( 0 < len ) |
1879 | { | 1896 | { |
@@ -1904,7 +1921,7 @@ BOOL LLLineEditor::prevalidatePositiveS32(const LLWString &str) | |||
1904 | LLLocale locale(LLLocale::USER_LOCALE); | 1921 | LLLocale locale(LLLocale::USER_LOCALE); |
1905 | 1922 | ||
1906 | LLWString trimmed = str; | 1923 | LLWString trimmed = str; |
1907 | LLWString::trim(trimmed); | 1924 | LLWStringUtil::trim(trimmed); |
1908 | S32 len = trimmed.length(); | 1925 | S32 len = trimmed.length(); |
1909 | BOOL success = TRUE; | 1926 | BOOL success = TRUE; |
1910 | if(0 < len) | 1927 | if(0 < len) |
@@ -1938,7 +1955,7 @@ BOOL LLLineEditor::prevalidateNonNegativeS32(const LLWString &str) | |||
1938 | LLLocale locale(LLLocale::USER_LOCALE); | 1955 | LLLocale locale(LLLocale::USER_LOCALE); |
1939 | 1956 | ||
1940 | LLWString trimmed = str; | 1957 | LLWString trimmed = str; |
1941 | LLWString::trim(trimmed); | 1958 | LLWStringUtil::trim(trimmed); |
1942 | S32 len = trimmed.length(); | 1959 | S32 len = trimmed.length(); |
1943 | BOOL success = TRUE; | 1960 | BOOL success = TRUE; |
1944 | if(0 < len) | 1961 | if(0 < len) |
@@ -2093,7 +2110,7 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const | |||
2093 | 2110 | ||
2094 | if (mBorder) | 2111 | if (mBorder) |
2095 | { | 2112 | { |
2096 | LLString bevel; | 2113 | std::string bevel; |
2097 | switch(mBorder->getBevel()) | 2114 | switch(mBorder->getBevel()) |
2098 | { | 2115 | { |
2099 | default: | 2116 | default: |
@@ -2104,7 +2121,7 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const | |||
2104 | } | 2121 | } |
2105 | node->createChild("bevel_style", TRUE)->setStringValue(bevel); | 2122 | node->createChild("bevel_style", TRUE)->setStringValue(bevel); |
2106 | 2123 | ||
2107 | LLString style; | 2124 | std::string style; |
2108 | switch(mBorder->getStyle()) | 2125 | switch(mBorder->getStyle()) |
2109 | { | 2126 | { |
2110 | default: | 2127 | default: |
@@ -2141,7 +2158,7 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const | |||
2141 | // static | 2158 | // static |
2142 | LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 2159 | LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
2143 | { | 2160 | { |
2144 | LLString name("line_editor"); | 2161 | std::string name("line_editor"); |
2145 | node->getAttributeString("name", name); | 2162 | node->getAttributeString("name", name); |
2146 | 2163 | ||
2147 | LLRect rect; | 2164 | LLRect rect; |
@@ -2152,15 +2169,15 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
2152 | 2169 | ||
2153 | LLFontGL* font = LLView::selectFont(node); | 2170 | LLFontGL* font = LLView::selectFont(node); |
2154 | 2171 | ||
2155 | LLString text = node->getTextContents().substr(0, max_text_length - 1); | 2172 | std::string text = node->getTextContents().substr(0, max_text_length - 1); |
2156 | 2173 | ||
2157 | LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; | 2174 | LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; |
2158 | LLViewBorder::getBevelFromAttribute(node, bevel_style); | 2175 | LLViewBorder::getBevelFromAttribute(node, bevel_style); |
2159 | 2176 | ||
2160 | LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; | 2177 | LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; |
2161 | LLString border_string; | 2178 | std::string border_string; |
2162 | node->getAttributeString("border_style", border_string); | 2179 | node->getAttributeString("border_style", border_string); |
2163 | LLString::toLower(border_string); | 2180 | LLStringUtil::toLower(border_string); |
2164 | 2181 | ||
2165 | if (border_string == "texture") | 2182 | if (border_string == "texture") |
2166 | { | 2183 | { |
@@ -2186,7 +2203,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
2186 | border_style, | 2203 | border_style, |
2187 | border_thickness); | 2204 | border_thickness); |
2188 | 2205 | ||
2189 | LLString label; | 2206 | std::string label; |
2190 | if(node->getAttributeString("label", label)) | 2207 | if(node->getAttributeString("label", label)) |
2191 | { | 2208 | { |
2192 | line_editor->setLabel(label); | 2209 | line_editor->setLabel(label); |
@@ -2216,10 +2233,10 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
2216 | line_editor->setSelectAllonFocusReceived(selectall); | 2233 | line_editor->setSelectAllonFocusReceived(selectall); |
2217 | } | 2234 | } |
2218 | 2235 | ||
2219 | LLString prevalidate; | 2236 | std::string prevalidate; |
2220 | if(node->getAttributeString("prevalidate", prevalidate)) | 2237 | if(node->getAttributeString("prevalidate", prevalidate)) |
2221 | { | 2238 | { |
2222 | LLString::toLower(prevalidate); | 2239 | LLStringUtil::toLower(prevalidate); |
2223 | 2240 | ||
2224 | if ("ascii" == prevalidate) | 2241 | if ("ascii" == prevalidate) |
2225 | { | 2242 | { |
@@ -2271,11 +2288,11 @@ void LLLineEditor::cleanupClass() | |||
2271 | } | 2288 | } |
2272 | 2289 | ||
2273 | /* static */ | 2290 | /* static */ |
2274 | LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def) | 2291 | LLPointer<LLUIImage> LLLineEditor::parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def) |
2275 | { | 2292 | { |
2276 | LLString xml_name; | 2293 | std::string xml_name; |
2277 | if (from->hasAttribute(name)) from->getAttributeString(name, xml_name); | 2294 | if (from->hasAttribute(name.c_str())) from->getAttributeString(name.c_str(), xml_name); |
2278 | if (xml_name == LLString::null) return def; | 2295 | if (xml_name == LLStringUtil::null) return def; |
2279 | LLPointer<LLUIImage> image = LLUI::getUIImage(xml_name); | 2296 | LLPointer<LLUIImage> image = LLUI::getUIImage(xml_name); |
2280 | return image.isNull() ? def : image; | 2297 | return image.isNull() ? def : image; |
2281 | } | 2298 | } |
@@ -2283,7 +2300,7 @@ LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, | |||
2283 | void LLLineEditor::setColorParameters(LLXMLNodePtr node) | 2300 | void LLLineEditor::setColorParameters(LLXMLNodePtr node) |
2284 | { | 2301 | { |
2285 | // overrides default image if supplied. | 2302 | // overrides default image if supplied. |
2286 | mImage = parseImage("image", node, mImage); | 2303 | mImage = parseImage(std::string("image"), node, mImage); |
2287 | 2304 | ||
2288 | LLColor4 color; | 2305 | LLColor4 color; |
2289 | if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) | 2306 | if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) |
@@ -2316,13 +2333,13 @@ void LLLineEditor::setColorParameters(LLXMLNodePtr node) | |||
2316 | } | 2333 | } |
2317 | } | 2334 | } |
2318 | 2335 | ||
2319 | BOOL LLLineEditor::setTextArg( const LLString& key, const LLStringExplicit& text ) | 2336 | BOOL LLLineEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) |
2320 | { | 2337 | { |
2321 | mText.setArg(key, text); | 2338 | mText.setArg(key, text); |
2322 | return TRUE; | 2339 | return TRUE; |
2323 | } | 2340 | } |
2324 | 2341 | ||
2325 | BOOL LLLineEditor::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 2342 | BOOL LLLineEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
2326 | { | 2343 | { |
2327 | mLabel.setArg(key, text); | 2344 | mLabel.setArg(key, text); |
2328 | return TRUE; | 2345 | return TRUE; |
@@ -2553,28 +2570,39 @@ void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace) | |||
2553 | mReplaceNewlinesWithSpaces = replace; | 2570 | mReplaceNewlinesWithSpaces = replace; |
2554 | } | 2571 | } |
2555 | 2572 | ||
2573 | LLWString LLLineEditor::getConvertedText() const | ||
2574 | { | ||
2575 | LLWString text = getWText(); | ||
2576 | LLWStringUtil::trim(text); | ||
2577 | if (!mReplaceNewlinesWithSpaces) | ||
2578 | { | ||
2579 | LLWStringUtil::replaceChar(text,182,'\n'); // Convert paragraph symbols back into newlines. | ||
2580 | } | ||
2581 | return text; | ||
2582 | } | ||
2583 | |||
2556 | static LLRegisterWidget<LLSearchEditor> r2("search_editor"); | 2584 | static LLRegisterWidget<LLSearchEditor> r2("search_editor"); |
2557 | 2585 | ||
2558 | 2586 | ||
2559 | LLSearchEditor::LLSearchEditor(const LLString& name, | 2587 | LLSearchEditor::LLSearchEditor(const std::string& name, |
2560 | const LLRect& rect, | 2588 | const LLRect& rect, |
2561 | S32 max_length_bytes, | 2589 | S32 max_length_bytes, |
2562 | void (*search_callback)(const LLString& search_string, void* user_data), | 2590 | void (*search_callback)(const std::string& search_string, void* user_data), |
2563 | void* userdata) | 2591 | void* userdata) |
2564 | : | 2592 | : |
2565 | LLUICtrl(name, rect, TRUE, NULL, userdata), | 2593 | LLUICtrl(name, rect, TRUE, NULL, userdata), |
2566 | mSearchCallback(search_callback) | 2594 | mSearchCallback(search_callback) |
2567 | { | 2595 | { |
2568 | LLRect search_edit_rect(0, getRect().getHeight(), getRect().getWidth(), 0); | 2596 | LLRect search_edit_rect(0, getRect().getHeight(), getRect().getWidth(), 0); |
2569 | mSearchEdit = new LLLineEditor("search edit", | 2597 | mSearchEdit = new LLLineEditor(std::string("search edit"), |
2570 | search_edit_rect, | 2598 | search_edit_rect, |
2571 | LLString::null, | 2599 | LLStringUtil::null, |
2572 | NULL, | 2600 | NULL, |
2573 | max_length_bytes, | 2601 | max_length_bytes, |
2574 | NULL, | 2602 | NULL, |
2575 | onSearchEdit, | 2603 | onSearchEdit, |
2576 | NULL, | 2604 | NULL, |
2577 | this); | 2605 | this); |
2578 | 2606 | ||
2579 | mSearchEdit->setFollowsAll(); | 2607 | mSearchEdit->setFollowsAll(); |
2580 | mSearchEdit->setSelectAllonFocusReceived(TRUE); | 2608 | mSearchEdit->setSelectAllonFocusReceived(TRUE); |
@@ -2583,15 +2611,15 @@ LLSearchEditor::LLSearchEditor(const LLString& name, | |||
2583 | 2611 | ||
2584 | S32 btn_width = rect.getHeight(); // button is square, and as tall as search editor | 2612 | S32 btn_width = rect.getHeight(); // button is square, and as tall as search editor |
2585 | LLRect clear_btn_rect(rect.getWidth() - btn_width, rect.getHeight(), rect.getWidth(), 0); | 2613 | LLRect clear_btn_rect(rect.getWidth() - btn_width, rect.getHeight(), rect.getWidth(), 0); |
2586 | mClearSearchButton = new LLButton("clear search", | 2614 | mClearSearchButton = new LLButton(std::string("clear search"), |
2587 | clear_btn_rect, | 2615 | clear_btn_rect, |
2588 | "icn_clear_lineeditor.tga", | 2616 | std::string("icn_clear_lineeditor.tga"), |
2589 | "UIImgBtnCloseInactiveUUID", | 2617 | std::string("UIImgBtnCloseInactiveUUID"), |
2590 | LLString::null, | 2618 | LLStringUtil::null, |
2591 | onClearSearch, | 2619 | onClearSearch, |
2592 | this, | 2620 | this, |
2593 | NULL, | 2621 | NULL, |
2594 | LLString::null); | 2622 | LLStringUtil::null); |
2595 | mClearSearchButton->setFollowsRight(); | 2623 | mClearSearchButton->setFollowsRight(); |
2596 | mClearSearchButton->setFollowsTop(); | 2624 | mClearSearchButton->setFollowsTop(); |
2597 | mClearSearchButton->setImageColor(LLUI::sColorsGroup->getColor("TextFgTentativeColor")); | 2625 | mClearSearchButton->setImageColor(LLUI::sColorsGroup->getColor("TextFgTentativeColor")); |
@@ -2615,13 +2643,13 @@ LLSD LLSearchEditor::getValue() const | |||
2615 | } | 2643 | } |
2616 | 2644 | ||
2617 | //virtual | 2645 | //virtual |
2618 | BOOL LLSearchEditor::setTextArg( const LLString& key, const LLStringExplicit& text ) | 2646 | BOOL LLSearchEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) |
2619 | { | 2647 | { |
2620 | return mSearchEdit->setTextArg(key, text); | 2648 | return mSearchEdit->setTextArg(key, text); |
2621 | } | 2649 | } |
2622 | 2650 | ||
2623 | //virtual | 2651 | //virtual |
2624 | BOOL LLSearchEditor::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 2652 | BOOL LLSearchEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
2625 | { | 2653 | { |
2626 | return mSearchEdit->setLabelArg(key, text); | 2654 | return mSearchEdit->setLabelArg(key, text); |
2627 | } | 2655 | } |
@@ -2658,17 +2686,17 @@ void LLSearchEditor::onClearSearch(void* user_data) | |||
2658 | { | 2686 | { |
2659 | LLSearchEditor* search_editor = (LLSearchEditor*)user_data; | 2687 | LLSearchEditor* search_editor = (LLSearchEditor*)user_data; |
2660 | 2688 | ||
2661 | search_editor->setText(LLString::null); | 2689 | search_editor->setText(LLStringUtil::null); |
2662 | if (search_editor->mSearchCallback) | 2690 | if (search_editor->mSearchCallback) |
2663 | { | 2691 | { |
2664 | search_editor->mSearchCallback(LLString::null, search_editor->mCallbackUserData); | 2692 | search_editor->mSearchCallback(LLStringUtil::null, search_editor->mCallbackUserData); |
2665 | } | 2693 | } |
2666 | } | 2694 | } |
2667 | 2695 | ||
2668 | // static | 2696 | // static |
2669 | LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 2697 | LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
2670 | { | 2698 | { |
2671 | LLString name("search_editor"); | 2699 | std::string name("search_editor"); |
2672 | node->getAttributeString("name", name); | 2700 | node->getAttributeString("name", name); |
2673 | 2701 | ||
2674 | LLRect rect; | 2702 | LLRect rect; |
@@ -2677,14 +2705,14 @@ LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
2677 | S32 max_text_length = 128; | 2705 | S32 max_text_length = 128; |
2678 | node->getAttributeS32("max_length", max_text_length); | 2706 | node->getAttributeS32("max_length", max_text_length); |
2679 | 2707 | ||
2680 | LLString text = node->getValue().substr(0, max_text_length - 1); | 2708 | std::string text = node->getValue().substr(0, max_text_length - 1); |
2681 | 2709 | ||
2682 | LLSearchEditor* search_editor = new LLSearchEditor(name, | 2710 | LLSearchEditor* search_editor = new LLSearchEditor(name, |
2683 | rect, | 2711 | rect, |
2684 | max_text_length, | 2712 | max_text_length, |
2685 | NULL, NULL); | 2713 | NULL, NULL); |
2686 | 2714 | ||
2687 | LLString label; | 2715 | std::string label; |
2688 | if(node->getAttributeString("label", label)) | 2716 | if(node->getAttributeString("label", label)) |
2689 | { | 2717 | { |
2690 | search_editor->mSearchEdit->setLabel(label); | 2718 | search_editor->mSearchEdit->setLabel(label); |
diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index c96e34d..09a240b 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h | |||
@@ -63,9 +63,9 @@ class LLLineEditor | |||
63 | { | 63 | { |
64 | 64 | ||
65 | public: | 65 | public: |
66 | LLLineEditor(const LLString& name, | 66 | LLLineEditor(const std::string& name, |
67 | const LLRect& rect, | 67 | const LLRect& rect, |
68 | const LLString& default_text = LLString::null, | 68 | const std::string& default_text = LLStringUtil::null, |
69 | const LLFontGL* glfont = NULL, | 69 | const LLFontGL* glfont = NULL, |
70 | S32 max_length_bytes = 254, | 70 | S32 max_length_bytes = 254, |
71 | void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, | 71 | void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, |
@@ -132,14 +132,16 @@ public: | |||
132 | // assumes UTF8 text | 132 | // assumes UTF8 text |
133 | virtual void setValue(const LLSD& value ) { setText(value.asString()); } | 133 | virtual void setValue(const LLSD& value ) { setText(value.asString()); } |
134 | virtual LLSD getValue() const { return LLSD(getText()); } | 134 | virtual LLSD getValue() const { return LLSD(getText()); } |
135 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 135 | virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
136 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 136 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
137 | 137 | ||
138 | void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } | 138 | void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } |
139 | void setText(const LLStringExplicit &new_text); | 139 | void setText(const LLStringExplicit &new_text); |
140 | 140 | ||
141 | const LLString& getText() const { return mText.getString(); } | 141 | const std::string& getText() const { return mText.getString(); } |
142 | const LLWString& getWText() const { return mText.getWString(); } | 142 | const LLWString& getWText() const { return mText.getWString(); } |
143 | LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines | ||
144 | |||
143 | S32 getLength() const { return mText.length(); } | 145 | S32 getLength() const { return mText.length(); } |
144 | 146 | ||
145 | S32 getCursor() const { return mCursorPos; } | 147 | S32 getCursor() const { return mCursorPos; } |
@@ -205,7 +207,7 @@ public: | |||
205 | static BOOL prevalidatePrintableNoSpace(const LLWString &str); | 207 | static BOOL prevalidatePrintableNoSpace(const LLWString &str); |
206 | static BOOL prevalidateASCII(const LLWString &str); | 208 | static BOOL prevalidateASCII(const LLWString &str); |
207 | 209 | ||
208 | static BOOL postvalidateFloat(const LLString &str); | 210 | static BOOL postvalidateFloat(const std::string &str); |
209 | 211 | ||
210 | // line history support: | 212 | // line history support: |
211 | void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off | 213 | void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off |
@@ -242,12 +244,12 @@ private: | |||
242 | 244 | ||
243 | protected: | 245 | protected: |
244 | LLUIString mText; // The string being edited. | 246 | LLUIString mText; // The string being edited. |
245 | LLString mPrevText; // Saved string for 'ESC' revert | 247 | std::string mPrevText; // Saved string for 'ESC' revert |
246 | LLUIString mLabel; // text label that is visible when no user text provided | 248 | LLUIString mLabel; // text label that is visible when no user text provided |
247 | 249 | ||
248 | // line history support: | 250 | // line history support: |
249 | BOOL mHaveHistory; // flag for enabled line history | 251 | BOOL mHaveHistory; // flag for enabled line history |
250 | std::vector<LLString> mLineHistory; // line history storage | 252 | std::vector<std::string> mLineHistory; // line history storage |
251 | U32 mCurrentHistoryLine; // currently browsed history line | 253 | U32 mCurrentHistoryLine; // currently browsed history line |
252 | 254 | ||
253 | LLViewBorder* mBorder; | 255 | LLViewBorder* mBorder; |
@@ -307,7 +309,7 @@ protected: | |||
307 | private: | 309 | private: |
308 | // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible | 310 | // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible |
309 | // or returns a given default image if anything in the process fails. | 311 | // or returns a given default image if anything in the process fails. |
310 | static LLPointer<LLUIImage> parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def); | 312 | static LLPointer<LLUIImage> parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def); |
311 | // Global instance used as default for member instance below. | 313 | // Global instance used as default for member instance below. |
312 | static LLPointer<LLUIImage> sImage; | 314 | static LLPointer<LLUIImage> sImage; |
313 | // Instances that by default point to the statics but can be overidden in XML. | 315 | // Instances that by default point to the statics but can be overidden in XML. |
@@ -341,10 +343,10 @@ private: | |||
341 | ed->mPrevText = mText; | 343 | ed->mPrevText = mText; |
342 | } | 344 | } |
343 | 345 | ||
344 | LLString getText() { return mText; } | 346 | std::string getText() { return mText; } |
345 | 347 | ||
346 | private: | 348 | private: |
347 | LLString mText; | 349 | std::string mText; |
348 | S32 mCursorPos; | 350 | S32 mCursorPos; |
349 | S32 mScrollHPos; | 351 | S32 mScrollHPos; |
350 | BOOL mIsSelecting; | 352 | BOOL mIsSelecting; |
@@ -362,10 +364,10 @@ private: | |||
362 | class LLSearchEditor : public LLUICtrl | 364 | class LLSearchEditor : public LLUICtrl |
363 | { | 365 | { |
364 | public: | 366 | public: |
365 | LLSearchEditor(const LLString& name, | 367 | LLSearchEditor(const std::string& name, |
366 | const LLRect& rect, | 368 | const LLRect& rect, |
367 | S32 max_length_bytes, | 369 | S32 max_length_bytes, |
368 | void (*search_callback)(const LLString& search_string, void* user_data), | 370 | void (*search_callback)(const std::string& search_string, void* user_data), |
369 | void* userdata); | 371 | void* userdata); |
370 | 372 | ||
371 | virtual ~LLSearchEditor() {} | 373 | virtual ~LLSearchEditor() {} |
@@ -376,13 +378,13 @@ public: | |||
376 | 378 | ||
377 | void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } | 379 | void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } |
378 | 380 | ||
379 | void setSearchCallback(void (*search_callback)(const LLString& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } | 381 | void setSearchCallback(void (*search_callback)(const std::string& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } |
380 | 382 | ||
381 | // LLUICtrl interface | 383 | // LLUICtrl interface |
382 | virtual void setValue(const LLSD& value ); | 384 | virtual void setValue(const LLSD& value ); |
383 | virtual LLSD getValue() const; | 385 | virtual LLSD getValue() const; |
384 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 386 | virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
385 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 387 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
386 | virtual void clear(); | 388 | virtual void clear(); |
387 | 389 | ||
388 | private: | 390 | private: |
@@ -391,7 +393,7 @@ private: | |||
391 | 393 | ||
392 | LLLineEditor* mSearchEdit; | 394 | LLLineEditor* mSearchEdit; |
393 | class LLButton* mClearSearchButton; | 395 | class LLButton* mClearSearchButton; |
394 | void (*mSearchCallback)(const LLString& search_string, void* user_data); | 396 | void (*mSearchCallback)(const std::string& search_string, void* user_data); |
395 | 397 | ||
396 | }; | 398 | }; |
397 | 399 | ||
diff --git a/linden/indra/llui/llmemberlistener.h b/linden/indra/llui/llmemberlistener.h index 6f4ba8b..a81f767 100644 --- a/linden/indra/llui/llmemberlistener.h +++ b/linden/indra/llui/llmemberlistener.h | |||
@@ -66,7 +66,7 @@ class LLMemberListener : public LLSimpleListener | |||
66 | public: | 66 | public: |
67 | LLMemberListener() : mPtr(NULL), mRegisteredName() { } | 67 | LLMemberListener() : mPtr(NULL), mRegisteredName() { } |
68 | 68 | ||
69 | void registerListener(T *pointer, const LLString& register_name) | 69 | void registerListener(T *pointer, const std::string& register_name) |
70 | { | 70 | { |
71 | mPtr = pointer; | 71 | mPtr = pointer; |
72 | mRegisteredName = register_name; | 72 | mRegisteredName = register_name; |
@@ -78,7 +78,7 @@ public: | |||
78 | 78 | ||
79 | protected: | 79 | protected: |
80 | T *mPtr; // The object that this listener manipulates | 80 | T *mPtr; // The object that this listener manipulates |
81 | LLString mRegisteredName; | 81 | std::string mRegisteredName; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | 84 | ||
diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index 5e46ab7..24cc47e 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp | |||
@@ -46,7 +46,6 @@ | |||
46 | #include "llmenugl.h" | 46 | #include "llmenugl.h" |
47 | 47 | ||
48 | #include "llmath.h" | 48 | #include "llmath.h" |
49 | #include "llgl.h" | ||
50 | #include "llrender.h" | 49 | #include "llrender.h" |
51 | #include "llfocusmgr.h" | 50 | #include "llfocusmgr.h" |
52 | #include "llfont.h" | 51 | #include "llfont.h" |
@@ -59,7 +58,6 @@ | |||
59 | #include "llresmgr.h" | 58 | #include "llresmgr.h" |
60 | #include "llui.h" | 59 | #include "llui.h" |
61 | 60 | ||
62 | #include "llglheaders.h" | ||
63 | #include "llstl.h" | 61 | #include "llstl.h" |
64 | 62 | ||
65 | #include "v2math.h" | 63 | #include "v2math.h" |
@@ -76,10 +74,10 @@ S32 MENU_BAR_WIDTH = 0; | |||
76 | /// Local function declarations, constants, enums, and typedefs | 74 | /// Local function declarations, constants, enums, and typedefs |
77 | ///============================================================================ | 75 | ///============================================================================ |
78 | 76 | ||
79 | const LLString SEPARATOR_NAME("separator"); | 77 | const std::string SEPARATOR_NAME("separator"); |
80 | const LLString TEAROFF_SEPARATOR_LABEL( "~~~~~~~~~~~" ); | 78 | const std::string TEAROFF_SEPARATOR_LABEL( "~~~~~~~~~~~" ); |
81 | const LLString SEPARATOR_LABEL( "-----------" ); | 79 | const std::string SEPARATOR_LABEL( "-----------" ); |
82 | const LLString VERTICAL_SEPARATOR_LABEL( "|" ); | 80 | const std::string VERTICAL_SEPARATOR_LABEL( "|" ); |
83 | 81 | ||
84 | const S32 LABEL_BOTTOM_PAD_PIXELS = 2; | 82 | const S32 LABEL_BOTTOM_PAD_PIXELS = 2; |
85 | 83 | ||
@@ -100,10 +98,10 @@ const U32 SEPARATOR_HEIGHT_PIXELS = 8; | |||
100 | const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10; | 98 | const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10; |
101 | const S32 MENU_ITEM_PADDING = 4; | 99 | const S32 MENU_ITEM_PADDING = 4; |
102 | 100 | ||
103 | const LLString BOOLEAN_TRUE_PREFIX( "X" ); | 101 | const std::string BOOLEAN_TRUE_PREFIX( "X" ); |
104 | const LLString BRANCH_SUFFIX( ">" ); | 102 | const std::string BRANCH_SUFFIX( ">" ); |
105 | const LLString ARROW_UP ("^^^^^^^"); | 103 | const std::string ARROW_UP ("^^^^^^^"); |
106 | const LLString ARROW_DOWN("vvvvvvv"); | 104 | const std::string ARROW_DOWN("vvvvvvv"); |
107 | 105 | ||
108 | const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f; | 106 | const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f; |
109 | 107 | ||
@@ -132,7 +130,7 @@ const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f; | |||
132 | ///============================================================================ | 130 | ///============================================================================ |
133 | 131 | ||
134 | // Default constructor | 132 | // Default constructor |
135 | LLMenuItemGL::LLMenuItemGL( const LLString& name, const LLString& label, KEY key, MASK mask ) : | 133 | LLMenuItemGL::LLMenuItemGL( const std::string& name, const std::string& label, KEY key, MASK mask ) : |
136 | LLView( name, TRUE ), | 134 | LLView( name, TRUE ), |
137 | mJumpKey(KEY_NONE), | 135 | mJumpKey(KEY_NONE), |
138 | mAcceleratorKey( key ), | 136 | mAcceleratorKey( key ), |
@@ -222,7 +220,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp) | |||
222 | 220 | ||
223 | // *NOTE: get calling code to throw up warning or route | 221 | // *NOTE: get calling code to throw up warning or route |
224 | // warning messages back to app-provided output | 222 | // warning messages back to app-provided output |
225 | // LLString warning; | 223 | // std::string warning; |
226 | // warning.append("Duplicate key binding <"); | 224 | // warning.append("Duplicate key binding <"); |
227 | // appendAcceleratorString( warning ); | 225 | // appendAcceleratorString( warning ); |
228 | // warning.append("> for menu items:\n "); | 226 | // warning.append("> for menu items:\n "); |
@@ -252,7 +250,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp) | |||
252 | 250 | ||
253 | // This function appends the character string representation of | 251 | // This function appends the character string representation of |
254 | // the current accelerator key and mask to the provided string. | 252 | // the current accelerator key and mask to the provided string. |
255 | void LLMenuItemGL::appendAcceleratorString( LLString& st ) const | 253 | void LLMenuItemGL::appendAcceleratorString( std::string& st ) const |
256 | { | 254 | { |
257 | // break early if this is a silly thing to do. | 255 | // break early if this is a silly thing to do. |
258 | if( KEY_NONE == mAcceleratorKey ) | 256 | if( KEY_NONE == mAcceleratorKey ) |
@@ -288,7 +286,7 @@ void LLMenuItemGL::appendAcceleratorString( LLString& st ) const | |||
288 | st.append( "Shift-" ); | 286 | st.append( "Shift-" ); |
289 | #endif | 287 | #endif |
290 | 288 | ||
291 | LLString keystr = LLKeyboard::stringFromKey( mAcceleratorKey ); | 289 | std::string keystr = LLKeyboard::stringFromKey( mAcceleratorKey ); |
292 | if ((mAcceleratorMask & MASK_NORMALKEYS) && | 290 | if ((mAcceleratorMask & MASK_NORMALKEYS) && |
293 | (keystr[0] == '-' || keystr[0] == '=')) | 291 | (keystr[0] == '-' || keystr[0] == '=')) |
294 | { | 292 | { |
@@ -336,7 +334,7 @@ U32 LLMenuItemGL::getNominalWidth( void ) const | |||
336 | if( KEY_NONE != mAcceleratorKey ) | 334 | if( KEY_NONE != mAcceleratorKey ) |
337 | { | 335 | { |
338 | width += ACCEL_PAD_PIXELS; | 336 | width += ACCEL_PAD_PIXELS; |
339 | LLString temp; | 337 | std::string temp; |
340 | appendAcceleratorString( temp ); | 338 | appendAcceleratorString( temp ); |
341 | width += mFont->getWidth( temp ); | 339 | width += mFont->getWidth( temp ); |
342 | } | 340 | } |
@@ -348,7 +346,7 @@ U32 LLMenuItemGL::getNominalWidth( void ) const | |||
348 | void LLMenuItemGL::buildDrawLabel( void ) | 346 | void LLMenuItemGL::buildDrawLabel( void ) |
349 | { | 347 | { |
350 | mDrawAccelLabel.clear(); | 348 | mDrawAccelLabel.clear(); |
351 | LLString st = mDrawAccelLabel.getString(); | 349 | std::string st = mDrawAccelLabel.getString(); |
352 | appendAcceleratorString( st ); | 350 | appendAcceleratorString( st ); |
353 | mDrawAccelLabel = st; | 351 | mDrawAccelLabel = st; |
354 | } | 352 | } |
@@ -493,8 +491,8 @@ void LLMenuItemGL::draw( void ) | |||
493 | // underline "jump" key only when keyboard navigation has been initiated | 491 | // underline "jump" key only when keyboard navigation has been initiated |
494 | if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode()) | 492 | if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode()) |
495 | { | 493 | { |
496 | LLString upper_case_label = mLabel.getString(); | 494 | std::string upper_case_label = mLabel.getString(); |
497 | LLString::toUpper(upper_case_label); | 495 | LLStringUtil::toUpper(upper_case_label); |
498 | std::string::size_type offset = upper_case_label.find(mJumpKey); | 496 | std::string::size_type offset = upper_case_label.find(mJumpKey); |
499 | if (offset != std::string::npos) | 497 | if (offset != std::string::npos) |
500 | { | 498 | { |
@@ -508,7 +506,7 @@ void LLMenuItemGL::draw( void ) | |||
508 | setHover(FALSE); | 506 | setHover(FALSE); |
509 | } | 507 | } |
510 | 508 | ||
511 | BOOL LLMenuItemGL::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 509 | BOOL LLMenuItemGL::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
512 | { | 510 | { |
513 | mLabel.setArg(key, text); | 511 | mLabel.setArg(key, text); |
514 | return TRUE; | 512 | return TRUE; |
@@ -523,9 +521,9 @@ BOOL LLMenuItemGL::setLabelArg( const LLString& key, const LLStringExplicit& tex | |||
523 | class LLMenuItemSeparatorGL : public LLMenuItemGL | 521 | class LLMenuItemSeparatorGL : public LLMenuItemGL |
524 | { | 522 | { |
525 | public: | 523 | public: |
526 | LLMenuItemSeparatorGL( const LLString &name = SEPARATOR_NAME ); | 524 | LLMenuItemSeparatorGL( const std::string &name = SEPARATOR_NAME ); |
527 | 525 | ||
528 | virtual LLString getType() const { return "separator"; } | 526 | virtual std::string getType() const { return "separator"; } |
529 | 527 | ||
530 | // doIt() - do the primary funcationality of the menu item. | 528 | // doIt() - do the primary funcationality of the menu item. |
531 | virtual void doIt( void ) {} | 529 | virtual void doIt( void ) {} |
@@ -538,7 +536,7 @@ public: | |||
538 | virtual U32 getNominalHeight( void ) const { return SEPARATOR_HEIGHT_PIXELS; } | 536 | virtual U32 getNominalHeight( void ) const { return SEPARATOR_HEIGHT_PIXELS; } |
539 | }; | 537 | }; |
540 | 538 | ||
541 | LLMenuItemSeparatorGL::LLMenuItemSeparatorGL( const LLString &name ) : | 539 | LLMenuItemSeparatorGL::LLMenuItemSeparatorGL( const std::string &name ) : |
542 | LLMenuItemGL( name, SEPARATOR_LABEL ) | 540 | LLMenuItemGL( name, SEPARATOR_LABEL ) |
543 | { | 541 | { |
544 | } | 542 | } |
@@ -617,7 +615,7 @@ LLMenuItemVerticalSeparatorGL::LLMenuItemVerticalSeparatorGL( void ) | |||
617 | // Class LLMenuItemTearOffGL | 615 | // Class LLMenuItemTearOffGL |
618 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 616 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
619 | LLMenuItemTearOffGL::LLMenuItemTearOffGL(LLHandle<LLFloater> parent_floater_handle) : | 617 | LLMenuItemTearOffGL::LLMenuItemTearOffGL(LLHandle<LLFloater> parent_floater_handle) : |
620 | LLMenuItemGL("tear off", TEAROFF_SEPARATOR_LABEL), | 618 | LLMenuItemGL(std::string("tear off"), TEAROFF_SEPARATOR_LABEL), |
621 | mParentHandle(parent_floater_handle) | 619 | mParentHandle(parent_floater_handle) |
622 | { | 620 | { |
623 | } | 621 | } |
@@ -696,7 +694,7 @@ U32 LLMenuItemTearOffGL::getNominalHeight( void ) const | |||
696 | class LLMenuItemBlankGL : public LLMenuItemGL | 694 | class LLMenuItemBlankGL : public LLMenuItemGL |
697 | { | 695 | { |
698 | public: | 696 | public: |
699 | LLMenuItemBlankGL( void ) : LLMenuItemGL( "", "" ) | 697 | LLMenuItemBlankGL( void ) : LLMenuItemGL( LLStringUtil::null, LLStringUtil::null ) |
700 | { | 698 | { |
701 | setEnabled(FALSE); | 699 | setEnabled(FALSE); |
702 | } | 700 | } |
@@ -709,8 +707,8 @@ public: | |||
709 | /// Class LLMenuItemCallGL | 707 | /// Class LLMenuItemCallGL |
710 | ///============================================================================ | 708 | ///============================================================================ |
711 | 709 | ||
712 | LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, | 710 | LLMenuItemCallGL::LLMenuItemCallGL( const std::string& name, |
713 | const LLString& label, | 711 | const std::string& label, |
714 | menu_callback clicked_cb, | 712 | menu_callback clicked_cb, |
715 | enabled_callback enabled_cb, | 713 | enabled_callback enabled_cb, |
716 | void* user_data, | 714 | void* user_data, |
@@ -727,7 +725,7 @@ LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, | |||
727 | if(!enabled) setEnabled(FALSE); | 725 | if(!enabled) setEnabled(FALSE); |
728 | } | 726 | } |
729 | 727 | ||
730 | LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, | 728 | LLMenuItemCallGL::LLMenuItemCallGL( const std::string& name, |
731 | menu_callback clicked_cb, | 729 | menu_callback clicked_cb, |
732 | enabled_callback enabled_cb, | 730 | enabled_callback enabled_cb, |
733 | void* user_data, | 731 | void* user_data, |
@@ -744,8 +742,8 @@ LLMenuItemCallGL::LLMenuItemCallGL( const LLString& name, | |||
744 | if(!enabled) setEnabled(FALSE); | 742 | if(!enabled) setEnabled(FALSE); |
745 | } | 743 | } |
746 | 744 | ||
747 | LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, | 745 | LLMenuItemCallGL::LLMenuItemCallGL(const std::string& name, |
748 | const LLString& label, | 746 | const std::string& label, |
749 | menu_callback clicked_cb, | 747 | menu_callback clicked_cb, |
750 | enabled_callback enabled_cb, | 748 | enabled_callback enabled_cb, |
751 | label_callback label_cb, | 749 | label_callback label_cb, |
@@ -763,7 +761,7 @@ LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, | |||
763 | if(!enabled) setEnabled(FALSE); | 761 | if(!enabled) setEnabled(FALSE); |
764 | } | 762 | } |
765 | 763 | ||
766 | LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, | 764 | LLMenuItemCallGL::LLMenuItemCallGL(const std::string& name, |
767 | menu_callback clicked_cb, | 765 | menu_callback clicked_cb, |
768 | enabled_callback enabled_cb, | 766 | enabled_callback enabled_cb, |
769 | label_callback label_cb, | 767 | label_callback label_cb, |
@@ -781,7 +779,7 @@ LLMenuItemCallGL::LLMenuItemCallGL(const LLString& name, | |||
781 | if(!enabled) setEnabled(FALSE); | 779 | if(!enabled) setEnabled(FALSE); |
782 | } | 780 | } |
783 | 781 | ||
784 | void LLMenuItemCallGL::setEnabledControl(LLString enabled_control, LLView *context) | 782 | void LLMenuItemCallGL::setEnabledControl(std::string enabled_control, LLView *context) |
785 | { | 783 | { |
786 | // Register new listener | 784 | // Register new listener |
787 | if (!enabled_control.empty()) | 785 | if (!enabled_control.empty()) |
@@ -798,7 +796,7 @@ void LLMenuItemCallGL::setEnabledControl(LLString enabled_control, LLView *conte | |||
798 | } | 796 | } |
799 | } | 797 | } |
800 | 798 | ||
801 | void LLMenuItemCallGL::setVisibleControl(LLString visible_control, LLView *context) | 799 | void LLMenuItemCallGL::setVisibleControl(std::string visible_control, LLView *context) |
802 | { | 800 | { |
803 | // Register new listener | 801 | // Register new listener |
804 | if (!visible_control.empty()) | 802 | if (!visible_control.empty()) |
@@ -826,7 +824,7 @@ LLXMLNodePtr LLMenuItemCallGL::getXML(bool save_children) const | |||
826 | std::vector<LLListenerEntry>::iterator itor; | 824 | std::vector<LLListenerEntry>::iterator itor; |
827 | for (itor = listeners.begin(); itor != listeners.end(); ++itor) | 825 | for (itor = listeners.begin(); itor != listeners.end(); ++itor) |
828 | { | 826 | { |
829 | LLString listener_name = findEventListener((LLSimpleListener*)itor->listener); | 827 | std::string listener_name = findEventListener((LLSimpleListener*)itor->listener); |
830 | if (!listener_name.empty()) | 828 | if (!listener_name.empty()) |
831 | { | 829 | { |
832 | LLXMLNodePtr child_node = node->createChild("on_click", FALSE); | 830 | LLXMLNodePtr child_node = node->createChild("on_click", FALSE); |
@@ -864,7 +862,7 @@ void LLMenuItemCallGL::buildDrawLabel( void ) | |||
864 | } | 862 | } |
865 | if(mLabelCallback) | 863 | if(mLabelCallback) |
866 | { | 864 | { |
867 | LLString label; | 865 | std::string label; |
868 | mLabelCallback(label, mUserData); | 866 | mLabelCallback(label, mUserData); |
869 | mLabel = label; | 867 | mLabel = label; |
870 | } | 868 | } |
@@ -896,8 +894,8 @@ BOOL LLMenuItemCallGL::handleAcceleratorKey( KEY key, MASK mask ) | |||
896 | /// Class LLMenuItemCheckGL | 894 | /// Class LLMenuItemCheckGL |
897 | ///============================================================================ | 895 | ///============================================================================ |
898 | 896 | ||
899 | LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, | 897 | LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, |
900 | const LLString& label, | 898 | const std::string& label, |
901 | menu_callback clicked_cb, | 899 | menu_callback clicked_cb, |
902 | enabled_callback enabled_cb, | 900 | enabled_callback enabled_cb, |
903 | check_callback check_cb, | 901 | check_callback check_cb, |
@@ -909,7 +907,7 @@ LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, | |||
909 | { | 907 | { |
910 | } | 908 | } |
911 | 909 | ||
912 | LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, | 910 | LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, |
913 | menu_callback clicked_cb, | 911 | menu_callback clicked_cb, |
914 | enabled_callback enabled_cb, | 912 | enabled_callback enabled_cb, |
915 | check_callback check_cb, | 913 | check_callback check_cb, |
@@ -921,11 +919,11 @@ LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, | |||
921 | { | 919 | { |
922 | } | 920 | } |
923 | 921 | ||
924 | LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, | 922 | LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, |
925 | const LLString& label, | 923 | const std::string& label, |
926 | menu_callback clicked_cb, | 924 | menu_callback clicked_cb, |
927 | enabled_callback enabled_cb, | 925 | enabled_callback enabled_cb, |
928 | LLString control_name, | 926 | std::string control_name, |
929 | LLView *context, | 927 | LLView *context, |
930 | void* user_data, | 928 | void* user_data, |
931 | KEY key, MASK mask ) : | 929 | KEY key, MASK mask ) : |
@@ -949,7 +947,7 @@ void LLMenuItemCheckGL::setValue(const LLSD& value) | |||
949 | } | 947 | } |
950 | } | 948 | } |
951 | 949 | ||
952 | void LLMenuItemCheckGL::setCheckedControl(LLString checked_control, LLView *context) | 950 | void LLMenuItemCheckGL::setCheckedControl(std::string checked_control, LLView *context) |
953 | { | 951 | { |
954 | // Register new listener | 952 | // Register new listener |
955 | if (!checked_control.empty()) | 953 | if (!checked_control.empty()) |
@@ -992,14 +990,14 @@ void LLMenuItemCheckGL::buildDrawLabel( void ) | |||
992 | /// Class LLMenuItemToggleGL | 990 | /// Class LLMenuItemToggleGL |
993 | ///============================================================================ | 991 | ///============================================================================ |
994 | 992 | ||
995 | LLMenuItemToggleGL::LLMenuItemToggleGL( const LLString& name, const LLString& label, BOOL* toggle, | 993 | LLMenuItemToggleGL::LLMenuItemToggleGL( const std::string& name, const std::string& label, BOOL* toggle, |
996 | KEY key, MASK mask ) : | 994 | KEY key, MASK mask ) : |
997 | LLMenuItemGL( name, label, key, mask ), | 995 | LLMenuItemGL( name, label, key, mask ), |
998 | mToggle( toggle ) | 996 | mToggle( toggle ) |
999 | { | 997 | { |
1000 | } | 998 | } |
1001 | 999 | ||
1002 | LLMenuItemToggleGL::LLMenuItemToggleGL( const LLString& name, BOOL* toggle, | 1000 | LLMenuItemToggleGL::LLMenuItemToggleGL( const std::string& name, BOOL* toggle, |
1003 | KEY key, MASK mask ) : | 1001 | KEY key, MASK mask ) : |
1004 | LLMenuItemGL( name, name, key, mask ), | 1002 | LLMenuItemGL( name, name, key, mask ), |
1005 | mToggle( toggle ) | 1003 | mToggle( toggle ) |
@@ -1019,7 +1017,7 @@ void LLMenuItemToggleGL::buildDrawLabel( void ) | |||
1019 | mDrawBoolLabel.clear(); | 1017 | mDrawBoolLabel.clear(); |
1020 | } | 1018 | } |
1021 | mDrawAccelLabel.clear(); | 1019 | mDrawAccelLabel.clear(); |
1022 | LLString st = mDrawAccelLabel; | 1020 | std::string st = mDrawAccelLabel; |
1023 | appendAcceleratorString( st ); | 1021 | appendAcceleratorString( st ); |
1024 | mDrawAccelLabel = st; | 1022 | mDrawAccelLabel = st; |
1025 | } | 1023 | } |
@@ -1035,7 +1033,7 @@ void LLMenuItemToggleGL::doIt( void ) | |||
1035 | } | 1033 | } |
1036 | 1034 | ||
1037 | 1035 | ||
1038 | LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch, | 1036 | LLMenuItemBranchGL::LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, |
1039 | KEY key, MASK mask ) : | 1037 | KEY key, MASK mask ) : |
1040 | LLMenuItemGL( name, label, key, mask ), | 1038 | LLMenuItemGL( name, label, key, mask ), |
1041 | mBranch( branch ) | 1039 | mBranch( branch ) |
@@ -1045,7 +1043,7 @@ LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& la | |||
1045 | } | 1043 | } |
1046 | 1044 | ||
1047 | // virtual | 1045 | // virtual |
1048 | LLView* LLMenuItemBranchGL::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const | 1046 | LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const |
1049 | { | 1047 | { |
1050 | // richard: this is redundant with parent, remove | 1048 | // richard: this is redundant with parent, remove |
1051 | if (mBranch->getName() == name) | 1049 | if (mBranch->getName() == name) |
@@ -1111,7 +1109,7 @@ BOOL LLMenuItemBranchGL::addToAcceleratorList(std::list<LLKeyBinding*> *listp) | |||
1111 | void LLMenuItemBranchGL::buildDrawLabel( void ) | 1109 | void LLMenuItemBranchGL::buildDrawLabel( void ) |
1112 | { | 1110 | { |
1113 | mDrawAccelLabel.clear(); | 1111 | mDrawAccelLabel.clear(); |
1114 | LLString st = mDrawAccelLabel; | 1112 | std::string st = mDrawAccelLabel; |
1115 | appendAcceleratorString( st ); | 1113 | appendAcceleratorString( st ); |
1116 | mDrawAccelLabel = st; | 1114 | mDrawAccelLabel = st; |
1117 | mDrawBranchLabel = BRANCH_SUFFIX; | 1115 | mDrawBranchLabel = BRANCH_SUFFIX; |
@@ -1327,10 +1325,10 @@ class LLMenuItemBranchDownGL : public LLMenuItemBranchGL | |||
1327 | protected: | 1325 | protected: |
1328 | 1326 | ||
1329 | public: | 1327 | public: |
1330 | LLMenuItemBranchDownGL( const LLString& name, const LLString& label, LLMenuGL* branch, | 1328 | LLMenuItemBranchDownGL( const std::string& name, const std::string& label, LLMenuGL* branch, |
1331 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 1329 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
1332 | 1330 | ||
1333 | virtual LLString getType() const { return "menu"; } | 1331 | virtual std::string getType() const { return "menu"; } |
1334 | 1332 | ||
1335 | // returns the normal width of this control in pixels - this is | 1333 | // returns the normal width of this control in pixels - this is |
1336 | // used for calculating the widest item, as well as for horizontal | 1334 | // used for calculating the widest item, as well as for horizontal |
@@ -1358,8 +1356,8 @@ public: | |||
1358 | virtual BOOL handleAcceleratorKey(KEY key, MASK mask); | 1356 | virtual BOOL handleAcceleratorKey(KEY key, MASK mask); |
1359 | }; | 1357 | }; |
1360 | 1358 | ||
1361 | LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const LLString& name, | 1359 | LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const std::string& name, |
1362 | const LLString& label, | 1360 | const std::string& label, |
1363 | LLMenuGL* branch, | 1361 | LLMenuGL* branch, |
1364 | KEY key, MASK mask ) : | 1362 | KEY key, MASK mask ) : |
1365 | LLMenuItemBranchGL( name, label, branch, key, mask ) | 1363 | LLMenuItemBranchGL( name, label, branch, key, mask ) |
@@ -1380,7 +1378,7 @@ U32 LLMenuItemBranchDownGL::getNominalWidth( void ) const | |||
1380 | void LLMenuItemBranchDownGL::buildDrawLabel( void ) | 1378 | void LLMenuItemBranchDownGL::buildDrawLabel( void ) |
1381 | { | 1379 | { |
1382 | mDrawAccelLabel.clear(); | 1380 | mDrawAccelLabel.clear(); |
1383 | LLString st = mDrawAccelLabel; | 1381 | std::string st = mDrawAccelLabel; |
1384 | appendAcceleratorString( st ); | 1382 | appendAcceleratorString( st ); |
1385 | mDrawAccelLabel = st; | 1383 | mDrawAccelLabel = st; |
1386 | } | 1384 | } |
@@ -1593,8 +1591,8 @@ void LLMenuItemBranchDownGL::draw( void ) | |||
1593 | // underline navigation key only when keyboard navigation has been initiated | 1591 | // underline navigation key only when keyboard navigation has been initiated |
1594 | if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode()) | 1592 | if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode()) |
1595 | { | 1593 | { |
1596 | LLString upper_case_label = mLabel.getString(); | 1594 | std::string upper_case_label = mLabel.getString(); |
1597 | LLString::toUpper(upper_case_label); | 1595 | LLStringUtil::toUpper(upper_case_label); |
1598 | std::string::size_type offset = upper_case_label.find(getJumpKey()); | 1596 | std::string::size_type offset = upper_case_label.find(getJumpKey()); |
1599 | if (offset != std::string::npos) | 1597 | if (offset != std::string::npos) |
1600 | { | 1598 | { |
@@ -1617,7 +1615,7 @@ void LLMenuItemBranchDownGL::draw( void ) | |||
1617 | static LLRegisterWidget<LLMenuGL> r1("menu"); | 1615 | static LLRegisterWidget<LLMenuGL> r1("menu"); |
1618 | 1616 | ||
1619 | // Default constructor | 1617 | // Default constructor |
1620 | LLMenuGL::LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater_handle ) | 1618 | LLMenuGL::LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater_handle ) |
1621 | : LLUICtrl( name, LLRect(), FALSE, NULL, NULL ), | 1619 | : LLUICtrl( name, LLRect(), FALSE, NULL, NULL ), |
1622 | mBackgroundColor( sDefaultBackgroundColor ), | 1620 | mBackgroundColor( sDefaultBackgroundColor ), |
1623 | mBgVisible( TRUE ), | 1621 | mBgVisible( TRUE ), |
@@ -1642,7 +1640,7 @@ LLMenuGL::LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloa | |||
1642 | setTabStop(FALSE); | 1640 | setTabStop(FALSE); |
1643 | } | 1641 | } |
1644 | 1642 | ||
1645 | LLMenuGL::LLMenuGL( const LLString& label, LLHandle<LLFloater> parent_floater_handle ) | 1643 | LLMenuGL::LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater_handle ) |
1646 | : LLUICtrl( label, LLRect(), FALSE, NULL, NULL ), | 1644 | : LLUICtrl( label, LLRect(), FALSE, NULL, NULL ), |
1647 | mBackgroundColor( sDefaultBackgroundColor ), | 1645 | mBackgroundColor( sDefaultBackgroundColor ), |
1648 | mBgVisible( TRUE ), | 1646 | mBgVisible( TRUE ), |
@@ -1751,10 +1749,10 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1751 | { | 1749 | { |
1752 | LLMenuItemGL *item = NULL; | 1750 | LLMenuItemGL *item = NULL; |
1753 | 1751 | ||
1754 | LLString type; | 1752 | std::string type; |
1755 | LLString item_name; | 1753 | std::string item_name; |
1756 | LLString source_label; | 1754 | std::string source_label; |
1757 | LLString item_label; | 1755 | std::string item_label; |
1758 | KEY jump_key = KEY_NONE; | 1756 | KEY jump_key = KEY_NONE; |
1759 | 1757 | ||
1760 | child->getAttributeString("type", type); | 1758 | child->getAttributeString("type", type); |
@@ -1796,7 +1794,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1796 | child->getAttributeBOOL("useMacCtrl", useMacCtrl); | 1794 | child->getAttributeBOOL("useMacCtrl", useMacCtrl); |
1797 | #endif // LL_DARWIN | 1795 | #endif // LL_DARWIN |
1798 | 1796 | ||
1799 | LLString shortcut; | 1797 | std::string shortcut; |
1800 | child->getAttributeString("shortcut", shortcut); | 1798 | child->getAttributeString("shortcut", shortcut); |
1801 | if (shortcut.find("control") != shortcut.npos) | 1799 | if (shortcut.find("control") != shortcut.npos) |
1802 | { | 1800 | { |
@@ -1817,7 +1815,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1817 | mask |= MASK_SHIFT; | 1815 | mask |= MASK_SHIFT; |
1818 | } | 1816 | } |
1819 | S32 pipe_pos = shortcut.rfind("|"); | 1817 | S32 pipe_pos = shortcut.rfind("|"); |
1820 | LLString key_str = shortcut.substr(pipe_pos+1); | 1818 | std::string key_str = shortcut.substr(pipe_pos+1); |
1821 | 1819 | ||
1822 | KEY key = KEY_NONE; | 1820 | KEY key = KEY_NONE; |
1823 | LLKeyboard::keyFromString(key_str, &key); | 1821 | LLKeyboard::keyFromString(key_str, &key); |
@@ -1827,7 +1825,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1827 | 1825 | ||
1828 | if (child->hasName(LL_MENU_ITEM_CHECK_GL_TAG)) | 1826 | if (child->hasName(LL_MENU_ITEM_CHECK_GL_TAG)) |
1829 | { | 1827 | { |
1830 | LLString control_name; | 1828 | std::string control_name; |
1831 | child->getAttributeString("control_name", control_name); | 1829 | child->getAttributeString("control_name", control_name); |
1832 | 1830 | ||
1833 | new_item = new LLMenuItemCheckGL(item_name, item_label, 0, 0, control_name, parent, 0, key, mask); | 1831 | new_item = new LLMenuItemCheckGL(item_name, item_label, 0, 0, control_name, parent, 0, key, mask); |
@@ -1836,15 +1834,15 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1836 | { | 1834 | { |
1837 | if (call_child->hasName("on_check")) | 1835 | if (call_child->hasName("on_check")) |
1838 | { | 1836 | { |
1839 | LLString callback_name; | 1837 | std::string callback_name; |
1840 | LLString control_name = ""; | 1838 | std::string control_name; |
1841 | if (call_child->hasAttribute("function")) | 1839 | if (call_child->hasAttribute("function")) |
1842 | { | 1840 | { |
1843 | call_child->getAttributeString("function", callback_name); | 1841 | call_child->getAttributeString("function", callback_name); |
1844 | 1842 | ||
1845 | control_name = callback_name; | 1843 | control_name = callback_name; |
1846 | 1844 | ||
1847 | LLString callback_data = item_name; | 1845 | std::string callback_data = item_name; |
1848 | if (call_child->hasAttribute("userdata")) | 1846 | if (call_child->hasAttribute("userdata")) |
1849 | { | 1847 | { |
1850 | call_child->getAttributeString("userdata", callback_data); | 1848 | call_child->getAttributeString("userdata", callback_data); |
@@ -1890,10 +1888,10 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1890 | { | 1888 | { |
1891 | if (call_child->hasName("on_click")) | 1889 | if (call_child->hasName("on_click")) |
1892 | { | 1890 | { |
1893 | LLString callback_name; | 1891 | std::string callback_name; |
1894 | call_child->getAttributeString("function", callback_name); | 1892 | call_child->getAttributeString("function", callback_name); |
1895 | 1893 | ||
1896 | LLString callback_data = item_name; | 1894 | std::string callback_data = item_name; |
1897 | if (call_child->hasAttribute("userdata")) | 1895 | if (call_child->hasAttribute("userdata")) |
1898 | { | 1896 | { |
1899 | call_child->getAttributeString("userdata", callback_data); | 1897 | call_child->getAttributeString("userdata", callback_data); |
@@ -1907,15 +1905,15 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1907 | } | 1905 | } |
1908 | if (call_child->hasName("on_enable")) | 1906 | if (call_child->hasName("on_enable")) |
1909 | { | 1907 | { |
1910 | LLString callback_name; | 1908 | std::string callback_name; |
1911 | LLString control_name = ""; | 1909 | std::string control_name; |
1912 | if (call_child->hasAttribute("function")) | 1910 | if (call_child->hasAttribute("function")) |
1913 | { | 1911 | { |
1914 | call_child->getAttributeString("function", callback_name); | 1912 | call_child->getAttributeString("function", callback_name); |
1915 | 1913 | ||
1916 | control_name = callback_name; | 1914 | control_name = callback_name; |
1917 | 1915 | ||
1918 | LLString callback_data = ""; | 1916 | std::string callback_data; |
1919 | if (call_child->hasAttribute("userdata")) | 1917 | if (call_child->hasAttribute("userdata")) |
1920 | { | 1918 | { |
1921 | call_child->getAttributeString("userdata", callback_data); | 1919 | call_child->getAttributeString("userdata", callback_data); |
@@ -1947,15 +1945,15 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory | |||
1947 | } | 1945 | } |
1948 | if (call_child->hasName("on_visible")) | 1946 | if (call_child->hasName("on_visible")) |
1949 | { | 1947 | { |
1950 | LLString callback_name; | 1948 | std::string callback_name; |
1951 | LLString control_name = ""; | 1949 | std::string control_name; |
1952 | if (call_child->hasAttribute("function")) | 1950 | if (call_child->hasAttribute("function")) |
1953 | { | 1951 | { |
1954 | call_child->getAttributeString("function", callback_name); | 1952 | call_child->getAttributeString("function", callback_name); |
1955 | 1953 | ||
1956 | control_name = callback_name; | 1954 | control_name = callback_name; |
1957 | 1955 | ||
1958 | LLString callback_data = ""; | 1956 | std::string callback_data; |
1959 | if (call_child->hasAttribute("userdata")) | 1957 | if (call_child->hasAttribute("userdata")) |
1960 | { | 1958 | { |
1961 | call_child->getAttributeString("userdata", callback_data); | 1959 | call_child->getAttributeString("userdata", callback_data); |
@@ -2047,14 +2045,14 @@ BOOL LLMenuGL::isOpen() | |||
2047 | // static | 2045 | // static |
2048 | LLView* LLMenuGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 2046 | LLView* LLMenuGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
2049 | { | 2047 | { |
2050 | LLString name("menu"); | 2048 | std::string name("menu"); |
2051 | node->getAttributeString("name", name); | 2049 | node->getAttributeString("name", name); |
2052 | 2050 | ||
2053 | LLString label = name; | 2051 | std::string label = name; |
2054 | node->getAttributeString("label", label); | 2052 | node->getAttributeString("label", label); |
2055 | 2053 | ||
2056 | // parse jump key out of label | 2054 | // parse jump key out of label |
2057 | LLString new_menu_label; | 2055 | std::string new_menu_label; |
2058 | 2056 | ||
2059 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 2057 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; |
2060 | boost::char_separator<char> sep("_"); | 2058 | boost::char_separator<char> sep("_"); |
@@ -2134,7 +2132,7 @@ void LLMenuGL::arrange( void ) | |||
2134 | U32 max_width = getTornOff() ? U32_MAX : menu_region_rect.getWidth(); | 2132 | U32 max_width = getTornOff() ? U32_MAX : menu_region_rect.getWidth(); |
2135 | U32 max_height = getTornOff() ? U32_MAX : menu_region_rect.getHeight(); | 2133 | U32 max_height = getTornOff() ? U32_MAX : menu_region_rect.getHeight(); |
2136 | // *FIX: create the item first and then ask for its dimensions? | 2134 | // *FIX: create the item first and then ask for its dimensions? |
2137 | S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::sSansSerif->getWidth( "More" ); | 2135 | S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::sSansSerif->getWidth( std::string("More") ); |
2138 | S32 spillover_item_height = llround(LLFontGL::sSansSerif->getLineHeight()) + MENU_ITEM_PADDING; | 2136 | S32 spillover_item_height = llround(LLFontGL::sSansSerif->getLineHeight()) + MENU_ITEM_PADDING; |
2139 | 2137 | ||
2140 | if (mHorizontalLayout) | 2138 | if (mHorizontalLayout) |
@@ -2251,13 +2249,13 @@ void LLMenuGL::createSpilloverBranch() | |||
2251 | delete mSpilloverMenu; | 2249 | delete mSpilloverMenu; |
2252 | // technically, you can't tear off spillover menus, but we're passing the handle | 2250 | // technically, you can't tear off spillover menus, but we're passing the handle |
2253 | // along just to be safe | 2251 | // along just to be safe |
2254 | mSpilloverMenu = new LLMenuGL("More", "More", mParentFloaterHandle); | 2252 | mSpilloverMenu = new LLMenuGL(std::string("More"), std::string("More"), mParentFloaterHandle); |
2255 | mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); | 2253 | mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); |
2256 | // Inherit colors | 2254 | // Inherit colors |
2257 | mSpilloverMenu->setBackgroundColor( mBackgroundColor ); | 2255 | mSpilloverMenu->setBackgroundColor( mBackgroundColor ); |
2258 | mSpilloverMenu->setCanTearOff(FALSE); | 2256 | mSpilloverMenu->setCanTearOff(FALSE); |
2259 | 2257 | ||
2260 | mSpilloverBranch = new LLMenuItemBranchGL("More", "More", mSpilloverMenu); | 2258 | mSpilloverBranch = new LLMenuItemBranchGL(std::string("More"), std::string("More"), mSpilloverMenu); |
2261 | mSpilloverBranch->setFontStyle(LLFontGL::ITALIC); | 2259 | mSpilloverBranch->setFontStyle(LLFontGL::ITALIC); |
2262 | } | 2260 | } |
2263 | } | 2261 | } |
@@ -2297,8 +2295,8 @@ void LLMenuGL::createJumpKeys() | |||
2297 | { | 2295 | { |
2298 | mJumpKeys.clear(); | 2296 | mJumpKeys.clear(); |
2299 | 2297 | ||
2300 | std::set<LLString> unique_words; | 2298 | std::set<std::string> unique_words; |
2301 | std::set<LLString> shared_words; | 2299 | std::set<std::string> shared_words; |
2302 | 2300 | ||
2303 | item_list_t::iterator item_it; | 2301 | item_list_t::iterator item_it; |
2304 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 2302 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; |
@@ -2306,8 +2304,8 @@ void LLMenuGL::createJumpKeys() | |||
2306 | 2304 | ||
2307 | for(item_it = mItems.begin(); item_it != mItems.end(); ++item_it) | 2305 | for(item_it = mItems.begin(); item_it != mItems.end(); ++item_it) |
2308 | { | 2306 | { |
2309 | LLString uppercase_label = (*item_it)->getLabel(); | 2307 | std::string uppercase_label = (*item_it)->getLabel(); |
2310 | LLString::toUpper(uppercase_label); | 2308 | LLStringUtil::toUpper(uppercase_label); |
2311 | 2309 | ||
2312 | tokenizer tokens(uppercase_label, sep); | 2310 | tokenizer tokens(uppercase_label, sep); |
2313 | tokenizer::iterator token_iter; | 2311 | tokenizer::iterator token_iter; |
@@ -2352,8 +2350,8 @@ void LLMenuGL::createJumpKeys() | |||
2352 | { | 2350 | { |
2353 | continue; | 2351 | continue; |
2354 | } | 2352 | } |
2355 | LLString uppercase_label = (*item_it)->getLabel(); | 2353 | std::string uppercase_label = (*item_it)->getLabel(); |
2356 | LLString::toUpper(uppercase_label); | 2354 | LLStringUtil::toUpper(uppercase_label); |
2357 | 2355 | ||
2358 | tokenizer tokens(uppercase_label, sep); | 2356 | tokenizer tokens(uppercase_label, sep); |
2359 | tokenizer::iterator token_iter; | 2357 | tokenizer::iterator token_iter; |
@@ -2361,7 +2359,7 @@ void LLMenuGL::createJumpKeys() | |||
2361 | BOOL found_key = FALSE; | 2359 | BOOL found_key = FALSE; |
2362 | for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) | 2360 | for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) |
2363 | { | 2361 | { |
2364 | LLString uppercase_word = *token_iter; | 2362 | std::string uppercase_word = *token_iter; |
2365 | 2363 | ||
2366 | // this word is not shared with other menu entries... | 2364 | // this word is not shared with other menu entries... |
2367 | if (shared_words.find(*token_iter) == shared_words.end()) | 2365 | if (shared_words.find(*token_iter) == shared_words.end()) |
@@ -2441,9 +2439,13 @@ BOOL LLMenuGL::append( LLMenuItemGL* item ) | |||
2441 | } | 2439 | } |
2442 | 2440 | ||
2443 | // add a separator to this menu | 2441 | // add a separator to this menu |
2444 | BOOL LLMenuGL::appendSeparator( const LLString &separator_name ) | 2442 | BOOL LLMenuGL::appendSeparator( const std::string &separator_name ) |
2445 | { | 2443 | { |
2446 | LLMenuItemGL* separator = new LLMenuItemSeparatorGL(separator_name); | 2444 | LLMenuItemGL* separator; |
2445 | if (separator_name.empty()) | ||
2446 | separator = new LLMenuItemSeparatorGL(std::string("separator")); | ||
2447 | else | ||
2448 | separator = new LLMenuItemSeparatorGL(separator_name); | ||
2447 | return append( separator ); | 2449 | return append( separator ); |
2448 | } | 2450 | } |
2449 | 2451 | ||
@@ -2480,7 +2482,7 @@ void LLMenuGL::setEnabledSubMenus(BOOL enable) | |||
2480 | 2482 | ||
2481 | // setItemEnabled() - pass the label and the enable flag for a menu | 2483 | // setItemEnabled() - pass the label and the enable flag for a menu |
2482 | // item. TRUE will make sure it's enabled, FALSE will disable it. | 2484 | // item. TRUE will make sure it's enabled, FALSE will disable it. |
2483 | void LLMenuGL::setItemEnabled( const LLString& name, BOOL enable ) | 2485 | void LLMenuGL::setItemEnabled( const std::string& name, BOOL enable ) |
2484 | { | 2486 | { |
2485 | item_list_t::iterator item_iter; | 2487 | item_list_t::iterator item_iter; |
2486 | for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) | 2488 | for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) |
@@ -2494,7 +2496,7 @@ void LLMenuGL::setItemEnabled( const LLString& name, BOOL enable ) | |||
2494 | } | 2496 | } |
2495 | } | 2497 | } |
2496 | 2498 | ||
2497 | void LLMenuGL::setItemVisible( const LLString& name, BOOL visible ) | 2499 | void LLMenuGL::setItemVisible( const std::string& name, BOOL visible ) |
2498 | { | 2500 | { |
2499 | item_list_t::iterator item_iter; | 2501 | item_list_t::iterator item_iter; |
2500 | for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) | 2502 | for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) |
@@ -2873,7 +2875,7 @@ void LLMenuGL::setVisible(BOOL visible) | |||
2873 | } | 2875 | } |
2874 | } | 2876 | } |
2875 | 2877 | ||
2876 | LLMenuGL* LLMenuGL::getChildMenuByName(const LLString& name, BOOL recurse) const | 2878 | LLMenuGL* LLMenuGL::getChildMenuByName(const std::string& name, BOOL recurse) const |
2877 | { | 2879 | { |
2878 | LLView* view = getChildView(name, recurse, FALSE); | 2880 | LLView* view = getChildView(name, recurse, FALSE); |
2879 | if (view) | 2881 | if (view) |
@@ -2965,7 +2967,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) | |||
2965 | class LLPieMenuBranch : public LLMenuItemGL | 2967 | class LLPieMenuBranch : public LLMenuItemGL |
2966 | { | 2968 | { |
2967 | public: | 2969 | public: |
2968 | LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch); | 2970 | LLPieMenuBranch(const std::string& name, const std::string& label, LLPieMenu* branch); |
2969 | 2971 | ||
2970 | // called to rebuild the draw label | 2972 | // called to rebuild the draw label |
2971 | virtual void buildDrawLabel( void ); | 2973 | virtual void buildDrawLabel( void ); |
@@ -2979,8 +2981,8 @@ protected: | |||
2979 | LLPieMenu* mBranch; | 2981 | LLPieMenu* mBranch; |
2980 | }; | 2982 | }; |
2981 | 2983 | ||
2982 | LLPieMenuBranch::LLPieMenuBranch(const LLString& name, | 2984 | LLPieMenuBranch::LLPieMenuBranch(const std::string& name, |
2983 | const LLString& label, | 2985 | const std::string& label, |
2984 | LLPieMenu* branch) | 2986 | LLPieMenu* branch) |
2985 | : LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ), | 2987 | : LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ), |
2986 | mBranch( branch ) | 2988 | mBranch( branch ) |
@@ -3013,7 +3015,7 @@ void LLPieMenuBranch::buildDrawLabel( void ) | |||
3013 | } | 3015 | } |
3014 | 3016 | ||
3015 | mDrawAccelLabel.clear(); | 3017 | mDrawAccelLabel.clear(); |
3016 | LLString st = mDrawAccelLabel; | 3018 | std::string st = mDrawAccelLabel; |
3017 | appendAcceleratorString( st ); | 3019 | appendAcceleratorString( st ); |
3018 | mDrawAccelLabel = st; | 3020 | mDrawAccelLabel = st; |
3019 | 3021 | ||
@@ -3039,7 +3041,7 @@ void LLPieMenuBranch::doIt( void ) | |||
3039 | // class LLPieMenu | 3041 | // class LLPieMenu |
3040 | // A circular menu of items, icons, etc. | 3042 | // A circular menu of items, icons, etc. |
3041 | //----------------------------------------------------------------------------- | 3043 | //----------------------------------------------------------------------------- |
3042 | LLPieMenu::LLPieMenu(const LLString& name, const LLString& label) | 3044 | LLPieMenu::LLPieMenu(const std::string& name, const std::string& label) |
3043 | : LLMenuGL(name, label), | 3045 | : LLMenuGL(name, label), |
3044 | mFirstMouseDown(FALSE), | 3046 | mFirstMouseDown(FALSE), |
3045 | mUseInfiniteRadius(FALSE), | 3047 | mUseInfiniteRadius(FALSE), |
@@ -3054,7 +3056,7 @@ LLPieMenu::LLPieMenu(const LLString& name, const LLString& label) | |||
3054 | setCanTearOff(FALSE); | 3056 | setCanTearOff(FALSE); |
3055 | } | 3057 | } |
3056 | 3058 | ||
3057 | LLPieMenu::LLPieMenu(const LLString& name) | 3059 | LLPieMenu::LLPieMenu(const std::string& name) |
3058 | : LLMenuGL(name, name), | 3060 | : LLMenuGL(name, name), |
3059 | mFirstMouseDown(FALSE), | 3061 | mFirstMouseDown(FALSE), |
3060 | mUseInfiniteRadius(FALSE), | 3062 | mUseInfiniteRadius(FALSE), |
@@ -3078,9 +3080,9 @@ void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *fac | |||
3078 | if (child->hasName(LL_PIE_MENU_TAG)) | 3080 | if (child->hasName(LL_PIE_MENU_TAG)) |
3079 | { | 3081 | { |
3080 | // SUBMENU | 3082 | // SUBMENU |
3081 | LLString name("menu"); | 3083 | std::string name("menu"); |
3082 | child->getAttributeString("name", name); | 3084 | child->getAttributeString("name", name); |
3083 | LLString label(name); | 3085 | std::string label(name); |
3084 | child->getAttributeString("label", label); | 3086 | child->getAttributeString("label", label); |
3085 | 3087 | ||
3086 | LLPieMenu *submenu = new LLPieMenu(name, label); | 3088 | LLPieMenu *submenu = new LLPieMenu(name, label); |
@@ -3458,7 +3460,7 @@ BOOL LLPieMenu::append(LLMenuItemGL *item) | |||
3458 | } | 3460 | } |
3459 | 3461 | ||
3460 | // virtual | 3462 | // virtual |
3461 | BOOL LLPieMenu::appendSeparator(const LLString &separator_name) | 3463 | BOOL LLPieMenu::appendSeparator(const std::string &separator_name) |
3462 | { | 3464 | { |
3463 | LLMenuItemGL* separator = new LLMenuItemBlankGL(); | 3465 | LLMenuItemGL* separator = new LLMenuItemBlankGL(); |
3464 | separator->setFont( LLFontGL::sSansSerifSmall ); | 3466 | separator->setFont( LLFontGL::sSansSerifSmall ); |
@@ -3482,8 +3484,8 @@ BOOL LLPieMenu::appendPieMenu(LLPieMenu *menu) | |||
3482 | // virtual | 3484 | // virtual |
3483 | void LLPieMenu::arrange() | 3485 | void LLPieMenu::arrange() |
3484 | { | 3486 | { |
3485 | const S32 rect_height = 180; | 3487 | const S32 rect_height = 190; |
3486 | const S32 rect_width = 180; | 3488 | const S32 rect_width = 190; |
3487 | 3489 | ||
3488 | // all divide by 6 | 3490 | // all divide by 6 |
3489 | const S32 CARD_X = 60; | 3491 | const S32 CARD_X = 60; |
@@ -3739,7 +3741,7 @@ void LLPieMenu::hide(BOOL item_selected) | |||
3739 | static LLRegisterWidget<LLMenuBarGL> r2("menu_bar"); | 3741 | static LLRegisterWidget<LLMenuBarGL> r2("menu_bar"); |
3740 | 3742 | ||
3741 | // Default constructor | 3743 | // Default constructor |
3742 | LLMenuBarGL::LLMenuBarGL( const LLString& name ) : LLMenuGL ( name, name ) | 3744 | LLMenuBarGL::LLMenuBarGL( const std::string& name ) : LLMenuGL ( name, name ) |
3743 | { | 3745 | { |
3744 | mHorizontalLayout = TRUE; | 3746 | mHorizontalLayout = TRUE; |
3745 | setCanTearOff(FALSE); | 3747 | setCanTearOff(FALSE); |
@@ -3784,7 +3786,7 @@ LLXMLNodePtr LLMenuBarGL::getXML(bool save_children) const | |||
3784 | 3786 | ||
3785 | LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 3787 | LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
3786 | { | 3788 | { |
3787 | LLString name("menu"); | 3789 | std::string name("menu"); |
3788 | node->getAttributeString("name", name); | 3790 | node->getAttributeString("name", name); |
3789 | 3791 | ||
3790 | BOOL opaque = FALSE; | 3792 | BOOL opaque = FALSE; |
@@ -3879,6 +3881,8 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) | |||
3879 | } | 3881 | } |
3880 | else | 3882 | else |
3881 | { | 3883 | { |
3884 | // close menus originating from other menu bars when first opening menu via keyboard | ||
3885 | LLMenuGL::sMenuContainer->hideMenus(); | ||
3882 | highlightNextItem(NULL); | 3886 | highlightNextItem(NULL); |
3883 | LLMenuGL::setKeyboardMode(TRUE); | 3887 | LLMenuGL::setKeyboardMode(TRUE); |
3884 | } | 3888 | } |
@@ -3898,6 +3902,13 @@ BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask) | |||
3898 | { | 3902 | { |
3899 | mAltKeyTrigger = FALSE; | 3903 | mAltKeyTrigger = FALSE; |
3900 | } | 3904 | } |
3905 | |||
3906 | if (key == KEY_ESCAPE && mask == MASK_NONE) | ||
3907 | { | ||
3908 | LLMenuGL::setKeyboardMode(FALSE); | ||
3909 | // if any menus are visible, this will return TRUE, stopping further processing of ESCAPE key | ||
3910 | return LLMenuGL::sMenuContainer->hideMenus(); | ||
3911 | } | ||
3901 | 3912 | ||
3902 | // before processing any other key, check to see if ALT key has triggered menu access | 3913 | // before processing any other key, check to see if ALT key has triggered menu access |
3903 | checkMenuTrigger(); | 3914 | checkMenuTrigger(); |
@@ -3921,13 +3932,38 @@ BOOL LLMenuBarGL::handleJumpKey(KEY key) | |||
3921 | return TRUE; | 3932 | return TRUE; |
3922 | } | 3933 | } |
3923 | 3934 | ||
3935 | BOOL LLMenuBarGL::handleMouseDown(S32 x, S32 y, MASK mask) | ||
3936 | { | ||
3937 | // clicks on menu bar closes existing menus from other contexts but leave | ||
3938 | // own menu open so that we get toggle behavior | ||
3939 | if (!getHighlightedItem() || !getHighlightedItem()->isActive()) | ||
3940 | { | ||
3941 | LLMenuGL::sMenuContainer->hideMenus(); | ||
3942 | } | ||
3943 | |||
3944 | return LLMenuGL::handleMouseDown(x, y, mask); | ||
3945 | } | ||
3946 | |||
3947 | BOOL LLMenuBarGL::handleRightMouseDown(S32 x, S32 y, MASK mask) | ||
3948 | { | ||
3949 | // clicks on menu bar closes existing menus from other contexts but leave | ||
3950 | // own menu open so that we get toggle behavior | ||
3951 | if (!getHighlightedItem() || !getHighlightedItem()->isActive()) | ||
3952 | { | ||
3953 | LLMenuGL::sMenuContainer->hideMenus(); | ||
3954 | } | ||
3955 | |||
3956 | return LLMenuGL::handleMouseDown(x, y, mask); | ||
3957 | } | ||
3958 | |||
3959 | |||
3924 | void LLMenuBarGL::draw() | 3960 | void LLMenuBarGL::draw() |
3925 | { | 3961 | { |
3926 | LLMenuItemGL* itemp = getHighlightedItem(); | 3962 | LLMenuItemGL* itemp = getHighlightedItem(); |
3927 | // If we are in mouse-control mode and the mouse cursor is not hovering over | 3963 | // If we are in mouse-control mode and the mouse cursor is not hovering over |
3928 | // the current highlighted menu item and it isn't open, then remove the highlight. | 3964 | // the current highlighted menu item and it isn't open, then remove the |
3929 | // This is done via a polling mechanism here, as we don't receive notifications when | 3965 | // highlight. This is done via a polling mechanism here, as we don't receive |
3930 | // the mouse cursor moves off of us | 3966 | // notifications when the mouse cursor moves off of us |
3931 | if (itemp && !itemp->isOpen() && !itemp->getHover() && !LLMenuGL::getKeyboardMode()) | 3967 | if (itemp && !itemp->isOpen() && !itemp->getHover() && !LLMenuGL::getKeyboardMode()) |
3932 | { | 3968 | { |
3933 | clearHoverItem(); | 3969 | clearHoverItem(); |
@@ -3954,6 +3990,9 @@ void LLMenuBarGL::checkMenuTrigger() | |||
3954 | } | 3990 | } |
3955 | else | 3991 | else |
3956 | { | 3992 | { |
3993 | // close menus originating from other menu bars | ||
3994 | LLMenuGL::sMenuContainer->hideMenus(); | ||
3995 | |||
3957 | highlightNextItem(NULL); | 3996 | highlightNextItem(NULL); |
3958 | LLMenuGL::setKeyboardMode(TRUE); | 3997 | LLMenuGL::setKeyboardMode(TRUE); |
3959 | } | 3998 | } |
@@ -4011,7 +4050,7 @@ S32 LLMenuBarGL::getRightmostMenuEdge() | |||
4011 | } | 4050 | } |
4012 | 4051 | ||
4013 | // add a vertical separator to this menu | 4052 | // add a vertical separator to this menu |
4014 | BOOL LLMenuBarGL::appendSeparator( const LLString &separator_name ) | 4053 | BOOL LLMenuBarGL::appendSeparator( const std::string &separator_name ) |
4015 | { | 4054 | { |
4016 | LLMenuItemGL* separator = new LLMenuItemVerticalSeparatorGL(); | 4055 | LLMenuItemGL* separator = new LLMenuItemVerticalSeparatorGL(); |
4017 | return append( separator ); | 4056 | return append( separator ); |
@@ -4110,14 +4149,14 @@ BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) | |||
4110 | /// Class LLMenuHolderGL | 4149 | /// Class LLMenuHolderGL |
4111 | ///============================================================================ | 4150 | ///============================================================================ |
4112 | LLMenuHolderGL::LLMenuHolderGL() | 4151 | LLMenuHolderGL::LLMenuHolderGL() |
4113 | : LLPanel("Menu Holder") | 4152 | : LLPanel(std::string("Menu Holder")) |
4114 | { | 4153 | { |
4115 | setMouseOpaque(FALSE); | 4154 | setMouseOpaque(FALSE); |
4116 | sItemActivationTimer.stop(); | 4155 | sItemActivationTimer.stop(); |
4117 | mCanHide = TRUE; | 4156 | mCanHide = TRUE; |
4118 | } | 4157 | } |
4119 | 4158 | ||
4120 | LLMenuHolderGL::LLMenuHolderGL(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) | 4159 | LLMenuHolderGL::LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) |
4121 | : LLPanel(name, rect, FALSE) | 4160 | : LLPanel(name, rect, FALSE) |
4122 | { | 4161 | { |
4123 | setMouseOpaque(mouse_opaque); | 4162 | setMouseOpaque(mouse_opaque); |
@@ -4362,6 +4401,7 @@ LLTearOffMenu* LLTearOffMenu::create(LLMenuGL* menup) | |||
4362 | // keep onscreen | 4401 | // keep onscreen |
4363 | gFloaterView->adjustToFitScreen(tearoffp, FALSE); | 4402 | gFloaterView->adjustToFitScreen(tearoffp, FALSE); |
4364 | tearoffp->open(); /* Flawfinder: ignore */ | 4403 | tearoffp->open(); /* Flawfinder: ignore */ |
4404 | |||
4365 | return tearoffp; | 4405 | return tearoffp; |
4366 | } | 4406 | } |
4367 | 4407 | ||
diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h index e7b009a..8561f1b 100644 --- a/linden/indra/llui/llmenugl.h +++ b/linden/indra/llui/llmenugl.h | |||
@@ -67,7 +67,7 @@ typedef BOOL (*check_callback)(void*); | |||
67 | // This callback is potentially used by LLMenuItemCallGL. If provided, | 67 | // This callback is potentially used by LLMenuItemCallGL. If provided, |
68 | // this function is called whenever it's time to determine the label's | 68 | // this function is called whenever it's time to determine the label's |
69 | // contents. Put the contents of the label in the provided parameter. | 69 | // contents. Put the contents of the label in the provided parameter. |
70 | typedef void (*label_callback)(LLString&,void*); | 70 | typedef void (*label_callback)(std::string&,void*); |
71 | 71 | ||
72 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 72 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
73 | // Class LLMenuItemGL | 73 | // Class LLMenuItemGL |
@@ -88,13 +88,13 @@ public: | |||
88 | static void setHighlightFGColor( const LLColor4& color ) { sHighlightForeground = color; } | 88 | static void setHighlightFGColor( const LLColor4& color ) { sHighlightForeground = color; } |
89 | static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } | 89 | static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } |
90 | 90 | ||
91 | LLMenuItemGL( const LLString& name, const LLString& label, KEY key = KEY_NONE, MASK = MASK_NONE ); | 91 | LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE ); |
92 | 92 | ||
93 | virtual void setValue(const LLSD& value) { setLabel(value.asString()); } | 93 | virtual void setValue(const LLSD& value) { setLabel(value.asString()); } |
94 | 94 | ||
95 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 95 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
96 | 96 | ||
97 | virtual LLString getType() const { return "item"; } | 97 | virtual std::string getType() const { return "item"; } |
98 | 98 | ||
99 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | 99 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); |
100 | 100 | ||
@@ -122,8 +122,8 @@ public: | |||
122 | 122 | ||
123 | // change the label | 123 | // change the label |
124 | void setLabel( const LLStringExplicit& label ) { mLabel = label; } | 124 | void setLabel( const LLStringExplicit& label ) { mLabel = label; } |
125 | LLString getLabel( void ) const { return mLabel.getString(); } | 125 | std::string getLabel( void ) const { return mLabel.getString(); } |
126 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 126 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
127 | 127 | ||
128 | // Get the parent menu for this item | 128 | // Get the parent menu for this item |
129 | virtual class LLMenuGL* getMenu(); | 129 | virtual class LLMenuGL* getMenu(); |
@@ -177,7 +177,7 @@ protected: | |||
177 | 177 | ||
178 | // This function appends the character string representation of | 178 | // This function appends the character string representation of |
179 | // the current accelerator key and mask to the provided string. | 179 | // the current accelerator key and mask to the provided string. |
180 | void appendAcceleratorString( LLString& st ) const; | 180 | void appendAcceleratorString( std::string& st ) const; |
181 | 181 | ||
182 | KEY mAcceleratorKey; | 182 | KEY mAcceleratorKey; |
183 | MASK mAcceleratorMask; | 183 | MASK mAcceleratorMask; |
@@ -226,15 +226,15 @@ class LLMenuItemCallGL : public LLMenuItemGL, public LLObservable | |||
226 | { | 226 | { |
227 | public: | 227 | public: |
228 | // normal constructor | 228 | // normal constructor |
229 | LLMenuItemCallGL( const LLString& name, | 229 | LLMenuItemCallGL( const std::string& name, |
230 | menu_callback clicked_cb, | 230 | menu_callback clicked_cb, |
231 | enabled_callback enabled_cb = NULL, | 231 | enabled_callback enabled_cb = NULL, |
232 | void* user_data = NULL, | 232 | void* user_data = NULL, |
233 | KEY key = KEY_NONE, MASK mask = MASK_NONE, | 233 | KEY key = KEY_NONE, MASK mask = MASK_NONE, |
234 | BOOL enabled = TRUE, | 234 | BOOL enabled = TRUE, |
235 | on_disabled_callback on_disabled_cb = NULL); | 235 | on_disabled_callback on_disabled_cb = NULL); |
236 | LLMenuItemCallGL( const LLString& name, | 236 | LLMenuItemCallGL( const std::string& name, |
237 | const LLString& label, | 237 | const std::string& label, |
238 | menu_callback clicked_cb, | 238 | menu_callback clicked_cb, |
239 | enabled_callback enabled_cb = NULL, | 239 | enabled_callback enabled_cb = NULL, |
240 | void* user_data = NULL, | 240 | void* user_data = NULL, |
@@ -243,8 +243,8 @@ public: | |||
243 | on_disabled_callback on_disabled_cb = NULL); | 243 | on_disabled_callback on_disabled_cb = NULL); |
244 | 244 | ||
245 | // constructor for when you want to trap the arrange method. | 245 | // constructor for when you want to trap the arrange method. |
246 | LLMenuItemCallGL( const LLString& name, | 246 | LLMenuItemCallGL( const std::string& name, |
247 | const LLString& label, | 247 | const std::string& label, |
248 | menu_callback clicked_cb, | 248 | menu_callback clicked_cb, |
249 | enabled_callback enabled_cb, | 249 | enabled_callback enabled_cb, |
250 | label_callback label_cb, | 250 | label_callback label_cb, |
@@ -252,7 +252,7 @@ public: | |||
252 | KEY key = KEY_NONE, MASK mask = MASK_NONE, | 252 | KEY key = KEY_NONE, MASK mask = MASK_NONE, |
253 | BOOL enabled = TRUE, | 253 | BOOL enabled = TRUE, |
254 | on_disabled_callback on_disabled_c = NULL); | 254 | on_disabled_callback on_disabled_c = NULL); |
255 | LLMenuItemCallGL( const LLString& name, | 255 | LLMenuItemCallGL( const std::string& name, |
256 | menu_callback clicked_cb, | 256 | menu_callback clicked_cb, |
257 | enabled_callback enabled_cb, | 257 | enabled_callback enabled_cb, |
258 | label_callback label_cb, | 258 | label_callback label_cb, |
@@ -262,11 +262,11 @@ public: | |||
262 | on_disabled_callback on_disabled_c = NULL); | 262 | on_disabled_callback on_disabled_c = NULL); |
263 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 263 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
264 | 264 | ||
265 | virtual LLString getType() const { return "call"; } | 265 | virtual std::string getType() const { return "call"; } |
266 | 266 | ||
267 | 267 | ||
268 | void setEnabledControl(LLString enabled_control, LLView *context); | 268 | void setEnabledControl(std::string enabled_control, LLView *context); |
269 | void setVisibleControl(LLString enabled_control, LLView *context); | 269 | void setVisibleControl(std::string enabled_control, LLView *context); |
270 | 270 | ||
271 | void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; | 271 | void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; |
272 | menu_callback getMenuCallback() const { return mCallback; } | 272 | menu_callback getMenuCallback() const { return mCallback; } |
@@ -310,34 +310,34 @@ class LLMenuItemCheckGL | |||
310 | : public LLMenuItemCallGL | 310 | : public LLMenuItemCallGL |
311 | { | 311 | { |
312 | public: | 312 | public: |
313 | LLMenuItemCheckGL( const LLString& name, | 313 | LLMenuItemCheckGL( const std::string& name, |
314 | const LLString& label, | 314 | const std::string& label, |
315 | menu_callback callback, | 315 | menu_callback callback, |
316 | enabled_callback enabled_cb, | 316 | enabled_callback enabled_cb, |
317 | check_callback check, | 317 | check_callback check, |
318 | void* user_data, | 318 | void* user_data, |
319 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 319 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
320 | LLMenuItemCheckGL( const LLString& name, | 320 | LLMenuItemCheckGL( const std::string& name, |
321 | menu_callback callback, | 321 | menu_callback callback, |
322 | enabled_callback enabled_cb, | 322 | enabled_callback enabled_cb, |
323 | check_callback check, | 323 | check_callback check, |
324 | void* user_data, | 324 | void* user_data, |
325 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 325 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
326 | LLMenuItemCheckGL( const LLString& name, | 326 | LLMenuItemCheckGL( const std::string& name, |
327 | const LLString& label, | 327 | const std::string& label, |
328 | menu_callback callback, | 328 | menu_callback callback, |
329 | enabled_callback enabled_cb, | 329 | enabled_callback enabled_cb, |
330 | LLString control_name, | 330 | std::string control_name, |
331 | LLView *context, | 331 | LLView *context, |
332 | void* user_data, | 332 | void* user_data, |
333 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 333 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
334 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 334 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
335 | 335 | ||
336 | void setCheckedControl(LLString checked_control, LLView *context); | 336 | void setCheckedControl(std::string checked_control, LLView *context); |
337 | 337 | ||
338 | virtual void setValue(const LLSD& value); | 338 | virtual void setValue(const LLSD& value); |
339 | 339 | ||
340 | virtual LLString getType() const { return "check"; } | 340 | virtual std::string getType() const { return "check"; } |
341 | 341 | ||
342 | // called to rebuild the draw label | 342 | // called to rebuild the draw label |
343 | virtual void buildDrawLabel( void ); | 343 | virtual void buildDrawLabel( void ); |
@@ -358,15 +358,15 @@ private: | |||
358 | class LLMenuItemToggleGL : public LLMenuItemGL | 358 | class LLMenuItemToggleGL : public LLMenuItemGL |
359 | { | 359 | { |
360 | public: | 360 | public: |
361 | LLMenuItemToggleGL( const LLString& name, const LLString& label, | 361 | LLMenuItemToggleGL( const std::string& name, const std::string& label, |
362 | BOOL* toggle, | 362 | BOOL* toggle, |
363 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 363 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
364 | 364 | ||
365 | LLMenuItemToggleGL( const LLString& name, | 365 | LLMenuItemToggleGL( const std::string& name, |
366 | BOOL* toggle, | 366 | BOOL* toggle, |
367 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 367 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
368 | 368 | ||
369 | virtual LLString getType() const { return "toggle"; } | 369 | virtual std::string getType() const { return "toggle"; } |
370 | 370 | ||
371 | // called to rebuild the draw label | 371 | // called to rebuild the draw label |
372 | virtual void buildDrawLabel( void ); | 372 | virtual void buildDrawLabel( void ); |
@@ -401,8 +401,8 @@ class LLMenuGL | |||
401 | // let branching menu items use my protected traversal methods | 401 | // let branching menu items use my protected traversal methods |
402 | friend class LLMenuItemBranchGL; | 402 | friend class LLMenuItemBranchGL; |
403 | public: | 403 | public: |
404 | LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); | 404 | LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); |
405 | LLMenuGL( const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); | 405 | LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); |
406 | virtual ~LLMenuGL( void ); | 406 | virtual ~LLMenuGL( void ); |
407 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 407 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
408 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 408 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
@@ -419,12 +419,12 @@ public: | |||
419 | 419 | ||
420 | virtual BOOL handleAcceleratorKey(KEY key, MASK mask); | 420 | virtual BOOL handleAcceleratorKey(KEY key, MASK mask); |
421 | 421 | ||
422 | LLMenuGL* getChildMenuByName(const LLString& name, BOOL recurse) const; | 422 | LLMenuGL* getChildMenuByName(const std::string& name, BOOL recurse) const; |
423 | 423 | ||
424 | BOOL clearHoverItem(); | 424 | BOOL clearHoverItem(); |
425 | 425 | ||
426 | // return the name label | 426 | // return the name label |
427 | const LLString& getLabel( void ) const { return mLabel.getString(); } | 427 | const std::string& getLabel( void ) const { return mLabel.getString(); } |
428 | void setLabel(const LLStringExplicit& label) { mLabel = label; } | 428 | void setLabel(const LLStringExplicit& label) { mLabel = label; } |
429 | 429 | ||
430 | // background colors | 430 | // background colors |
@@ -438,7 +438,7 @@ public: | |||
438 | virtual BOOL append( LLMenuItemGL* item ); | 438 | virtual BOOL append( LLMenuItemGL* item ); |
439 | 439 | ||
440 | // add a separator to this menu | 440 | // add a separator to this menu |
441 | virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); | 441 | virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); |
442 | 442 | ||
443 | // add a menu - this will create a cascading menu | 443 | // add a menu - this will create a cascading menu |
444 | virtual BOOL appendMenu( LLMenuGL* menu ); | 444 | virtual BOOL appendMenu( LLMenuGL* menu ); |
@@ -449,12 +449,12 @@ public: | |||
449 | // setItemEnabled() - pass the name and the enable flag for a | 449 | // setItemEnabled() - pass the name and the enable flag for a |
450 | // menu item. TRUE will make sure it's enabled, FALSE will disable | 450 | // menu item. TRUE will make sure it's enabled, FALSE will disable |
451 | // it. | 451 | // it. |
452 | void setItemEnabled( const LLString& name, BOOL enable ); | 452 | void setItemEnabled( const std::string& name, BOOL enable ); |
453 | 453 | ||
454 | // propagate message to submenus | 454 | // propagate message to submenus |
455 | void setEnabledSubMenus(BOOL enable); | 455 | void setEnabledSubMenus(BOOL enable); |
456 | 456 | ||
457 | void setItemVisible( const LLString& name, BOOL visible); | 457 | void setItemVisible( const std::string& name, BOOL visible); |
458 | 458 | ||
459 | // sets the left,bottom corner of menu, useful for popups | 459 | // sets the left,bottom corner of menu, useful for popups |
460 | void setLeftAndBottom(S32 left, S32 bottom); | 460 | void setLeftAndBottom(S32 left, S32 bottom); |
@@ -499,7 +499,7 @@ public: | |||
499 | void setDropShadowed( const BOOL shadowed ); | 499 | void setDropShadowed( const BOOL shadowed ); |
500 | 500 | ||
501 | void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item; } | 501 | void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item; } |
502 | LLMenuItemGL* getParentMenuItem() { return mParentMenuItem; } | 502 | LLMenuItemGL* getParentMenuItem() const { return mParentMenuItem; } |
503 | 503 | ||
504 | void setTornOff(BOOL torn_off); | 504 | void setTornOff(BOOL torn_off); |
505 | BOOL getTornOff() { return mTornOff; } | 505 | BOOL getTornOff() { return mTornOff; } |
@@ -561,11 +561,11 @@ private: | |||
561 | class LLMenuItemBranchGL : public LLMenuItemGL | 561 | class LLMenuItemBranchGL : public LLMenuItemGL |
562 | { | 562 | { |
563 | public: | 563 | public: |
564 | LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch, | 564 | LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, |
565 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); | 565 | KEY key = KEY_NONE, MASK mask = MASK_NONE ); |
566 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 566 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
567 | 567 | ||
568 | virtual LLString getType() const { return "menu"; } | 568 | virtual std::string getType() const { return "menu"; } |
569 | 569 | ||
570 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); | 570 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); |
571 | 571 | ||
@@ -606,7 +606,7 @@ public: | |||
606 | 606 | ||
607 | virtual void openMenu(); | 607 | virtual void openMenu(); |
608 | 608 | ||
609 | virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; | 609 | virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; |
610 | 610 | ||
611 | private: | 611 | private: |
612 | LLMenuGL* mBranch; | 612 | LLMenuGL* mBranch; |
@@ -623,8 +623,8 @@ class LLPieMenu | |||
623 | : public LLMenuGL | 623 | : public LLMenuGL |
624 | { | 624 | { |
625 | public: | 625 | public: |
626 | LLPieMenu(const LLString& name, const LLString& label); | 626 | LLPieMenu(const std::string& name, const std::string& label); |
627 | LLPieMenu(const LLString& name); | 627 | LLPieMenu(const std::string& name); |
628 | virtual ~LLPieMenu() {} | 628 | virtual ~LLPieMenu() {} |
629 | 629 | ||
630 | void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); | 630 | void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); |
@@ -642,7 +642,7 @@ public: | |||
642 | virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); | 642 | virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); |
643 | 643 | ||
644 | virtual BOOL append(LLMenuItemGL* item); | 644 | virtual BOOL append(LLMenuItemGL* item); |
645 | virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); | 645 | virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); |
646 | 646 | ||
647 | BOOL appendPieMenu(LLPieMenu *menu); | 647 | BOOL appendPieMenu(LLPieMenu *menu); |
648 | 648 | ||
@@ -682,7 +682,7 @@ private: | |||
682 | class LLMenuBarGL : public LLMenuGL | 682 | class LLMenuBarGL : public LLMenuGL |
683 | { | 683 | { |
684 | public: | 684 | public: |
685 | LLMenuBarGL( const LLString& name ); | 685 | LLMenuBarGL( const std::string& name ); |
686 | virtual ~LLMenuBarGL(); | 686 | virtual ~LLMenuBarGL(); |
687 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 687 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
688 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 688 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
@@ -690,6 +690,8 @@ public: | |||
690 | virtual BOOL handleAcceleratorKey(KEY key, MASK mask); | 690 | virtual BOOL handleAcceleratorKey(KEY key, MASK mask); |
691 | virtual BOOL handleKeyHere(KEY key, MASK mask); | 691 | virtual BOOL handleKeyHere(KEY key, MASK mask); |
692 | virtual BOOL handleJumpKey(KEY key); | 692 | virtual BOOL handleJumpKey(KEY key); |
693 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); | ||
694 | virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); | ||
693 | 695 | ||
694 | // rearrange the child rects so they fit the shape of the menu | 696 | // rearrange the child rects so they fit the shape of the menu |
695 | // bar. | 697 | // bar. |
@@ -698,7 +700,7 @@ public: | |||
698 | virtual BOOL jumpKeysActive(); | 700 | virtual BOOL jumpKeysActive(); |
699 | 701 | ||
700 | // add a vertical separator to this menu | 702 | // add a vertical separator to this menu |
701 | virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); | 703 | virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); |
702 | 704 | ||
703 | // add a menu - this will create a drop down menu. | 705 | // add a menu - this will create a drop down menu. |
704 | virtual BOOL appendMenu( LLMenuGL* menu ); | 706 | virtual BOOL appendMenu( LLMenuGL* menu ); |
@@ -727,7 +729,7 @@ class LLMenuHolderGL : public LLPanel | |||
727 | { | 729 | { |
728 | public: | 730 | public: |
729 | LLMenuHolderGL(); | 731 | LLMenuHolderGL(); |
730 | LLMenuHolderGL(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); | 732 | LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); |
731 | virtual ~LLMenuHolderGL() {} | 733 | virtual ~LLMenuHolderGL() {} |
732 | 734 | ||
733 | virtual BOOL hideMenus(); | 735 | virtual BOOL hideMenus(); |
@@ -789,7 +791,7 @@ class LLMenuItemTearOffGL : public LLMenuItemGL | |||
789 | public: | 791 | public: |
790 | LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); | 792 | LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); |
791 | 793 | ||
792 | virtual LLString getType() const { return "tearoff_menu"; } | 794 | virtual std::string getType() const { return "tearoff_menu"; } |
793 | 795 | ||
794 | virtual void doIt(void); | 796 | virtual void doIt(void); |
795 | virtual void draw(void); | 797 | virtual void draw(void); |
diff --git a/linden/indra/llui/llmodaldialog.cpp b/linden/indra/llui/llmodaldialog.cpp index 160495d..1b05b0e 100644 --- a/linden/indra/llui/llmodaldialog.cpp +++ b/linden/indra/llui/llmodaldialog.cpp | |||
@@ -43,8 +43,8 @@ | |||
43 | // static | 43 | // static |
44 | std::list<LLModalDialog*> LLModalDialog::sModalStack; | 44 | std::list<LLModalDialog*> LLModalDialog::sModalStack; |
45 | 45 | ||
46 | LLModalDialog::LLModalDialog( const LLString& title, S32 width, S32 height, BOOL modal ) | 46 | LLModalDialog::LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal ) |
47 | : LLFloater( "modal container", | 47 | : LLFloater( std::string("modal container"), |
48 | LLRect( 0, height, width, 0 ), | 48 | LLRect( 0, height, width, 0 ), |
49 | title, | 49 | title, |
50 | FALSE, // resizable | 50 | FALSE, // resizable |
diff --git a/linden/indra/llui/llmodaldialog.h b/linden/indra/llui/llmodaldialog.h index 77bd9db..d38b7a6 100644 --- a/linden/indra/llui/llmodaldialog.h +++ b/linden/indra/llui/llmodaldialog.h | |||
@@ -44,7 +44,7 @@ class LLModalDialog; | |||
44 | class LLModalDialog : public LLFloater | 44 | class LLModalDialog : public LLFloater |
45 | { | 45 | { |
46 | public: | 46 | public: |
47 | LLModalDialog( const LLString& title, S32 width, S32 height, BOOL modal = true ); | 47 | LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal = true ); |
48 | /*virtual*/ ~LLModalDialog(); | 48 | /*virtual*/ ~LLModalDialog(); |
49 | 49 | ||
50 | /*virtual*/ void open(); /* Flawfinder: ignore */ | 50 | /*virtual*/ void open(); /* Flawfinder: ignore */ |
diff --git a/linden/indra/llui/llmultislider.cpp b/linden/indra/llui/llmultislider.cpp index dfa36fa..227cf98 100644 --- a/linden/indra/llui/llmultislider.cpp +++ b/linden/indra/llui/llmultislider.cpp | |||
@@ -54,7 +54,7 @@ const S32 EXTRA_TRIANGLE_HEIGHT = -2; | |||
54 | S32 LLMultiSlider::mNameCounter = 0; | 54 | S32 LLMultiSlider::mNameCounter = 0; |
55 | 55 | ||
56 | LLMultiSlider::LLMultiSlider( | 56 | LLMultiSlider::LLMultiSlider( |
57 | const LLString& name, | 57 | const std::string& name, |
58 | const LLRect& rect, | 58 | const LLRect& rect, |
59 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), | 59 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), |
60 | void* callback_userdata, | 60 | void* callback_userdata, |
@@ -66,7 +66,7 @@ LLMultiSlider::LLMultiSlider( | |||
66 | BOOL allow_overlap, | 66 | BOOL allow_overlap, |
67 | BOOL draw_track, | 67 | BOOL draw_track, |
68 | BOOL use_triangle, | 68 | BOOL use_triangle, |
69 | const LLString& control_name) | 69 | const std::string& control_name) |
70 | : | 70 | : |
71 | LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, | 71 | LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, |
72 | FOLLOWS_LEFT | FOLLOWS_TOP), | 72 | FOLLOWS_LEFT | FOLLOWS_TOP), |
@@ -91,7 +91,7 @@ LLMultiSlider::LLMultiSlider( | |||
91 | mMouseUpCallback( NULL ) | 91 | mMouseUpCallback( NULL ) |
92 | { | 92 | { |
93 | mValue.emptyMap(); | 93 | mValue.emptyMap(); |
94 | mCurSlider = LLString::null; | 94 | mCurSlider = LLStringUtil::null; |
95 | 95 | ||
96 | // properly handle setting the starting thumb rect | 96 | // properly handle setting the starting thumb rect |
97 | // do it this way to handle both the operating-on-settings | 97 | // do it this way to handle both the operating-on-settings |
@@ -100,7 +100,7 @@ LLMultiSlider::LLMultiSlider( | |||
100 | setValue(getValue()); | 100 | setValue(getValue()); |
101 | } | 101 | } |
102 | 102 | ||
103 | void LLMultiSlider::setSliderValue(const LLString& name, F32 value, BOOL from_event) | 103 | void LLMultiSlider::setSliderValue(const std::string& name, F32 value, BOOL from_event) |
104 | { | 104 | { |
105 | // exit if not there | 105 | // exit if not there |
106 | if(!mValue.has(name)) { | 106 | if(!mValue.has(name)) { |
@@ -174,30 +174,30 @@ void LLMultiSlider::setValue(const LLSD& value) | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | F32 LLMultiSlider::getSliderValue(const LLString& name) const | 177 | F32 LLMultiSlider::getSliderValue(const std::string& name) const |
178 | { | 178 | { |
179 | return (F32)mValue[name].asReal(); | 179 | return (F32)mValue[name].asReal(); |
180 | } | 180 | } |
181 | 181 | ||
182 | void LLMultiSlider::setCurSlider(const LLString& name) | 182 | void LLMultiSlider::setCurSlider(const std::string& name) |
183 | { | 183 | { |
184 | if(mValue.has(name)) { | 184 | if(mValue.has(name)) { |
185 | mCurSlider = name; | 185 | mCurSlider = name; |
186 | } | 186 | } |
187 | } | 187 | } |
188 | 188 | ||
189 | const LLString& LLMultiSlider::addSlider() | 189 | const std::string& LLMultiSlider::addSlider() |
190 | { | 190 | { |
191 | return addSlider(mInitialValue); | 191 | return addSlider(mInitialValue); |
192 | } | 192 | } |
193 | 193 | ||
194 | const LLString& LLMultiSlider::addSlider(F32 val) | 194 | const std::string& LLMultiSlider::addSlider(F32 val) |
195 | { | 195 | { |
196 | std::stringstream newName; | 196 | std::stringstream newName; |
197 | F32 initVal = val; | 197 | F32 initVal = val; |
198 | 198 | ||
199 | if(mValue.size() >= mMaxNumSliders) { | 199 | if(mValue.size() >= mMaxNumSliders) { |
200 | return LLString::null; | 200 | return LLStringUtil::null; |
201 | } | 201 | } |
202 | 202 | ||
203 | // create a new name | 203 | // create a new name |
@@ -206,7 +206,7 @@ const LLString& LLMultiSlider::addSlider(F32 val) | |||
206 | 206 | ||
207 | bool foundOne = findUnusedValue(initVal); | 207 | bool foundOne = findUnusedValue(initVal); |
208 | if(!foundOne) { | 208 | if(!foundOne) { |
209 | return LLString::null; | 209 | return LLStringUtil::null; |
210 | } | 210 | } |
211 | 211 | ||
212 | // add a new thumb rect | 212 | // add a new thumb rect |
@@ -269,7 +269,7 @@ bool LLMultiSlider::findUnusedValue(F32& initVal) | |||
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
272 | void LLMultiSlider::deleteSlider(const LLString& name) | 272 | void LLMultiSlider::deleteSlider(const std::string& name) |
273 | { | 273 | { |
274 | // can't delete last slider | 274 | // can't delete last slider |
275 | if(mValue.size() <= 0) { | 275 | if(mValue.size() <= 0) { |
@@ -282,7 +282,7 @@ void LLMultiSlider::deleteSlider(const LLString& name) | |||
282 | 282 | ||
283 | // set to the last created | 283 | // set to the last created |
284 | if(mValue.size() > 0) { | 284 | if(mValue.size() > 0) { |
285 | std::map<LLString, LLRect>::iterator mIt = mThumbRects.end(); | 285 | std::map<std::string, LLRect>::iterator mIt = mThumbRects.end(); |
286 | mIt--; | 286 | mIt--; |
287 | mCurSlider = mIt->first; | 287 | mCurSlider = mIt->first; |
288 | } | 288 | } |
@@ -365,7 +365,7 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask) | |||
365 | else | 365 | else |
366 | { | 366 | { |
367 | // scroll through thumbs to see if we have a new one selected and select that one | 367 | // scroll through thumbs to see if we have a new one selected and select that one |
368 | std::map<LLString, LLRect>::iterator mIt = mThumbRects.begin(); | 368 | std::map<std::string, LLRect>::iterator mIt = mThumbRects.begin(); |
369 | for(; mIt != mThumbRects.end(); mIt++) { | 369 | for(; mIt != mThumbRects.end(); mIt++) { |
370 | 370 | ||
371 | // check if inside. If so, set current slider and continue | 371 | // check if inside. If so, set current slider and continue |
@@ -425,8 +425,8 @@ void LLMultiSlider::draw() | |||
425 | { | 425 | { |
426 | LLColor4 curThumbColor; | 426 | LLColor4 curThumbColor; |
427 | 427 | ||
428 | std::map<LLString, LLRect>::iterator mIt; | 428 | std::map<std::string, LLRect>::iterator mIt; |
429 | std::map<LLString, LLRect>::iterator curSldrIt; | 429 | std::map<std::string, LLRect>::iterator curSldrIt; |
430 | 430 | ||
431 | // Draw background and thumb. | 431 | // Draw background and thumb. |
432 | 432 | ||
@@ -582,7 +582,7 @@ LLXMLNodePtr LLMultiSlider::getXML(bool save_children) const | |||
582 | //static | 582 | //static |
583 | LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 583 | LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
584 | { | 584 | { |
585 | LLString name("multi_slider_bar"); | 585 | std::string name("multi_slider_bar"); |
586 | node->getAttributeString("name", name); | 586 | node->getAttributeString("name", name); |
587 | 587 | ||
588 | LLRect rect; | 588 | LLRect rect; |
diff --git a/linden/indra/llui/llmultislider.h b/linden/indra/llui/llmultislider.h index df6153a..001ed26 100644 --- a/linden/indra/llui/llmultislider.h +++ b/linden/indra/llui/llmultislider.h | |||
@@ -41,7 +41,7 @@ class LLMultiSlider : public LLUICtrl | |||
41 | { | 41 | { |
42 | public: | 42 | public: |
43 | LLMultiSlider( | 43 | LLMultiSlider( |
44 | const LLString& name, | 44 | const std::string& name, |
45 | const LLRect& rect, | 45 | const LLRect& rect, |
46 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), | 46 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), |
47 | void* callback_userdata, | 47 | void* callback_userdata, |
@@ -53,17 +53,17 @@ public: | |||
53 | BOOL allow_overlap, | 53 | BOOL allow_overlap, |
54 | BOOL draw_track, | 54 | BOOL draw_track, |
55 | BOOL use_triangle, | 55 | BOOL use_triangle, |
56 | const LLString& control_name = LLString::null ); | 56 | const std::string& control_name = LLStringUtil::null ); |
57 | 57 | ||
58 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 58 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
59 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 59 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
60 | 60 | ||
61 | void setSliderValue(const LLString& name, F32 value, BOOL from_event = FALSE); | 61 | void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); |
62 | F32 getSliderValue(const LLString& name) const; | 62 | F32 getSliderValue(const std::string& name) const; |
63 | 63 | ||
64 | const LLString& getCurSlider() const { return mCurSlider; } | 64 | const std::string& getCurSlider() const { return mCurSlider; } |
65 | F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } | 65 | F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } |
66 | void setCurSlider(const LLString& name); | 66 | void setCurSlider(const std::string& name); |
67 | void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } | 67 | void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } |
68 | 68 | ||
69 | virtual void setValue(const LLSD& value); | 69 | virtual void setValue(const LLSD& value); |
@@ -83,9 +83,9 @@ public: | |||
83 | void setMouseUpCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseUpCallback = cb; } | 83 | void setMouseUpCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseUpCallback = cb; } |
84 | 84 | ||
85 | bool findUnusedValue(F32& initVal); | 85 | bool findUnusedValue(F32& initVal); |
86 | const LLString& addSlider(); | 86 | const std::string& addSlider(); |
87 | const LLString& addSlider(F32 val); | 87 | const std::string& addSlider(F32 val); |
88 | void deleteSlider(const LLString& name); | 88 | void deleteSlider(const std::string& name); |
89 | void deleteCurSlider() { deleteSlider(mCurSlider); } | 89 | void deleteCurSlider() { deleteSlider(mCurSlider); } |
90 | void clear(); | 90 | void clear(); |
91 | 91 | ||
@@ -101,7 +101,7 @@ protected: | |||
101 | F32 mMinValue; | 101 | F32 mMinValue; |
102 | F32 mMaxValue; | 102 | F32 mMaxValue; |
103 | F32 mIncrement; | 103 | F32 mIncrement; |
104 | LLString mCurSlider; | 104 | std::string mCurSlider; |
105 | static S32 mNameCounter; | 105 | static S32 mNameCounter; |
106 | 106 | ||
107 | S32 mMaxNumSliders; | 107 | S32 mMaxNumSliders; |
@@ -112,7 +112,7 @@ protected: | |||
112 | S32 mMouseOffset; | 112 | S32 mMouseOffset; |
113 | LLRect mDragStartThumbRect; | 113 | LLRect mDragStartThumbRect; |
114 | 114 | ||
115 | std::map<LLString, LLRect> mThumbRects; | 115 | std::map<std::string, LLRect> mThumbRects; |
116 | LLColor4 mTrackColor; | 116 | LLColor4 mTrackColor; |
117 | LLColor4 mThumbOutlineColor; | 117 | LLColor4 mThumbOutlineColor; |
118 | LLColor4 mThumbCenterColor; | 118 | LLColor4 mThumbCenterColor; |
diff --git a/linden/indra/llui/llmultisliderctrl.cpp b/linden/indra/llui/llmultisliderctrl.cpp index c242d18..673887b 100644 --- a/linden/indra/llui/llmultisliderctrl.cpp +++ b/linden/indra/llui/llmultisliderctrl.cpp | |||
@@ -55,8 +55,8 @@ static LLRegisterWidget<LLMultiSliderCtrl> r("multi_slider"); | |||
55 | const U32 MAX_STRING_LENGTH = 10; | 55 | const U32 MAX_STRING_LENGTH = 10; |
56 | 56 | ||
57 | 57 | ||
58 | LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, | 58 | LLMultiSliderCtrl::LLMultiSliderCtrl(const std::string& name, const LLRect& rect, |
59 | const LLString& label, | 59 | const std::string& label, |
60 | const LLFontGL* font, | 60 | const LLFontGL* font, |
61 | S32 label_width, | 61 | S32 label_width, |
62 | S32 text_left, | 62 | S32 text_left, |
@@ -68,7 +68,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, | |||
68 | S32 max_sliders, BOOL allow_overlap, | 68 | S32 max_sliders, BOOL allow_overlap, |
69 | BOOL draw_track, | 69 | BOOL draw_track, |
70 | BOOL use_triangle, | 70 | BOOL use_triangle, |
71 | const LLString& control_which) | 71 | const std::string& control_which) |
72 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), | 72 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), |
73 | mFont(font), | 73 | mFont(font), |
74 | mShowText( show_text ), | 74 | mShowText( show_text ), |
@@ -96,7 +96,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, | |||
96 | label_width = font->getWidth(label); | 96 | label_width = font->getWidth(label); |
97 | } | 97 | } |
98 | LLRect label_rect( left, top, label_width, bottom ); | 98 | LLRect label_rect( left, top, label_width, bottom ); |
99 | mLabelBox = new LLTextBox( "MultiSliderCtrl Label", label_rect, label.c_str(), font ); | 99 | mLabelBox = new LLTextBox( std::string("MultiSliderCtrl Label"), label_rect, label, font ); |
100 | addChild(mLabelBox); | 100 | addChild(mLabelBox); |
101 | } | 101 | } |
102 | 102 | ||
@@ -109,7 +109,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, | |||
109 | S32 slider_left = label_width ? label_width + MULTI_SLIDERCTRL_SPACING : 0; | 109 | S32 slider_left = label_width ? label_width + MULTI_SLIDERCTRL_SPACING : 0; |
110 | LLRect slider_rect( slider_left, top, slider_right, bottom ); | 110 | LLRect slider_rect( slider_left, top, slider_right, bottom ); |
111 | mMultiSlider = new LLMultiSlider( | 111 | mMultiSlider = new LLMultiSlider( |
112 | "multi_slider", | 112 | std::string("multi_slider"), |
113 | slider_rect, | 113 | slider_rect, |
114 | LLMultiSliderCtrl::onSliderCommit, this, | 114 | LLMultiSliderCtrl::onSliderCommit, this, |
115 | initial_value, min_value, max_value, increment, | 115 | initial_value, min_value, max_value, increment, |
@@ -124,8 +124,8 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, | |||
124 | LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); | 124 | LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); |
125 | if( can_edit_text ) | 125 | if( can_edit_text ) |
126 | { | 126 | { |
127 | mEditor = new LLLineEditor( "MultiSliderCtrl Editor", text_rect, | 127 | mEditor = new LLLineEditor( std::string("MultiSliderCtrl Editor"), text_rect, |
128 | "", font, | 128 | LLStringUtil::null, font, |
129 | MAX_STRING_LENGTH, | 129 | MAX_STRING_LENGTH, |
130 | &LLMultiSliderCtrl::onEditorCommit, NULL, NULL, this, | 130 | &LLMultiSliderCtrl::onEditorCommit, NULL, NULL, this, |
131 | &LLLineEditor::prevalidateFloat ); | 131 | &LLLineEditor::prevalidateFloat ); |
@@ -140,7 +140,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLString& name, const LLRect& rect, | |||
140 | } | 140 | } |
141 | else | 141 | else |
142 | { | 142 | { |
143 | mTextBox = new LLTextBox( "MultiSliderCtrl Text", text_rect, "", font); | 143 | mTextBox = new LLTextBox( std::string("MultiSliderCtrl Text"), text_rect, LLStringUtil::null, font); |
144 | mTextBox->setFollowsLeft(); | 144 | mTextBox->setFollowsLeft(); |
145 | mTextBox->setFollowsBottom(); | 145 | mTextBox->setFollowsBottom(); |
146 | addChild(mTextBox); | 146 | addChild(mTextBox); |
@@ -172,20 +172,20 @@ void LLMultiSliderCtrl::setValue(const LLSD& value) | |||
172 | updateText(); | 172 | updateText(); |
173 | } | 173 | } |
174 | 174 | ||
175 | void LLMultiSliderCtrl::setSliderValue(const LLString& name, F32 v, BOOL from_event) | 175 | void LLMultiSliderCtrl::setSliderValue(const std::string& name, F32 v, BOOL from_event) |
176 | { | 176 | { |
177 | mMultiSlider->setSliderValue(name, v, from_event ); | 177 | mMultiSlider->setSliderValue(name, v, from_event ); |
178 | mCurValue = mMultiSlider->getCurSliderValue(); | 178 | mCurValue = mMultiSlider->getCurSliderValue(); |
179 | updateText(); | 179 | updateText(); |
180 | } | 180 | } |
181 | 181 | ||
182 | void LLMultiSliderCtrl::setCurSlider(const LLString& name) | 182 | void LLMultiSliderCtrl::setCurSlider(const std::string& name) |
183 | { | 183 | { |
184 | mMultiSlider->setCurSlider(name); | 184 | mMultiSlider->setCurSlider(name); |
185 | mCurValue = mMultiSlider->getCurSliderValue(); | 185 | mCurValue = mMultiSlider->getCurSliderValue(); |
186 | } | 186 | } |
187 | 187 | ||
188 | BOOL LLMultiSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 188 | BOOL LLMultiSliderCtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
189 | { | 189 | { |
190 | BOOL res = FALSE; | 190 | BOOL res = FALSE; |
191 | if (mLabelBox) | 191 | if (mLabelBox) |
@@ -210,13 +210,13 @@ BOOL LLMultiSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit | |||
210 | return res; | 210 | return res; |
211 | } | 211 | } |
212 | 212 | ||
213 | const LLString& LLMultiSliderCtrl::addSlider() | 213 | const std::string& LLMultiSliderCtrl::addSlider() |
214 | { | 214 | { |
215 | const LLString& name = mMultiSlider->addSlider(); | 215 | const std::string& name = mMultiSlider->addSlider(); |
216 | 216 | ||
217 | // if it returns null, pass it on | 217 | // if it returns null, pass it on |
218 | if(name == LLString::null) { | 218 | if(name == LLStringUtil::null) { |
219 | return LLString::null; | 219 | return LLStringUtil::null; |
220 | } | 220 | } |
221 | 221 | ||
222 | // otherwise, update stuff | 222 | // otherwise, update stuff |
@@ -225,13 +225,13 @@ const LLString& LLMultiSliderCtrl::addSlider() | |||
225 | return name; | 225 | return name; |
226 | } | 226 | } |
227 | 227 | ||
228 | const LLString& LLMultiSliderCtrl::addSlider(F32 val) | 228 | const std::string& LLMultiSliderCtrl::addSlider(F32 val) |
229 | { | 229 | { |
230 | const LLString& name = mMultiSlider->addSlider(val); | 230 | const std::string& name = mMultiSlider->addSlider(val); |
231 | 231 | ||
232 | // if it returns null, pass it on | 232 | // if it returns null, pass it on |
233 | if(name == LLString::null) { | 233 | if(name == LLStringUtil::null) { |
234 | return LLString::null; | 234 | return LLStringUtil::null; |
235 | } | 235 | } |
236 | 236 | ||
237 | // otherwise, update stuff | 237 | // otherwise, update stuff |
@@ -240,7 +240,7 @@ const LLString& LLMultiSliderCtrl::addSlider(F32 val) | |||
240 | return name; | 240 | return name; |
241 | } | 241 | } |
242 | 242 | ||
243 | void LLMultiSliderCtrl::deleteSlider(const LLString& name) | 243 | void LLMultiSliderCtrl::deleteSlider(const std::string& name) |
244 | { | 244 | { |
245 | mMultiSlider->deleteSlider(name); | 245 | mMultiSlider->deleteSlider(name); |
246 | mCurValue = mMultiSlider->getCurSliderValue(); | 246 | mCurValue = mMultiSlider->getCurSliderValue(); |
@@ -253,11 +253,11 @@ void LLMultiSliderCtrl::clear() | |||
253 | setCurSliderValue(0.0f); | 253 | setCurSliderValue(0.0f); |
254 | if( mEditor ) | 254 | if( mEditor ) |
255 | { | 255 | { |
256 | mEditor->setText(LLString("")); | 256 | mEditor->setText(std::string("")); |
257 | } | 257 | } |
258 | if( mTextBox ) | 258 | if( mTextBox ) |
259 | { | 259 | { |
260 | mTextBox->setText(LLString("")); | 260 | mTextBox->setText(std::string("")); |
261 | } | 261 | } |
262 | 262 | ||
263 | // get rid of sliders | 263 | // get rid of sliders |
@@ -279,8 +279,8 @@ void LLMultiSliderCtrl::updateText() | |||
279 | // Don't display very small negative values as -0.000 | 279 | // Don't display very small negative values as -0.000 |
280 | F32 displayed_value = (F32)(floor(getCurSliderValue() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision)); | 280 | F32 displayed_value = (F32)(floor(getCurSliderValue() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision)); |
281 | 281 | ||
282 | LLString format = llformat("%%.%df", mPrecision); | 282 | std::string format = llformat("%%.%df", mPrecision); |
283 | LLString text = llformat(format.c_str(), displayed_value); | 283 | std::string text = llformat(format.c_str(), displayed_value); |
284 | if( mEditor ) | 284 | if( mEditor ) |
285 | { | 285 | { |
286 | mEditor->setText( text ); | 286 | mEditor->setText( text ); |
@@ -302,7 +302,7 @@ void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) | |||
302 | F32 val = self->mCurValue; | 302 | F32 val = self->mCurValue; |
303 | F32 saved_val = self->mCurValue; | 303 | F32 saved_val = self->mCurValue; |
304 | 304 | ||
305 | LLString text = self->mEditor->getText(); | 305 | std::string text = self->mEditor->getText(); |
306 | if( LLLineEditor::postvalidateFloat( text ) ) | 306 | if( LLLineEditor::postvalidateFloat( text ) ) |
307 | { | 307 | { |
308 | LLLocale locale(LLLocale::USER_LOCALE); | 308 | LLLocale locale(LLLocale::USER_LOCALE); |
@@ -484,13 +484,13 @@ void LLMultiSliderCtrl::reportInvalidData() | |||
484 | } | 484 | } |
485 | 485 | ||
486 | //virtual | 486 | //virtual |
487 | LLString LLMultiSliderCtrl::getControlName() const | 487 | std::string LLMultiSliderCtrl::getControlName() const |
488 | { | 488 | { |
489 | return mMultiSlider->getControlName(); | 489 | return mMultiSlider->getControlName(); |
490 | } | 490 | } |
491 | 491 | ||
492 | // virtual | 492 | // virtual |
493 | void LLMultiSliderCtrl::setControlName(const LLString& control_name, LLView* context) | 493 | void LLMultiSliderCtrl::setControlName(const std::string& control_name, LLView* context) |
494 | { | 494 | { |
495 | mMultiSlider->setControlName(control_name, context); | 495 | mMultiSlider->setControlName(control_name, context); |
496 | } | 496 | } |
@@ -529,10 +529,10 @@ LLXMLNodePtr LLMultiSliderCtrl::getXML(bool save_children) const | |||
529 | 529 | ||
530 | LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 530 | LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
531 | { | 531 | { |
532 | LLString name("multi_slider"); | 532 | std::string name("multi_slider"); |
533 | node->getAttributeString("name", name); | 533 | node->getAttributeString("name", name); |
534 | 534 | ||
535 | LLString label; | 535 | std::string label; |
536 | node->getAttributeString("label", label); | 536 | node->getAttributeString("label", label); |
537 | 537 | ||
538 | LLRect rect; | 538 | LLRect rect; |
@@ -588,13 +588,13 @@ LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa | |||
588 | { | 588 | { |
589 | // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) | 589 | // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) |
590 | if ( max_value ) | 590 | if ( max_value ) |
591 | text_left = font->getWidth("0") * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); | 591 | text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); |
592 | 592 | ||
593 | if ( increment < 1.0f ) | 593 | if ( increment < 1.0f ) |
594 | text_left += font->getWidth("."); // (mostly) take account of decimal point in value | 594 | text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value |
595 | 595 | ||
596 | if ( min_value < 0.0f || max_value < 0.0f ) | 596 | if ( min_value < 0.0f || max_value < 0.0f ) |
597 | text_left += font->getWidth("-"); // (mostly) take account of minus sign | 597 | text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign |
598 | 598 | ||
599 | // padding to make things look nicer | 599 | // padding to make things look nicer |
600 | text_left += 8; | 600 | text_left += 8; |
diff --git a/linden/indra/llui/llmultisliderctrl.h b/linden/indra/llui/llmultisliderctrl.h index 6a298c8..1f41d81 100644 --- a/linden/indra/llui/llmultisliderctrl.h +++ b/linden/indra/llui/llmultisliderctrl.h | |||
@@ -55,9 +55,9 @@ class LLSlider; | |||
55 | class LLMultiSliderCtrl : public LLUICtrl | 55 | class LLMultiSliderCtrl : public LLUICtrl |
56 | { | 56 | { |
57 | public: | 57 | public: |
58 | LLMultiSliderCtrl(const LLString& name, | 58 | LLMultiSliderCtrl(const std::string& name, |
59 | const LLRect& rect, | 59 | const LLRect& rect, |
60 | const LLString& label, | 60 | const std::string& label, |
61 | const LLFontGL* font, | 61 | const LLFontGL* font, |
62 | S32 slider_left, | 62 | S32 slider_left, |
63 | S32 text_left, | 63 | S32 text_left, |
@@ -68,22 +68,22 @@ public: | |||
68 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, | 68 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, |
69 | S32 max_sliders, BOOL allow_overlap, BOOL draw_track, | 69 | S32 max_sliders, BOOL allow_overlap, BOOL draw_track, |
70 | BOOL use_triangle, | 70 | BOOL use_triangle, |
71 | const LLString& control_which = LLString::null ); | 71 | const std::string& control_which = LLStringUtil::null ); |
72 | 72 | ||
73 | virtual ~LLMultiSliderCtrl(); | 73 | virtual ~LLMultiSliderCtrl(); |
74 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 74 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
75 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 75 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
76 | 76 | ||
77 | F32 getSliderValue(const LLString& name) const; | 77 | F32 getSliderValue(const std::string& name) const; |
78 | void setSliderValue(const LLString& name, F32 v, BOOL from_event = FALSE); | 78 | void setSliderValue(const std::string& name, F32 v, BOOL from_event = FALSE); |
79 | 79 | ||
80 | virtual void setValue(const LLSD& value ); | 80 | virtual void setValue(const LLSD& value ); |
81 | virtual LLSD getValue() const { return mMultiSlider->getValue(); } | 81 | virtual LLSD getValue() const { return mMultiSlider->getValue(); } |
82 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 82 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
83 | 83 | ||
84 | const LLString& getCurSlider() const { return mMultiSlider->getCurSlider(); } | 84 | const std::string& getCurSlider() const { return mMultiSlider->getCurSlider(); } |
85 | F32 getCurSliderValue() const { return mCurValue; } | 85 | F32 getCurSliderValue() const { return mCurValue; } |
86 | void setCurSlider(const LLString& name); | 86 | void setCurSlider(const std::string& name); |
87 | void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mMultiSlider->getCurSlider(), val, from_event); } | 87 | void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mMultiSlider->getCurSlider(), val, from_event); } |
88 | 88 | ||
89 | virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } | 89 | virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } |
@@ -99,15 +99,15 @@ public: | |||
99 | void setIncrement(F32 increment) {mMultiSlider->setIncrement(increment);} | 99 | void setIncrement(F32 increment) {mMultiSlider->setIncrement(increment);} |
100 | 100 | ||
101 | /// for adding and deleting sliders | 101 | /// for adding and deleting sliders |
102 | const LLString& addSlider(); | 102 | const std::string& addSlider(); |
103 | const LLString& addSlider(F32 val); | 103 | const std::string& addSlider(F32 val); |
104 | void deleteSlider(const LLString& name); | 104 | void deleteSlider(const std::string& name); |
105 | void deleteCurSlider() { deleteSlider(mMultiSlider->getCurSlider()); } | 105 | void deleteCurSlider() { deleteSlider(mMultiSlider->getCurSlider()); } |
106 | 106 | ||
107 | F32 getMinValue() { return mMultiSlider->getMinValue(); } | 107 | F32 getMinValue() { return mMultiSlider->getMinValue(); } |
108 | F32 getMaxValue() { return mMultiSlider->getMaxValue(); } | 108 | F32 getMaxValue() { return mMultiSlider->getMaxValue(); } |
109 | 109 | ||
110 | void setLabel(const LLString& label) { if (mLabelBox) mLabelBox->setText(label); } | 110 | void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); } |
111 | void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } | 111 | void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } |
112 | void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } | 112 | void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } |
113 | 113 | ||
@@ -119,8 +119,8 @@ public: | |||
119 | virtual void setTentative(BOOL b); // marks value as tentative | 119 | virtual void setTentative(BOOL b); // marks value as tentative |
120 | virtual void onCommit(); // mark not tentative, then commit | 120 | virtual void onCommit(); // mark not tentative, then commit |
121 | 121 | ||
122 | virtual void setControlName(const LLString& control_name, LLView* context); | 122 | virtual void setControlName(const std::string& control_name, LLView* context); |
123 | virtual LLString getControlName() const; | 123 | virtual std::string getControlName() const; |
124 | 124 | ||
125 | static void onSliderCommit(LLUICtrl* caller, void* userdata); | 125 | static void onSliderCommit(LLUICtrl* caller, void* userdata); |
126 | static void onSliderMouseDown(LLUICtrl* caller,void* userdata); | 126 | static void onSliderMouseDown(LLUICtrl* caller,void* userdata); |
diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index 7db3725..f1ccb01 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp | |||
@@ -55,8 +55,6 @@ | |||
55 | #include "llbutton.h" | 55 | #include "llbutton.h" |
56 | 56 | ||
57 | // LLLayoutStack | 57 | // LLLayoutStack |
58 | #include "llgl.h" | ||
59 | #include "llglheaders.h" | ||
60 | #include "llresizebar.h" | 58 | #include "llresizebar.h" |
61 | #include "llcriticaldamp.h" | 59 | #include "llcriticaldamp.h" |
62 | 60 | ||
@@ -88,10 +86,10 @@ LLPanel::LLPanel() | |||
88 | : mRectControl() | 86 | : mRectControl() |
89 | { | 87 | { |
90 | init(); | 88 | init(); |
91 | setName("panel"); | 89 | setName(std::string("panel")); |
92 | } | 90 | } |
93 | 91 | ||
94 | LLPanel::LLPanel(const LLString& name) | 92 | LLPanel::LLPanel(const std::string& name) |
95 | : LLUICtrl(name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL), | 93 | : LLUICtrl(name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL), |
96 | mRectControl() | 94 | mRectControl() |
97 | { | 95 | { |
@@ -99,7 +97,7 @@ LLPanel::LLPanel(const LLString& name) | |||
99 | } | 97 | } |
100 | 98 | ||
101 | 99 | ||
102 | LLPanel::LLPanel(const LLString& name, const LLRect& rect, BOOL bordered) | 100 | LLPanel::LLPanel(const std::string& name, const LLRect& rect, BOOL bordered) |
103 | : LLUICtrl(name, rect, TRUE, NULL, NULL), | 101 | : LLUICtrl(name, rect, TRUE, NULL, NULL), |
104 | mRectControl() | 102 | mRectControl() |
105 | { | 103 | { |
@@ -111,7 +109,7 @@ LLPanel::LLPanel(const LLString& name, const LLRect& rect, BOOL bordered) | |||
111 | } | 109 | } |
112 | 110 | ||
113 | 111 | ||
114 | LLPanel::LLPanel(const LLString& name, const LLString& rect_control, BOOL bordered) | 112 | LLPanel::LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered) |
115 | : LLUICtrl(name, LLUI::sConfigGroup->getRect(rect_control), TRUE, NULL, NULL), | 113 | : LLUICtrl(name, LLUI::sConfigGroup->getRect(rect_control), TRUE, NULL, NULL), |
116 | mRectControl( rect_control ) | 114 | mRectControl( rect_control ) |
117 | { | 115 | { |
@@ -143,7 +141,7 @@ void LLPanel::addBorder(LLViewBorder::EBevel border_bevel, | |||
143 | LLViewBorder::EStyle border_style, S32 border_thickness) | 141 | LLViewBorder::EStyle border_style, S32 border_thickness) |
144 | { | 142 | { |
145 | removeBorder(); | 143 | removeBorder(); |
146 | mBorder = new LLViewBorder( "panel border", | 144 | mBorder = new LLViewBorder( std::string("panel border"), |
147 | LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), | 145 | LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), |
148 | border_bevel, border_style, border_thickness ); | 146 | border_bevel, border_style, border_thickness ); |
149 | mBorder->setSaveToXML(false); | 147 | mBorder->setSaveToXML(false); |
@@ -248,7 +246,7 @@ void LLPanel::setDefaultBtn(LLButton* btn) | |||
248 | } | 246 | } |
249 | } | 247 | } |
250 | 248 | ||
251 | void LLPanel::setDefaultBtn(const LLString& id) | 249 | void LLPanel::setDefaultBtn(const std::string& id) |
252 | { | 250 | { |
253 | LLButton *button = getChild<LLButton>(id); | 251 | LLButton *button = getChild<LLButton>(id); |
254 | if (button) | 252 | if (button) |
@@ -346,14 +344,14 @@ BOOL LLPanel::checkRequirements() | |||
346 | { | 344 | { |
347 | if (!mRequirementsError.empty()) | 345 | if (!mRequirementsError.empty()) |
348 | { | 346 | { |
349 | LLString::format_map_t args; | 347 | LLStringUtil::format_map_t args; |
350 | args["[COMPONENTS]"] = mRequirementsError; | 348 | args["[COMPONENTS]"] = mRequirementsError; |
351 | args["[FLOATER]"] = getName(); | 349 | args["[FLOATER]"] = getName(); |
352 | 350 | ||
353 | llwarns << getName() << " failed requirements check on: \n" | 351 | llwarns << getName() << " failed requirements check on: \n" |
354 | << mRequirementsError << llendl; | 352 | << mRequirementsError << llendl; |
355 | 353 | ||
356 | alertXml("FailedRequirementsCheck", args); | 354 | alertXml(std::string("FailedRequirementsCheck"), args); |
357 | mRequirementsError.clear(); | 355 | mRequirementsError.clear(); |
358 | return FALSE; | 356 | return FALSE; |
359 | } | 357 | } |
@@ -362,7 +360,7 @@ BOOL LLPanel::checkRequirements() | |||
362 | } | 360 | } |
363 | 361 | ||
364 | //static | 362 | //static |
365 | void LLPanel::alertXml(LLString label, LLString::format_map_t args) | 363 | void LLPanel::alertXml(const std::string& label, LLStringUtil::format_map_t args) |
366 | { | 364 | { |
367 | sAlertQueue.push(LLAlertInfo(label,args)); | 365 | sAlertQueue.push(LLAlertInfo(label,args)); |
368 | } | 366 | } |
@@ -462,7 +460,7 @@ LLXMLNodePtr LLPanel::getXML(bool save_children) const | |||
462 | 460 | ||
463 | LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory) | 461 | LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory) |
464 | { | 462 | { |
465 | LLString name("panel"); | 463 | std::string name("panel"); |
466 | node->getAttributeString("name", name); | 464 | node->getAttributeString("name", name); |
467 | 465 | ||
468 | LLPanel* panelp = factory->createFactoryPanel(name); | 466 | LLPanel* panelp = factory->createFactoryPanel(name); |
@@ -491,7 +489,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *fac | |||
491 | 489 | ||
492 | BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 490 | BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
493 | { | 491 | { |
494 | LLString name = getName(); | 492 | std::string name = getName(); |
495 | node->getAttributeString("name", name); | 493 | node->getAttributeString("name", name); |
496 | setName(name); | 494 | setName(name); |
497 | 495 | ||
@@ -499,7 +497,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f | |||
499 | 497 | ||
500 | initChildrenXML(node, factory); | 498 | initChildrenXML(node, factory); |
501 | 499 | ||
502 | LLString xml_filename; | 500 | std::string xml_filename; |
503 | node->getAttributeString("filename", xml_filename); | 501 | node->getAttributeString("filename", xml_filename); |
504 | 502 | ||
505 | BOOL didPost; | 503 | BOOL didPost; |
@@ -538,7 +536,7 @@ void LLPanel::initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory) | |||
538 | // look for string declarations for programmatic text | 536 | // look for string declarations for programmatic text |
539 | if (child->hasName("string")) | 537 | if (child->hasName("string")) |
540 | { | 538 | { |
541 | LLString string_name; | 539 | std::string string_name; |
542 | child->getAttributeString("name", string_name); | 540 | child->getAttributeString("name", string_name); |
543 | if (!string_name.empty()) | 541 | if (!string_name.empty()) |
544 | { | 542 | { |
@@ -566,9 +564,9 @@ void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parent) | |||
566 | LLViewBorder::getBevelFromAttribute(node, bevel_style); | 564 | LLViewBorder::getBevelFromAttribute(node, bevel_style); |
567 | 565 | ||
568 | LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; | 566 | LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; |
569 | LLString border_string; | 567 | std::string border_string; |
570 | node->getAttributeString("border_style", border_string); | 568 | node->getAttributeString("border_style", border_string); |
571 | LLString::toLower(border_string); | 569 | LLStringUtil::toLower(border_string); |
572 | 570 | ||
573 | if (border_string == "texture") | 571 | if (border_string == "texture") |
574 | { | 572 | { |
@@ -603,12 +601,12 @@ void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parent) | |||
603 | LLUICtrlFactory::getAttributeColor(node,"bg_alpha_color", color); | 601 | LLUICtrlFactory::getAttributeColor(node,"bg_alpha_color", color); |
604 | setTransparentColor(color); | 602 | setTransparentColor(color); |
605 | 603 | ||
606 | LLString label = getLabel(); | 604 | std::string label = getLabel(); |
607 | node->getAttributeString("label", label); | 605 | node->getAttributeString("label", label); |
608 | setLabel(label); | 606 | setLabel(label); |
609 | } | 607 | } |
610 | 608 | ||
611 | LLString LLPanel::getString(const LLString& name, const LLString::format_map_t& args) const | 609 | std::string LLPanel::getString(const std::string& name, const LLStringUtil::format_map_t& args) const |
612 | { | 610 | { |
613 | ui_string_map_t::const_iterator found_it = mUIStrings.find(name); | 611 | ui_string_map_t::const_iterator found_it = mUIStrings.find(name); |
614 | if (found_it != mUIStrings.end()) | 612 | if (found_it != mUIStrings.end()) |
@@ -618,7 +616,7 @@ LLString LLPanel::getString(const LLString& name, const LLString::format_map_t& | |||
618 | formatted_string.setArgList(args); | 616 | formatted_string.setArgList(args); |
619 | return formatted_string.getString(); | 617 | return formatted_string.getString(); |
620 | } | 618 | } |
621 | LLString err_str("Failed to find string " + name + " in panel " + getName()); | 619 | std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate |
622 | // *TODO: once the QAR-369 ui-cleanup work on settings is in we need to change the following line to be | 620 | // *TODO: once the QAR-369 ui-cleanup work on settings is in we need to change the following line to be |
623 | //if(LLUI::sConfigGroup->getBOOL("QAMode")) | 621 | //if(LLUI::sConfigGroup->getBOOL("QAMode")) |
624 | if(LLUI::sQAMode) | 622 | if(LLUI::sQAMode) |
@@ -629,10 +627,10 @@ LLString LLPanel::getString(const LLString& name, const LLString::format_map_t& | |||
629 | { | 627 | { |
630 | llwarns << err_str << llendl; | 628 | llwarns << err_str << llendl; |
631 | } | 629 | } |
632 | return LLString::null; | 630 | return LLStringUtil::null; |
633 | } | 631 | } |
634 | 632 | ||
635 | LLUIString LLPanel::getUIString(const LLString& name) const | 633 | LLUIString LLPanel::getUIString(const std::string& name) const |
636 | { | 634 | { |
637 | ui_string_map_t::const_iterator found_it = mUIStrings.find(name); | 635 | ui_string_map_t::const_iterator found_it = mUIStrings.find(name); |
638 | if (found_it != mUIStrings.end()) | 636 | if (found_it != mUIStrings.end()) |
@@ -640,11 +638,11 @@ LLUIString LLPanel::getUIString(const LLString& name) const | |||
640 | return found_it->second; | 638 | return found_it->second; |
641 | } | 639 | } |
642 | llerrs << "Failed to find string " << name << " in panel " << getName() << llendl; | 640 | llerrs << "Failed to find string " << name << " in panel " << getName() << llendl; |
643 | return LLUIString(LLString::null); | 641 | return LLUIString(LLStringUtil::null); |
644 | } | 642 | } |
645 | 643 | ||
646 | 644 | ||
647 | void LLPanel::childSetVisible(const LLString& id, bool visible) | 645 | void LLPanel::childSetVisible(const std::string& id, bool visible) |
648 | { | 646 | { |
649 | LLView* child = getChild<LLView>(id); | 647 | LLView* child = getChild<LLView>(id); |
650 | if (child) | 648 | if (child) |
@@ -653,7 +651,7 @@ void LLPanel::childSetVisible(const LLString& id, bool visible) | |||
653 | } | 651 | } |
654 | } | 652 | } |
655 | 653 | ||
656 | bool LLPanel::childIsVisible(const LLString& id) const | 654 | bool LLPanel::childIsVisible(const std::string& id) const |
657 | { | 655 | { |
658 | LLView* child = getChild<LLView>(id); | 656 | LLView* child = getChild<LLView>(id); |
659 | if (child) | 657 | if (child) |
@@ -663,7 +661,7 @@ bool LLPanel::childIsVisible(const LLString& id) const | |||
663 | return false; | 661 | return false; |
664 | } | 662 | } |
665 | 663 | ||
666 | void LLPanel::childSetEnabled(const LLString& id, bool enabled) | 664 | void LLPanel::childSetEnabled(const std::string& id, bool enabled) |
667 | { | 665 | { |
668 | LLView* child = getChild<LLView>(id); | 666 | LLView* child = getChild<LLView>(id); |
669 | if (child) | 667 | if (child) |
@@ -672,7 +670,7 @@ void LLPanel::childSetEnabled(const LLString& id, bool enabled) | |||
672 | } | 670 | } |
673 | } | 671 | } |
674 | 672 | ||
675 | void LLPanel::childSetTentative(const LLString& id, bool tentative) | 673 | void LLPanel::childSetTentative(const std::string& id, bool tentative) |
676 | { | 674 | { |
677 | LLView* child = getChild<LLView>(id); | 675 | LLView* child = getChild<LLView>(id); |
678 | if (child) | 676 | if (child) |
@@ -681,7 +679,7 @@ void LLPanel::childSetTentative(const LLString& id, bool tentative) | |||
681 | } | 679 | } |
682 | } | 680 | } |
683 | 681 | ||
684 | bool LLPanel::childIsEnabled(const LLString& id) const | 682 | bool LLPanel::childIsEnabled(const std::string& id) const |
685 | { | 683 | { |
686 | LLView* child = getChild<LLView>(id); | 684 | LLView* child = getChild<LLView>(id); |
687 | if (child) | 685 | if (child) |
@@ -692,7 +690,7 @@ bool LLPanel::childIsEnabled(const LLString& id) const | |||
692 | } | 690 | } |
693 | 691 | ||
694 | 692 | ||
695 | void LLPanel::childSetToolTip(const LLString& id, const LLString& msg) | 693 | void LLPanel::childSetToolTip(const std::string& id, const std::string& msg) |
696 | { | 694 | { |
697 | LLView* child = getChild<LLView>(id); | 695 | LLView* child = getChild<LLView>(id); |
698 | if (child) | 696 | if (child) |
@@ -701,7 +699,7 @@ void LLPanel::childSetToolTip(const LLString& id, const LLString& msg) | |||
701 | } | 699 | } |
702 | } | 700 | } |
703 | 701 | ||
704 | void LLPanel::childSetRect(const LLString& id, const LLRect& rect) | 702 | void LLPanel::childSetRect(const std::string& id, const LLRect& rect) |
705 | { | 703 | { |
706 | LLView* child = getChild<LLView>(id); | 704 | LLView* child = getChild<LLView>(id); |
707 | if (child) | 705 | if (child) |
@@ -710,7 +708,7 @@ void LLPanel::childSetRect(const LLString& id, const LLRect& rect) | |||
710 | } | 708 | } |
711 | } | 709 | } |
712 | 710 | ||
713 | bool LLPanel::childGetRect(const LLString& id, LLRect& rect) const | 711 | bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const |
714 | { | 712 | { |
715 | LLView* child = getChild<LLView>(id); | 713 | LLView* child = getChild<LLView>(id); |
716 | if (child) | 714 | if (child) |
@@ -721,7 +719,7 @@ bool LLPanel::childGetRect(const LLString& id, LLRect& rect) const | |||
721 | return false; | 719 | return false; |
722 | } | 720 | } |
723 | 721 | ||
724 | void LLPanel::childSetFocus(const LLString& id, BOOL focus) | 722 | void LLPanel::childSetFocus(const std::string& id, BOOL focus) |
725 | { | 723 | { |
726 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 724 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
727 | if (child) | 725 | if (child) |
@@ -730,7 +728,7 @@ void LLPanel::childSetFocus(const LLString& id, BOOL focus) | |||
730 | } | 728 | } |
731 | } | 729 | } |
732 | 730 | ||
733 | BOOL LLPanel::childHasFocus(const LLString& id) | 731 | BOOL LLPanel::childHasFocus(const std::string& id) |
734 | { | 732 | { |
735 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 733 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
736 | if (child) | 734 | if (child) |
@@ -745,7 +743,7 @@ BOOL LLPanel::childHasFocus(const LLString& id) | |||
745 | } | 743 | } |
746 | 744 | ||
747 | 745 | ||
748 | void LLPanel::childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocusableElement*, void*), void* user_data) | 746 | void LLPanel::childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data) |
749 | { | 747 | { |
750 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 748 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
751 | if (child) | 749 | if (child) |
@@ -754,7 +752,7 @@ void LLPanel::childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocu | |||
754 | } | 752 | } |
755 | } | 753 | } |
756 | 754 | ||
757 | void LLPanel::childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, void*), void *userdata ) | 755 | void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void *userdata ) |
758 | { | 756 | { |
759 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 757 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
760 | if (child) | 758 | if (child) |
@@ -764,7 +762,7 @@ void LLPanel::childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, v | |||
764 | } | 762 | } |
765 | } | 763 | } |
766 | 764 | ||
767 | void LLPanel::childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), void *userdata ) | 765 | void LLPanel::childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void *userdata ) |
768 | { | 766 | { |
769 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 767 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
770 | if (child) | 768 | if (child) |
@@ -777,7 +775,7 @@ void LLPanel::childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), | |||
777 | } | 775 | } |
778 | } | 776 | } |
779 | 777 | ||
780 | void LLPanel::childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*)) | 778 | void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*)) |
781 | { | 779 | { |
782 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 780 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
783 | if (child) | 781 | if (child) |
@@ -786,7 +784,7 @@ void LLPanel::childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*)) | |||
786 | } | 784 | } |
787 | } | 785 | } |
788 | 786 | ||
789 | void LLPanel::childSetUserData(const LLString& id, void* userdata) | 787 | void LLPanel::childSetUserData(const std::string& id, void* userdata) |
790 | { | 788 | { |
791 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 789 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
792 | if (child) | 790 | if (child) |
@@ -795,7 +793,7 @@ void LLPanel::childSetUserData(const LLString& id, void* userdata) | |||
795 | } | 793 | } |
796 | } | 794 | } |
797 | 795 | ||
798 | void LLPanel::childSetColor(const LLString& id, const LLColor4& color) | 796 | void LLPanel::childSetColor(const std::string& id, const LLColor4& color) |
799 | { | 797 | { |
800 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 798 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
801 | if (child) | 799 | if (child) |
@@ -804,7 +802,7 @@ void LLPanel::childSetColor(const LLString& id, const LLColor4& color) | |||
804 | } | 802 | } |
805 | } | 803 | } |
806 | 804 | ||
807 | LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const LLString& id) const | 805 | LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const std::string& id) const |
808 | { | 806 | { |
809 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 807 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
810 | if (child) | 808 | if (child) |
@@ -814,7 +812,7 @@ LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const LLString& id | |||
814 | return NULL; | 812 | return NULL; |
815 | } | 813 | } |
816 | 814 | ||
817 | LLCtrlListInterface* LLPanel::childGetListInterface(const LLString& id) const | 815 | LLCtrlListInterface* LLPanel::childGetListInterface(const std::string& id) const |
818 | { | 816 | { |
819 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 817 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
820 | if (child) | 818 | if (child) |
@@ -824,7 +822,7 @@ LLCtrlListInterface* LLPanel::childGetListInterface(const LLString& id) const | |||
824 | return NULL; | 822 | return NULL; |
825 | } | 823 | } |
826 | 824 | ||
827 | LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const LLString& id) const | 825 | LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const std::string& id) const |
828 | { | 826 | { |
829 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 827 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
830 | if (child) | 828 | if (child) |
@@ -834,7 +832,7 @@ LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const LLString& id) cons | |||
834 | return NULL; | 832 | return NULL; |
835 | } | 833 | } |
836 | 834 | ||
837 | void LLPanel::childSetValue(const LLString& id, LLSD value) | 835 | void LLPanel::childSetValue(const std::string& id, LLSD value) |
838 | { | 836 | { |
839 | LLView* child = getChild<LLView>(id, true); | 837 | LLView* child = getChild<LLView>(id, true); |
840 | if (child) | 838 | if (child) |
@@ -843,7 +841,7 @@ void LLPanel::childSetValue(const LLString& id, LLSD value) | |||
843 | } | 841 | } |
844 | } | 842 | } |
845 | 843 | ||
846 | LLSD LLPanel::childGetValue(const LLString& id) const | 844 | LLSD LLPanel::childGetValue(const std::string& id) const |
847 | { | 845 | { |
848 | LLView* child = getChild<LLView>(id, true); | 846 | LLView* child = getChild<LLView>(id, true); |
849 | if (child) | 847 | if (child) |
@@ -854,7 +852,7 @@ LLSD LLPanel::childGetValue(const LLString& id) const | |||
854 | return LLSD(); | 852 | return LLSD(); |
855 | } | 853 | } |
856 | 854 | ||
857 | BOOL LLPanel::childSetTextArg(const LLString& id, const LLString& key, const LLStringExplicit& text) | 855 | BOOL LLPanel::childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text) |
858 | { | 856 | { |
859 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 857 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
860 | if (child) | 858 | if (child) |
@@ -864,7 +862,7 @@ BOOL LLPanel::childSetTextArg(const LLString& id, const LLString& key, const LLS | |||
864 | return FALSE; | 862 | return FALSE; |
865 | } | 863 | } |
866 | 864 | ||
867 | BOOL LLPanel::childSetLabelArg(const LLString& id, const LLString& key, const LLStringExplicit& text) | 865 | BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text) |
868 | { | 866 | { |
869 | LLView* child = getChild<LLView>(id); | 867 | LLView* child = getChild<LLView>(id); |
870 | if (child) | 868 | if (child) |
@@ -874,7 +872,7 @@ BOOL LLPanel::childSetLabelArg(const LLString& id, const LLString& key, const LL | |||
874 | return FALSE; | 872 | return FALSE; |
875 | } | 873 | } |
876 | 874 | ||
877 | BOOL LLPanel::childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text) | 875 | BOOL LLPanel::childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text) |
878 | { | 876 | { |
879 | LLView* child = getChildView(id, true, FALSE); | 877 | LLView* child = getChildView(id, true, FALSE); |
880 | if (child) | 878 | if (child) |
@@ -884,7 +882,7 @@ BOOL LLPanel::childSetToolTipArg(const LLString& id, const LLString& key, const | |||
884 | return FALSE; | 882 | return FALSE; |
885 | } | 883 | } |
886 | 884 | ||
887 | void LLPanel::childSetMinValue(const LLString& id, LLSD min_value) | 885 | void LLPanel::childSetMinValue(const std::string& id, LLSD min_value) |
888 | { | 886 | { |
889 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 887 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
890 | if (child) | 888 | if (child) |
@@ -893,7 +891,7 @@ void LLPanel::childSetMinValue(const LLString& id, LLSD min_value) | |||
893 | } | 891 | } |
894 | } | 892 | } |
895 | 893 | ||
896 | void LLPanel::childSetMaxValue(const LLString& id, LLSD max_value) | 894 | void LLPanel::childSetMaxValue(const std::string& id, LLSD max_value) |
897 | { | 895 | { |
898 | LLUICtrl* child = getChild<LLUICtrl>(id, true); | 896 | LLUICtrl* child = getChild<LLUICtrl>(id, true); |
899 | if (child) | 897 | if (child) |
@@ -902,7 +900,7 @@ void LLPanel::childSetMaxValue(const LLString& id, LLSD max_value) | |||
902 | } | 900 | } |
903 | } | 901 | } |
904 | 902 | ||
905 | void LLPanel::childShowTab(const LLString& id, const LLString& tabname, bool visible) | 903 | void LLPanel::childShowTab(const std::string& id, const std::string& tabname, bool visible) |
906 | { | 904 | { |
907 | LLTabContainer* child = getChild<LLTabContainer>(id); | 905 | LLTabContainer* child = getChild<LLTabContainer>(id); |
908 | if (child) | 906 | if (child) |
@@ -911,7 +909,7 @@ void LLPanel::childShowTab(const LLString& id, const LLString& tabname, bool vis | |||
911 | } | 909 | } |
912 | } | 910 | } |
913 | 911 | ||
914 | LLPanel *LLPanel::childGetVisibleTab(const LLString& id) const | 912 | LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const |
915 | { | 913 | { |
916 | LLTabContainer* child = getChild<LLTabContainer>(id); | 914 | LLTabContainer* child = getChild<LLTabContainer>(id); |
917 | if (child) | 915 | if (child) |
@@ -921,7 +919,7 @@ LLPanel *LLPanel::childGetVisibleTab(const LLString& id) const | |||
921 | return NULL; | 919 | return NULL; |
922 | } | 920 | } |
923 | 921 | ||
924 | void LLPanel::childSetTabChangeCallback(const LLString& id, const LLString& tabname, void (*on_tab_clicked)(void*, bool), void *userdata) | 922 | void LLPanel::childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata) |
925 | { | 923 | { |
926 | LLTabContainer* child = getChild<LLTabContainer>(id); | 924 | LLTabContainer* child = getChild<LLTabContainer>(id); |
927 | if (child) | 925 | if (child) |
@@ -935,7 +933,7 @@ void LLPanel::childSetTabChangeCallback(const LLString& id, const LLString& tabn | |||
935 | } | 933 | } |
936 | } | 934 | } |
937 | 935 | ||
938 | void LLPanel::childSetKeystrokeCallback(const LLString& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) | 936 | void LLPanel::childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) |
939 | { | 937 | { |
940 | LLLineEditor* child = getChild<LLLineEditor>(id); | 938 | LLLineEditor* child = getChild<LLLineEditor>(id); |
941 | if (child) | 939 | if (child) |
@@ -948,7 +946,7 @@ void LLPanel::childSetKeystrokeCallback(const LLString& id, void (*keystroke_cal | |||
948 | } | 946 | } |
949 | } | 947 | } |
950 | 948 | ||
951 | void LLPanel::childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWString &) ) | 949 | void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) |
952 | { | 950 | { |
953 | LLLineEditor* child = getChild<LLLineEditor>(id); | 951 | LLLineEditor* child = getChild<LLLineEditor>(id); |
954 | if (child) | 952 | if (child) |
@@ -957,7 +955,7 @@ void LLPanel::childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWStri | |||
957 | } | 955 | } |
958 | } | 956 | } |
959 | 957 | ||
960 | void LLPanel::childSetWrappedText(const LLString& id, const LLString& text, bool visible) | 958 | void LLPanel::childSetWrappedText(const std::string& id, const std::string& text, bool visible) |
961 | { | 959 | { |
962 | LLTextBox* child = getChild<LLTextBox>(id); | 960 | LLTextBox* child = getChild<LLTextBox>(id); |
963 | if (child) | 961 | if (child) |
@@ -967,7 +965,7 @@ void LLPanel::childSetWrappedText(const LLString& id, const LLString& text, bool | |||
967 | } | 965 | } |
968 | } | 966 | } |
969 | 967 | ||
970 | void LLPanel::childSetAction(const LLString& id, void(*function)(void*), void* value) | 968 | void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void* value) |
971 | { | 969 | { |
972 | LLButton* button = getChild<LLButton>(id); | 970 | LLButton* button = getChild<LLButton>(id); |
973 | if (button) | 971 | if (button) |
@@ -976,7 +974,7 @@ void LLPanel::childSetAction(const LLString& id, void(*function)(void*), void* v | |||
976 | } | 974 | } |
977 | } | 975 | } |
978 | 976 | ||
979 | void LLPanel::childSetActionTextbox(const LLString& id, void(*function)(void*)) | 977 | void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*)) |
980 | { | 978 | { |
981 | LLTextBox* textbox = getChild<LLTextBox>(id); | 979 | LLTextBox* textbox = getChild<LLTextBox>(id); |
982 | if (textbox) | 980 | if (textbox) |
@@ -985,7 +983,7 @@ void LLPanel::childSetActionTextbox(const LLString& id, void(*function)(void*)) | |||
985 | } | 983 | } |
986 | } | 984 | } |
987 | 985 | ||
988 | void LLPanel::childSetControlName(const LLString& id, const LLString& control_name) | 986 | void LLPanel::childSetControlName(const std::string& id, const std::string& control_name) |
989 | { | 987 | { |
990 | LLView* view = getChild<LLView>(id); | 988 | LLView* view = getChild<LLView>(id); |
991 | if (view) | 989 | if (view) |
@@ -995,7 +993,7 @@ void LLPanel::childSetControlName(const LLString& id, const LLString& control_na | |||
995 | } | 993 | } |
996 | 994 | ||
997 | //virtual | 995 | //virtual |
998 | LLView* LLPanel::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const | 996 | LLView* LLPanel::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const |
999 | { | 997 | { |
1000 | // just get child, don't try to create a dummy one | 998 | // just get child, don't try to create a dummy one |
1001 | LLView* view = LLUICtrl::getChildView(name, recurse, FALSE); | 999 | LLView* view = LLUICtrl::getChildView(name, recurse, FALSE); |
@@ -1010,7 +1008,7 @@ LLView* LLPanel::getChildView(const LLString& name, BOOL recurse, BOOL create_if | |||
1010 | return view; | 1008 | return view; |
1011 | } | 1009 | } |
1012 | 1010 | ||
1013 | void LLPanel::childNotFound(const LLString& id) const | 1011 | void LLPanel::childNotFound(const std::string& id) const |
1014 | { | 1012 | { |
1015 | if (mExpectedMembers.find(id) == mExpectedMembers.end()) | 1013 | if (mExpectedMembers.find(id) == mExpectedMembers.end()) |
1016 | { | 1014 | { |
@@ -1024,7 +1022,7 @@ void LLPanel::childDisplayNotFound() | |||
1024 | { | 1022 | { |
1025 | return; | 1023 | return; |
1026 | } | 1024 | } |
1027 | LLString msg; | 1025 | std::string msg; |
1028 | expected_members_list_t::iterator itor; | 1026 | expected_members_list_t::iterator itor; |
1029 | for (itor=mNewExpectedMembers.begin(); itor!=mNewExpectedMembers.end(); ++itor) | 1027 | for (itor=mNewExpectedMembers.begin(); itor!=mNewExpectedMembers.end(); ++itor) |
1030 | { | 1028 | { |
@@ -1033,7 +1031,7 @@ void LLPanel::childDisplayNotFound() | |||
1033 | mExpectedMembers.insert(*itor); | 1031 | mExpectedMembers.insert(*itor); |
1034 | } | 1032 | } |
1035 | mNewExpectedMembers.clear(); | 1033 | mNewExpectedMembers.clear(); |
1036 | LLString::format_map_t args; | 1034 | LLStringUtil::format_map_t args; |
1037 | args["[CONTROLS]"] = msg; | 1035 | args["[CONTROLS]"] = msg; |
1038 | LLAlertDialog::showXml("FloaterNotFound", args); | 1036 | LLAlertDialog::showXml("FloaterNotFound", args); |
1039 | } | 1037 | } |
@@ -1073,7 +1071,7 @@ struct LLLayoutStack::LLEmbeddedPanel | |||
1073 | { | 1071 | { |
1074 | min_dim = mMinWidth; | 1072 | min_dim = mMinWidth; |
1075 | } | 1073 | } |
1076 | mResizeBar = new LLResizeBar("resizer", mPanel, LLRect(), min_dim, S32_MAX, side); | 1074 | mResizeBar = new LLResizeBar(std::string("resizer"), mPanel, LLRect(), min_dim, S32_MAX, side); |
1077 | mResizeBar->setEnableSnapping(FALSE); | 1075 | mResizeBar->setEnableSnapping(FALSE); |
1078 | // panels initialized as hidden should not start out partially visible | 1076 | // panels initialized as hidden should not start out partially visible |
1079 | if (!mPanel->getVisible()) | 1077 | if (!mPanel->getVisible()) |
@@ -1168,7 +1166,7 @@ LLXMLNodePtr LLLayoutStack::getXML(bool save_children) const | |||
1168 | //static | 1166 | //static |
1169 | LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 1167 | LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
1170 | { | 1168 | { |
1171 | LLString orientation_string("vertical"); | 1169 | std::string orientation_string("vertical"); |
1172 | node->getAttributeString("orientation", orientation_string); | 1170 | node->getAttributeString("orientation", orientation_string); |
1173 | 1171 | ||
1174 | eLayoutOrientation orientation = VERTICAL; | 1172 | eLayoutOrientation orientation = VERTICAL; |
@@ -1192,7 +1190,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor | |||
1192 | // don't allow negative spacing values | 1190 | // don't allow negative spacing values |
1193 | layout_stackp->mPanelSpacing = llmax(layout_stackp->mPanelSpacing, 0); | 1191 | layout_stackp->mPanelSpacing = llmax(layout_stackp->mPanelSpacing, 0); |
1194 | 1192 | ||
1195 | LLString name("stack"); | 1193 | std::string name("stack"); |
1196 | node->getAttributeString("name", name); | 1194 | node->getAttributeString("name", name); |
1197 | 1195 | ||
1198 | layout_stackp->setName(name); | 1196 | layout_stackp->setName(name); |
@@ -1225,7 +1223,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor | |||
1225 | BOOL user_resize = FALSE; | 1223 | BOOL user_resize = FALSE; |
1226 | child->getAttributeBOOL("user_resize", user_resize); | 1224 | child->getAttributeBOOL("user_resize", user_resize); |
1227 | 1225 | ||
1228 | LLPanel* panelp = new LLPanel("auto_panel"); | 1226 | LLPanel* panelp = new LLPanel(std::string("auto_panel")); |
1229 | LLView* new_child = factory->createWidget(panelp, child); | 1227 | LLView* new_child = factory->createWidget(panelp, child); |
1230 | if (new_child) | 1228 | if (new_child) |
1231 | { | 1229 | { |
diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h index c7627ff..46cde5b 100644 --- a/linden/indra/llui/llpanel.h +++ b/linden/indra/llui/llpanel.h | |||
@@ -51,10 +51,10 @@ const BOOL BORDER_NO = FALSE; | |||
51 | 51 | ||
52 | struct LLAlertInfo | 52 | struct LLAlertInfo |
53 | { | 53 | { |
54 | LLString mLabel; | 54 | std::string mLabel; |
55 | LLString::format_map_t mArgs; | 55 | LLStringUtil::format_map_t mArgs; |
56 | 56 | ||
57 | LLAlertInfo(LLString label, LLString::format_map_t args) : mLabel(label), mArgs(args) { } | 57 | LLAlertInfo(std::string label, LLStringUtil::format_map_t args) : mLabel(label), mArgs(args) { } |
58 | LLAlertInfo(){} | 58 | LLAlertInfo(){} |
59 | }; | 59 | }; |
60 | 60 | ||
@@ -71,13 +71,13 @@ public: | |||
71 | 71 | ||
72 | // minimal constructor for data-driven initialization | 72 | // minimal constructor for data-driven initialization |
73 | LLPanel(); | 73 | LLPanel(); |
74 | LLPanel(const LLString& name); | 74 | LLPanel(const std::string& name); |
75 | 75 | ||
76 | // Position and size not saved | 76 | // Position and size not saved |
77 | LLPanel(const LLString& name, const LLRect& rect, BOOL bordered = TRUE); | 77 | LLPanel(const std::string& name, const LLRect& rect, BOOL bordered = TRUE); |
78 | 78 | ||
79 | // Position and size are saved to rect_control | 79 | // Position and size are saved to rect_control |
80 | LLPanel(const LLString& name, const LLString& rect_control, BOOL bordered = TRUE); | 80 | LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered = TRUE); |
81 | 81 | ||
82 | /*virtual*/ ~LLPanel(); | 82 | /*virtual*/ ~LLPanel(); |
83 | 83 | ||
@@ -87,7 +87,7 @@ public: | |||
87 | /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); | 87 | /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); |
88 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; | 88 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; |
89 | // Override to set not found list: | 89 | // Override to set not found list: |
90 | virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; | 90 | virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; |
91 | 91 | ||
92 | // From LLFocusableElement | 92 | // From LLFocusableElement |
93 | /*virtual*/ void setFocus( BOOL b ); | 93 | /*virtual*/ void setFocus( BOOL b ); |
@@ -105,7 +105,7 @@ public: | |||
105 | BOOL hasBorder() const { return mBorder != NULL; } | 105 | BOOL hasBorder() const { return mBorder != NULL; } |
106 | void setBorderVisible( BOOL b ); | 106 | void setBorderVisible( BOOL b ); |
107 | 107 | ||
108 | template <class T> void requires(LLString name) | 108 | template <class T> void requires(const std::string& name) |
109 | { | 109 | { |
110 | // check for widget with matching type and name | 110 | // check for widget with matching type and name |
111 | if (LLView::getChild<T>(name) == NULL) | 111 | if (LLView::getChild<T>(name) == NULL) |
@@ -115,7 +115,7 @@ public: | |||
115 | } | 115 | } |
116 | 116 | ||
117 | // requires LLView by default | 117 | // requires LLView by default |
118 | void requires(LLString name) | 118 | void requires(const std::string& name) |
119 | { | 119 | { |
120 | requires<LLView>(name); | 120 | requires<LLView>(name); |
121 | } | 121 | } |
@@ -130,13 +130,13 @@ public: | |||
130 | void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } | 130 | void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } |
131 | BOOL isBackgroundOpaque() const { return mBgOpaque; } | 131 | BOOL isBackgroundOpaque() const { return mBgOpaque; } |
132 | void setDefaultBtn(LLButton* btn = NULL); | 132 | void setDefaultBtn(LLButton* btn = NULL); |
133 | void setDefaultBtn(const LLString& id); | 133 | void setDefaultBtn(const std::string& id); |
134 | void updateDefaultBtn(); | 134 | void updateDefaultBtn(); |
135 | void setLabel(const LLStringExplicit& label) { mLabel = label; } | 135 | void setLabel(const LLStringExplicit& label) { mLabel = label; } |
136 | LLString getLabel() const { return mLabel; } | 136 | std::string getLabel() const { return mLabel; } |
137 | 137 | ||
138 | void setRectControl(const LLString& rect_control) { mRectControl.assign(rect_control); } | 138 | void setRectControl(const std::string& rect_control) { mRectControl.assign(rect_control); } |
139 | const LLString& getRectControl() const { return mRectControl; } | 139 | const std::string& getRectControl() const { return mRectControl; } |
140 | void storeRectControl(); | 140 | void storeRectControl(); |
141 | 141 | ||
142 | void setCtrlsEnabled(BOOL b); | 142 | void setCtrlsEnabled(BOOL b); |
@@ -151,83 +151,83 @@ public: | |||
151 | void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory); | 151 | void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory); |
152 | void setPanelParameters(LLXMLNodePtr node, LLView *parentp); | 152 | void setPanelParameters(LLXMLNodePtr node, LLView *parentp); |
153 | 153 | ||
154 | LLString getString(const LLString& name, const LLString::format_map_t& args = LLUIString::sNullArgs) const; | 154 | std::string getString(const std::string& name, const LLStringUtil::format_map_t& args = LLUIString::sNullArgs) const; |
155 | LLUIString getUIString(const LLString& name) const; | 155 | LLUIString getUIString(const std::string& name) const; |
156 | 156 | ||
157 | // ** Wrappers for setting child properties by name ** -TomY | 157 | // ** Wrappers for setting child properties by name ** -TomY |
158 | 158 | ||
159 | // LLView | 159 | // LLView |
160 | void childSetVisible(const LLString& name, bool visible); | 160 | void childSetVisible(const std::string& name, bool visible); |
161 | void childShow(const LLString& name) { childSetVisible(name, true); } | 161 | void childShow(const std::string& name) { childSetVisible(name, true); } |
162 | void childHide(const LLString& name) { childSetVisible(name, false); } | 162 | void childHide(const std::string& name) { childSetVisible(name, false); } |
163 | bool childIsVisible(const LLString& id) const; | 163 | bool childIsVisible(const std::string& id) const; |
164 | void childSetTentative(const LLString& name, bool tentative); | 164 | void childSetTentative(const std::string& name, bool tentative); |
165 | 165 | ||
166 | void childSetEnabled(const LLString& name, bool enabled); | 166 | void childSetEnabled(const std::string& name, bool enabled); |
167 | void childEnable(const LLString& name) { childSetEnabled(name, true); } | 167 | void childEnable(const std::string& name) { childSetEnabled(name, true); } |
168 | void childDisable(const LLString& name) { childSetEnabled(name, false); }; | 168 | void childDisable(const std::string& name) { childSetEnabled(name, false); }; |
169 | bool childIsEnabled(const LLString& id) const; | 169 | bool childIsEnabled(const std::string& id) const; |
170 | 170 | ||
171 | void childSetToolTip(const LLString& id, const LLString& msg); | 171 | void childSetToolTip(const std::string& id, const std::string& msg); |
172 | void childSetRect(const LLString& id, const LLRect &rect); | 172 | void childSetRect(const std::string& id, const LLRect &rect); |
173 | bool childGetRect(const LLString& id, LLRect& rect) const; | 173 | bool childGetRect(const std::string& id, LLRect& rect) const; |
174 | 174 | ||
175 | // LLUICtrl | 175 | // LLUICtrl |
176 | void childSetFocus(const LLString& id, BOOL focus = TRUE); | 176 | void childSetFocus(const std::string& id, BOOL focus = TRUE); |
177 | BOOL childHasFocus(const LLString& id); | 177 | BOOL childHasFocus(const std::string& id); |
178 | void childSetFocusChangedCallback(const LLString& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL); | 178 | void childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL); |
179 | 179 | ||
180 | void childSetCommitCallback(const LLString& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); | 180 | void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); |
181 | void childSetDoubleClickCallback(const LLString& id, void (*cb)(void*), void* userdata = NULL ); | 181 | void childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void* userdata = NULL ); |
182 | void childSetValidate(const LLString& id, BOOL (*cb)(LLUICtrl*, void*) ); | 182 | void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) ); |
183 | void childSetUserData(const LLString& id, void* userdata); | 183 | void childSetUserData(const std::string& id, void* userdata); |
184 | 184 | ||
185 | void childSetColor(const LLString& id, const LLColor4& color); | 185 | void childSetColor(const std::string& id, const LLColor4& color); |
186 | 186 | ||
187 | LLCtrlSelectionInterface* childGetSelectionInterface(const LLString& id) const; | 187 | LLCtrlSelectionInterface* childGetSelectionInterface(const std::string& id) const; |
188 | LLCtrlListInterface* childGetListInterface(const LLString& id) const; | 188 | LLCtrlListInterface* childGetListInterface(const std::string& id) const; |
189 | LLCtrlScrollInterface* childGetScrollInterface(const LLString& id) const; | 189 | LLCtrlScrollInterface* childGetScrollInterface(const std::string& id) const; |
190 | 190 | ||
191 | // This is the magic bullet for data-driven UI | 191 | // This is the magic bullet for data-driven UI |
192 | void childSetValue(const LLString& id, LLSD value); | 192 | void childSetValue(const std::string& id, LLSD value); |
193 | LLSD childGetValue(const LLString& id) const; | 193 | LLSD childGetValue(const std::string& id) const; |
194 | 194 | ||
195 | // For setting text / label replacement params, e.g. "Hello [NAME]" | 195 | // For setting text / label replacement params, e.g. "Hello [NAME]" |
196 | // Not implemented for all types, defaults to noop, returns FALSE if not applicaple | 196 | // Not implemented for all types, defaults to noop, returns FALSE if not applicaple |
197 | BOOL childSetTextArg(const LLString& id, const LLString& key, const LLStringExplicit& text); | 197 | BOOL childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text); |
198 | BOOL childSetLabelArg(const LLString& id, const LLString& key, const LLStringExplicit& text); | 198 | BOOL childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text); |
199 | BOOL childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text); | 199 | BOOL childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text); |
200 | 200 | ||
201 | // LLSlider / LLMultiSlider / LLSpinCtrl | 201 | // LLSlider / LLMultiSlider / LLSpinCtrl |
202 | void childSetMinValue(const LLString& id, LLSD min_value); | 202 | void childSetMinValue(const std::string& id, LLSD min_value); |
203 | void childSetMaxValue(const LLString& id, LLSD max_value); | 203 | void childSetMaxValue(const std::string& id, LLSD max_value); |
204 | 204 | ||
205 | // LLTabContainer | 205 | // LLTabContainer |
206 | void childShowTab(const LLString& id, const LLString& tabname, bool visible = true); | 206 | void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); |
207 | LLPanel *childGetVisibleTab(const LLString& id) const; | 207 | LLPanel *childGetVisibleTab(const std::string& id) const; |
208 | void childSetTabChangeCallback(const LLString& id, const LLString& tabname, void (*on_tab_clicked)(void*, bool), void *userdata); | 208 | void childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata); |
209 | 209 | ||
210 | // LLTextBox | 210 | // LLTextBox |
211 | void childSetWrappedText(const LLString& id, const LLString& text, bool visible = true); | 211 | void childSetWrappedText(const std::string& id, const std::string& text, bool visible = true); |
212 | 212 | ||
213 | // LLTextBox/LLTextEditor/LLLineEditor | 213 | // LLTextBox/LLTextEditor/LLLineEditor |
214 | void childSetText(const LLString& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } | 214 | void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } |
215 | LLString childGetText(const LLString& id) const { return childGetValue(id).asString(); } | 215 | std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); } |
216 | 216 | ||
217 | // LLLineEditor | 217 | // LLLineEditor |
218 | void childSetKeystrokeCallback(const LLString& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data); | 218 | void childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data); |
219 | void childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWString &) ); | 219 | void childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ); |
220 | 220 | ||
221 | // LLButton | 221 | // LLButton |
222 | void childSetAction(const LLString& id, void(*function)(void*), void* value); | 222 | void childSetAction(const std::string& id, void(*function)(void*), void* value); |
223 | void childSetActionTextbox(const LLString& id, void(*function)(void*)); | 223 | void childSetActionTextbox(const std::string& id, void(*function)(void*)); |
224 | void childSetControlName(const LLString& id, const LLString& control_name); | 224 | void childSetControlName(const std::string& id, const std::string& control_name); |
225 | 225 | ||
226 | // Error reporting | 226 | // Error reporting |
227 | void childNotFound(const LLString& id) const; | 227 | void childNotFound(const std::string& id) const; |
228 | void childDisplayNotFound(); | 228 | void childDisplayNotFound(); |
229 | 229 | ||
230 | static void alertXml(LLString label, LLString::format_map_t args = LLString::format_map_t()); | 230 | static void alertXml(const std::string& label, LLStringUtil::format_map_t args = LLStringUtil::format_map_t()); |
231 | static BOOL nextAlert(LLAlertInfo &alert); | 231 | static BOOL nextAlert(LLAlertInfo &alert); |
232 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 232 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
233 | 233 | ||
@@ -245,11 +245,11 @@ private: | |||
245 | virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); | 245 | virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); |
246 | 246 | ||
247 | // Unified error reporting for the child* functions | 247 | // Unified error reporting for the child* functions |
248 | typedef std::set<LLString> expected_members_list_t; | 248 | typedef std::set<std::string> expected_members_list_t; |
249 | mutable expected_members_list_t mExpectedMembers; | 249 | mutable expected_members_list_t mExpectedMembers; |
250 | mutable expected_members_list_t mNewExpectedMembers; | 250 | mutable expected_members_list_t mNewExpectedMembers; |
251 | 251 | ||
252 | LLString mRectControl; | 252 | std::string mRectControl; |
253 | LLColor4 mBgColorAlpha; | 253 | LLColor4 mBgColorAlpha; |
254 | LLColor4 mBgColorOpaque; | 254 | LLColor4 mBgColorOpaque; |
255 | LLColor4 mDefaultBtnHighlight; | 255 | LLColor4 mDefaultBtnHighlight; |
@@ -257,14 +257,14 @@ private: | |||
257 | BOOL mBgOpaque; | 257 | BOOL mBgOpaque; |
258 | LLViewBorder* mBorder; | 258 | LLViewBorder* mBorder; |
259 | LLButton* mDefaultBtn; | 259 | LLButton* mDefaultBtn; |
260 | LLString mLabel; | 260 | std::string mLabel; |
261 | S32 mLastTabGroup; | 261 | S32 mLastTabGroup; |
262 | LLRootHandle<LLPanel> mPanelHandle; | 262 | LLRootHandle<LLPanel> mPanelHandle; |
263 | 263 | ||
264 | typedef std::map<LLString, LLUIString> ui_string_map_t; | 264 | typedef std::map<std::string, LLUIString> ui_string_map_t; |
265 | ui_string_map_t mUIStrings; | 265 | ui_string_map_t mUIStrings; |
266 | 266 | ||
267 | LLString mRequirementsError; | 267 | std::string mRequirementsError; |
268 | 268 | ||
269 | typedef std::queue<LLAlertInfo> alert_queue_t; | 269 | typedef std::queue<LLAlertInfo> alert_queue_t; |
270 | static alert_queue_t sAlertQueue; | 270 | static alert_queue_t sAlertQueue; |
diff --git a/linden/indra/llui/llradiogroup.cpp b/linden/indra/llui/llradiogroup.cpp index d7373f1..e518069 100644 --- a/linden/indra/llui/llradiogroup.cpp +++ b/linden/indra/llui/llradiogroup.cpp | |||
@@ -44,8 +44,8 @@ | |||
44 | 44 | ||
45 | static LLRegisterWidget<LLRadioGroup> r("radio_group"); | 45 | static LLRegisterWidget<LLRadioGroup> r("radio_group"); |
46 | 46 | ||
47 | LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, | 47 | LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, |
48 | const LLString& control_name, | 48 | const std::string& control_name, |
49 | LLUICtrlCallback callback, | 49 | LLUICtrlCallback callback, |
50 | void* userdata, | 50 | void* userdata, |
51 | BOOL border) | 51 | BOOL border) |
@@ -56,7 +56,7 @@ LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, | |||
56 | init(border); | 56 | init(border); |
57 | } | 57 | } |
58 | 58 | ||
59 | LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, | 59 | LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, |
60 | S32 initial_index, | 60 | S32 initial_index, |
61 | LLUICtrlCallback callback, | 61 | LLUICtrlCallback callback, |
62 | void* userdata, | 62 | void* userdata, |
@@ -71,7 +71,7 @@ void LLRadioGroup::init(BOOL border) | |||
71 | { | 71 | { |
72 | if (border) | 72 | if (border) |
73 | { | 73 | { |
74 | addChild( new LLViewBorder( "radio group border", | 74 | addChild( new LLViewBorder( std::string("radio group border"), |
75 | LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), | 75 | LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), |
76 | LLViewBorder::BEVEL_NONE, | 76 | LLViewBorder::BEVEL_NONE, |
77 | LLViewBorder::STYLE_LINE, | 77 | LLViewBorder::STYLE_LINE, |
@@ -252,7 +252,7 @@ void LLRadioGroup::draw() | |||
252 | 252 | ||
253 | // When adding a button, we need to ensure that the radio | 253 | // When adding a button, we need to ensure that the radio |
254 | // group gets a message when the button is clicked. | 254 | // group gets a message when the button is clicked. |
255 | LLRadioCtrl* LLRadioGroup::addRadioButton(const LLString& name, const LLString& label, const LLRect& rect, const LLFontGL* font ) | 255 | LLRadioCtrl* LLRadioGroup::addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font ) |
256 | { | 256 | { |
257 | // Highlight will get fixed in draw method above | 257 | // Highlight will get fixed in draw method above |
258 | LLRadioCtrl* radio = new LLRadioCtrl(name, rect, label, font, | 258 | LLRadioCtrl* radio = new LLRadioCtrl(name, rect, label, font, |
@@ -298,7 +298,7 @@ void LLRadioGroup::onClickButton(LLUICtrl* ui_ctrl, void* userdata) | |||
298 | 298 | ||
299 | void LLRadioGroup::setValue( const LLSD& value ) | 299 | void LLRadioGroup::setValue( const LLSD& value ) |
300 | { | 300 | { |
301 | LLString value_name = value.asString(); | 301 | std::string value_name = value.asString(); |
302 | int idx = 0; | 302 | int idx = 0; |
303 | for (button_list_t::const_iterator iter = mRadioButtons.begin(); | 303 | for (button_list_t::const_iterator iter = mRadioButtons.begin(); |
304 | iter != mRadioButtons.end(); ++iter) | 304 | iter != mRadioButtons.end(); ++iter) |
@@ -357,7 +357,7 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const | |||
357 | 357 | ||
358 | LLXMLNodePtr child_node = radio->LLView::getXML(); | 358 | LLXMLNodePtr child_node = radio->LLView::getXML(); |
359 | child_node->setStringValue(radio->getLabel()); | 359 | child_node->setStringValue(radio->getLabel()); |
360 | child_node->setName("radio_item"); | 360 | child_node->setName(std::string("radio_item")); |
361 | 361 | ||
362 | node->addChild(child_node); | 362 | node->addChild(child_node); |
363 | } | 363 | } |
@@ -368,7 +368,7 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const | |||
368 | // static | 368 | // static |
369 | LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 369 | LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
370 | { | 370 | { |
371 | LLString name("radio_group"); | 371 | std::string name("radio_group"); |
372 | node->getAttributeString("name", name); | 372 | node->getAttributeString("name", name); |
373 | 373 | ||
374 | U32 initial_value = 0; | 374 | U32 initial_value = 0; |
@@ -387,7 +387,7 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
387 | NULL, | 387 | NULL, |
388 | draw_border); | 388 | draw_border); |
389 | 389 | ||
390 | const LLString& contents = node->getValue(); | 390 | const std::string& contents = node->getValue(); |
391 | 391 | ||
392 | LLRect group_rect = radio_group->getRect(); | 392 | LLRect group_rect = radio_group->getRect(); |
393 | 393 | ||
@@ -406,10 +406,10 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
406 | 406 | ||
407 | while(token_iter != tokens.end()) | 407 | while(token_iter != tokens.end()) |
408 | { | 408 | { |
409 | const char* line = token_iter->c_str(); | 409 | const std::string& line = *token_iter; |
410 | LLRect rect(HPAD, cur_y, group_rect.getWidth() - (2 * HPAD), cur_y - 15); | 410 | LLRect rect(HPAD, cur_y, group_rect.getWidth() - (2 * HPAD), cur_y - 15); |
411 | cur_y -= VPAD + 15; | 411 | cur_y -= VPAD + 15; |
412 | radio_group->addRadioButton("radio", line, rect, font); | 412 | radio_group->addRadioButton(std::string("radio"), line, rect, font); |
413 | ++token_iter; | 413 | ++token_iter; |
414 | } | 414 | } |
415 | llwarns << "Legacy radio group format used! Please convert to use <radio_item> tags!" << llendl; | 415 | llwarns << "Legacy radio group format used! Please convert to use <radio_item> tags!" << llendl; |
@@ -425,10 +425,10 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
425 | LLRect item_rect; | 425 | LLRect item_rect; |
426 | createRect(child, item_rect, radio_group, rect); | 426 | createRect(child, item_rect, radio_group, rect); |
427 | 427 | ||
428 | LLString radioname("radio"); | 428 | std::string radioname("radio"); |
429 | child->getAttributeString("name", radioname); | 429 | child->getAttributeString("name", radioname); |
430 | LLString item_label = child->getTextContents(); | 430 | std::string item_label = child->getTextContents(); |
431 | LLRadioCtrl* radio = radio_group->addRadioButton(radioname, item_label.c_str(), item_rect, font); | 431 | LLRadioCtrl* radio = radio_group->addRadioButton(radioname, item_label, item_rect, font); |
432 | 432 | ||
433 | radio->initFromXML(child, radio_group); | 433 | radio->initFromXML(child, radio_group); |
434 | } | 434 | } |
diff --git a/linden/indra/llui/llradiogroup.h b/linden/indra/llui/llradiogroup.h index e208b79..c8b96db 100644 --- a/linden/indra/llui/llradiogroup.h +++ b/linden/indra/llui/llradiogroup.h | |||
@@ -43,7 +43,7 @@ | |||
43 | class LLRadioCtrl : public LLCheckBoxCtrl | 43 | class LLRadioCtrl : public LLCheckBoxCtrl |
44 | { | 44 | { |
45 | public: | 45 | public: |
46 | LLRadioCtrl(const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font = NULL, | 46 | LLRadioCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font = NULL, |
47 | void (*commit_callback)(LLUICtrl*, void*) = NULL, void* callback_userdata = NULL) : | 47 | void (*commit_callback)(LLUICtrl*, void*) = NULL, void* callback_userdata = NULL) : |
48 | LLCheckBoxCtrl(name, rect, label, font, commit_callback, callback_userdata, FALSE, RADIO_STYLE) | 48 | LLCheckBoxCtrl(name, rect, label, font, commit_callback, callback_userdata, FALSE, RADIO_STYLE) |
49 | { | 49 | { |
@@ -67,15 +67,15 @@ public: | |||
67 | // Build a radio group. The number (0...n-1) of the currently selected | 67 | // Build a radio group. The number (0...n-1) of the currently selected |
68 | // element will be stored in the named control. After the control is | 68 | // element will be stored in the named control. After the control is |
69 | // changed the callback will be called. | 69 | // changed the callback will be called. |
70 | LLRadioGroup(const LLString& name, const LLRect& rect, | 70 | LLRadioGroup(const std::string& name, const LLRect& rect, |
71 | const LLString& control_name, | 71 | const std::string& control_name, |
72 | LLUICtrlCallback callback = NULL, | 72 | LLUICtrlCallback callback = NULL, |
73 | void* userdata = NULL, | 73 | void* userdata = NULL, |
74 | BOOL border = TRUE); | 74 | BOOL border = TRUE); |
75 | 75 | ||
76 | // Another radio group constructor, but this one doesn't rely on | 76 | // Another radio group constructor, but this one doesn't rely on |
77 | // needing a control | 77 | // needing a control |
78 | LLRadioGroup(const LLString& name, const LLRect& rect, | 78 | LLRadioGroup(const std::string& name, const LLRect& rect, |
79 | S32 initial_index, | 79 | S32 initial_index, |
80 | LLUICtrlCallback callback = NULL, | 80 | LLUICtrlCallback callback = NULL, |
81 | void* userdata = NULL, | 81 | void* userdata = NULL, |
@@ -106,7 +106,7 @@ public: | |||
106 | // You must use this method to add buttons to a radio group. | 106 | // You must use this method to add buttons to a radio group. |
107 | // Don't use addChild -- it won't set the callback function | 107 | // Don't use addChild -- it won't set the callback function |
108 | // correctly. | 108 | // correctly. |
109 | LLRadioCtrl* addRadioButton(const LLString& name, const LLString& label, const LLRect& rect, const LLFontGL* font); | 109 | LLRadioCtrl* addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font); |
110 | LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } | 110 | LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } |
111 | // Update the control as needed. Userdata must be a pointer to the button. | 111 | // Update the control as needed. Userdata must be a pointer to the button. |
112 | static void onClickButton(LLUICtrl* radio, void* userdata); | 112 | static void onClickButton(LLUICtrl* radio, void* userdata); |
diff --git a/linden/indra/llui/llresizebar.cpp b/linden/indra/llui/llresizebar.cpp index fd571a1..d8a7b92 100644 --- a/linden/indra/llui/llresizebar.cpp +++ b/linden/indra/llui/llresizebar.cpp | |||
@@ -39,7 +39,7 @@ | |||
39 | #include "llfocusmgr.h" | 39 | #include "llfocusmgr.h" |
40 | #include "llwindow.h" | 40 | #include "llwindow.h" |
41 | 41 | ||
42 | LLResizeBar::LLResizeBar( const LLString& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ) | 42 | LLResizeBar::LLResizeBar( const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ) |
43 | : | 43 | : |
44 | LLView( name, rect, TRUE ), | 44 | LLView( name, rect, TRUE ), |
45 | mDragLastScreenX( 0 ), | 45 | mDragLastScreenX( 0 ), |
diff --git a/linden/indra/llui/llresizebar.h b/linden/indra/llui/llresizebar.h index f8a7514..70dc7eb 100644 --- a/linden/indra/llui/llresizebar.h +++ b/linden/indra/llui/llresizebar.h | |||
@@ -40,7 +40,7 @@ class LLResizeBar : public LLView | |||
40 | public: | 40 | public: |
41 | enum Side { LEFT, TOP, RIGHT, BOTTOM }; | 41 | enum Side { LEFT, TOP, RIGHT, BOTTOM }; |
42 | 42 | ||
43 | LLResizeBar(const LLString& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ); | 43 | LLResizeBar(const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ); |
44 | 44 | ||
45 | // virtual void draw(); No appearance | 45 | // virtual void draw(); No appearance |
46 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | 46 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); |
diff --git a/linden/indra/llui/llresizehandle.cpp b/linden/indra/llui/llresizehandle.cpp index 3aa968f..340dff5 100644 --- a/linden/indra/llui/llresizehandle.cpp +++ b/linden/indra/llui/llresizehandle.cpp | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | const S32 RESIZE_BORDER_WIDTH = 3; | 44 | const S32 RESIZE_BORDER_WIDTH = 3; |
45 | 45 | ||
46 | LLResizeHandle::LLResizeHandle( const LLString& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner ) | 46 | LLResizeHandle::LLResizeHandle( const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner ) |
47 | : | 47 | : |
48 | LLView( name, rect, TRUE ), | 48 | LLView( name, rect, TRUE ), |
49 | mDragLastScreenX( 0 ), | 49 | mDragLastScreenX( 0 ), |
diff --git a/linden/indra/llui/llresizehandle.h b/linden/indra/llui/llresizehandle.h index 5302612..46d3827 100644 --- a/linden/indra/llui/llresizehandle.h +++ b/linden/indra/llui/llresizehandle.h | |||
@@ -44,7 +44,7 @@ public: | |||
44 | enum ECorner { LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM }; | 44 | enum ECorner { LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM }; |
45 | 45 | ||
46 | 46 | ||
47 | LLResizeHandle(const LLString& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ); | 47 | LLResizeHandle(const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ); |
48 | 48 | ||
49 | virtual void draw(); | 49 | virtual void draw(); |
50 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | 50 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); |
diff --git a/linden/indra/llui/llresmgr.cpp b/linden/indra/llui/llresmgr.cpp index b5b9174..bd05d43 100644 --- a/linden/indra/llui/llresmgr.cpp +++ b/linden/indra/llui/llresmgr.cpp | |||
@@ -292,7 +292,7 @@ std::string LLResMgr::getMonetaryString( S32 input ) const | |||
292 | BOOL negative_before = negative && (conv->n_sign_posn != 2); | 292 | BOOL negative_before = negative && (conv->n_sign_posn != 2); |
293 | BOOL negative_after = negative && (conv->n_sign_posn == 2); | 293 | BOOL negative_after = negative && (conv->n_sign_posn == 2); |
294 | 294 | ||
295 | LLString digits = llformat("%u", abs(input)); | 295 | std::string digits = llformat("%u", abs(input)); |
296 | if( !grouping || !grouping[0] ) | 296 | if( !grouping || !grouping[0] ) |
297 | { | 297 | { |
298 | if( negative_before ) | 298 | if( negative_before ) |
@@ -378,10 +378,10 @@ std::string LLResMgr::getMonetaryString( S32 input ) const | |||
378 | return output; | 378 | return output; |
379 | } | 379 | } |
380 | 380 | ||
381 | void LLResMgr::getIntegerString( LLString& output, S32 input ) const | 381 | void LLResMgr::getIntegerString( std::string& output, S32 input ) const |
382 | { | 382 | { |
383 | S32 fraction = 0; | 383 | S32 fraction = 0; |
384 | LLString fraction_string; | 384 | std::string fraction_string; |
385 | S32 remaining_count = input; | 385 | S32 remaining_count = input; |
386 | while(remaining_count > 0) | 386 | while(remaining_count > 0) |
387 | { | 387 | { |
@@ -415,16 +415,16 @@ void LLResMgr::getIntegerString( LLString& output, S32 input ) const | |||
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
418 | const LLString LLFONT_ID_NAMES[] = | 418 | const std::string LLFONT_ID_NAMES[] = |
419 | { | 419 | { |
420 | LLString("OCRA"), | 420 | std::string("OCRA"), |
421 | LLString("SANSSERIF"), | 421 | std::string("SANSSERIF"), |
422 | LLString("SANSSERIF_SMALL"), | 422 | std::string("SANSSERIF_SMALL"), |
423 | LLString("SANSSERIF_BIG"), | 423 | std::string("SANSSERIF_BIG"), |
424 | LLString("SMALL"), | 424 | std::string("SMALL"), |
425 | }; | 425 | }; |
426 | 426 | ||
427 | const LLFontGL* LLResMgr::getRes( LLString font_id ) const | 427 | const LLFontGL* LLResMgr::getRes( std::string font_id ) const |
428 | { | 428 | { |
429 | for (S32 i=0; i<LLFONT_COUNT; ++i) | 429 | for (S32 i=0; i<LLFONT_COUNT; ++i) |
430 | { | 430 | { |
@@ -437,21 +437,21 @@ const LLFontGL* LLResMgr::getRes( LLString font_id ) const | |||
437 | } | 437 | } |
438 | 438 | ||
439 | #if LL_WINDOWS | 439 | #if LL_WINDOWS |
440 | const LLString LLLocale::USER_LOCALE("English_United States.1252");// = LLString::null; | 440 | const std::string LLLocale::USER_LOCALE("English_United States.1252");// = LLStringUtil::null; |
441 | const LLString LLLocale::SYSTEM_LOCALE("English_United States.1252"); | 441 | const std::string LLLocale::SYSTEM_LOCALE("English_United States.1252"); |
442 | #elif LL_DARWIN | 442 | #elif LL_DARWIN |
443 | const LLString LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLString::null; | 443 | const std::string LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLStringUtil::null; |
444 | const LLString LLLocale::SYSTEM_LOCALE("en_US.iso8859-1"); | 444 | const std::string LLLocale::SYSTEM_LOCALE("en_US.iso8859-1"); |
445 | #elif LL_SOLARIS | 445 | #elif LL_SOLARIS |
446 | const LLString LLLocale::USER_LOCALE("en_US.ISO8859-1"); | 446 | const std::string LLLocale::USER_LOCALE("en_US.ISO8859-1"); |
447 | const LLString LLLocale::SYSTEM_LOCALE("C"); | 447 | const std::string LLLocale::SYSTEM_LOCALE("C"); |
448 | #else // LL_LINUX likes this | 448 | #else // LL_LINUX likes this |
449 | const LLString LLLocale::USER_LOCALE("en_US.utf8"); | 449 | const std::string LLLocale::USER_LOCALE("en_US.utf8"); |
450 | const LLString LLLocale::SYSTEM_LOCALE("C"); | 450 | const std::string LLLocale::SYSTEM_LOCALE("C"); |
451 | #endif | 451 | #endif |
452 | 452 | ||
453 | 453 | ||
454 | LLLocale::LLLocale(const LLString& locale_string) | 454 | LLLocale::LLLocale(const std::string& locale_string) |
455 | { | 455 | { |
456 | mPrevLocaleString = setlocale( LC_ALL, NULL ); | 456 | mPrevLocaleString = setlocale( LC_ALL, NULL ); |
457 | char* new_locale_string = setlocale( LC_ALL, locale_string.c_str()); | 457 | char* new_locale_string = setlocale( LC_ALL, locale_string.c_str()); |
diff --git a/linden/indra/llui/llresmgr.h b/linden/indra/llui/llresmgr.h index f9ec115..d7bc86c 100644 --- a/linden/indra/llui/llresmgr.h +++ b/linden/indra/llui/llresmgr.h | |||
@@ -71,11 +71,11 @@ public: | |||
71 | char getMonetaryDecimalPoint() const; | 71 | char getMonetaryDecimalPoint() const; |
72 | char getMonetaryThousandsSeparator() const; | 72 | char getMonetaryThousandsSeparator() const; |
73 | std::string getMonetaryString( S32 input ) const; | 73 | std::string getMonetaryString( S32 input ) const; |
74 | void getIntegerString( LLString& output, S32 input ) const; | 74 | void getIntegerString( std::string& output, S32 input ) const; |
75 | 75 | ||
76 | // const char* getRes( LLSTR_ID string_id ) const { return mStrings[ string_id ]; } | 76 | // const char* getRes( LLSTR_ID string_id ) const { return mStrings[ string_id ]; } |
77 | const LLFontGL* getRes( LLFONT_ID font_id ) const { return mFonts[ font_id ]; } | 77 | const LLFontGL* getRes( LLFONT_ID font_id ) const { return mFonts[ font_id ]; } |
78 | const LLFontGL* getRes( LLString font_id ) const; | 78 | const LLFontGL* getRes( std::string font_id ) const; |
79 | 79 | ||
80 | private: | 80 | private: |
81 | LLLOCALE_ID mLocale; | 81 | LLLOCALE_ID mLocale; |
@@ -92,14 +92,14 @@ private: | |||
92 | class LLLocale | 92 | class LLLocale |
93 | { | 93 | { |
94 | public: | 94 | public: |
95 | LLLocale(const LLString& locale_string); | 95 | LLLocale(const std::string& locale_string); |
96 | virtual ~LLLocale(); | 96 | virtual ~LLLocale(); |
97 | 97 | ||
98 | static const LLString USER_LOCALE; | 98 | static const std::string USER_LOCALE; |
99 | static const LLString SYSTEM_LOCALE; | 99 | static const std::string SYSTEM_LOCALE; |
100 | 100 | ||
101 | private: | 101 | private: |
102 | LLString mPrevLocaleString; | 102 | std::string mPrevLocaleString; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | #endif // LL_RESMGR_ | 105 | #endif // LL_RESMGR_ |
diff --git a/linden/indra/llui/llrootview.cpp b/linden/indra/llui/llrootview.cpp index cea9ded..fa7c730 100644 --- a/linden/indra/llui/llrootview.cpp +++ b/linden/indra/llui/llrootview.cpp | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #include "llrootview.h" | 33 | #include "llrootview.h" |
34 | 34 | ||
35 | LLRootView::LLRootView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) | 35 | LLRootView::LLRootView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) |
36 | : LLView(name,rect,mouse_opaque,follows) | 36 | : LLView(name,rect,mouse_opaque,follows) |
37 | { } | 37 | { } |
38 | 38 | ||
diff --git a/linden/indra/llui/llrootview.h b/linden/indra/llui/llrootview.h index f4c047c..9936f2d 100644 --- a/linden/indra/llui/llrootview.h +++ b/linden/indra/llui/llrootview.h | |||
@@ -37,7 +37,7 @@ | |||
37 | class LLRootView : public LLView | 37 | class LLRootView : public LLView |
38 | { | 38 | { |
39 | public: | 39 | public: |
40 | LLRootView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); | 40 | LLRootView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #endif | 43 | #endif |
diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp index 3d412c1..b011325 100644 --- a/linden/indra/llui/llscrollbar.cpp +++ b/linden/indra/llui/llscrollbar.cpp | |||
@@ -41,15 +41,13 @@ | |||
41 | #include "llcriticaldamp.h" | 41 | #include "llcriticaldamp.h" |
42 | #include "llkeyboard.h" | 42 | #include "llkeyboard.h" |
43 | #include "llui.h" | 43 | #include "llui.h" |
44 | //#include "llviewerimagelist.h" | ||
45 | #include "llfocusmgr.h" | 44 | #include "llfocusmgr.h" |
46 | #include "llwindow.h" | 45 | #include "llwindow.h" |
47 | #include "llglheaders.h" | ||
48 | #include "llcontrol.h" | 46 | #include "llcontrol.h" |
49 | #include "llrender.h" | 47 | #include "llrender.h" |
50 | 48 | ||
51 | LLScrollbar::LLScrollbar( | 49 | LLScrollbar::LLScrollbar( |
52 | const LLString& name, LLRect rect, | 50 | const std::string& name, LLRect rect, |
53 | LLScrollbar::ORIENTATION orientation, | 51 | LLScrollbar::ORIENTATION orientation, |
54 | S32 doc_size, S32 doc_pos, S32 page_size, | 52 | S32 doc_size, S32 doc_pos, S32 page_size, |
55 | void (*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), | 53 | void (*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), |
@@ -84,10 +82,10 @@ LLScrollbar::LLScrollbar( | |||
84 | 82 | ||
85 | // Page up and page down buttons | 83 | // Page up and page down buttons |
86 | LLRect line_up_rect; | 84 | LLRect line_up_rect; |
87 | LLString line_up_img; | 85 | std::string line_up_img; |
88 | LLString line_up_selected_img; | 86 | std::string line_up_selected_img; |
89 | LLString line_down_img; | 87 | std::string line_down_img; |
90 | LLString line_down_selected_img; | 88 | std::string line_down_selected_img; |
91 | 89 | ||
92 | LLRect line_down_rect; | 90 | LLRect line_down_rect; |
93 | 91 | ||
@@ -113,10 +111,9 @@ LLScrollbar::LLScrollbar( | |||
113 | line_down_selected_img="UIImgBtnScrollRightInUUID"; | 111 | line_down_selected_img="UIImgBtnScrollRightInUUID"; |
114 | } | 112 | } |
115 | 113 | ||
116 | LLButton* line_up_btn = new LLButton( | 114 | LLButton* line_up_btn = new LLButton(std::string("Line Up"), line_up_rect, |
117 | "Line Up", line_up_rect, | 115 | line_up_img, line_up_selected_img, LLStringUtil::null, |
118 | line_up_img, line_up_selected_img, "", | 116 | &LLScrollbar::onLineUpBtnPressed, this, LLFontGL::sSansSerif ); |
119 | &LLScrollbar::onLineUpBtnPressed, this, LLFontGL::sSansSerif ); | ||
120 | if( LLScrollbar::VERTICAL == mOrientation ) | 117 | if( LLScrollbar::VERTICAL == mOrientation ) |
121 | { | 118 | { |
122 | line_up_btn->setFollowsRight(); | 119 | line_up_btn->setFollowsRight(); |
@@ -132,10 +129,9 @@ LLScrollbar::LLScrollbar( | |||
132 | line_up_btn->setTabStop(FALSE); | 129 | line_up_btn->setTabStop(FALSE); |
133 | addChild(line_up_btn); | 130 | addChild(line_up_btn); |
134 | 131 | ||
135 | LLButton* line_down_btn = new LLButton( | 132 | LLButton* line_down_btn = new LLButton(std::string("Line Down"), line_down_rect, |
136 | "Line Down", line_down_rect, | 133 | line_down_img, line_down_selected_img, LLStringUtil::null, |
137 | line_down_img, line_down_selected_img, "", | 134 | &LLScrollbar::onLineDownBtnPressed, this, LLFontGL::sSansSerif ); |
138 | &LLScrollbar::onLineDownBtnPressed, this, LLFontGL::sSansSerif ); | ||
139 | line_down_btn->setFollowsRight(); | 135 | line_down_btn->setFollowsRight(); |
140 | line_down_btn->setFollowsBottom(); | 136 | line_down_btn->setFollowsBottom(); |
141 | line_down_btn->setHeldDownCallback( &LLScrollbar::onLineDownBtnPressed ); | 137 | line_down_btn->setHeldDownCallback( &LLScrollbar::onLineDownBtnPressed ); |
@@ -419,7 +415,7 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) | |||
419 | } | 415 | } |
420 | 416 | ||
421 | BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 417 | BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
422 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, LLString &tooltip_msg) | 418 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg) |
423 | { | 419 | { |
424 | // enable this to get drag and drop to control scrollbars | 420 | // enable this to get drag and drop to control scrollbars |
425 | //if (!drop) | 421 | //if (!drop) |
diff --git a/linden/indra/llui/llscrollbar.h b/linden/indra/llui/llscrollbar.h index 52f19d1..cb0ad97 100644 --- a/linden/indra/llui/llscrollbar.h +++ b/linden/indra/llui/llscrollbar.h | |||
@@ -51,7 +51,7 @@ class LLScrollbar | |||
51 | public: | 51 | public: |
52 | enum ORIENTATION { HORIZONTAL, VERTICAL }; | 52 | enum ORIENTATION { HORIZONTAL, VERTICAL }; |
53 | 53 | ||
54 | LLScrollbar(const LLString& name, LLRect rect, | 54 | LLScrollbar(const std::string& name, LLRect rect, |
55 | ORIENTATION orientation, | 55 | ORIENTATION orientation, |
56 | S32 doc_size, S32 doc_pos, S32 page_size, | 56 | S32 doc_size, S32 doc_pos, S32 page_size, |
57 | void(*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), | 57 | void(*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), |
@@ -69,7 +69,7 @@ public: | |||
69 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | 69 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); |
70 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 70 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
71 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 71 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
72 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, LLString &tooltip_msg); | 72 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg); |
73 | 73 | ||
74 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 74 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
75 | 75 | ||
diff --git a/linden/indra/llui/llscrollcontainer.cpp b/linden/indra/llui/llscrollcontainer.cpp index 1217a58..1ba2923 100644 --- a/linden/indra/llui/llscrollcontainer.cpp +++ b/linden/indra/llui/llscrollcontainer.cpp | |||
@@ -32,9 +32,7 @@ | |||
32 | 32 | ||
33 | #include "linden_common.h" | 33 | #include "linden_common.h" |
34 | 34 | ||
35 | #include "llgl.h" | ||
36 | #include "llrender.h" | 35 | #include "llrender.h" |
37 | |||
38 | #include "llscrollcontainer.h" | 36 | #include "llscrollcontainer.h" |
39 | #include "llscrollbar.h" | 37 | #include "llscrollbar.h" |
40 | #include "llui.h" | 38 | #include "llui.h" |
@@ -45,8 +43,6 @@ | |||
45 | #include "lluictrlfactory.h" | 43 | #include "lluictrlfactory.h" |
46 | #include "llfontgl.h" | 44 | #include "llfontgl.h" |
47 | 45 | ||
48 | #include "llglheaders.h" | ||
49 | |||
50 | ///---------------------------------------------------------------------------- | 46 | ///---------------------------------------------------------------------------- |
51 | /// Local function declarations, constants, enums, and typedefs | 47 | /// Local function declarations, constants, enums, and typedefs |
52 | ///---------------------------------------------------------------------------- | 48 | ///---------------------------------------------------------------------------- |
@@ -64,7 +60,7 @@ static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; | |||
64 | static LLRegisterWidget<LLScrollableContainerView> r("scroll_container"); | 60 | static LLRegisterWidget<LLScrollableContainerView> r("scroll_container"); |
65 | 61 | ||
66 | // Default constructor | 62 | // Default constructor |
67 | LLScrollableContainerView::LLScrollableContainerView( const LLString& name, | 63 | LLScrollableContainerView::LLScrollableContainerView( const std::string& name, |
68 | const LLRect& rect, | 64 | const LLRect& rect, |
69 | LLView* scrolled_view, | 65 | LLView* scrolled_view, |
70 | BOOL is_opaque, | 66 | BOOL is_opaque, |
@@ -86,7 +82,7 @@ LLScrollableContainerView::LLScrollableContainerView( const LLString& name, | |||
86 | } | 82 | } |
87 | 83 | ||
88 | // LLUICtrl constructor | 84 | // LLUICtrl constructor |
89 | LLScrollableContainerView::LLScrollableContainerView( const LLString& name, const LLRect& rect, | 85 | LLScrollableContainerView::LLScrollableContainerView( const std::string& name, const LLRect& rect, |
90 | LLUICtrl* scrolled_ctrl, BOOL is_opaque, | 86 | LLUICtrl* scrolled_ctrl, BOOL is_opaque, |
91 | const LLColor4& bg_color) : | 87 | const LLColor4& bg_color) : |
92 | LLUICtrl( name, rect, FALSE, NULL, NULL ), | 88 | LLUICtrl( name, rect, FALSE, NULL, NULL ), |
@@ -108,7 +104,7 @@ LLScrollableContainerView::LLScrollableContainerView( const LLString& name, cons | |||
108 | void LLScrollableContainerView::init() | 104 | void LLScrollableContainerView::init() |
109 | { | 105 | { |
110 | LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); | 106 | LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); |
111 | mBorder = new LLViewBorder( "scroll border", border_rect, LLViewBorder::BEVEL_IN ); | 107 | mBorder = new LLViewBorder( std::string("scroll border"), border_rect, LLViewBorder::BEVEL_IN ); |
112 | addChild( mBorder ); | 108 | addChild( mBorder ); |
113 | 109 | ||
114 | mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); | 110 | mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); |
@@ -116,7 +112,7 @@ void LLScrollableContainerView::init() | |||
116 | 112 | ||
117 | LLRect vertical_scroll_rect = mInnerRect; | 113 | LLRect vertical_scroll_rect = mInnerRect; |
118 | vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - SCROLLBAR_SIZE; | 114 | vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - SCROLLBAR_SIZE; |
119 | mScrollbar[VERTICAL] = new LLScrollbar( "scrollable vertical", | 115 | mScrollbar[VERTICAL] = new LLScrollbar( std::string("scrollable vertical"), |
120 | vertical_scroll_rect, | 116 | vertical_scroll_rect, |
121 | LLScrollbar::VERTICAL, | 117 | LLScrollbar::VERTICAL, |
122 | mInnerRect.getHeight(), | 118 | mInnerRect.getHeight(), |
@@ -132,7 +128,7 @@ void LLScrollableContainerView::init() | |||
132 | 128 | ||
133 | LLRect horizontal_scroll_rect = mInnerRect; | 129 | LLRect horizontal_scroll_rect = mInnerRect; |
134 | horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + SCROLLBAR_SIZE; | 130 | horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + SCROLLBAR_SIZE; |
135 | mScrollbar[HORIZONTAL] = new LLScrollbar( "scrollable horizontal", | 131 | mScrollbar[HORIZONTAL] = new LLScrollbar( std::string("scrollable horizontal"), |
136 | horizontal_scroll_rect, | 132 | horizontal_scroll_rect, |
137 | LLScrollbar::HORIZONTAL, | 133 | LLScrollbar::HORIZONTAL, |
138 | mInnerRect.getWidth(), | 134 | mInnerRect.getWidth(), |
@@ -268,7 +264,7 @@ BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, | |||
268 | EDragAndDropType cargo_type, | 264 | EDragAndDropType cargo_type, |
269 | void* cargo_data, | 265 | void* cargo_data, |
270 | EAcceptance* accept, | 266 | EAcceptance* accept, |
271 | LLString& tooltip_msg) | 267 | std::string& tooltip_msg) |
272 | { | 268 | { |
273 | // Scroll folder view if needed. Never accepts a drag or drop. | 269 | // Scroll folder view if needed. Never accepts a drag or drop. |
274 | *accept = ACCEPT_NO; | 270 | *accept = ACCEPT_NO; |
@@ -340,7 +336,7 @@ BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, | |||
340 | } | 336 | } |
341 | 337 | ||
342 | 338 | ||
343 | BOOL LLScrollableContainerView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect) | 339 | BOOL LLScrollableContainerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) |
344 | { | 340 | { |
345 | S32 local_x, local_y; | 341 | S32 local_x, local_y; |
346 | for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) | 342 | for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) |
@@ -704,7 +700,7 @@ LLXMLNodePtr LLScrollableContainerView::getXML(bool save_children) const | |||
704 | 700 | ||
705 | LLView* LLScrollableContainerView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 701 | LLView* LLScrollableContainerView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
706 | { | 702 | { |
707 | LLString name("scroll_container"); | 703 | std::string name("scroll_container"); |
708 | node->getAttributeString("name", name); | 704 | node->getAttributeString("name", name); |
709 | 705 | ||
710 | LLRect rect; | 706 | LLRect rect; |
@@ -742,7 +738,7 @@ LLView* LLScrollableContainerView::fromXML(LLXMLNodePtr node, LLView *parent, LL | |||
742 | 738 | ||
743 | if (panelp == NULL) | 739 | if (panelp == NULL) |
744 | { | 740 | { |
745 | panelp = new LLPanel("dummy", LLRect::null, FALSE); | 741 | panelp = new LLPanel(std::string("dummy"), LLRect::null, FALSE); |
746 | } | 742 | } |
747 | 743 | ||
748 | ret->mScrolledView = panelp; | 744 | ret->mScrolledView = panelp; |
diff --git a/linden/indra/llui/llscrollcontainer.h b/linden/indra/llui/llscrollcontainer.h index b6999e6..3e42dd4 100644 --- a/linden/indra/llui/llscrollcontainer.h +++ b/linden/indra/llui/llscrollcontainer.h | |||
@@ -59,10 +59,10 @@ public: | |||
59 | // scrollbars have priority for mouse and keyboard events. | 59 | // scrollbars have priority for mouse and keyboard events. |
60 | enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT }; | 60 | enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT }; |
61 | 61 | ||
62 | LLScrollableContainerView( const LLString& name, const LLRect& rect, | 62 | LLScrollableContainerView( const std::string& name, const LLRect& rect, |
63 | LLView* scrolled_view, BOOL is_opaque = FALSE, | 63 | LLView* scrolled_view, BOOL is_opaque = FALSE, |
64 | const LLColor4& bg_color = LLColor4(0,0,0,0) ); | 64 | const LLColor4& bg_color = LLColor4(0,0,0,0) ); |
65 | LLScrollableContainerView( const LLString& name, const LLRect& rect, | 65 | LLScrollableContainerView( const std::string& name, const LLRect& rect, |
66 | LLUICtrl* scrolled_ctrl, BOOL is_opaque = FALSE, | 66 | LLUICtrl* scrolled_ctrl, BOOL is_opaque = FALSE, |
67 | const LLColor4& bg_color = LLColor4(0,0,0,0) ); | 67 | const LLColor4& bg_color = LLColor4(0,0,0,0) ); |
68 | virtual ~LLScrollableContainerView( void ); | 68 | virtual ~LLScrollableContainerView( void ); |
@@ -94,9 +94,9 @@ public: | |||
94 | EDragAndDropType cargo_type, | 94 | EDragAndDropType cargo_type, |
95 | void* cargo_data, | 95 | void* cargo_data, |
96 | EAcceptance* accept, | 96 | EAcceptance* accept, |
97 | LLString& tooltip_msg); | 97 | std::string& tooltip_msg); |
98 | 98 | ||
99 | virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | 99 | virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); |
100 | virtual void draw(); | 100 | virtual void draw(); |
101 | 101 | ||
102 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 102 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
diff --git a/linden/indra/llui/llscrollingpanellist.cpp b/linden/indra/llui/llscrollingpanellist.cpp index c9cdf3f..cc4b8f4 100644 --- a/linden/indra/llui/llscrollingpanellist.cpp +++ b/linden/indra/llui/llscrollingpanellist.cpp | |||
@@ -141,7 +141,7 @@ void LLScrollingPanelList::draw() | |||
141 | // static | 141 | // static |
142 | LLView* LLScrollingPanelList::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 142 | LLView* LLScrollingPanelList::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
143 | { | 143 | { |
144 | LLString name("scrolling_panel_list"); | 144 | std::string name("scrolling_panel_list"); |
145 | node->getAttributeString("name", name); | 145 | node->getAttributeString("name", name); |
146 | 146 | ||
147 | LLRect rect; | 147 | LLRect rect; |
diff --git a/linden/indra/llui/llscrollingpanellist.h b/linden/indra/llui/llscrollingpanellist.h index 7729250..2b8072d 100644 --- a/linden/indra/llui/llscrollingpanellist.h +++ b/linden/indra/llui/llscrollingpanellist.h | |||
@@ -41,7 +41,7 @@ | |||
41 | class LLScrollingPanel : public LLPanel | 41 | class LLScrollingPanel : public LLPanel |
42 | { | 42 | { |
43 | public: | 43 | public: |
44 | LLScrollingPanel(const LLString& name, const LLRect& rect) : LLPanel(name, rect) { } | 44 | LLScrollingPanel(const std::string& name, const LLRect& rect) : LLPanel(name, rect) { } |
45 | virtual void updatePanel(BOOL allow_modify) = 0; | 45 | virtual void updatePanel(BOOL allow_modify) = 0; |
46 | }; | 46 | }; |
47 | 47 | ||
@@ -52,7 +52,7 @@ public: | |||
52 | class LLScrollingPanelList : public LLUICtrl | 52 | class LLScrollingPanelList : public LLUICtrl |
53 | { | 53 | { |
54 | public: | 54 | public: |
55 | LLScrollingPanelList(const LLString& name, const LLRect& rect) | 55 | LLScrollingPanelList(const std::string& name, const LLRect& rect) |
56 | : LLUICtrl(name, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_BOTTOM ) {} | 56 | : LLUICtrl(name, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_BOTTOM ) {} |
57 | 57 | ||
58 | virtual void setValue(const LLSD& value) {}; | 58 | virtual void setValue(const LLSD& value) {}; |
diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index 307d045..6561bb5 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp | |||
@@ -42,9 +42,7 @@ | |||
42 | #include "llcheckboxctrl.h" | 42 | #include "llcheckboxctrl.h" |
43 | #include "llclipboard.h" | 43 | #include "llclipboard.h" |
44 | #include "llfocusmgr.h" | 44 | #include "llfocusmgr.h" |
45 | #include "llgl.h" | ||
46 | #include "llrender.h" | 45 | #include "llrender.h" |
47 | #include "llglheaders.h" | ||
48 | #include "llresmgr.h" | 46 | #include "llresmgr.h" |
49 | #include "llscrollbar.h" | 47 | #include "llscrollbar.h" |
50 | #include "llstring.h" | 48 | #include "llstring.h" |
@@ -85,7 +83,7 @@ struct SortScrollListItem | |||
85 | S32 order = sort_ascending ? 1 : -1; // ascending or descending sort for this column? | 83 | S32 order = sort_ascending ? 1 : -1; // ascending or descending sort for this column? |
86 | if (cell1 && cell2) | 84 | if (cell1 && cell2) |
87 | { | 85 | { |
88 | sort_result = order * LLString::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); | 86 | sort_result = order * LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); |
89 | if (sort_result != 0) | 87 | if (sort_result != 0) |
90 | { | 88 | { |
91 | break; // we have a sort order! | 89 | break; // we have a sort order! |
@@ -133,7 +131,7 @@ void LLScrollListIcon::setValue(const LLSD& value) | |||
133 | } | 131 | } |
134 | else | 132 | else |
135 | { | 133 | { |
136 | LLString value_string = value.asString(); | 134 | std::string value_string = value.asString(); |
137 | if (LLUUID::validate(value_string)) | 135 | if (LLUUID::validate(value_string)) |
138 | { | 136 | { |
139 | setValue(LLUUID(value_string)); | 137 | setValue(LLUUID(value_string)); |
@@ -239,7 +237,7 @@ void LLScrollListSeparator::draw(const LLColor4& color, const LLColor4& highligh | |||
239 | // | 237 | // |
240 | U32 LLScrollListText::sCount = 0; | 238 | U32 LLScrollListText::sCount = 0; |
241 | 239 | ||
242 | LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible) | 240 | LLScrollListText::LLScrollListText( const std::string& text, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible) |
243 | : LLScrollListCell(width), | 241 | : LLScrollListCell(width), |
244 | mText( text ), | 242 | mText( text ), |
245 | mFont( font ), | 243 | mFont( font ), |
@@ -418,9 +416,9 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell ) | |||
418 | } | 416 | } |
419 | } | 417 | } |
420 | 418 | ||
421 | LLString LLScrollListItem::getContentsCSV() const | 419 | std::string LLScrollListItem::getContentsCSV() const |
422 | { | 420 | { |
423 | LLString ret; | 421 | std::string ret; |
424 | 422 | ||
425 | S32 count = getNumColumns(); | 423 | S32 count = getNumColumns(); |
426 | for (S32 i=0; i<count; ++i) | 424 | for (S32 i=0; i<count; ++i) |
@@ -476,7 +474,7 @@ void LLScrollListItem::setEnabled(BOOL b) | |||
476 | //--------------------------------------------------------------------------- | 474 | //--------------------------------------------------------------------------- |
477 | // LLScrollListItemComment | 475 | // LLScrollListItemComment |
478 | //--------------------------------------------------------------------------- | 476 | //--------------------------------------------------------------------------- |
479 | LLScrollListItemComment::LLScrollListItemComment(const LLString& comment_string, const LLColor4& color) | 477 | LLScrollListItemComment::LLScrollListItemComment(const std::string& comment_string, const LLColor4& color) |
480 | : LLScrollListItem(FALSE), | 478 | : LLScrollListItem(FALSE), |
481 | mColor(color) | 479 | mColor(color) |
482 | { | 480 | { |
@@ -541,7 +539,7 @@ void LLScrollListItemSeparator::draw(const LLRect& rect, const LLColor4& fg_colo | |||
541 | // LLScrollListCtrl | 539 | // LLScrollListCtrl |
542 | //--------------------------------------------------------------------------- | 540 | //--------------------------------------------------------------------------- |
543 | 541 | ||
544 | LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, | 542 | LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect, |
545 | void (*commit_callback)(LLUICtrl* ctrl, void* userdata), | 543 | void (*commit_callback)(LLUICtrl* ctrl, void* userdata), |
546 | void* callback_user_data, | 544 | void* callback_user_data, |
547 | BOOL allow_multiple_selection, | 545 | BOOL allow_multiple_selection, |
@@ -605,12 +603,12 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, | |||
605 | mItemListRect.mBottom, | 603 | mItemListRect.mBottom, |
606 | SCROLLBAR_SIZE, | 604 | SCROLLBAR_SIZE, |
607 | mItemListRect.getHeight()); | 605 | mItemListRect.getHeight()); |
608 | mScrollbar = new LLScrollbar( "Scrollbar", scroll_rect, | 606 | mScrollbar = new LLScrollbar( std::string("Scrollbar"), scroll_rect, |
609 | LLScrollbar::VERTICAL, | 607 | LLScrollbar::VERTICAL, |
610 | getItemCount(), | 608 | getItemCount(), |
611 | mScrollLines, | 609 | mScrollLines, |
612 | mPageLines, | 610 | mPageLines, |
613 | &LLScrollListCtrl::onScrollChange, this ); | 611 | &LLScrollListCtrl::onScrollChange, this ); |
614 | mScrollbar->setFollowsRight(); | 612 | mScrollbar->setFollowsRight(); |
615 | mScrollbar->setFollowsTop(); | 613 | mScrollbar->setFollowsTop(); |
616 | mScrollbar->setFollowsBottom(); | 614 | mScrollbar->setFollowsBottom(); |
@@ -623,7 +621,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, | |||
623 | if (show_border) | 621 | if (show_border) |
624 | { | 622 | { |
625 | LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); | 623 | LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); |
626 | mBorder = new LLViewBorder( "dlg border", border_rect, LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, 1 ); | 624 | mBorder = new LLViewBorder( std::string("dlg border"), border_rect, LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, 1 ); |
627 | addChild(mBorder); | 625 | addChild(mBorder); |
628 | } | 626 | } |
629 | 627 | ||
@@ -758,7 +756,7 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllData() const | |||
758 | // returns first matching item | 756 | // returns first matching item |
759 | LLScrollListItem* LLScrollListCtrl::getItem(const LLSD& sd) const | 757 | LLScrollListItem* LLScrollListCtrl::getItem(const LLSD& sd) const |
760 | { | 758 | { |
761 | LLString string_val = sd.asString(); | 759 | std::string string_val = sd.asString(); |
762 | 760 | ||
763 | item_list::const_iterator iter; | 761 | item_list::const_iterator iter; |
764 | for(iter = mItemList.begin(); iter != mItemList.end(); iter++) | 762 | for(iter = mItemList.begin(); iter != mItemList.end(); iter++) |
@@ -1405,7 +1403,7 @@ void LLScrollListCtrl::deselectAllItems(BOOL no_commit_on_change) | |||
1405 | /////////////////////////////////////////////////////////////////////////////////////////////////// | 1403 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
1406 | // Use this to add comment text such as "Searching", which ignores column settings of list | 1404 | // Use this to add comment text such as "Searching", which ignores column settings of list |
1407 | 1405 | ||
1408 | LLScrollListItem* LLScrollListCtrl::addCommentText(const LLString& comment_text, EAddPosition pos) | 1406 | LLScrollListItem* LLScrollListCtrl::addCommentText(const std::string& comment_text, EAddPosition pos) |
1409 | { | 1407 | { |
1410 | LLScrollListItem* item = NULL; | 1408 | LLScrollListItem* item = NULL; |
1411 | if (getItemCount() < mMaxItemCount) | 1409 | if (getItemCount() < mMaxItemCount) |
@@ -1426,7 +1424,7 @@ LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos) | |||
1426 | 1424 | ||
1427 | // Selects first enabled item of the given name. | 1425 | // Selects first enabled item of the given name. |
1428 | // Returns false if item not found. | 1426 | // Returns false if item not found. |
1429 | BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensitive) | 1427 | BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive) |
1430 | { | 1428 | { |
1431 | // ensure that no stale items are selected, even if we don't find a match | 1429 | // ensure that no stale items are selected, even if we don't find a match |
1432 | deselectAllItems(TRUE); | 1430 | deselectAllItems(TRUE); |
@@ -1436,10 +1434,10 @@ BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensit | |||
1436 | return FALSE; | 1434 | return FALSE; |
1437 | } | 1435 | } |
1438 | 1436 | ||
1439 | LLString target_text = label; | 1437 | std::string target_text = label; |
1440 | if (!case_sensitive) | 1438 | if (!case_sensitive) |
1441 | { | 1439 | { |
1442 | LLString::toLower(target_text); | 1440 | LLStringUtil::toLower(target_text); |
1443 | } | 1441 | } |
1444 | 1442 | ||
1445 | BOOL found = FALSE; | 1443 | BOOL found = FALSE; |
@@ -1450,10 +1448,10 @@ BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensit | |||
1450 | { | 1448 | { |
1451 | LLScrollListItem* item = *iter; | 1449 | LLScrollListItem* item = *iter; |
1452 | // Only select enabled items with matching names | 1450 | // Only select enabled items with matching names |
1453 | LLString item_text = item->getColumn(0)->getValue().asString(); | 1451 | std::string item_text = item->getColumn(0)->getValue().asString(); |
1454 | if (!case_sensitive) | 1452 | if (!case_sensitive) |
1455 | { | 1453 | { |
1456 | LLString::toLower(item_text); | 1454 | LLStringUtil::toLower(item_text); |
1457 | } | 1455 | } |
1458 | BOOL select = !found && item->getEnabled() && item_text == target_text; | 1456 | BOOL select = !found && item->getEnabled() && item_text == target_text; |
1459 | if (select) | 1457 | if (select) |
@@ -1473,7 +1471,7 @@ BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensit | |||
1473 | } | 1471 | } |
1474 | 1472 | ||
1475 | 1473 | ||
1476 | BOOL LLScrollListCtrl::selectItemByPrefix(const LLString& target, BOOL case_sensitive) | 1474 | BOOL LLScrollListCtrl::selectItemByPrefix(const std::string& target, BOOL case_sensitive) |
1477 | { | 1475 | { |
1478 | return selectItemByPrefix(utf8str_to_wstring(target), case_sensitive); | 1476 | return selectItemByPrefix(utf8str_to_wstring(target), case_sensitive); |
1479 | } | 1477 | } |
@@ -1510,7 +1508,7 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen | |||
1510 | if (!case_sensitive) | 1508 | if (!case_sensitive) |
1511 | { | 1509 | { |
1512 | // do comparisons in lower case | 1510 | // do comparisons in lower case |
1513 | LLWString::toLower(target_trimmed); | 1511 | LLWStringUtil::toLower(target_trimmed); |
1514 | } | 1512 | } |
1515 | 1513 | ||
1516 | for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); iter++) | 1514 | for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); iter++) |
@@ -1526,11 +1524,11 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen | |||
1526 | LLWString item_label = utf8str_to_wstring(cellp->getValue().asString()); | 1524 | LLWString item_label = utf8str_to_wstring(cellp->getValue().asString()); |
1527 | if (!case_sensitive) | 1525 | if (!case_sensitive) |
1528 | { | 1526 | { |
1529 | LLWString::toLower(item_label); | 1527 | LLWStringUtil::toLower(item_label); |
1530 | } | 1528 | } |
1531 | // remove extraneous whitespace from searchable label | 1529 | // remove extraneous whitespace from searchable label |
1532 | LLWString trimmed_label = item_label; | 1530 | LLWString trimmed_label = item_label; |
1533 | LLWString::trim(trimmed_label); | 1531 | LLWStringUtil::trim(trimmed_label); |
1534 | 1532 | ||
1535 | BOOL select = item->getEnabled() && trimmed_label.compare(0, target_trimmed.size(), target_trimmed) == 0; | 1533 | BOOL select = item->getEnabled() && trimmed_label.compare(0, target_trimmed.size(), target_trimmed) == 0; |
1536 | 1534 | ||
@@ -1554,7 +1552,7 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen | |||
1554 | return found; | 1552 | return found; |
1555 | } | 1553 | } |
1556 | 1554 | ||
1557 | const LLString LLScrollListCtrl::getSelectedItemLabel(S32 column) const | 1555 | const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const |
1558 | { | 1556 | { |
1559 | LLScrollListItem* item; | 1557 | LLScrollListItem* item; |
1560 | 1558 | ||
@@ -1564,14 +1562,14 @@ const LLString LLScrollListCtrl::getSelectedItemLabel(S32 column) const | |||
1564 | return item->getColumn(column)->getValue().asString(); | 1562 | return item->getColumn(column)->getValue().asString(); |
1565 | } | 1563 | } |
1566 | 1564 | ||
1567 | return LLString::null; | 1565 | return LLStringUtil::null; |
1568 | } | 1566 | } |
1569 | 1567 | ||
1570 | /////////////////////////////////////////////////////////////////////////////////////////////////// | 1568 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
1571 | // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which | 1569 | // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which |
1572 | // has an associated, unique UUID, and only one of which can be selected at a time. | 1570 | // has an associated, unique UUID, and only one of which can be selected at a time. |
1573 | 1571 | ||
1574 | LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const LLString& item_text, const LLUUID& id, EAddPosition pos, BOOL enabled, S32 column_width) | 1572 | LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos, BOOL enabled, S32 column_width) |
1575 | { | 1573 | { |
1576 | LLScrollListItem* item = NULL; | 1574 | LLScrollListItem* item = NULL; |
1577 | if (getItemCount() < mMaxItemCount) | 1575 | if (getItemCount() < mMaxItemCount) |
@@ -1799,7 +1797,7 @@ BOOL LLScrollListCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks) | |||
1799 | return handled; | 1797 | return handled; |
1800 | } | 1798 | } |
1801 | 1799 | ||
1802 | BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) | 1800 | BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) |
1803 | { | 1801 | { |
1804 | S32 column_index = getColumnIndexFromOffset(x); | 1802 | S32 column_index = getColumnIndexFromOffset(x); |
1805 | LLScrollListColumn* columnp = getColumn(column_index); | 1803 | LLScrollListColumn* columnp = getColumn(column_index); |
@@ -2539,7 +2537,7 @@ void LLScrollListCtrl::onScrollChange( S32 new_pos, LLScrollbar* scrollbar, void | |||
2539 | } | 2537 | } |
2540 | 2538 | ||
2541 | 2539 | ||
2542 | void LLScrollListCtrl::sortByColumn(LLString name, BOOL ascending) | 2540 | void LLScrollListCtrl::sortByColumn(const std::string& name, BOOL ascending) |
2543 | { | 2541 | { |
2544 | if (name.empty()) | 2542 | if (name.empty()) |
2545 | { | 2543 | { |
@@ -2547,15 +2545,15 @@ void LLScrollListCtrl::sortByColumn(LLString name, BOOL ascending) | |||
2547 | return; | 2545 | return; |
2548 | } | 2546 | } |
2549 | 2547 | ||
2550 | std::map<LLString, LLScrollListColumn>::iterator itor = mColumns.find(name); | 2548 | std::map<std::string, LLScrollListColumn>::iterator itor = mColumns.find(name); |
2551 | if (itor != mColumns.end()) | 2549 | if (itor != mColumns.end()) |
2552 | { | 2550 | { |
2553 | sortByColumn((*itor).second.mIndex, ascending); | 2551 | sortByColumnIndex((*itor).second.mIndex, ascending); |
2554 | } | 2552 | } |
2555 | } | 2553 | } |
2556 | 2554 | ||
2557 | // First column is column 0 | 2555 | // First column is column 0 |
2558 | void LLScrollListCtrl::sortByColumn(U32 column, BOOL ascending) | 2556 | void LLScrollListCtrl::sortByColumnIndex(U32 column, BOOL ascending) |
2559 | { | 2557 | { |
2560 | if (setSort(column, ascending)) | 2558 | if (setSort(column, ascending)) |
2561 | { | 2559 | { |
@@ -2582,7 +2580,7 @@ void LLScrollListCtrl::dirtyColumns() | |||
2582 | // just in case someone indexes into it immediately | 2580 | // just in case someone indexes into it immediately |
2583 | mColumnsIndexed.resize(mColumns.size()); | 2581 | mColumnsIndexed.resize(mColumns.size()); |
2584 | 2582 | ||
2585 | std::map<LLString, LLScrollListColumn>::iterator column_itor; | 2583 | std::map<std::string, LLScrollListColumn>::iterator column_itor; |
2586 | for (column_itor = mColumns.begin(); column_itor != mColumns.end(); ++column_itor) | 2584 | for (column_itor = mColumns.begin(); column_itor != mColumns.end(); ++column_itor) |
2587 | { | 2585 | { |
2588 | LLScrollListColumn *column = &column_itor->second; | 2586 | LLScrollListColumn *column = &column_itor->second; |
@@ -2671,7 +2669,7 @@ LLXMLNodePtr LLScrollListCtrl::getXML(bool save_children) const | |||
2671 | 2669 | ||
2672 | // Contents | 2670 | // Contents |
2673 | 2671 | ||
2674 | std::map<LLString, LLScrollListColumn>::const_iterator itor; | 2672 | std::map<std::string, LLScrollListColumn>::const_iterator itor; |
2675 | std::vector<const LLScrollListColumn*> sorted_list; | 2673 | std::vector<const LLScrollListColumn*> sorted_list; |
2676 | sorted_list.resize(mColumns.size()); | 2674 | sorted_list.resize(mColumns.size()); |
2677 | for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) | 2675 | for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) |
@@ -2763,7 +2761,7 @@ void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node) | |||
2763 | // static | 2761 | // static |
2764 | LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 2762 | LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
2765 | { | 2763 | { |
2766 | LLString name("scroll_list"); | 2764 | std::string name("scroll_list"); |
2767 | node->getAttributeString("name", name); | 2765 | node->getAttributeString("name", name); |
2768 | 2766 | ||
2769 | LLRect rect; | 2767 | LLRect rect; |
@@ -2813,7 +2811,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2813 | 2811 | ||
2814 | if (sort_column >= 0) | 2812 | if (sort_column >= 0) |
2815 | { | 2813 | { |
2816 | scroll_list->sortByColumn(sort_column, sort_ascending); | 2814 | scroll_list->sortByColumnIndex(sort_column, sort_ascending); |
2817 | } | 2815 | } |
2818 | 2816 | ||
2819 | LLSD columns; | 2817 | LLSD columns; |
@@ -2824,19 +2822,19 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2824 | { | 2822 | { |
2825 | if (child->hasName("column")) | 2823 | if (child->hasName("column")) |
2826 | { | 2824 | { |
2827 | LLString labelname(""); | 2825 | std::string labelname(""); |
2828 | child->getAttributeString("label", labelname); | 2826 | child->getAttributeString("label", labelname); |
2829 | 2827 | ||
2830 | LLString columnname(labelname); | 2828 | std::string columnname(labelname); |
2831 | child->getAttributeString("name", columnname); | 2829 | child->getAttributeString("name", columnname); |
2832 | 2830 | ||
2833 | LLString sortname(columnname); | 2831 | std::string sortname(columnname); |
2834 | child->getAttributeString("sort", sortname); | 2832 | child->getAttributeString("sort", sortname); |
2835 | 2833 | ||
2836 | BOOL sort_ascending = TRUE; | 2834 | BOOL sort_ascending = TRUE; |
2837 | child->getAttributeBOOL("sort_ascending", sort_ascending); | 2835 | child->getAttributeBOOL("sort_ascending", sort_ascending); |
2838 | 2836 | ||
2839 | LLString imagename; | 2837 | std::string imagename; |
2840 | child->getAttributeString("image", imagename); | 2838 | child->getAttributeString("image", imagename); |
2841 | 2839 | ||
2842 | BOOL columndynamicwidth = FALSE; | 2840 | BOOL columndynamicwidth = FALSE; |
@@ -2845,7 +2843,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2845 | S32 columnwidth = -1; | 2843 | S32 columnwidth = -1; |
2846 | child->getAttributeS32("width", columnwidth); | 2844 | child->getAttributeS32("width", columnwidth); |
2847 | 2845 | ||
2848 | LLString tooltip; | 2846 | std::string tooltip; |
2849 | child->getAttributeString("tool_tip", tooltip); | 2847 | child->getAttributeString("tool_tip", tooltip); |
2850 | 2848 | ||
2851 | if(!columndynamicwidth) total_static += llmax(0, columnwidth); | 2849 | if(!columndynamicwidth) total_static += llmax(0, columnwidth); |
@@ -2890,15 +2888,15 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2890 | { | 2888 | { |
2891 | if (row_child->hasName("column")) | 2889 | if (row_child->hasName("column")) |
2892 | { | 2890 | { |
2893 | LLString value = row_child->getTextContents(); | 2891 | std::string value = row_child->getTextContents(); |
2894 | 2892 | ||
2895 | LLString columnname(""); | 2893 | std::string columnname(""); |
2896 | row_child->getAttributeString("name", columnname); | 2894 | row_child->getAttributeString("name", columnname); |
2897 | 2895 | ||
2898 | LLString font(""); | 2896 | std::string font(""); |
2899 | row_child->getAttributeString("font", font); | 2897 | row_child->getAttributeString("font", font); |
2900 | 2898 | ||
2901 | LLString font_style(""); | 2899 | std::string font_style(""); |
2902 | row_child->getAttributeString("font-style", font_style); | 2900 | row_child->getAttributeString("font-style", font_style); |
2903 | 2901 | ||
2904 | row["columns"][column_idx]["column"] = columnname; | 2902 | row["columns"][column_idx]["column"] = columnname; |
@@ -2912,7 +2910,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2912 | } | 2910 | } |
2913 | } | 2911 | } |
2914 | 2912 | ||
2915 | LLString contents = node->getTextContents(); | 2913 | std::string contents = node->getTextContents(); |
2916 | if (!contents.empty()) | 2914 | if (!contents.empty()) |
2917 | { | 2915 | { |
2918 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 2916 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; |
@@ -2922,7 +2920,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2922 | 2920 | ||
2923 | while(token_iter != tokens.end()) | 2921 | while(token_iter != tokens.end()) |
2924 | { | 2922 | { |
2925 | const char* line = token_iter->c_str(); | 2923 | const std::string& line = *token_iter; |
2926 | scroll_list->addSimpleElement(line); | 2924 | scroll_list->addSimpleElement(line); |
2927 | ++token_iter; | 2925 | ++token_iter; |
2928 | } | 2926 | } |
@@ -2936,7 +2934,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac | |||
2936 | // virtual | 2934 | // virtual |
2937 | void LLScrollListCtrl::copy() | 2935 | void LLScrollListCtrl::copy() |
2938 | { | 2936 | { |
2939 | LLString buffer; | 2937 | std::string buffer; |
2940 | 2938 | ||
2941 | std::vector<LLScrollListItem*> items = getAllSelected(); | 2939 | std::vector<LLScrollListItem*> items = getAllSelected(); |
2942 | std::vector<LLScrollListItem*>::iterator itor; | 2940 | std::vector<LLScrollListItem*>::iterator itor; |
@@ -3006,7 +3004,7 @@ BOOL LLScrollListCtrl::canDeselect() const | |||
3006 | 3004 | ||
3007 | void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) | 3005 | void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) |
3008 | { | 3006 | { |
3009 | LLString name = column["name"].asString(); | 3007 | std::string name = column["name"].asString(); |
3010 | // if no column name provided, just use ordinal as name | 3008 | // if no column name provided, just use ordinal as name |
3011 | if (name.empty()) | 3009 | if (name.empty()) |
3012 | { | 3010 | { |
@@ -3037,7 +3035,7 @@ void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) | |||
3037 | S32 top = mItemListRect.mTop; | 3035 | S32 top = mItemListRect.mTop; |
3038 | S32 left = mItemListRect.mLeft; | 3036 | S32 left = mItemListRect.mLeft; |
3039 | { | 3037 | { |
3040 | std::map<LLString, LLScrollListColumn>::iterator itor; | 3038 | std::map<std::string, LLScrollListColumn>::iterator itor; |
3041 | for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) | 3039 | for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) |
3042 | { | 3040 | { |
3043 | if (itor->second.mIndex < new_column->mIndex && | 3041 | if (itor->second.mIndex < new_column->mIndex && |
@@ -3047,7 +3045,7 @@ void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) | |||
3047 | } | 3045 | } |
3048 | } | 3046 | } |
3049 | } | 3047 | } |
3050 | LLString button_name = "btn_" + name; | 3048 | std::string button_name = "btn_" + name; |
3051 | S32 right = left+new_column->mWidth; | 3049 | S32 right = left+new_column->mWidth; |
3052 | if (new_column->mIndex != (S32)mColumns.size()-1) | 3050 | if (new_column->mIndex != (S32)mColumns.size()-1) |
3053 | { | 3051 | { |
@@ -3108,7 +3106,7 @@ void LLScrollListCtrl::onClickColumn(void *userdata) | |||
3108 | ascending = !parent->mSortColumns.back().second; | 3106 | ascending = !parent->mSortColumns.back().second; |
3109 | } | 3107 | } |
3110 | 3108 | ||
3111 | parent->sortByColumn(column_index, ascending); | 3109 | parent->sortByColumnIndex(column_index, ascending); |
3112 | 3110 | ||
3113 | if (parent->mOnSortChangedCallback) | 3111 | if (parent->mOnSortChangedCallback) |
3114 | { | 3112 | { |
@@ -3131,7 +3129,7 @@ BOOL LLScrollListCtrl::needsSorting() | |||
3131 | 3129 | ||
3132 | void LLScrollListCtrl::clearColumns() | 3130 | void LLScrollListCtrl::clearColumns() |
3133 | { | 3131 | { |
3134 | std::map<LLString, LLScrollListColumn>::iterator itor; | 3132 | std::map<std::string, LLScrollListColumn>::iterator itor; |
3135 | for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) | 3133 | for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) |
3136 | { | 3134 | { |
3137 | LLColumnHeader *header = itor->second.mHeader; | 3135 | LLColumnHeader *header = itor->second.mHeader; |
@@ -3145,9 +3143,9 @@ void LLScrollListCtrl::clearColumns() | |||
3145 | mSortColumns.clear(); | 3143 | mSortColumns.clear(); |
3146 | } | 3144 | } |
3147 | 3145 | ||
3148 | void LLScrollListCtrl::setColumnLabel(const LLString& column, const LLString& label) | 3146 | void LLScrollListCtrl::setColumnLabel(const std::string& column, const std::string& label) |
3149 | { | 3147 | { |
3150 | std::map<LLString, LLScrollListColumn>::iterator itor = mColumns.find(column); | 3148 | std::map<std::string, LLScrollListColumn>::iterator itor = mColumns.find(column); |
3151 | if (itor != mColumns.end()) | 3149 | if (itor != mColumns.end()) |
3152 | { | 3150 | { |
3153 | itor->second.mLabel = label; | 3151 | itor->second.mLabel = label; |
@@ -3201,7 +3199,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3201 | // skip unused columns in item passed in | 3199 | // skip unused columns in item passed in |
3202 | continue; | 3200 | continue; |
3203 | } | 3201 | } |
3204 | LLString column = (*itor)["column"].asString(); | 3202 | std::string column = (*itor)["column"].asString(); |
3205 | 3203 | ||
3206 | LLScrollListColumn* columnp = NULL; | 3204 | LLScrollListColumn* columnp = NULL; |
3207 | 3205 | ||
@@ -3213,7 +3211,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3213 | column = new_name.str(); | 3211 | column = new_name.str(); |
3214 | } | 3212 | } |
3215 | 3213 | ||
3216 | std::map<LLString, LLScrollListColumn>::iterator column_itor; | 3214 | std::map<std::string, LLScrollListColumn>::iterator column_itor; |
3217 | column_itor = mColumns.find(column); | 3215 | column_itor = mColumns.find(column); |
3218 | if (column_itor != mColumns.end()) | 3216 | if (column_itor != mColumns.end()) |
3219 | { | 3217 | { |
@@ -3244,11 +3242,19 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3244 | S32 index = columnp->mIndex; | 3242 | S32 index = columnp->mIndex; |
3245 | S32 width = columnp->mWidth; | 3243 | S32 width = columnp->mWidth; |
3246 | LLFontGL::HAlign font_alignment = columnp->mFontAlignment; | 3244 | LLFontGL::HAlign font_alignment = columnp->mFontAlignment; |
3247 | 3245 | LLColor4 fcolor = LLColor4::black; | |
3246 | |||
3248 | LLSD value = (*itor)["value"]; | 3247 | LLSD value = (*itor)["value"]; |
3249 | LLString fontname = (*itor)["font"].asString(); | 3248 | std::string fontname = (*itor)["font"].asString(); |
3250 | LLString fontstyle = (*itor)["font-style"].asString(); | 3249 | std::string fontstyle = (*itor)["font-style"].asString(); |
3251 | LLString type = (*itor)["type"].asString(); | 3250 | std::string type = (*itor)["type"].asString(); |
3251 | |||
3252 | if ((*itor).has("font-color")) | ||
3253 | { | ||
3254 | LLSD sd_color = (*itor)["font-color"]; | ||
3255 | fcolor.setValue(sd_color); | ||
3256 | } | ||
3257 | |||
3252 | BOOL has_color = (*itor).has("color"); | 3258 | BOOL has_color = (*itor).has("color"); |
3253 | LLColor4 color = ((*itor)["color"]); | 3259 | LLColor4 color = ((*itor)["color"]); |
3254 | BOOL enabled = !(*itor).has("enabled") || (*itor)["enabled"].asBoolean() == true; | 3260 | BOOL enabled = !(*itor).has("enabled") || (*itor)["enabled"].asBoolean() == true; |
@@ -3271,8 +3277,8 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3271 | } | 3277 | } |
3272 | else if (type == "checkbox") | 3278 | else if (type == "checkbox") |
3273 | { | 3279 | { |
3274 | LLCheckBoxCtrl* ctrl = new LLCheckBoxCtrl("check", | 3280 | LLCheckBoxCtrl* ctrl = new LLCheckBoxCtrl(std::string("check"), |
3275 | LLRect(0, width, width, 0), " "); | 3281 | LLRect(0, width, width, 0), std::string(" ")); |
3276 | ctrl->setEnabled(enabled); | 3282 | ctrl->setEnabled(enabled); |
3277 | ctrl->setValue(value); | 3283 | ctrl->setValue(value); |
3278 | LLScrollListCheck* cell = new LLScrollListCheck(ctrl,width); | 3284 | LLScrollListCheck* cell = new LLScrollListCheck(ctrl,width); |
@@ -3293,7 +3299,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3293 | } | 3299 | } |
3294 | else | 3300 | else |
3295 | { | 3301 | { |
3296 | LLScrollListText* cell = new LLScrollListText(value.asString(), font, width, font_style, font_alignment); | 3302 | LLScrollListText* cell = new LLScrollListText(value.asString(), font, width, font_style, font_alignment, fcolor, TRUE); |
3297 | if (has_color) | 3303 | if (has_color) |
3298 | { | 3304 | { |
3299 | cell->setColor(color); | 3305 | cell->setColor(color); |
@@ -3315,7 +3321,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3315 | if (new_item->getColumn(column_idx) == NULL) | 3321 | if (new_item->getColumn(column_idx) == NULL) |
3316 | { | 3322 | { |
3317 | LLScrollListColumn* column_ptr = &column_it->second; | 3323 | LLScrollListColumn* column_ptr = &column_it->second; |
3318 | new_item->setColumn(column_idx, new LLScrollListText("", LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL)); | 3324 | new_item->setColumn(column_idx, new LLScrollListText(LLStringUtil::null, LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL)); |
3319 | } | 3325 | } |
3320 | } | 3326 | } |
3321 | 3327 | ||
@@ -3324,7 +3330,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p | |||
3324 | return new_item; | 3330 | return new_item; |
3325 | } | 3331 | } |
3326 | 3332 | ||
3327 | LLScrollListItem* LLScrollListCtrl::addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) | 3333 | LLScrollListItem* LLScrollListCtrl::addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) |
3328 | { | 3334 | { |
3329 | LLSD entry_id = id; | 3335 | LLSD entry_id = id; |
3330 | 3336 | ||
@@ -3441,7 +3447,7 @@ void LLScrollListCtrl::onFocusLost() | |||
3441 | LLUICtrl::onFocusLost(); | 3447 | LLUICtrl::onFocusLost(); |
3442 | } | 3448 | } |
3443 | 3449 | ||
3444 | LLColumnHeader::LLColumnHeader(const LLString& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL* fontp) : | 3450 | LLColumnHeader::LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL* fontp) : |
3445 | LLComboBox(label, rect, label, NULL, NULL), | 3451 | LLComboBox(label, rect, label, NULL, NULL), |
3446 | mColumn(column), | 3452 | mColumn(column), |
3447 | mOrigLabel(label), | 3453 | mOrigLabel(label), |
@@ -3460,15 +3466,15 @@ LLColumnHeader::LLColumnHeader(const LLString& label, const LLRect &rect, LLScro | |||
3460 | 3466 | ||
3461 | mButton->setCallbackUserData(this); | 3467 | mButton->setCallbackUserData(this); |
3462 | 3468 | ||
3463 | mAscendingText = "[LOW]...[HIGH](Ascending)"; | 3469 | mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate |
3464 | mDescendingText = "[HIGH]...[LOW](Descending)"; | 3470 | mDescendingText = std::string("[HIGH]...[LOW](Descending)"); // *TODO: Translate |
3465 | 3471 | ||
3466 | mList->reshape(llmax(mList->getRect().getWidth(), 110, getRect().getWidth()), mList->getRect().getHeight()); | 3472 | mList->reshape(llmax(mList->getRect().getWidth(), 110, getRect().getWidth()), mList->getRect().getHeight()); |
3467 | 3473 | ||
3468 | // resize handles on left and right | 3474 | // resize handles on left and right |
3469 | const S32 RESIZE_BAR_THICKNESS = 3; | 3475 | const S32 RESIZE_BAR_THICKNESS = 3; |
3470 | mResizeBar = new LLResizeBar( | 3476 | mResizeBar = new LLResizeBar( |
3471 | "resizebar", | 3477 | std::string("resizebar"), |
3472 | this, | 3478 | this, |
3473 | LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), | 3479 | LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), |
3474 | MIN_COLUMN_WIDTH, S32_MAX, LLResizeBar::RIGHT ); | 3480 | MIN_COLUMN_WIDTH, S32_MAX, LLResizeBar::RIGHT ); |
@@ -3521,7 +3527,7 @@ BOOL LLColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
3521 | return TRUE; | 3527 | return TRUE; |
3522 | } | 3528 | } |
3523 | 3529 | ||
3524 | void LLColumnHeader::setImage(const LLString &image_name) | 3530 | void LLColumnHeader::setImage(const std::string &image_name) |
3525 | { | 3531 | { |
3526 | if (mButton) | 3532 | if (mButton) |
3527 | { | 3533 | { |
@@ -3574,8 +3580,8 @@ void LLColumnHeader::showList() | |||
3574 | // move sort column over to this column and do initial sort | 3580 | // move sort column over to this column and do initial sort |
3575 | mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, mColumn->mParentCtrl->getSortAscending()); | 3581 | mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, mColumn->mParentCtrl->getSortAscending()); |
3576 | 3582 | ||
3577 | LLString low_item_text; | 3583 | std::string low_item_text; |
3578 | LLString high_item_text; | 3584 | std::string high_item_text; |
3579 | 3585 | ||
3580 | LLScrollListItem* itemp = mColumn->mParentCtrl->getFirstData(); | 3586 | LLScrollListItem* itemp = mColumn->mParentCtrl->getFirstData(); |
3581 | if (itemp) | 3587 | if (itemp) |
@@ -3611,11 +3617,11 @@ void LLColumnHeader::showList() | |||
3611 | } | 3617 | } |
3612 | } | 3618 | } |
3613 | 3619 | ||
3614 | LLString::truncate(low_item_text, 3); | 3620 | LLStringUtil::truncate(low_item_text, 3); |
3615 | LLString::truncate(high_item_text, 3); | 3621 | LLStringUtil::truncate(high_item_text, 3); |
3616 | 3622 | ||
3617 | LLString ascending_string; | 3623 | std::string ascending_string; |
3618 | LLString descending_string; | 3624 | std::string descending_string; |
3619 | 3625 | ||
3620 | if (low_item_text.empty() || high_item_text.empty()) | 3626 | if (low_item_text.empty() || high_item_text.empty()) |
3621 | { | 3627 | { |
diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h index 667a89a..6f26c8d 100644 --- a/linden/indra/llui/llscrolllistctrl.h +++ b/linden/indra/llui/llscrolllistctrl.h | |||
@@ -65,7 +65,7 @@ public: | |||
65 | virtual S32 getWidth() const {return mWidth;} | 65 | virtual S32 getWidth() const {return mWidth;} |
66 | virtual S32 getContentWidth() const { return 0; } | 66 | virtual S32 getContentWidth() const { return 0; } |
67 | virtual S32 getHeight() const = 0; | 67 | virtual S32 getHeight() const = 0; |
68 | virtual const LLSD getValue() const { return LLString::null; } | 68 | virtual const LLSD getValue() const { return LLStringUtil::null; } |
69 | virtual void setValue(const LLSD& value) { } | 69 | virtual void setValue(const LLSD& value) { } |
70 | virtual BOOL getVisible() const { return TRUE; } | 70 | virtual BOOL getVisible() const { return TRUE; } |
71 | virtual void setWidth(S32 width) { mWidth = width; } | 71 | virtual void setWidth(S32 width) { mWidth = width; } |
@@ -100,7 +100,7 @@ public: | |||
100 | class LLScrollListText : public LLScrollListCell | 100 | class LLScrollListText : public LLScrollListCell |
101 | { | 101 | { |
102 | public: | 102 | public: |
103 | LLScrollListText( const LLString& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); | 103 | LLScrollListText( const std::string& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); |
104 | /*virtual*/ ~LLScrollListText(); | 104 | /*virtual*/ ~LLScrollListText(); |
105 | 105 | ||
106 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; | 106 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; |
@@ -145,7 +145,7 @@ public: | |||
145 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; | 145 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; |
146 | virtual S32 getWidth() const; | 146 | virtual S32 getWidth() const; |
147 | virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } | 147 | virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } |
148 | virtual const LLSD getValue() const { return mIcon.isNull() ? LLString::null : mIcon->getName(); } | 148 | virtual const LLSD getValue() const { return mIcon.isNull() ? LLStringUtil::null : mIcon->getName(); } |
149 | virtual void setColor(const LLColor4&); | 149 | virtual void setColor(const LLColor4&); |
150 | virtual BOOL isText()const { return FALSE; } | 150 | virtual BOOL isText()const { return FALSE; } |
151 | virtual void setValue(const LLSD& value); | 151 | virtual void setValue(const LLSD& value); |
@@ -201,7 +201,7 @@ public: | |||
201 | mFontAlignment(LLFontGL::LEFT) | 201 | mFontAlignment(LLFontGL::LEFT) |
202 | { } | 202 | { } |
203 | 203 | ||
204 | LLScrollListColumn(LLString name, LLString label, S32 width, F32 relwidth) : | 204 | LLScrollListColumn(std::string name, std::string label, S32 width, F32 relwidth) : |
205 | mName(name), | 205 | mName(name), |
206 | mSortingColumn(name), | 206 | mSortingColumn(name), |
207 | mSortAscending(TRUE), | 207 | mSortAscending(TRUE), |
@@ -265,15 +265,16 @@ public: | |||
265 | mIndex = -1; | 265 | mIndex = -1; |
266 | mParentCtrl = NULL; | 266 | mParentCtrl = NULL; |
267 | mHeader = NULL; | 267 | mHeader = NULL; |
268 | mFontAlignment = LLFontGL::LEFT; | ||
268 | } | 269 | } |
269 | 270 | ||
270 | // Public data is fine so long as this remains a simple struct-like data class. | 271 | // Public data is fine so long as this remains a simple struct-like data class. |
271 | // If it ever gets any smarter than that, these should all become private | 272 | // If it ever gets any smarter than that, these should all become private |
272 | // with protected or public accessor methods added as needed. -MG | 273 | // with protected or public accessor methods added as needed. -MG |
273 | LLString mName; | 274 | std::string mName; |
274 | LLString mSortingColumn; | 275 | std::string mSortingColumn; |
275 | BOOL mSortAscending; | 276 | BOOL mSortAscending; |
276 | LLString mLabel; | 277 | std::string mLabel; |
277 | S32 mWidth; | 278 | S32 mWidth; |
278 | F32 mRelWidth; | 279 | F32 mRelWidth; |
279 | BOOL mDynamicWidth; | 280 | BOOL mDynamicWidth; |
@@ -287,7 +288,7 @@ public: | |||
287 | class LLColumnHeader : public LLComboBox | 288 | class LLColumnHeader : public LLComboBox |
288 | { | 289 | { |
289 | public: | 290 | public: |
290 | LLColumnHeader(const LLString& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); | 291 | LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); |
291 | ~LLColumnHeader(); | 292 | ~LLColumnHeader(); |
292 | 293 | ||
293 | /*virtual*/ void draw(); | 294 | /*virtual*/ void draw(); |
@@ -297,12 +298,12 @@ public: | |||
297 | /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); | 298 | /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); |
298 | /*virtual*/ void userSetShape(const LLRect& new_rect); | 299 | /*virtual*/ void userSetShape(const LLRect& new_rect); |
299 | 300 | ||
300 | void setImage(const LLString &image_name); | 301 | void setImage(const std::string &image_name); |
301 | LLScrollListColumn* getColumn() { return mColumn; } | 302 | LLScrollListColumn* getColumn() { return mColumn; } |
302 | void setHasResizableElement(BOOL resizable); | 303 | void setHasResizableElement(BOOL resizable); |
303 | BOOL canResize(); | 304 | BOOL canResize(); |
304 | void enableResizeBar(BOOL enable); | 305 | void enableResizeBar(BOOL enable); |
305 | LLString getLabel() { return mOrigLabel; } | 306 | std::string getLabel() { return mOrigLabel; } |
306 | 307 | ||
307 | static void onSelectSort(LLUICtrl* ctrl, void* user_data); | 308 | static void onSelectSort(LLUICtrl* ctrl, void* user_data); |
308 | static void onClick(void* user_data); | 309 | static void onClick(void* user_data); |
@@ -312,7 +313,7 @@ public: | |||
312 | private: | 313 | private: |
313 | LLScrollListColumn* mColumn; | 314 | LLScrollListColumn* mColumn; |
314 | LLResizeBar* mResizeBar; | 315 | LLResizeBar* mResizeBar; |
315 | LLString mOrigLabel; | 316 | std::string mOrigLabel; |
316 | LLUIString mAscendingText; | 317 | LLUIString mAscendingText; |
317 | LLUIString mDescendingText; | 318 | LLUIString mDescendingText; |
318 | BOOL mShowSortOptions; | 319 | BOOL mShowSortOptions; |
@@ -343,7 +344,7 @@ public: | |||
343 | 344 | ||
344 | // If width = 0, just use the width of the text. Otherwise override with | 345 | // If width = 0, just use the width of the text. Otherwise override with |
345 | // specified width in pixels. | 346 | // specified width in pixels. |
346 | void addColumn( const LLString& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) | 347 | void addColumn( const std::string& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) |
347 | { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } | 348 | { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } |
348 | 349 | ||
349 | void addColumn( LLUIImagePtr icon, S32 width = 0 ) | 350 | void addColumn( LLUIImagePtr icon, S32 width = 0 ) |
@@ -360,7 +361,7 @@ public: | |||
360 | 361 | ||
361 | LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; } | 362 | LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; } |
362 | 363 | ||
363 | LLString getContentsCSV() const; | 364 | std::string getContentsCSV() const; |
364 | 365 | ||
365 | virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); | 366 | virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); |
366 | 367 | ||
@@ -380,7 +381,7 @@ private: | |||
380 | class LLScrollListItemComment : public LLScrollListItem | 381 | class LLScrollListItemComment : public LLScrollListItem |
381 | { | 382 | { |
382 | public: | 383 | public: |
383 | LLScrollListItemComment(const LLString& comment_string, const LLColor4& color); | 384 | LLScrollListItemComment(const std::string& comment_string, const LLColor4& color); |
384 | 385 | ||
385 | /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); | 386 | /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); |
386 | private: | 387 | private: |
@@ -400,7 +401,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, | |||
400 | { | 401 | { |
401 | public: | 402 | public: |
402 | LLScrollListCtrl( | 403 | LLScrollListCtrl( |
403 | const LLString& name, | 404 | const std::string& name, |
404 | const LLRect& rect, | 405 | const LLRect& rect, |
405 | void (*commit_callback)(LLUICtrl*, void*), | 406 | void (*commit_callback)(LLUICtrl*, void*), |
406 | void* callback_userdata, | 407 | void* callback_userdata, |
@@ -419,14 +420,14 @@ public: | |||
419 | 420 | ||
420 | // Sets an array of column descriptors | 421 | // Sets an array of column descriptors |
421 | void setColumnHeadings(LLSD headings); | 422 | void setColumnHeadings(LLSD headings); |
422 | void sortByColumn(U32 column, BOOL ascending); | 423 | void sortByColumnIndex(U32 column, BOOL ascending); |
423 | 424 | ||
424 | // LLCtrlListInterface functions | 425 | // LLCtrlListInterface functions |
425 | virtual S32 getItemCount() const; | 426 | virtual S32 getItemCount() const; |
426 | // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] | 427 | // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] |
427 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); | 428 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); |
428 | virtual void clearColumns(); | 429 | virtual void clearColumns(); |
429 | virtual void setColumnLabel(const LLString& column, const LLString& label); | 430 | virtual void setColumnLabel(const std::string& column, const std::string& label); |
430 | 431 | ||
431 | virtual LLScrollListColumn* getColumn(S32 index); | 432 | virtual LLScrollListColumn* getColumn(S32 index); |
432 | virtual S32 getNumColumns() const { return mColumnsIndexed.size(); } | 433 | virtual S32 getNumColumns() const { return mColumnsIndexed.size(); } |
@@ -438,7 +439,7 @@ public: | |||
438 | // Simple add element. Takes a single array of: | 439 | // Simple add element. Takes a single array of: |
439 | // [ "value" => value, "font" => font, "font-style" => style ] | 440 | // [ "value" => value, "font" => font, "font-style" => style ] |
440 | virtual void clearRows(); // clears all elements | 441 | virtual void clearRows(); // clears all elements |
441 | virtual void sortByColumn(LLString name, BOOL ascending); | 442 | virtual void sortByColumn(const std::string& name, BOOL ascending); |
442 | 443 | ||
443 | // These functions take and return an array of arrays of elements, as above | 444 | // These functions take and return an array of arrays of elements, as above |
444 | virtual void setValue(const LLSD& value ); | 445 | virtual void setValue(const LLSD& value ); |
@@ -493,24 +494,24 @@ public: | |||
493 | S32 getItemIndex( LLScrollListItem* item ) const; | 494 | S32 getItemIndex( LLScrollListItem* item ) const; |
494 | S32 getItemIndex( const LLUUID& item_id ) const; | 495 | S32 getItemIndex( const LLUUID& item_id ) const; |
495 | 496 | ||
496 | LLScrollListItem* addCommentText( const LLString& comment_text, EAddPosition pos = ADD_BOTTOM); | 497 | LLScrollListItem* addCommentText( const std::string& comment_text, EAddPosition pos = ADD_BOTTOM); |
497 | LLScrollListItem* addSeparator(EAddPosition pos); | 498 | LLScrollListItem* addSeparator(EAddPosition pos); |
498 | 499 | ||
499 | // "Simple" interface: use this when you're creating a list that contains only unique strings, only | 500 | // "Simple" interface: use this when you're creating a list that contains only unique strings, only |
500 | // one of which can be selected at a time. | 501 | // one of which can be selected at a time. |
501 | virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); | 502 | virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); |
502 | 503 | ||
503 | 504 | ||
504 | BOOL selectItemByLabel( const LLString& item, BOOL case_sensitive = TRUE ); // FALSE if item not found | 505 | BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found |
505 | BOOL selectItemByPrefix(const LLString& target, BOOL case_sensitive = TRUE); | 506 | BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); |
506 | BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); | 507 | BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); |
507 | const LLString getSelectedItemLabel(S32 column = 0) const; | 508 | const std::string getSelectedItemLabel(S32 column = 0) const; |
508 | LLSD getSelectedValue(); | 509 | LLSD getSelectedValue(); |
509 | 510 | ||
510 | // DEPRECATED: Use LLSD versions of addCommentText() and getSelectedValue(). | 511 | // DEPRECATED: Use LLSD versions of addCommentText() and getSelectedValue(). |
511 | // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which | 512 | // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which |
512 | // has an associated, unique UUID, and only one of which can be selected at a time. | 513 | // has an associated, unique UUID, and only one of which can be selected at a time. |
513 | LLScrollListItem* addStringUUIDItem(const LLString& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); | 514 | LLScrollListItem* addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); |
514 | LLUUID getStringUUIDSelectedItem() const; | 515 | LLUUID getStringUUIDSelectedItem() const; |
515 | 516 | ||
516 | LLScrollListItem* getFirstSelected() const; | 517 | LLScrollListItem* getFirstSelected() const; |
@@ -568,7 +569,7 @@ public: | |||
568 | /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); | 569 | /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); |
569 | /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); | 570 | /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); |
570 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 571 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
571 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | 572 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); |
572 | /*virtual*/ void setEnabled(BOOL enabled); | 573 | /*virtual*/ void setEnabled(BOOL enabled); |
573 | /*virtual*/ void setFocus( BOOL b ); | 574 | /*virtual*/ void setFocus( BOOL b ); |
574 | /*virtual*/ void onFocusReceived(); | 575 | /*virtual*/ void onFocusReceived(); |
@@ -719,7 +720,7 @@ private: | |||
719 | 720 | ||
720 | BOOL mSorted; | 721 | BOOL mSorted; |
721 | 722 | ||
722 | typedef std::map<LLString, LLScrollListColumn> column_map_t; | 723 | typedef std::map<std::string, LLScrollListColumn> column_map_t; |
723 | column_map_t mColumns; | 724 | column_map_t mColumns; |
724 | 725 | ||
725 | BOOL mDirty; | 726 | BOOL mDirty; |
diff --git a/linden/indra/llui/llslider.cpp b/linden/indra/llui/llslider.cpp index 12d794c..4cc558f 100644 --- a/linden/indra/llui/llslider.cpp +++ b/linden/indra/llui/llslider.cpp | |||
@@ -46,7 +46,7 @@ static LLRegisterWidget<LLSlider> r2("volume_slider"); | |||
46 | 46 | ||
47 | 47 | ||
48 | LLSlider::LLSlider( | 48 | LLSlider::LLSlider( |
49 | const LLString& name, | 49 | const std::string& name, |
50 | const LLRect& rect, | 50 | const LLRect& rect, |
51 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), | 51 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), |
52 | void* callback_userdata, | 52 | void* callback_userdata, |
@@ -55,7 +55,7 @@ LLSlider::LLSlider( | |||
55 | F32 max_value, | 55 | F32 max_value, |
56 | F32 increment, | 56 | F32 increment, |
57 | BOOL volume, | 57 | BOOL volume, |
58 | const LLString& control_name) | 58 | const std::string& control_name) |
59 | : | 59 | : |
60 | LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, | 60 | LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, |
61 | FOLLOWS_LEFT | FOLLOWS_TOP), | 61 | FOLLOWS_LEFT | FOLLOWS_TOP), |
@@ -303,7 +303,7 @@ LLXMLNodePtr LLSlider::getXML(bool save_children) const | |||
303 | //static | 303 | //static |
304 | LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory) | 304 | LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory) |
305 | { | 305 | { |
306 | LLString name("slider_bar"); | 306 | std::string name("slider_bar"); |
307 | node->getAttributeString("name", name); | 307 | node->getAttributeString("name", name); |
308 | 308 | ||
309 | LLRect rect; | 309 | LLRect rect; |
diff --git a/linden/indra/llui/llslider.h b/linden/indra/llui/llslider.h index 1c9d5e1..b963beb 100644 --- a/linden/indra/llui/llslider.h +++ b/linden/indra/llui/llslider.h | |||
@@ -41,7 +41,7 @@ class LLSlider : public LLUICtrl | |||
41 | { | 41 | { |
42 | public: | 42 | public: |
43 | LLSlider( | 43 | LLSlider( |
44 | const LLString& name, | 44 | const std::string& name, |
45 | const LLRect& rect, | 45 | const LLRect& rect, |
46 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), | 46 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), |
47 | void* callback_userdata, | 47 | void* callback_userdata, |
@@ -50,7 +50,7 @@ public: | |||
50 | F32 max_value, | 50 | F32 max_value, |
51 | F32 increment, | 51 | F32 increment, |
52 | BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG | 52 | BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG |
53 | const LLString& control_name = LLString::null ); | 53 | const std::string& control_name = LLStringUtil::null ); |
54 | 54 | ||
55 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 55 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
56 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); | 56 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); |
diff --git a/linden/indra/llui/llsliderctrl.cpp b/linden/indra/llui/llsliderctrl.cpp index d3dc35f..a47f133 100644 --- a/linden/indra/llui/llsliderctrl.cpp +++ b/linden/indra/llui/llsliderctrl.cpp | |||
@@ -34,7 +34,6 @@ | |||
34 | #include "llsliderctrl.h" | 34 | #include "llsliderctrl.h" |
35 | 35 | ||
36 | #include "audioengine.h" | 36 | #include "audioengine.h" |
37 | #include "sound_ids.h" | ||
38 | 37 | ||
39 | #include "llmath.h" | 38 | #include "llmath.h" |
40 | #include "llfontgl.h" | 39 | #include "llfontgl.h" |
@@ -54,8 +53,8 @@ const U32 MAX_STRING_LENGTH = 10; | |||
54 | 53 | ||
55 | static LLRegisterWidget<LLSliderCtrl> r("slider"); | 54 | static LLRegisterWidget<LLSliderCtrl> r("slider"); |
56 | 55 | ||
57 | LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, | 56 | LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, |
58 | const LLString& label, | 57 | const std::string& label, |
59 | const LLFontGL* font, | 58 | const LLFontGL* font, |
60 | S32 label_width, | 59 | S32 label_width, |
61 | S32 text_left, | 60 | S32 text_left, |
@@ -65,7 +64,7 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, | |||
65 | void (*commit_callback)(LLUICtrl*, void*), | 64 | void (*commit_callback)(LLUICtrl*, void*), |
66 | void* callback_user_data, | 65 | void* callback_user_data, |
67 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, | 66 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, |
68 | const LLString& control_which) | 67 | const std::string& control_which) |
69 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), | 68 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), |
70 | mFont(font), | 69 | mFont(font), |
71 | mShowText( show_text ), | 70 | mShowText( show_text ), |
@@ -94,7 +93,7 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, | |||
94 | label_width = font->getWidth(label); | 93 | label_width = font->getWidth(label); |
95 | } | 94 | } |
96 | LLRect label_rect( left, top, label_width, bottom ); | 95 | LLRect label_rect( left, top, label_width, bottom ); |
97 | mLabelBox = new LLTextBox( "SliderCtrl Label", label_rect, label.c_str(), font ); | 96 | mLabelBox = new LLTextBox( std::string("SliderCtrl Label"), label_rect, label, font ); |
98 | addChild(mLabelBox); | 97 | addChild(mLabelBox); |
99 | } | 98 | } |
100 | 99 | ||
@@ -106,12 +105,11 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, | |||
106 | 105 | ||
107 | S32 slider_left = label_width ? label_width + SLIDERCTRL_SPACING : 0; | 106 | S32 slider_left = label_width ? label_width + SLIDERCTRL_SPACING : 0; |
108 | LLRect slider_rect( slider_left, top, slider_right, bottom ); | 107 | LLRect slider_rect( slider_left, top, slider_right, bottom ); |
109 | mSlider = new LLSlider( | 108 | mSlider = new LLSlider(std::string("slider"), |
110 | "slider", | 109 | slider_rect, |
111 | slider_rect, | 110 | LLSliderCtrl::onSliderCommit, this, |
112 | LLSliderCtrl::onSliderCommit, this, | 111 | initial_value, min_value, max_value, increment, volume, |
113 | initial_value, min_value, max_value, increment, volume, | 112 | control_which ); |
114 | control_which ); | ||
115 | addChild( mSlider ); | 113 | addChild( mSlider ); |
116 | 114 | ||
117 | if( show_text ) | 115 | if( show_text ) |
@@ -119,11 +117,11 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, | |||
119 | LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); | 117 | LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); |
120 | if( can_edit_text ) | 118 | if( can_edit_text ) |
121 | { | 119 | { |
122 | mEditor = new LLLineEditor( "SliderCtrl Editor", text_rect, | 120 | mEditor = new LLLineEditor( std::string("SliderCtrl Editor"), text_rect, |
123 | "", font, | 121 | LLStringUtil::null, font, |
124 | MAX_STRING_LENGTH, | 122 | MAX_STRING_LENGTH, |
125 | &LLSliderCtrl::onEditorCommit, NULL, NULL, this, | 123 | &LLSliderCtrl::onEditorCommit, NULL, NULL, this, |
126 | &LLLineEditor::prevalidateFloat ); | 124 | &LLLineEditor::prevalidateFloat ); |
127 | mEditor->setFollowsLeft(); | 125 | mEditor->setFollowsLeft(); |
128 | mEditor->setFollowsBottom(); | 126 | mEditor->setFollowsBottom(); |
129 | mEditor->setFocusReceivedCallback( &LLSliderCtrl::onEditorGainFocus, this ); | 127 | mEditor->setFocusReceivedCallback( &LLSliderCtrl::onEditorGainFocus, this ); |
@@ -135,7 +133,7 @@ LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, | |||
135 | } | 133 | } |
136 | else | 134 | else |
137 | { | 135 | { |
138 | mTextBox = new LLTextBox( "SliderCtrl Text", text_rect, "", font); | 136 | mTextBox = new LLTextBox( std::string("SliderCtrl Text"), text_rect, LLStringUtil::null, font); |
139 | mTextBox->setFollowsLeft(); | 137 | mTextBox->setFollowsLeft(); |
140 | mTextBox->setFollowsBottom(); | 138 | mTextBox->setFollowsBottom(); |
141 | addChild(mTextBox); | 139 | addChild(mTextBox); |
@@ -163,7 +161,7 @@ void LLSliderCtrl::setValue(F32 v, BOOL from_event) | |||
163 | updateText(); | 161 | updateText(); |
164 | } | 162 | } |
165 | 163 | ||
166 | BOOL LLSliderCtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 164 | BOOL LLSliderCtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
167 | { | 165 | { |
168 | BOOL res = FALSE; | 166 | BOOL res = FALSE; |
169 | if (mLabelBox) | 167 | if (mLabelBox) |
@@ -193,11 +191,11 @@ void LLSliderCtrl::clear() | |||
193 | setValue(0.0f); | 191 | setValue(0.0f); |
194 | if( mEditor ) | 192 | if( mEditor ) |
195 | { | 193 | { |
196 | mEditor->setText( LLString::null ); | 194 | mEditor->setText( LLStringUtil::null ); |
197 | } | 195 | } |
198 | if( mTextBox ) | 196 | if( mTextBox ) |
199 | { | 197 | { |
200 | mTextBox->setText( LLString::null ); | 198 | mTextBox->setText( LLStringUtil::null ); |
201 | } | 199 | } |
202 | 200 | ||
203 | } | 201 | } |
@@ -211,8 +209,8 @@ void LLSliderCtrl::updateText() | |||
211 | // Don't display very small negative values as -0.000 | 209 | // Don't display very small negative values as -0.000 |
212 | F32 displayed_value = (F32)(floor(getValueF32() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision)); | 210 | F32 displayed_value = (F32)(floor(getValueF32() * pow(10.0, (F64)mPrecision) + 0.5) / pow(10.0, (F64)mPrecision)); |
213 | 211 | ||
214 | LLString format = llformat("%%.%df", mPrecision); | 212 | std::string format = llformat("%%.%df", mPrecision); |
215 | LLString text = llformat(format.c_str(), displayed_value); | 213 | std::string text = llformat(format.c_str(), displayed_value); |
216 | if( mEditor ) | 214 | if( mEditor ) |
217 | { | 215 | { |
218 | mEditor->setText( text ); | 216 | mEditor->setText( text ); |
@@ -234,7 +232,7 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) | |||
234 | F32 val = self->mValue; | 232 | F32 val = self->mValue; |
235 | F32 saved_val = self->mValue; | 233 | F32 saved_val = self->mValue; |
236 | 234 | ||
237 | LLString text = self->mEditor->getText(); | 235 | std::string text = self->mEditor->getText(); |
238 | if( LLLineEditor::postvalidateFloat( text ) ) | 236 | if( LLLineEditor::postvalidateFloat( text ) ) |
239 | { | 237 | { |
240 | LLLocale locale(LLLocale::USER_LOCALE); | 238 | LLLocale locale(LLLocale::USER_LOCALE); |
@@ -451,10 +449,10 @@ LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const | |||
451 | 449 | ||
452 | LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 450 | LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
453 | { | 451 | { |
454 | LLString name("slider"); | 452 | std::string name("slider"); |
455 | node->getAttributeString("name", name); | 453 | node->getAttributeString("name", name); |
456 | 454 | ||
457 | LLString label; | 455 | std::string label; |
458 | node->getAttributeString("label", label); | 456 | node->getAttributeString("label", label); |
459 | 457 | ||
460 | LLRect rect; | 458 | LLRect rect; |
@@ -500,13 +498,13 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
500 | { | 498 | { |
501 | // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) | 499 | // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) |
502 | if ( max_value ) | 500 | if ( max_value ) |
503 | text_left = font->getWidth("0") * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); | 501 | text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); |
504 | 502 | ||
505 | if ( increment < 1.0f ) | 503 | if ( increment < 1.0f ) |
506 | text_left += font->getWidth("."); // (mostly) take account of decimal point in value | 504 | text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value |
507 | 505 | ||
508 | if ( min_value < 0.0f || max_value < 0.0f ) | 506 | if ( min_value < 0.0f || max_value < 0.0f ) |
509 | text_left += font->getWidth("-"); // (mostly) take account of minus sign | 507 | text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign |
510 | 508 | ||
511 | // padding to make things look nicer | 509 | // padding to make things look nicer |
512 | text_left += 8; | 510 | text_left += 8; |
diff --git a/linden/indra/llui/llsliderctrl.h b/linden/indra/llui/llsliderctrl.h index 0c8a8b6..7df255c 100644 --- a/linden/indra/llui/llsliderctrl.h +++ b/linden/indra/llui/llsliderctrl.h | |||
@@ -48,9 +48,9 @@ const S32 SLIDERCTRL_HEIGHT = 16; | |||
48 | class LLSliderCtrl : public LLUICtrl | 48 | class LLSliderCtrl : public LLUICtrl |
49 | { | 49 | { |
50 | public: | 50 | public: |
51 | LLSliderCtrl(const LLString& name, | 51 | LLSliderCtrl(const std::string& name, |
52 | const LLRect& rect, | 52 | const LLRect& rect, |
53 | const LLString& label, | 53 | const std::string& label, |
54 | const LLFontGL* font, | 54 | const LLFontGL* font, |
55 | S32 slider_left, | 55 | S32 slider_left, |
56 | S32 text_left, | 56 | S32 text_left, |
@@ -60,7 +60,7 @@ public: | |||
60 | void (*commit_callback)(LLUICtrl*, void*), | 60 | void (*commit_callback)(LLUICtrl*, void*), |
61 | void* callback_userdata, | 61 | void* callback_userdata, |
62 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, | 62 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, |
63 | const LLString& control_which = LLString::null ); | 63 | const std::string& control_which = LLStringUtil::null ); |
64 | 64 | ||
65 | virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. | 65 | virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. |
66 | 66 | ||
@@ -72,7 +72,7 @@ public: | |||
72 | 72 | ||
73 | virtual void setValue(const LLSD& value) { setValue((F32)value.asReal(), TRUE); } | 73 | virtual void setValue(const LLSD& value) { setValue((F32)value.asReal(), TRUE); } |
74 | virtual LLSD getValue() const { return LLSD(getValueF32()); } | 74 | virtual LLSD getValue() const { return LLSD(getValueF32()); } |
75 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 75 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
76 | 76 | ||
77 | virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } | 77 | virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } |
78 | virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } | 78 | virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } |
@@ -101,13 +101,13 @@ public: | |||
101 | virtual void setTentative(BOOL b); // marks value as tentative | 101 | virtual void setTentative(BOOL b); // marks value as tentative |
102 | virtual void onCommit(); // mark not tentative, then commit | 102 | virtual void onCommit(); // mark not tentative, then commit |
103 | 103 | ||
104 | virtual void setControlName(const LLString& control_name, LLView* context) | 104 | virtual void setControlName(const std::string& control_name, LLView* context) |
105 | { | 105 | { |
106 | LLView::setControlName(control_name, context); | 106 | LLView::setControlName(control_name, context); |
107 | mSlider->setControlName(control_name, context); | 107 | mSlider->setControlName(control_name, context); |
108 | } | 108 | } |
109 | 109 | ||
110 | virtual LLString getControlName() const { return mSlider->getControlName(); } | 110 | virtual std::string getControlName() const { return mSlider->getControlName(); } |
111 | 111 | ||
112 | static void onSliderCommit(LLUICtrl* caller, void* userdata); | 112 | static void onSliderCommit(LLUICtrl* caller, void* userdata); |
113 | static void onSliderMouseDown(LLUICtrl* caller,void* userdata); | 113 | static void onSliderMouseDown(LLUICtrl* caller,void* userdata); |
diff --git a/linden/indra/llui/llspinctrl.cpp b/linden/indra/llui/llspinctrl.cpp index f196975..a106af4 100644 --- a/linden/indra/llui/llspinctrl.cpp +++ b/linden/indra/llui/llspinctrl.cpp | |||
@@ -44,7 +44,6 @@ | |||
44 | #include "lltextbox.h" | 44 | #include "lltextbox.h" |
45 | #include "llkeyboard.h" | 45 | #include "llkeyboard.h" |
46 | #include "llmath.h" | 46 | #include "llmath.h" |
47 | #include "sound_ids.h" | ||
48 | #include "audioengine.h" | 47 | #include "audioengine.h" |
49 | #include "llcontrol.h" | 48 | #include "llcontrol.h" |
50 | #include "llfocusmgr.h" | 49 | #include "llfocusmgr.h" |
@@ -54,11 +53,11 @@ const U32 MAX_STRING_LENGTH = 32; | |||
54 | 53 | ||
55 | static LLRegisterWidget<LLSpinCtrl> r2("spinner"); | 54 | static LLRegisterWidget<LLSpinCtrl> r2("spinner"); |
56 | 55 | ||
57 | LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font, | 56 | LLSpinCtrl::LLSpinCtrl( const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font, |
58 | void (*commit_callback)(LLUICtrl*, void*), | 57 | void (*commit_callback)(LLUICtrl*, void*), |
59 | void* callback_user_data, | 58 | void* callback_user_data, |
60 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, | 59 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, |
61 | const LLString& control_name, | 60 | const std::string& control_name, |
62 | S32 label_width) | 61 | S32 label_width) |
63 | : | 62 | : |
64 | LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP ), | 63 | LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP ), |
@@ -83,7 +82,7 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString | |||
83 | if( !label.empty() ) | 82 | if( !label.empty() ) |
84 | { | 83 | { |
85 | LLRect label_rect( 0, centered_top, label_width, centered_bottom ); | 84 | LLRect label_rect( 0, centered_top, label_width, centered_bottom ); |
86 | mLabelBox = new LLTextBox( "SpinCtrl Label", label_rect, label.c_str(), font ); | 85 | mLabelBox = new LLTextBox( std::string("SpinCtrl Label"), label_rect, label, font ); |
87 | addChild(mLabelBox); | 86 | addChild(mLabelBox); |
88 | 87 | ||
89 | btn_left += label_rect.mRight + SPINCTRL_SPACING; | 88 | btn_left += label_rect.mRight + SPINCTRL_SPACING; |
@@ -93,14 +92,13 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString | |||
93 | 92 | ||
94 | // Spin buttons | 93 | // Spin buttons |
95 | LLRect up_rect( btn_left, top, btn_right, top - SPINCTRL_BTN_HEIGHT ); | 94 | LLRect up_rect( btn_left, top, btn_right, top - SPINCTRL_BTN_HEIGHT ); |
96 | LLString out_id = "UIImgBtnSpinUpOutUUID"; | 95 | std::string out_id = "UIImgBtnSpinUpOutUUID"; |
97 | LLString in_id = "UIImgBtnSpinUpInUUID"; | 96 | std::string in_id = "UIImgBtnSpinUpInUUID"; |
98 | mUpBtn = new LLButton( | 97 | mUpBtn = new LLButton(std::string("SpinCtrl Up"), up_rect, |
99 | "SpinCtrl Up", up_rect, | 98 | out_id, |
100 | out_id, | 99 | in_id, |
101 | in_id, | 100 | LLStringUtil::null, |
102 | "", | 101 | &LLSpinCtrl::onUpBtn, this, LLFontGL::sSansSerif ); |
103 | &LLSpinCtrl::onUpBtn, this, LLFontGL::sSansSerif ); | ||
104 | mUpBtn->setFollowsLeft(); | 102 | mUpBtn->setFollowsLeft(); |
105 | mUpBtn->setFollowsBottom(); | 103 | mUpBtn->setFollowsBottom(); |
106 | mUpBtn->setHeldDownCallback( &LLSpinCtrl::onUpBtn ); | 104 | mUpBtn->setHeldDownCallback( &LLSpinCtrl::onUpBtn ); |
@@ -110,12 +108,11 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString | |||
110 | LLRect down_rect( btn_left, top - SPINCTRL_BTN_HEIGHT, btn_right, bottom ); | 108 | LLRect down_rect( btn_left, top - SPINCTRL_BTN_HEIGHT, btn_right, bottom ); |
111 | out_id = "UIImgBtnSpinDownOutUUID"; | 109 | out_id = "UIImgBtnSpinDownOutUUID"; |
112 | in_id = "UIImgBtnSpinDownInUUID"; | 110 | in_id = "UIImgBtnSpinDownInUUID"; |
113 | mDownBtn = new LLButton( | 111 | mDownBtn = new LLButton(std::string("SpinCtrl Down"), down_rect, |
114 | "SpinCtrl Down", down_rect, | 112 | out_id, |
115 | out_id, | 113 | in_id, |
116 | in_id, | 114 | LLStringUtil::null, |
117 | "", | 115 | &LLSpinCtrl::onDownBtn, this, LLFontGL::sSansSerif ); |
118 | &LLSpinCtrl::onDownBtn, this, LLFontGL::sSansSerif ); | ||
119 | mDownBtn->setFollowsLeft(); | 116 | mDownBtn->setFollowsLeft(); |
120 | mDownBtn->setFollowsBottom(); | 117 | mDownBtn->setFollowsBottom(); |
121 | mDownBtn->setHeldDownCallback( &LLSpinCtrl::onDownBtn ); | 118 | mDownBtn->setHeldDownCallback( &LLSpinCtrl::onDownBtn ); |
@@ -123,10 +120,10 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString | |||
123 | addChild(mDownBtn); | 120 | addChild(mDownBtn); |
124 | 121 | ||
125 | LLRect editor_rect( btn_right + 1, centered_top, getRect().getWidth(), centered_bottom ); | 122 | LLRect editor_rect( btn_right + 1, centered_top, getRect().getWidth(), centered_bottom ); |
126 | mEditor = new LLLineEditor( "SpinCtrl Editor", editor_rect, "", font, | 123 | mEditor = new LLLineEditor( std::string("SpinCtrl Editor"), editor_rect, LLStringUtil::null, font, |
127 | MAX_STRING_LENGTH, | 124 | MAX_STRING_LENGTH, |
128 | &LLSpinCtrl::onEditorCommit, NULL, NULL, this, | 125 | &LLSpinCtrl::onEditorCommit, NULL, NULL, this, |
129 | &LLLineEditor::prevalidateFloat ); | 126 | &LLLineEditor::prevalidateFloat ); |
130 | mEditor->setFollowsLeft(); | 127 | mEditor->setFollowsLeft(); |
131 | mEditor->setFollowsBottom(); | 128 | mEditor->setFollowsBottom(); |
132 | mEditor->setFocusReceivedCallback( &LLSpinCtrl::onEditorGainFocus, this ); | 129 | mEditor->setFocusReceivedCallback( &LLSpinCtrl::onEditorGainFocus, this ); |
@@ -283,8 +280,8 @@ void LLSpinCtrl::updateEditor() | |||
283 | // displayed_value = 0.f; | 280 | // displayed_value = 0.f; |
284 | // } | 281 | // } |
285 | 282 | ||
286 | LLString format = llformat("%%.%df", mPrecision); | 283 | std::string format = llformat("%%.%df", mPrecision); |
287 | LLString text = llformat(format.c_str(), displayed_value); | 284 | std::string text = llformat(format.c_str(), displayed_value); |
288 | mEditor->setText( text ); | 285 | mEditor->setText( text ); |
289 | } | 286 | } |
290 | 287 | ||
@@ -295,7 +292,7 @@ void LLSpinCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) | |||
295 | LLSpinCtrl* self = (LLSpinCtrl*) userdata; | 292 | LLSpinCtrl* self = (LLSpinCtrl*) userdata; |
296 | llassert( caller == self->mEditor ); | 293 | llassert( caller == self->mEditor ); |
297 | 294 | ||
298 | LLString text = self->mEditor->getText(); | 295 | std::string text = self->mEditor->getText(); |
299 | if( LLLineEditor::postvalidateFloat( text ) ) | 296 | if( LLLineEditor::postvalidateFloat( text ) ) |
300 | { | 297 | { |
301 | LLLocale locale(LLLocale::USER_LOCALE); | 298 | LLLocale locale(LLLocale::USER_LOCALE); |
@@ -399,6 +396,12 @@ void LLSpinCtrl::setLabel(const LLStringExplicit& label) | |||
399 | } | 396 | } |
400 | } | 397 | } |
401 | 398 | ||
399 | void LLSpinCtrl::setAllowEdit(BOOL allow_edit) | ||
400 | { | ||
401 | mEditor->setEnabled(allow_edit); | ||
402 | mAllowEdit = allow_edit; | ||
403 | } | ||
404 | |||
402 | void LLSpinCtrl::onTabInto() | 405 | void LLSpinCtrl::onTabInto() |
403 | { | 406 | { |
404 | mEditor->onTabInto(); | 407 | mEditor->onTabInto(); |
@@ -494,10 +497,10 @@ LLXMLNodePtr LLSpinCtrl::getXML(bool save_children) const | |||
494 | 497 | ||
495 | LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 498 | LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
496 | { | 499 | { |
497 | LLString name("spinner"); | 500 | std::string name("spinner"); |
498 | node->getAttributeString("name", name); | 501 | node->getAttributeString("name", name); |
499 | 502 | ||
500 | LLString label; | 503 | std::string label; |
501 | node->getAttributeString("label", label); | 504 | node->getAttributeString("label", label); |
502 | 505 | ||
503 | LLRect rect; | 506 | LLRect rect; |
@@ -523,6 +526,9 @@ LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * | |||
523 | S32 label_width = llmin(40, rect.getWidth() - 40); | 526 | S32 label_width = llmin(40, rect.getWidth() - 40); |
524 | node->getAttributeS32("label_width", label_width); | 527 | node->getAttributeS32("label_width", label_width); |
525 | 528 | ||
529 | BOOL allow_text_entry = TRUE; | ||
530 | node->getAttributeBOOL("allow_text_entry", allow_text_entry); | ||
531 | |||
526 | LLUICtrlCallback callback = NULL; | 532 | LLUICtrlCallback callback = NULL; |
527 | 533 | ||
528 | if(label.empty()) | 534 | if(label.empty()) |
@@ -540,12 +546,13 @@ LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * | |||
540 | min_value, | 546 | min_value, |
541 | max_value, | 547 | max_value, |
542 | increment, | 548 | increment, |
543 | "", | 549 | LLStringUtil::null, |
544 | label_width); | 550 | label_width); |
545 | 551 | ||
546 | spinner->setPrecision(precision); | 552 | spinner->setPrecision(precision); |
547 | 553 | ||
548 | spinner->initFromXML(node, parent); | 554 | spinner->initFromXML(node, parent); |
555 | spinner->setAllowEdit(allow_text_entry); | ||
549 | 556 | ||
550 | return spinner; | 557 | return spinner; |
551 | } | 558 | } |
diff --git a/linden/indra/llui/llspinctrl.h b/linden/indra/llui/llspinctrl.h index 5d040fd..0cc6661 100644 --- a/linden/indra/llui/llspinctrl.h +++ b/linden/indra/llui/llspinctrl.h | |||
@@ -52,13 +52,13 @@ class LLSpinCtrl | |||
52 | : public LLUICtrl | 52 | : public LLUICtrl |
53 | { | 53 | { |
54 | public: | 54 | public: |
55 | LLSpinCtrl(const LLString& name, const LLRect& rect, | 55 | LLSpinCtrl(const std::string& name, const LLRect& rect, |
56 | const LLString& label, | 56 | const std::string& label, |
57 | const LLFontGL* font, | 57 | const LLFontGL* font, |
58 | void (*commit_callback)(LLUICtrl*, void*), | 58 | void (*commit_callback)(LLUICtrl*, void*), |
59 | void* callback_userdata, | 59 | void* callback_userdata, |
60 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, | 60 | F32 initial_value, F32 min_value, F32 max_value, F32 increment, |
61 | const LLString& control_name = LLString(), | 61 | const std::string& control_name = std::string(), |
62 | S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH ); | 62 | S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH ); |
63 | 63 | ||
64 | virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor. | 64 | virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor. |
@@ -93,6 +93,7 @@ public: | |||
93 | void setLabel(const LLStringExplicit& label); | 93 | void setLabel(const LLStringExplicit& label); |
94 | void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } | 94 | void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } |
95 | void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } | 95 | void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } |
96 | void setAllowEdit(BOOL allow_edit); | ||
96 | 97 | ||
97 | virtual void onTabInto(); | 98 | virtual void onTabInto(); |
98 | 99 | ||
@@ -134,6 +135,7 @@ private: | |||
134 | class LLButton* mDownBtn; | 135 | class LLButton* mDownBtn; |
135 | 136 | ||
136 | BOOL mbHasBeenSet; | 137 | BOOL mbHasBeenSet; |
138 | BOOL mAllowEdit; | ||
137 | }; | 139 | }; |
138 | 140 | ||
139 | #endif // LL_LLSPINCTRL_H | 141 | #endif // LL_LLSPINCTRL_H |
diff --git a/linden/indra/llui/llstyle.cpp b/linden/indra/llui/llstyle.cpp index 58cf200..6130416 100644 --- a/linden/indra/llui/llstyle.cpp +++ b/linden/indra/llui/llstyle.cpp | |||
@@ -39,7 +39,7 @@ | |||
39 | 39 | ||
40 | LLStyle::LLStyle() | 40 | LLStyle::LLStyle() |
41 | { | 41 | { |
42 | init(TRUE, LLColor4(0,0,0,1),""); | 42 | init(TRUE, LLColor4(0,0,0,1),LLStringUtil::null); |
43 | } | 43 | } |
44 | 44 | ||
45 | LLStyle::LLStyle(const LLStyle &style) | 45 | LLStyle::LLStyle(const LLStyle &style) |
@@ -62,21 +62,21 @@ LLStyle::LLStyle(const LLStyle &style) | |||
62 | } | 62 | } |
63 | else | 63 | else |
64 | { | 64 | { |
65 | init(TRUE, LLColor4(0,0,0,1),""); | 65 | init(TRUE, LLColor4(0,0,0,1),LLStringUtil::null); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | LLStyle::LLStyle(BOOL is_visible, const LLColor4 &color, const LLString& font_name) | 69 | LLStyle::LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name) |
70 | { | 70 | { |
71 | init(is_visible, color, font_name); | 71 | init(is_visible, color, font_name); |
72 | } | 72 | } |
73 | 73 | ||
74 | void LLStyle::init(BOOL is_visible, const LLColor4 &color, const LLString& font_name) | 74 | void LLStyle::init(BOOL is_visible, const LLColor4 &color, const std::string& font_name) |
75 | { | 75 | { |
76 | mVisible = is_visible; | 76 | mVisible = is_visible; |
77 | mColor = color; | 77 | mColor = color; |
78 | setFontName(font_name); | 78 | setFontName(font_name); |
79 | setLinkHREF(""); | 79 | setLinkHREF(LLStringUtil::null); |
80 | mItalic = FALSE; | 80 | mItalic = FALSE; |
81 | mBold = FALSE; | 81 | mBold = FALSE; |
82 | mUnderline = FALSE; | 82 | mUnderline = FALSE; |
@@ -110,12 +110,12 @@ LLStyle &LLStyle::operator=(const LLStyle &rhs) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | void LLStyle::setFontName(const LLString& fontname) | 113 | void LLStyle::setFontName(const std::string& fontname) |
114 | { | 114 | { |
115 | mFontName = fontname; | 115 | mFontName = fontname; |
116 | 116 | ||
117 | LLString fontname_lc = fontname; | 117 | std::string fontname_lc = fontname; |
118 | LLString::toLower(fontname_lc); | 118 | LLStringUtil::toLower(fontname_lc); |
119 | 119 | ||
120 | mFontID = LLFONT_OCRA; // default | 120 | mFontID = LLFONT_OCRA; // default |
121 | 121 | ||
@@ -138,7 +138,7 @@ void LLStyle::setFontName(const LLString& fontname) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
141 | void LLStyle::setLinkHREF(const LLString& href) | 141 | void LLStyle::setLinkHREF(const std::string& href) |
142 | { | 142 | { |
143 | mLink = href; | 143 | mLink = href; |
144 | } | 144 | } |
diff --git a/linden/indra/llui/llstyle.h b/linden/indra/llui/llstyle.h index 56f1398..d235e15 100644 --- a/linden/indra/llui/llstyle.h +++ b/linden/indra/llui/llstyle.h | |||
@@ -42,11 +42,11 @@ class LLStyle : public LLRefCount | |||
42 | public: | 42 | public: |
43 | LLStyle(); | 43 | LLStyle(); |
44 | LLStyle(const LLStyle &style); | 44 | LLStyle(const LLStyle &style); |
45 | LLStyle(BOOL is_visible, const LLColor4 &color, const LLString& font_name); | 45 | LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name); |
46 | 46 | ||
47 | LLStyle &operator=(const LLStyle &rhs); | 47 | LLStyle &operator=(const LLStyle &rhs); |
48 | 48 | ||
49 | virtual void init (BOOL is_visible, const LLColor4 &color, const LLString& font_name); | 49 | virtual void init (BOOL is_visible, const LLColor4 &color, const std::string& font_name); |
50 | 50 | ||
51 | virtual const LLColor4& getColor() const { return mColor; } | 51 | virtual const LLColor4& getColor() const { return mColor; } |
52 | virtual void setColor(const LLColor4 &color) { mColor = color; } | 52 | virtual void setColor(const LLColor4 &color) { mColor = color; } |
@@ -54,12 +54,12 @@ public: | |||
54 | virtual BOOL isVisible() const; | 54 | virtual BOOL isVisible() const; |
55 | virtual void setVisible(BOOL is_visible); | 55 | virtual void setVisible(BOOL is_visible); |
56 | 56 | ||
57 | virtual const LLString& getFontString() const { return mFontName; } | 57 | virtual const std::string& getFontString() const { return mFontName; } |
58 | virtual void setFontName(const LLString& fontname); | 58 | virtual void setFontName(const std::string& fontname); |
59 | virtual LLFONT_ID getFontID() const { return mFontID; } | 59 | virtual LLFONT_ID getFontID() const { return mFontID; } |
60 | 60 | ||
61 | virtual const LLString& getLinkHREF() const { return mLink; } | 61 | virtual const std::string& getLinkHREF() const { return mLink; } |
62 | virtual void setLinkHREF(const LLString& href); | 62 | virtual void setLinkHREF(const std::string& href); |
63 | virtual BOOL isLink() const; | 63 | virtual BOOL isLink() const; |
64 | 64 | ||
65 | virtual LLUIImagePtr getImage() const; | 65 | virtual LLUIImagePtr getImage() const; |
@@ -105,9 +105,9 @@ protected: | |||
105 | private: | 105 | private: |
106 | BOOL mVisible; | 106 | BOOL mVisible; |
107 | LLColor4 mColor; | 107 | LLColor4 mColor; |
108 | LLString mFontName; | 108 | std::string mFontName; |
109 | LLFONT_ID mFontID; | 109 | LLFONT_ID mFontID; |
110 | LLString mLink; | 110 | std::string mLink; |
111 | LLUIImagePtr mImagep; | 111 | LLUIImagePtr mImagep; |
112 | BOOL mIsEmbeddedItem; | 112 | BOOL mIsEmbeddedItem; |
113 | }; | 113 | }; |
diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index 827d4fb..7bf1485 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp | |||
@@ -42,7 +42,6 @@ | |||
42 | #include "lltabcontainervertical.h" | 42 | #include "lltabcontainervertical.h" |
43 | #include "llrender.h" | 43 | #include "llrender.h" |
44 | 44 | ||
45 | |||
46 | const F32 SCROLL_STEP_TIME = 0.4f; | 45 | const F32 SCROLL_STEP_TIME = 0.4f; |
47 | const F32 SCROLL_DELAY_TIME = 0.5f; | 46 | const F32 SCROLL_DELAY_TIME = 0.5f; |
48 | const S32 TAB_PADDING = 15; | 47 | const S32 TAB_PADDING = 15; |
@@ -66,7 +65,7 @@ const S32 TABCNTRV_PAD = 0; | |||
66 | 65 | ||
67 | static LLRegisterWidget<LLTabContainer> r("tab_container"); | 66 | static LLRegisterWidget<LLTabContainer> r("tab_container"); |
68 | 67 | ||
69 | LLTabContainer::LLTabContainer(const LLString& name, const LLRect& rect, TabPosition pos, | 68 | LLTabContainer::LLTabContainer(const std::string& name, const LLRect& rect, TabPosition pos, |
70 | BOOL bordered, BOOL is_vertical ) | 69 | BOOL bordered, BOOL is_vertical ) |
71 | : | 70 | : |
72 | LLPanel(name, rect, bordered), | 71 | LLPanel(name, rect, bordered), |
@@ -122,7 +121,7 @@ void LLTabContainer::reshape(S32 width, S32 height, BOOL called_from_parent) | |||
122 | } | 121 | } |
123 | 122 | ||
124 | //virtual | 123 | //virtual |
125 | LLView* LLTabContainer::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const | 124 | LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const |
126 | { | 125 | { |
127 | tuple_list_t::const_iterator itor; | 126 | tuple_list_t::const_iterator itor; |
128 | for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) | 127 | for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) |
@@ -153,24 +152,43 @@ LLView* LLTabContainer::getChildView(const LLString& name, BOOL recurse, BOOL cr | |||
153 | void LLTabContainer::draw() | 152 | void LLTabContainer::draw() |
154 | { | 153 | { |
155 | S32 target_pixel_scroll = 0; | 154 | S32 target_pixel_scroll = 0; |
156 | S32 cur_scroll_pos = mIsVertical ? 0 : getScrollPos(); | 155 | S32 cur_scroll_pos = getScrollPos(); |
157 | if (cur_scroll_pos > 0) | 156 | if (cur_scroll_pos > 0) |
158 | { | 157 | { |
159 | S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); | 158 | if (!mIsVertical) |
160 | for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) | ||
161 | { | 159 | { |
162 | if (cur_scroll_pos == 0) | 160 | S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); |
161 | for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) | ||
163 | { | 162 | { |
164 | break; | 163 | if (cur_scroll_pos == 0) |
164 | { | ||
165 | break; | ||
166 | } | ||
167 | target_pixel_scroll += (*iter)->mButton->getRect().getWidth(); | ||
168 | cur_scroll_pos--; | ||
165 | } | 169 | } |
166 | target_pixel_scroll += (*iter)->mButton->getRect().getWidth(); | ||
167 | cur_scroll_pos--; | ||
168 | } | ||
169 | 170 | ||
170 | // Show part of the tab to the left of what is fully visible | 171 | // Show part of the tab to the left of what is fully visible |
171 | target_pixel_scroll -= TABCNTR_TAB_PARTIAL_WIDTH; | 172 | target_pixel_scroll -= TABCNTR_TAB_PARTIAL_WIDTH; |
172 | // clamp so that rightmost tab never leaves right side of screen | 173 | // clamp so that rightmost tab never leaves right side of screen |
173 | target_pixel_scroll = llmin(mTotalTabWidth - available_width_with_arrows, target_pixel_scroll); | 174 | target_pixel_scroll = llmin(mTotalTabWidth - available_width_with_arrows, target_pixel_scroll); |
175 | } | ||
176 | else | ||
177 | { | ||
178 | S32 available_height_with_arrows = getRect().getHeight() - getTopBorderHeight() - (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); | ||
179 | for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) | ||
180 | { | ||
181 | if (cur_scroll_pos==0) | ||
182 | { | ||
183 | break; | ||
184 | } | ||
185 | target_pixel_scroll += (*iter)->mButton->getRect().getHeight(); | ||
186 | cur_scroll_pos--; | ||
187 | } | ||
188 | S32 total_tab_height = (BTN_HEIGHT + TABCNTRV_PAD) * getTabCount() + TABCNTRV_PAD; | ||
189 | // clamp so that the bottom tab never leaves bottom of panel | ||
190 | target_pixel_scroll = llmin(total_tab_height - available_height_with_arrows, target_pixel_scroll); | ||
191 | } | ||
174 | } | 192 | } |
175 | 193 | ||
176 | setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); | 194 | setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); |
@@ -461,7 +479,7 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask ) | |||
461 | } | 479 | } |
462 | 480 | ||
463 | // virtual | 481 | // virtual |
464 | BOOL LLTabContainer::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect ) | 482 | BOOL LLTabContainer::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect ) |
465 | { | 483 | { |
466 | BOOL handled = LLPanel::handleToolTip( x, y, msg, sticky_rect ); | 484 | BOOL handled = LLPanel::handleToolTip( x, y, msg, sticky_rect ); |
467 | if (!handled && getTabCount() > 0) | 485 | if (!handled && getTabCount() > 0) |
@@ -605,7 +623,7 @@ LLXMLNodePtr LLTabContainer::getXML(bool save_children) const | |||
605 | } | 623 | } |
606 | 624 | ||
607 | // virtual | 625 | // virtual |
608 | BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, LLString &tooltip) | 626 | BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string &tooltip) |
609 | { | 627 | { |
610 | BOOL has_scroll_arrows = (getMaxScrollPos() > 0); | 628 | BOOL has_scroll_arrows = (getMaxScrollPos() > 0); |
611 | 629 | ||
@@ -613,13 +631,13 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag | |||
613 | { | 631 | { |
614 | if (has_scroll_arrows) | 632 | if (has_scroll_arrows) |
615 | { | 633 | { |
616 | if (mJumpPrevArrowBtn->getRect().pointInRect(x, y)) | 634 | if (mJumpPrevArrowBtn && mJumpPrevArrowBtn->getRect().pointInRect(x, y)) |
617 | { | 635 | { |
618 | S32 local_x = x - mJumpPrevArrowBtn->getRect().mLeft; | 636 | S32 local_x = x - mJumpPrevArrowBtn->getRect().mLeft; |
619 | S32 local_y = y - mJumpPrevArrowBtn->getRect().mBottom; | 637 | S32 local_y = y - mJumpPrevArrowBtn->getRect().mBottom; |
620 | mJumpPrevArrowBtn->handleHover(local_x, local_y, mask); | 638 | mJumpPrevArrowBtn->handleHover(local_x, local_y, mask); |
621 | } | 639 | } |
622 | if (mJumpNextArrowBtn->getRect().pointInRect(x, y)) | 640 | if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x, y)) |
623 | { | 641 | { |
624 | S32 local_x = x - mJumpNextArrowBtn->getRect().mLeft; | 642 | S32 local_x = x - mJumpNextArrowBtn->getRect().mLeft; |
625 | S32 local_y = y - mJumpNextArrowBtn->getRect().mBottom; | 643 | S32 local_y = y - mJumpNextArrowBtn->getRect().mBottom; |
@@ -657,7 +675,7 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag | |||
657 | } | 675 | } |
658 | 676 | ||
659 | void LLTabContainer::addTabPanel(LLPanel* child, | 677 | void LLTabContainer::addTabPanel(LLPanel* child, |
660 | const LLString& label, | 678 | const std::string& label, |
661 | BOOL select, | 679 | BOOL select, |
662 | void (*on_tab_clicked)(void*, bool), | 680 | void (*on_tab_clicked)(void*, bool), |
663 | void* userdata, | 681 | void* userdata, |
@@ -674,8 +692,8 @@ void LLTabContainer::addTabPanel(LLPanel* child, | |||
674 | 692 | ||
675 | // Store the original label for possible xml export. | 693 | // Store the original label for possible xml export. |
676 | child->setLabel(label); | 694 | child->setLabel(label); |
677 | LLString trimmed_label = label; | 695 | std::string trimmed_label = label; |
678 | LLString::trim(trimmed_label); | 696 | LLStringUtil::trim(trimmed_label); |
679 | 697 | ||
680 | S32 button_width = mMinTabWidth; | 698 | S32 button_width = mMinTabWidth; |
681 | if (!mIsVertical) | 699 | if (!mIsVertical) |
@@ -724,8 +742,8 @@ void LLTabContainer::addTabPanel(LLPanel* child, | |||
724 | 742 | ||
725 | // Tab button | 743 | // Tab button |
726 | LLRect btn_rect; // Note: btn_rect.mLeft is just a dummy. Will be updated in draw(). | 744 | LLRect btn_rect; // Note: btn_rect.mLeft is just a dummy. Will be updated in draw(). |
727 | LLString tab_img; | 745 | std::string tab_img; |
728 | LLString tab_selected_img; | 746 | std::string tab_selected_img; |
729 | S32 tab_fudge = 1; // To make new tab art look better, nudge buttons up 1 pel | 747 | S32 tab_fudge = 1; // To make new tab art look better, nudge buttons up 1 pel |
730 | 748 | ||
731 | if (mIsVertical) | 749 | if (mIsVertical) |
@@ -756,21 +774,21 @@ void LLTabContainer::addTabPanel(LLPanel* child, | |||
756 | btn_rect.translate(0, -LLBUTTON_V_PAD-2); | 774 | btn_rect.translate(0, -LLBUTTON_V_PAD-2); |
757 | textbox = new LLTextBox(trimmed_label, btn_rect, trimmed_label, font); | 775 | textbox = new LLTextBox(trimmed_label, btn_rect, trimmed_label, font); |
758 | 776 | ||
759 | btn = new LLButton("", LLRect(0,0,0,0)); | 777 | btn = new LLButton(LLStringUtil::null, LLRect(0,0,0,0)); |
760 | } | 778 | } |
761 | else | 779 | else |
762 | { | 780 | { |
763 | if (mIsVertical) | 781 | if (mIsVertical) |
764 | { | 782 | { |
765 | btn = new LLButton("vert tab button", | 783 | btn = new LLButton(std::string("vert tab button"), |
766 | btn_rect, | 784 | btn_rect, |
767 | "", | 785 | LLStringUtil::null, |
768 | "", | 786 | LLStringUtil::null, |
769 | "", | 787 | LLStringUtil::null, |
770 | &LLTabContainer::onTabBtn, NULL, | 788 | &LLTabContainer::onTabBtn, NULL, |
771 | font, | 789 | font, |
772 | trimmed_label, trimmed_label); | 790 | trimmed_label, trimmed_label); |
773 | btn->setImages("tab_left.tga", "tab_left_selected.tga"); | 791 | btn->setImages(std::string("tab_left.tga"), std::string("tab_left_selected.tga")); |
774 | btn->setScaleImage(TRUE); | 792 | btn->setScaleImage(TRUE); |
775 | btn->setHAlign(LLFontGL::LEFT); | 793 | btn->setHAlign(LLFontGL::LEFT); |
776 | btn->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); | 794 | btn->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); |
@@ -782,13 +800,13 @@ void LLTabContainer::addTabPanel(LLPanel* child, | |||
782 | } | 800 | } |
783 | else | 801 | else |
784 | { | 802 | { |
785 | LLString tooltip = trimmed_label; | 803 | std::string tooltip = trimmed_label; |
786 | tooltip += "\nAlt-Left arrow for previous tab"; | 804 | tooltip += "\nAlt-Left arrow for previous tab"; |
787 | tooltip += "\nAlt-Right arrow for next tab"; | 805 | tooltip += "\nAlt-Right arrow for next tab"; |
788 | 806 | ||
789 | btn = new LLButton(LLString(child->getName()) + " tab", | 807 | btn = new LLButton(std::string(child->getName()) + " tab", |
790 | btn_rect, | 808 | btn_rect, |
791 | "", "", "", | 809 | LLStringUtil::null, LLStringUtil::null, LLStringUtil::null, |
792 | &LLTabContainer::onTabBtn, NULL, // set userdata below | 810 | &LLTabContainer::onTabBtn, NULL, // set userdata below |
793 | font, | 811 | font, |
794 | trimmed_label, trimmed_label ); | 812 | trimmed_label, trimmed_label ); |
@@ -845,7 +863,7 @@ void LLTabContainer::addTabPanel(LLPanel* child, | |||
845 | updateMaxScrollPos(); | 863 | updateMaxScrollPos(); |
846 | } | 864 | } |
847 | 865 | ||
848 | void LLTabContainer::addPlaceholder(LLPanel* child, const LLString& label) | 866 | void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) |
849 | { | 867 | { |
850 | addTabPanel(child, label, FALSE, NULL, NULL, 0, TRUE); | 868 | addTabPanel(child, label, FALSE, NULL, NULL, 0, TRUE); |
851 | } | 869 | } |
@@ -1012,7 +1030,7 @@ S32 LLTabContainer::getIndexForPanel(LLPanel* panel) | |||
1012 | return -1; | 1030 | return -1; |
1013 | } | 1031 | } |
1014 | 1032 | ||
1015 | S32 LLTabContainer::getPanelIndexByTitle(const LLString& title) | 1033 | S32 LLTabContainer::getPanelIndexByTitle(const std::string& title) |
1016 | { | 1034 | { |
1017 | for (S32 index = 0 ; index < (S32)mTabList.size(); index++) | 1035 | for (S32 index = 0 ; index < (S32)mTabList.size(); index++) |
1018 | { | 1036 | { |
@@ -1024,7 +1042,7 @@ S32 LLTabContainer::getPanelIndexByTitle(const LLString& title) | |||
1024 | return -1; | 1042 | return -1; |
1025 | } | 1043 | } |
1026 | 1044 | ||
1027 | LLPanel *LLTabContainer::getPanelByName(const LLString& name) | 1045 | LLPanel *LLTabContainer::getPanelByName(const std::string& name) |
1028 | { | 1046 | { |
1029 | for (S32 index = 0 ; index < (S32)mTabList.size(); index++) | 1047 | for (S32 index = 0 ; index < (S32)mTabList.size(); index++) |
1030 | { | 1048 | { |
@@ -1038,7 +1056,7 @@ LLPanel *LLTabContainer::getPanelByName(const LLString& name) | |||
1038 | } | 1056 | } |
1039 | 1057 | ||
1040 | // Change the name of the button for the current tab. | 1058 | // Change the name of the button for the current tab. |
1041 | void LLTabContainer::setCurrentTabName(const LLString& name) | 1059 | void LLTabContainer::setCurrentTabName(const std::string& name) |
1042 | { | 1060 | { |
1043 | // Might not have a tab selected | 1061 | // Might not have a tab selected |
1044 | if (mCurrentTabIdx < 0) return; | 1062 | if (mCurrentTabIdx < 0) return; |
@@ -1212,7 +1230,7 @@ BOOL LLTabContainer::selectTab(S32 which) | |||
1212 | return is_visible; | 1230 | return is_visible; |
1213 | } | 1231 | } |
1214 | 1232 | ||
1215 | BOOL LLTabContainer::selectTabByName(const LLString& name) | 1233 | BOOL LLTabContainer::selectTabByName(const std::string& name) |
1216 | { | 1234 | { |
1217 | LLPanel* panel = getPanelByName(name); | 1235 | LLPanel* panel = getPanelByName(name); |
1218 | if (!panel) | 1236 | if (!panel) |
@@ -1276,7 +1294,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L | |||
1276 | } | 1294 | } |
1277 | } | 1295 | } |
1278 | 1296 | ||
1279 | void LLTabContainer::setTitle(const LLString& title) | 1297 | void LLTabContainer::setTitle(const std::string& title) |
1280 | { | 1298 | { |
1281 | if (mTitleBox) | 1299 | if (mTitleBox) |
1282 | { | 1300 | { |
@@ -1284,14 +1302,14 @@ void LLTabContainer::setTitle(const LLString& title) | |||
1284 | } | 1302 | } |
1285 | } | 1303 | } |
1286 | 1304 | ||
1287 | const LLString LLTabContainer::getPanelTitle(S32 index) | 1305 | const std::string LLTabContainer::getPanelTitle(S32 index) |
1288 | { | 1306 | { |
1289 | if (index >= 0 && index < (S32)mTabList.size()) | 1307 | if (index >= 0 && index < (S32)mTabList.size()) |
1290 | { | 1308 | { |
1291 | LLButton* tab_button = mTabList[index]->mButton; | 1309 | LLButton* tab_button = mTabList[index]->mButton; |
1292 | return tab_button->getLabelSelected(); | 1310 | return tab_button->getLabelSelected(); |
1293 | } | 1311 | } |
1294 | return LLString::null; | 1312 | return LLStringUtil::null; |
1295 | } | 1313 | } |
1296 | 1314 | ||
1297 | void LLTabContainer::setTopBorderHeight(S32 height) | 1315 | void LLTabContainer::setTopBorderHeight(S32 height) |
@@ -1329,7 +1347,7 @@ void LLTabContainer::setRightTabBtnOffset(S32 offset) | |||
1329 | updateMaxScrollPos(); | 1347 | updateMaxScrollPos(); |
1330 | } | 1348 | } |
1331 | 1349 | ||
1332 | void LLTabContainer::setPanelTitle(S32 index, const LLString& title) | 1350 | void LLTabContainer::setPanelTitle(S32 index, const std::string& title) |
1333 | { | 1351 | { |
1334 | if (index >= 0 && index < getTabCount()) | 1352 | if (index >= 0 && index < getTabCount()) |
1335 | { | 1353 | { |
@@ -1435,7 +1453,7 @@ void LLTabContainer::onPrevBtnHeld( void* userdata ) | |||
1435 | // static | 1453 | // static |
1436 | LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 1454 | LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
1437 | { | 1455 | { |
1438 | LLString name("tab_container"); | 1456 | std::string name("tab_container"); |
1439 | node->getAttributeString("name", name); | 1457 | node->getAttributeString("name", name); |
1440 | 1458 | ||
1441 | // Figure out if we are creating a vertical or horizontal tab container. | 1459 | // Figure out if we are creating a vertical or horizontal tab container. |
@@ -1443,9 +1461,9 @@ LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
1443 | LLTabContainer::TabPosition tab_position = LLTabContainer::TOP; | 1461 | LLTabContainer::TabPosition tab_position = LLTabContainer::TOP; |
1444 | if (node->hasAttribute("tab_position")) | 1462 | if (node->hasAttribute("tab_position")) |
1445 | { | 1463 | { |
1446 | LLString tab_position_string; | 1464 | std::string tab_position_string; |
1447 | node->getAttributeString("tab_position", tab_position_string); | 1465 | node->getAttributeString("tab_position", tab_position_string); |
1448 | LLString::toLower(tab_position_string); | 1466 | LLStringUtil::toLower(tab_position_string); |
1449 | 1467 | ||
1450 | if ("top" == tab_position_string) | 1468 | if ("top" == tab_position_string) |
1451 | { | 1469 | { |
@@ -1507,7 +1525,7 @@ LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
1507 | if (control && control->isPanel()) | 1525 | if (control && control->isPanel()) |
1508 | { | 1526 | { |
1509 | LLPanel* panelp = (LLPanel*)control; | 1527 | LLPanel* panelp = (LLPanel*)control; |
1510 | LLString label; | 1528 | std::string label; |
1511 | child->getAttributeString("label", label); | 1529 | child->getAttributeString("label", label); |
1512 | if (label.empty()) | 1530 | if (label.empty()) |
1513 | { | 1531 | { |
@@ -1515,7 +1533,7 @@ LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
1515 | } | 1533 | } |
1516 | BOOL placeholder = FALSE; | 1534 | BOOL placeholder = FALSE; |
1517 | child->getAttributeBOOL("placeholder", placeholder); | 1535 | child->getAttributeBOOL("placeholder", placeholder); |
1518 | tab_container->addTabPanel(panelp, label.c_str(), false, | 1536 | tab_container->addTabPanel(panelp, label, false, |
1519 | NULL, NULL, 0, placeholder); | 1537 | NULL, NULL, 0, placeholder); |
1520 | } | 1538 | } |
1521 | } | 1539 | } |
@@ -1539,8 +1557,8 @@ void LLTabContainer::initButtons() | |||
1539 | return; // Don't have a rect yet or already got called | 1557 | return; // Don't have a rect yet or already got called |
1540 | } | 1558 | } |
1541 | 1559 | ||
1542 | LLString out_id; | 1560 | std::string out_id; |
1543 | LLString in_id; | 1561 | std::string in_id; |
1544 | 1562 | ||
1545 | if (mIsVertical) | 1563 | if (mIsVertical) |
1546 | { | 1564 | { |
@@ -1556,16 +1574,16 @@ void LLTabContainer::initButtons() | |||
1556 | 1574 | ||
1557 | out_id = "UIImgBtnScrollUpOutUUID"; | 1575 | out_id = "UIImgBtnScrollUpOutUUID"; |
1558 | in_id = "UIImgBtnScrollUpInUUID"; | 1576 | in_id = "UIImgBtnScrollUpInUUID"; |
1559 | mPrevArrowBtn = new LLButton("Up Arrow", up_arrow_btn_rect, | 1577 | mPrevArrowBtn = new LLButton(std::string("Up Arrow"), up_arrow_btn_rect, |
1560 | out_id, in_id, "", | 1578 | out_id, in_id, LLStringUtil::null, |
1561 | &onPrevBtn, this, NULL ); | 1579 | &onPrevBtn, this, NULL ); |
1562 | mPrevArrowBtn->setFollowsTop(); | 1580 | mPrevArrowBtn->setFollowsTop(); |
1563 | mPrevArrowBtn->setFollowsLeft(); | 1581 | mPrevArrowBtn->setFollowsLeft(); |
1564 | 1582 | ||
1565 | out_id = "UIImgBtnScrollDownOutUUID"; | 1583 | out_id = "UIImgBtnScrollDownOutUUID"; |
1566 | in_id = "UIImgBtnScrollDownInUUID"; | 1584 | in_id = "UIImgBtnScrollDownInUUID"; |
1567 | mNextArrowBtn = new LLButton("Down Arrow", down_arrow_btn_rect, | 1585 | mNextArrowBtn = new LLButton(std::string("Down Arrow"), down_arrow_btn_rect, |
1568 | out_id, in_id, "", | 1586 | out_id, in_id, LLStringUtil::null, |
1569 | &onNextBtn, this, NULL ); | 1587 | &onNextBtn, this, NULL ); |
1570 | mNextArrowBtn->setFollowsBottom(); | 1588 | mNextArrowBtn->setFollowsBottom(); |
1571 | mNextArrowBtn->setFollowsLeft(); | 1589 | mNextArrowBtn->setFollowsLeft(); |
@@ -1604,31 +1622,31 @@ void LLTabContainer::initButtons() | |||
1604 | 1622 | ||
1605 | out_id = "UIImgBtnJumpLeftOutUUID"; | 1623 | out_id = "UIImgBtnJumpLeftOutUUID"; |
1606 | in_id = "UIImgBtnJumpLeftInUUID"; | 1624 | in_id = "UIImgBtnJumpLeftInUUID"; |
1607 | mJumpPrevArrowBtn = new LLButton("Jump Left Arrow", jump_left_arrow_btn_rect, | 1625 | mJumpPrevArrowBtn = new LLButton(std::string("Jump Left Arrow"), jump_left_arrow_btn_rect, |
1608 | out_id, in_id, "", | 1626 | out_id, in_id, LLStringUtil::null, |
1609 | &LLTabContainer::onJumpFirstBtn, this, LLFontGL::sSansSerif ); | 1627 | &LLTabContainer::onJumpFirstBtn, this, LLFontGL::sSansSerif ); |
1610 | mJumpPrevArrowBtn->setFollowsLeft(); | 1628 | mJumpPrevArrowBtn->setFollowsLeft(); |
1611 | 1629 | ||
1612 | out_id = "UIImgBtnScrollLeftOutUUID"; | 1630 | out_id = "UIImgBtnScrollLeftOutUUID"; |
1613 | in_id = "UIImgBtnScrollLeftInUUID"; | 1631 | in_id = "UIImgBtnScrollLeftInUUID"; |
1614 | mPrevArrowBtn = new LLButton("Left Arrow", left_arrow_btn_rect, | 1632 | mPrevArrowBtn = new LLButton(std::string("Left Arrow"), left_arrow_btn_rect, |
1615 | out_id, in_id, "", | 1633 | out_id, in_id, LLStringUtil::null, |
1616 | &LLTabContainer::onPrevBtn, this, LLFontGL::sSansSerif ); | 1634 | &LLTabContainer::onPrevBtn, this, LLFontGL::sSansSerif ); |
1617 | mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld); | 1635 | mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld); |
1618 | mPrevArrowBtn->setFollowsLeft(); | 1636 | mPrevArrowBtn->setFollowsLeft(); |
1619 | 1637 | ||
1620 | out_id = "UIImgBtnJumpRightOutUUID"; | 1638 | out_id = "UIImgBtnJumpRightOutUUID"; |
1621 | in_id = "UIImgBtnJumpRightInUUID"; | 1639 | in_id = "UIImgBtnJumpRightInUUID"; |
1622 | mJumpNextArrowBtn = new LLButton("Jump Right Arrow", jump_right_arrow_btn_rect, | 1640 | mJumpNextArrowBtn = new LLButton(std::string("Jump Right Arrow"), jump_right_arrow_btn_rect, |
1623 | out_id, in_id, "", | 1641 | out_id, in_id, LLStringUtil::null, |
1624 | &LLTabContainer::onJumpLastBtn, this, | 1642 | &LLTabContainer::onJumpLastBtn, this, |
1625 | LLFontGL::sSansSerif); | 1643 | LLFontGL::sSansSerif); |
1626 | mJumpNextArrowBtn->setFollowsRight(); | 1644 | mJumpNextArrowBtn->setFollowsRight(); |
1627 | 1645 | ||
1628 | out_id = "UIImgBtnScrollRightOutUUID"; | 1646 | out_id = "UIImgBtnScrollRightOutUUID"; |
1629 | in_id = "UIImgBtnScrollRightInUUID"; | 1647 | in_id = "UIImgBtnScrollRightInUUID"; |
1630 | mNextArrowBtn = new LLButton("Right Arrow", right_arrow_btn_rect, | 1648 | mNextArrowBtn = new LLButton(std::string("Right Arrow"), right_arrow_btn_rect, |
1631 | out_id, in_id, "", | 1649 | out_id, in_id, LLStringUtil::null, |
1632 | &LLTabContainer::onNextBtn, this, | 1650 | &LLTabContainer::onNextBtn, this, |
1633 | LLFontGL::sSansSerif); | 1651 | LLFontGL::sSansSerif); |
1634 | mNextArrowBtn->setFollowsRight(); | 1652 | mNextArrowBtn->setFollowsRight(); |
@@ -1795,3 +1813,4 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y) | |||
1795 | } | 1813 | } |
1796 | 1814 | ||
1797 | 1815 | ||
1816 | |||
diff --git a/linden/indra/llui/lltabcontainer.h b/linden/indra/llui/lltabcontainer.h index 16f8be5..8d4218a 100644 --- a/linden/indra/llui/lltabcontainer.h +++ b/linden/indra/llui/lltabcontainer.h | |||
@@ -55,7 +55,7 @@ public: | |||
55 | RIGHT_OF_CURRENT | 55 | RIGHT_OF_CURRENT |
56 | } eInsertionPoint; | 56 | } eInsertionPoint; |
57 | 57 | ||
58 | LLTabContainer( const LLString& name, const LLRect& rect, TabPosition pos, | 58 | LLTabContainer( const std::string& name, const LLRect& rect, TabPosition pos, |
59 | BOOL bordered, BOOL is_vertical); | 59 | BOOL bordered, BOOL is_vertical); |
60 | 60 | ||
61 | /*virtual*/ ~LLTabContainer(); | 61 | /*virtual*/ ~LLTabContainer(); |
@@ -68,23 +68,23 @@ public: | |||
68 | /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); | 68 | /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); |
69 | /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); | 69 | /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); |
70 | /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); | 70 | /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); |
71 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect ); | 71 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect ); |
72 | /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); | 72 | /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); |
73 | /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 73 | /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
74 | EDragAndDropType type, void* cargo_data, | 74 | EDragAndDropType type, void* cargo_data, |
75 | EAcceptance* accept, LLString& tooltip); | 75 | EAcceptance* accept, std::string& tooltip); |
76 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; | 76 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; |
77 | /*virtual*/ LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; | 77 | /*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; |
78 | 78 | ||
79 | void addTabPanel(LLPanel* child, | 79 | void addTabPanel(LLPanel* child, |
80 | const LLString& label, | 80 | const std::string& label, |
81 | BOOL select = FALSE, | 81 | BOOL select = FALSE, |
82 | void (*on_tab_clicked)(void*, bool) = NULL, | 82 | void (*on_tab_clicked)(void*, bool) = NULL, |
83 | void* userdata = NULL, | 83 | void* userdata = NULL, |
84 | S32 indent = 0, | 84 | S32 indent = 0, |
85 | BOOL placeholder = FALSE, | 85 | BOOL placeholder = FALSE, |
86 | eInsertionPoint insertion_point = END); | 86 | eInsertionPoint insertion_point = END); |
87 | void addPlaceholder(LLPanel* child, const LLString& label); | 87 | void addPlaceholder(LLPanel* child, const std::string& label); |
88 | void removeTabPanel( LLPanel* child ); | 88 | void removeTabPanel( LLPanel* child ); |
89 | void lockTabs(S32 num_tabs = 0); | 89 | void lockTabs(S32 num_tabs = 0); |
90 | void unlockTabs(); | 90 | void unlockTabs(); |
@@ -96,9 +96,9 @@ public: | |||
96 | S32 getTabCount(); | 96 | S32 getTabCount(); |
97 | LLPanel* getPanelByIndex(S32 index); | 97 | LLPanel* getPanelByIndex(S32 index); |
98 | S32 getIndexForPanel(LLPanel* panel); | 98 | S32 getIndexForPanel(LLPanel* panel); |
99 | S32 getPanelIndexByTitle(const LLString& title); | 99 | S32 getPanelIndexByTitle(const std::string& title); |
100 | LLPanel* getPanelByName(const LLString& name); | 100 | LLPanel* getPanelByName(const std::string& name); |
101 | void setCurrentTabName(const LLString& name); | 101 | void setCurrentTabName(const std::string& name); |
102 | 102 | ||
103 | void selectFirstTab(); | 103 | void selectFirstTab(); |
104 | void selectLastTab(); | 104 | void selectLastTab(); |
@@ -106,13 +106,13 @@ public: | |||
106 | void selectPrevTab(); | 106 | void selectPrevTab(); |
107 | BOOL selectTabPanel( LLPanel* child ); | 107 | BOOL selectTabPanel( LLPanel* child ); |
108 | BOOL selectTab(S32 which); | 108 | BOOL selectTab(S32 which); |
109 | BOOL selectTabByName(const LLString& title); | 109 | BOOL selectTabByName(const std::string& title); |
110 | 110 | ||
111 | BOOL getTabPanelFlashing(LLPanel* child); | 111 | BOOL getTabPanelFlashing(LLPanel* child); |
112 | void setTabPanelFlashing(LLPanel* child, BOOL state); | 112 | void setTabPanelFlashing(LLPanel* child, BOOL state); |
113 | void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white); | 113 | void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white); |
114 | void setTitle( const LLString& title ); | 114 | void setTitle( const std::string& title ); |
115 | const LLString getPanelTitle(S32 index); | 115 | const std::string getPanelTitle(S32 index); |
116 | 116 | ||
117 | void setTopBorderHeight(S32 height); | 117 | void setTopBorderHeight(S32 height); |
118 | S32 getTopBorderHeight() const; | 118 | S32 getTopBorderHeight() const; |
@@ -121,7 +121,7 @@ public: | |||
121 | void setTabUserData(LLPanel* tab, void* userdata); | 121 | void setTabUserData(LLPanel* tab, void* userdata); |
122 | 122 | ||
123 | void setRightTabBtnOffset( S32 offset ); | 123 | void setRightTabBtnOffset( S32 offset ); |
124 | void setPanelTitle(S32 index, const LLString& title); | 124 | void setPanelTitle(S32 index, const std::string& title); |
125 | 125 | ||
126 | TabPosition getTabPosition() const { return mTabPosition; } | 126 | TabPosition getTabPosition() const { return mTabPosition; } |
127 | void setMinTabWidth(S32 width) { mMinTabWidth = width; } | 127 | void setMinTabWidth(S32 width) { mMinTabWidth = width; } |
diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp index 0f411b8..6997c61 100644 --- a/linden/indra/llui/lltextbox.cpp +++ b/linden/indra/llui/lltextbox.cpp | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | static LLRegisterWidget<LLTextBox> r("text"); | 37 | static LLRegisterWidget<LLTextBox> r("text"); |
38 | 38 | ||
39 | LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& text, | 39 | LLTextBox::LLTextBox(const std::string& name, const LLRect& rect, const std::string& text, |
40 | const LLFontGL* font, BOOL mouse_opaque) | 40 | const LLFontGL* font, BOOL mouse_opaque) |
41 | : LLUICtrl(name, rect, mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP ), | 41 | : LLUICtrl(name, rect, mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP ), |
42 | mFontGL(font ? font : LLFontGL::sSansSerifSmall), | 42 | mFontGL(font ? font : LLFontGL::sSansSerifSmall), |
@@ -63,7 +63,7 @@ LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& t | |||
63 | setTabStop(FALSE); | 63 | setTabStop(FALSE); |
64 | } | 64 | } |
65 | 65 | ||
66 | LLTextBox::LLTextBox(const LLString& name, const LLString& text, F32 max_width, | 66 | LLTextBox::LLTextBox(const std::string& name, const std::string& text, F32 max_width, |
67 | const LLFontGL* font, BOOL mouse_opaque) : | 67 | const LLFontGL* font, BOOL mouse_opaque) : |
68 | LLUICtrl(name, LLRect(0, 0, 1, 1), mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), | 68 | LLUICtrl(name, LLRect(0, 0, 1, 1), mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), |
69 | mFontGL(font ? font : LLFontGL::sSansSerifSmall), | 69 | mFontGL(font ? font : LLFontGL::sSansSerifSmall), |
@@ -91,7 +91,7 @@ LLTextBox::LLTextBox(const LLString& name, const LLString& text, F32 max_width, | |||
91 | setTabStop(FALSE); | 91 | setTabStop(FALSE); |
92 | } | 92 | } |
93 | 93 | ||
94 | LLTextBox::LLTextBox(const LLString& name_and_label, const LLRect& rect) : | 94 | LLTextBox::LLTextBox(const std::string& name_and_label, const LLRect& rect) : |
95 | LLUICtrl(name_and_label, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), | 95 | LLUICtrl(name_and_label, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), |
96 | mFontGL(LLFontGL::sSansSerifSmall), | 96 | mFontGL(LLFontGL::sSansSerifSmall), |
97 | mTextColor(LLUI::sColorsGroup->getColor("LabelTextColor")), | 97 | mTextColor(LLUI::sColorsGroup->getColor("LabelTextColor")), |
@@ -113,7 +113,7 @@ LLTextBox::LLTextBox(const LLString& name_and_label, const LLRect& rect) : | |||
113 | setTabStop(FALSE); | 113 | setTabStop(FALSE); |
114 | } | 114 | } |
115 | 115 | ||
116 | LLTextBox::LLTextBox(const LLString& name_and_label) : | 116 | LLTextBox::LLTextBox(const std::string& name_and_label) : |
117 | LLUICtrl(name_and_label, LLRect(0, 0, 1, 1), TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), | 117 | LLUICtrl(name_and_label, LLRect(0, 0, 1, 1), TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), |
118 | mFontGL(LLFontGL::sSansSerifSmall), | 118 | mFontGL(LLFontGL::sSansSerifSmall), |
119 | mTextColor(LLUI::sColorsGroup->getColor("LabelTextColor")), | 119 | mTextColor(LLUI::sColorsGroup->getColor("LabelTextColor")), |
@@ -211,15 +211,15 @@ void LLTextBox::setLineLengths() | |||
211 | { | 211 | { |
212 | mLineLengthList.clear(); | 212 | mLineLengthList.clear(); |
213 | 213 | ||
214 | LLString::size_type cur = 0; | 214 | std::string::size_type cur = 0; |
215 | LLString::size_type len = mText.getWString().size(); | 215 | std::string::size_type len = mText.getWString().size(); |
216 | 216 | ||
217 | while (cur < len) | 217 | while (cur < len) |
218 | { | 218 | { |
219 | LLString::size_type end = mText.getWString().find('\n', cur); | 219 | std::string::size_type end = mText.getWString().find('\n', cur); |
220 | LLString::size_type runLen; | 220 | std::string::size_type runLen; |
221 | 221 | ||
222 | if (end == LLString::npos) | 222 | if (end == std::string::npos) |
223 | { | 223 | { |
224 | runLen = len - cur; | 224 | runLen = len - cur; |
225 | cur = len; | 225 | cur = len; |
@@ -276,7 +276,7 @@ void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width) | |||
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | LLString final_text = wstring_to_utf8str(final_wtext); | 279 | std::string final_text = wstring_to_utf8str(final_wtext); |
280 | setText(final_text); | 280 | setText(final_text); |
281 | } | 281 | } |
282 | 282 | ||
@@ -316,7 +316,7 @@ S32 LLTextBox::getTextPixelHeight() | |||
316 | } | 316 | } |
317 | 317 | ||
318 | 318 | ||
319 | BOOL LLTextBox::setTextArg( const LLString& key, const LLStringExplicit& text ) | 319 | BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) |
320 | { | 320 | { |
321 | mText.setArg(key, text); | 321 | mText.setArg(key, text); |
322 | setLineLengths(); | 322 | setLineLengths(); |
@@ -451,11 +451,11 @@ LLXMLNodePtr LLTextBox::getXML(bool save_children) const | |||
451 | // static | 451 | // static |
452 | LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 452 | LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
453 | { | 453 | { |
454 | LLString name("text_box"); | 454 | std::string name("text_box"); |
455 | node->getAttributeString("name", name); | 455 | node->getAttributeString("name", name); |
456 | LLFontGL* font = LLView::selectFont(node); | 456 | LLFontGL* font = LLView::selectFont(node); |
457 | 457 | ||
458 | LLString text = node->getTextContents(); | 458 | std::string text = node->getTextContents(); |
459 | 459 | ||
460 | LLTextBox* text_box = new LLTextBox(name, | 460 | LLTextBox* text_box = new LLTextBox(name, |
461 | LLRect(), | 461 | LLRect(), |
@@ -469,7 +469,7 @@ LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f | |||
469 | 469 | ||
470 | text_box->initFromXML(node, parent); | 470 | text_box->initFromXML(node, parent); |
471 | 471 | ||
472 | LLString font_style; | 472 | std::string font_style; |
473 | if (node->getAttributeString("font-style", font_style)) | 473 | if (node->getAttributeString("font-style", font_style)) |
474 | { | 474 | { |
475 | text_box->mFontStyle = LLFontGL::getStyleFromString(font_style); | 475 | text_box->mFontStyle = LLFontGL::getStyleFromString(font_style); |
diff --git a/linden/indra/llui/lltextbox.h b/linden/indra/llui/lltextbox.h index ffe6f4c..c2211fb 100644 --- a/linden/indra/llui/lltextbox.h +++ b/linden/indra/llui/lltextbox.h | |||
@@ -45,16 +45,16 @@ public: | |||
45 | // By default, follows top and left and is mouse-opaque. | 45 | // By default, follows top and left and is mouse-opaque. |
46 | // If no text, text = name. | 46 | // If no text, text = name. |
47 | // If no font, uses default system font. | 47 | // If no font, uses default system font. |
48 | LLTextBox(const LLString& name, const LLRect& rect, const LLString& text, | 48 | LLTextBox(const std::string& name, const LLRect& rect, const std::string& text, |
49 | const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); | 49 | const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); |
50 | 50 | ||
51 | // Construct a textbox which handles word wrapping for us. | 51 | // Construct a textbox which handles word wrapping for us. |
52 | LLTextBox(const LLString& name, const LLString& text, F32 max_width = 200, | 52 | LLTextBox(const std::string& name, const std::string& text, F32 max_width = 200, |
53 | const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); | 53 | const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); |
54 | 54 | ||
55 | // "Simple" constructors for text boxes that have the same name and label *TO BE DEPRECATED* | 55 | // "Simple" constructors for text boxes that have the same name and label *TO BE DEPRECATED* |
56 | LLTextBox(const LLString& name_and_label, const LLRect& rect); | 56 | LLTextBox(const std::string& name_and_label, const LLRect& rect); |
57 | LLTextBox(const LLString& name_and_label); | 57 | LLTextBox(const std::string& name_and_label); |
58 | 58 | ||
59 | virtual ~LLTextBox() {} | 59 | virtual ~LLTextBox() {} |
60 | 60 | ||
@@ -95,13 +95,13 @@ public: | |||
95 | 95 | ||
96 | void reshapeToFitText(); | 96 | void reshapeToFitText(); |
97 | 97 | ||
98 | const LLString& getText() const { return mText.getString(); } | 98 | const std::string& getText() const { return mText.getString(); } |
99 | S32 getTextPixelWidth(); | 99 | S32 getTextPixelWidth(); |
100 | S32 getTextPixelHeight(); | 100 | S32 getTextPixelHeight(); |
101 | 101 | ||
102 | virtual void setValue(const LLSD& value ) { setText(value.asString()); } | 102 | virtual void setValue(const LLSD& value ) { setText(value.asString()); } |
103 | virtual LLSD getValue() const { return LLSD(getText()); } | 103 | virtual LLSD getValue() const { return LLSD(getText()); } |
104 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 104 | virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
105 | 105 | ||
106 | private: | 106 | private: |
107 | void setLineLengths(); | 107 | void setLineLengths(); |
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 71522e5..e56002f 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -36,13 +36,11 @@ | |||
36 | #include "lltexteditor.h" | 36 | #include "lltexteditor.h" |
37 | 37 | ||
38 | #include "llfontgl.h" | 38 | #include "llfontgl.h" |
39 | #include "llgl.h" | ||
40 | #include "llrender.h" | 39 | #include "llrender.h" |
41 | #include "llui.h" | 40 | #include "llui.h" |
42 | #include "lluictrlfactory.h" | 41 | #include "lluictrlfactory.h" |
43 | #include "llrect.h" | 42 | #include "llrect.h" |
44 | #include "llfocusmgr.h" | 43 | #include "llfocusmgr.h" |
45 | #include "sound_ids.h" | ||
46 | #include "lltimer.h" | 44 | #include "lltimer.h" |
47 | #include "llmath.h" | 45 | #include "llmath.h" |
48 | 46 | ||
@@ -58,7 +56,6 @@ | |||
58 | #include "llcontrol.h" | 56 | #include "llcontrol.h" |
59 | #include "llimagegl.h" | 57 | #include "llimagegl.h" |
60 | #include "llwindow.h" | 58 | #include "llwindow.h" |
61 | #include "llglheaders.h" | ||
62 | #include <queue> | 59 | #include <queue> |
63 | 60 | ||
64 | // | 61 | // |
@@ -75,6 +72,8 @@ const S32 UI_TEXTEDITOR_BUFFER_BLOCK_SIZE = 512; | |||
75 | const S32 UI_TEXTEDITOR_BORDER = 1; | 72 | const S32 UI_TEXTEDITOR_BORDER = 1; |
76 | const S32 UI_TEXTEDITOR_H_PAD = 4; | 73 | const S32 UI_TEXTEDITOR_H_PAD = 4; |
77 | const S32 UI_TEXTEDITOR_V_PAD_TOP = 4; | 74 | const S32 UI_TEXTEDITOR_V_PAD_TOP = 4; |
75 | const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32; | ||
76 | const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4; | ||
78 | const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds | 77 | const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds |
79 | const S32 CURSOR_THICKNESS = 2; | 78 | const S32 CURSOR_THICKNESS = 2; |
80 | const S32 SPACES_PER_TAB = 4; | 79 | const S32 SPACES_PER_TAB = 4; |
@@ -88,8 +87,9 @@ const S32 PREEDIT_STANDOUT_GAP = 1; | |||
88 | const S32 PREEDIT_STANDOUT_POSITION = 2; | 87 | const S32 PREEDIT_STANDOUT_POSITION = 2; |
89 | const S32 PREEDIT_STANDOUT_THICKNESS = 2; | 88 | const S32 PREEDIT_STANDOUT_THICKNESS = 2; |
90 | 89 | ||
90 | |||
91 | LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; | 91 | LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; |
92 | void (* LLTextEditor::mURLcallback)(const char*) = NULL; | 92 | void (* LLTextEditor::mURLcallback)(const std::string&) = NULL; |
93 | bool (* LLTextEditor::mSecondlifeURLcallback)(const std::string&) = NULL; | 93 | bool (* LLTextEditor::mSecondlifeURLcallback)(const std::string&) = NULL; |
94 | bool (* LLTextEditor::mSecondlifeURLcallbackRightClick)(const std::string&) = NULL; | 94 | bool (* LLTextEditor::mSecondlifeURLcallbackRightClick)(const std::string&) = NULL; |
95 | 95 | ||
@@ -107,7 +107,7 @@ public: | |||
107 | virtual BOOL execute( LLTextEditor* editor, S32* delta ) | 107 | virtual BOOL execute( LLTextEditor* editor, S32* delta ) |
108 | { | 108 | { |
109 | *delta = insert(editor, getPosition(), mWString ); | 109 | *delta = insert(editor, getPosition(), mWString ); |
110 | LLWString::truncate(mWString, *delta); | 110 | LLWStringUtil::truncate(mWString, *delta); |
111 | //mWString = wstring_truncate(mWString, *delta); | 111 | //mWString = wstring_truncate(mWString, *delta); |
112 | return (*delta != 0); | 112 | return (*delta != 0); |
113 | } | 113 | } |
@@ -145,7 +145,7 @@ public: | |||
145 | virtual BOOL execute( LLTextEditor* editor, S32* delta ) | 145 | virtual BOOL execute( LLTextEditor* editor, S32* delta ) |
146 | { | 146 | { |
147 | *delta = insert(editor, getPosition(), mWString); | 147 | *delta = insert(editor, getPosition(), mWString); |
148 | LLWString::truncate(mWString, *delta); | 148 | LLWStringUtil::truncate(mWString, *delta); |
149 | //mWString = wstring_truncate(mWString, *delta); | 149 | //mWString = wstring_truncate(mWString, *delta); |
150 | return (*delta != 0); | 150 | return (*delta != 0); |
151 | } | 151 | } |
@@ -243,10 +243,10 @@ private: | |||
243 | /////////////////////////////////////////////////////////////////// | 243 | /////////////////////////////////////////////////////////////////// |
244 | 244 | ||
245 | LLTextEditor::LLTextEditor( | 245 | LLTextEditor::LLTextEditor( |
246 | const LLString& name, | 246 | const std::string& name, |
247 | const LLRect& rect, | 247 | const LLRect& rect, |
248 | S32 max_length, // In bytes | 248 | S32 max_length, // In bytes |
249 | const LLString &default_text, | 249 | const std::string &default_text, |
250 | const LLFontGL* font, | 250 | const LLFontGL* font, |
251 | BOOL allow_embedded_items) | 251 | BOOL allow_embedded_items) |
252 | : | 252 | : |
@@ -260,6 +260,7 @@ LLTextEditor::LLTextEditor( | |||
260 | mIsSelecting( FALSE ), | 260 | mIsSelecting( FALSE ), |
261 | mSelectionStart( 0 ), | 261 | mSelectionStart( 0 ), |
262 | mSelectionEnd( 0 ), | 262 | mSelectionEnd( 0 ), |
263 | mScrolledToBottom( FALSE ), | ||
263 | mOnScrollEndCallback( NULL ), | 264 | mOnScrollEndCallback( NULL ), |
264 | mOnScrollEndData( NULL ), | 265 | mOnScrollEndData( NULL ), |
265 | mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ), | 266 | mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ), |
@@ -271,6 +272,7 @@ LLTextEditor::LLTextEditor( | |||
271 | mFocusBgColor( LLUI::sColorsGroup->getColor( "TextBgFocusColor" ) ), | 272 | mFocusBgColor( LLUI::sColorsGroup->getColor( "TextBgFocusColor" ) ), |
272 | mReadOnly(FALSE), | 273 | mReadOnly(FALSE), |
273 | mWordWrap( FALSE ), | 274 | mWordWrap( FALSE ), |
275 | mShowLineNumbers ( FALSE ), | ||
274 | mTabsToNextField( TRUE ), | 276 | mTabsToNextField( TRUE ), |
275 | mCommitOnFocusLost( FALSE ), | 277 | mCommitOnFocusLost( FALSE ), |
276 | mHideScrollbarForShortDocs( FALSE ), | 278 | mHideScrollbarForShortDocs( FALSE ), |
@@ -311,7 +313,7 @@ LLTextEditor::LLTextEditor( | |||
311 | SCROLLBAR_SIZE, | 313 | SCROLLBAR_SIZE, |
312 | getRect().getHeight() - 1); | 314 | getRect().getHeight() - 1); |
313 | S32 lines_in_doc = getLineCount(); | 315 | S32 lines_in_doc = getLineCount(); |
314 | mScrollbar = new LLScrollbar( "Scrollbar", scroll_rect, | 316 | mScrollbar = new LLScrollbar( std::string("Scrollbar"), scroll_rect, |
315 | LLScrollbar::VERTICAL, | 317 | LLScrollbar::VERTICAL, |
316 | lines_in_doc, | 318 | lines_in_doc, |
317 | 0, | 319 | 0, |
@@ -325,7 +327,7 @@ LLTextEditor::LLTextEditor( | |||
325 | mScrollbar->setOnScrollEndCallback(mOnScrollEndCallback, mOnScrollEndData); | 327 | mScrollbar->setOnScrollEndCallback(mOnScrollEndCallback, mOnScrollEndData); |
326 | addChild(mScrollbar); | 328 | addChild(mScrollbar); |
327 | 329 | ||
328 | mBorder = new LLViewBorder( "text ed border", LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER ); | 330 | mBorder = new LLViewBorder( std::string("text ed border"), LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER ); |
329 | addChild( mBorder ); | 331 | addChild( mBorder ); |
330 | 332 | ||
331 | appendText(default_text, FALSE, FALSE); | 333 | appendText(default_text, FALSE, FALSE); |
@@ -333,7 +335,7 @@ LLTextEditor::LLTextEditor( | |||
333 | resetDirty(); // Update saved text state | 335 | resetDirty(); // Update saved text state |
334 | 336 | ||
335 | mParseHTML=FALSE; | 337 | mParseHTML=FALSE; |
336 | mHTML=""; | 338 | mHTML.clear(); |
337 | } | 339 | } |
338 | 340 | ||
339 | 341 | ||
@@ -399,7 +401,8 @@ void LLTextEditor::updateLineStartList(S32 startpos) | |||
399 | { | 401 | { |
400 | mLineStartList.push_back(line_info(seg_idx,seg_offset)); | 402 | mLineStartList.push_back(line_info(seg_idx,seg_offset)); |
401 | BOOL line_ended = FALSE; | 403 | BOOL line_ended = FALSE; |
402 | S32 line_width = 0; | 404 | S32 start_x = mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0; |
405 | S32 line_width = start_x; | ||
403 | while(!line_ended && seg_idx < seg_num) | 406 | while(!line_ended && seg_idx < seg_num) |
404 | { | 407 | { |
405 | LLTextSegment* segment = mSegments[seg_idx]; | 408 | LLTextSegment* segment = mSegments[seg_idx]; |
@@ -429,7 +432,7 @@ void LLTextEditor::updateLineStartList(S32 startpos) | |||
429 | const llwchar* str = mWText.c_str() + start_idx; | 432 | const llwchar* str = mWText.c_str() + start_idx; |
430 | S32 drawn = mGLFont->maxDrawableChars(str, (F32)abs(mTextRect.getWidth()) - line_width, | 433 | S32 drawn = mGLFont->maxDrawableChars(str, (F32)abs(mTextRect.getWidth()) - line_width, |
431 | end_idx - start_idx, mWordWrap, mAllowEmbeddedItems ); | 434 | end_idx - start_idx, mWordWrap, mAllowEmbeddedItems ); |
432 | if( 0 == drawn && line_width == 0) | 435 | if( 0 == drawn && line_width == start_x) |
433 | { | 436 | { |
434 | // If at the beginning of a line, draw at least one character, even if it doesn't all fit. | 437 | // If at the beginning of a line, draw at least one character, even if it doesn't all fit. |
435 | drawn = 1; | 438 | drawn = 1; |
@@ -496,7 +499,7 @@ BOOL LLTextEditor::truncate() | |||
496 | 499 | ||
497 | void LLTextEditor::setText(const LLStringExplicit &utf8str) | 500 | void LLTextEditor::setText(const LLStringExplicit &utf8str) |
498 | { | 501 | { |
499 | // LLString::removeCRLF(utf8str); | 502 | // LLStringUtil::removeCRLF(utf8str); |
500 | mUTF8Text = utf8str_removeCRLF(utf8str); | 503 | mUTF8Text = utf8str_removeCRLF(utf8str); |
501 | // mUTF8Text = utf8str; | 504 | // mUTF8Text = utf8str; |
502 | mWText = utf8str_to_wstring(mUTF8Text); | 505 | mWText = utf8str_to_wstring(mUTF8Text); |
@@ -538,7 +541,7 @@ void LLTextEditor::setValue(const LLSD& value) | |||
538 | setText(value.asString()); | 541 | setText(value.asString()); |
539 | } | 542 | } |
540 | 543 | ||
541 | const LLString& LLTextEditor::getText() const | 544 | const std::string& LLTextEditor::getText() const |
542 | { | 545 | { |
543 | if (!mTextIsUpToDate) | 546 | if (!mTextIsUpToDate) |
544 | { | 547 | { |
@@ -591,7 +594,7 @@ void LLTextEditor::setHideScrollbarForShortDocs(BOOL b) | |||
591 | } | 594 | } |
592 | } | 595 | } |
593 | 596 | ||
594 | void LLTextEditor::selectNext(const LLString& search_text_in, BOOL case_insensitive, BOOL wrap) | 597 | void LLTextEditor::selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap) |
595 | { | 598 | { |
596 | if (search_text_in.empty()) | 599 | if (search_text_in.empty()) |
597 | { | 600 | { |
@@ -602,8 +605,8 @@ void LLTextEditor::selectNext(const LLString& search_text_in, BOOL case_insensit | |||
602 | LLWString search_text = utf8str_to_wstring(search_text_in); | 605 | LLWString search_text = utf8str_to_wstring(search_text_in); |
603 | if (case_insensitive) | 606 | if (case_insensitive) |
604 | { | 607 | { |
605 | LLWString::toLower(text); | 608 | LLWStringUtil::toLower(text); |
606 | LLWString::toLower(search_text); | 609 | LLWStringUtil::toLower(search_text); |
607 | } | 610 | } |
608 | 611 | ||
609 | if (mIsSelecting) | 612 | if (mIsSelecting) |
@@ -641,7 +644,7 @@ void LLTextEditor::selectNext(const LLString& search_text_in, BOOL case_insensit | |||
641 | mSelectionStart = llmin((S32)getLength(), (S32)(mCursorPos + search_text.size())); | 644 | mSelectionStart = llmin((S32)getLength(), (S32)(mCursorPos + search_text.size())); |
642 | } | 645 | } |
643 | 646 | ||
644 | BOOL LLTextEditor::replaceText(const LLString& search_text_in, const LLString& replace_text, | 647 | BOOL LLTextEditor::replaceText(const std::string& search_text_in, const std::string& replace_text, |
645 | BOOL case_insensitive, BOOL wrap) | 648 | BOOL case_insensitive, BOOL wrap) |
646 | { | 649 | { |
647 | BOOL replaced = FALSE; | 650 | BOOL replaced = FALSE; |
@@ -659,8 +662,8 @@ BOOL LLTextEditor::replaceText(const LLString& search_text_in, const LLString& r | |||
659 | 662 | ||
660 | if (case_insensitive) | 663 | if (case_insensitive) |
661 | { | 664 | { |
662 | LLWString::toLower(selected_text); | 665 | LLWStringUtil::toLower(selected_text); |
663 | LLWString::toLower(search_text); | 666 | LLWStringUtil::toLower(search_text); |
664 | } | 667 | } |
665 | 668 | ||
666 | if (selected_text == search_text) | 669 | if (selected_text == search_text) |
@@ -674,7 +677,7 @@ BOOL LLTextEditor::replaceText(const LLString& search_text_in, const LLString& r | |||
674 | return replaced; | 677 | return replaced; |
675 | } | 678 | } |
676 | 679 | ||
677 | void LLTextEditor::replaceTextAll(const LLString& search_text, const LLString& replace_text, BOOL case_insensitive) | 680 | void LLTextEditor::replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive) |
678 | { | 681 | { |
679 | S32 cur_pos = mScrollbar->getDocPos(); | 682 | S32 cur_pos = mScrollbar->getDocPos(); |
680 | 683 | ||
@@ -800,7 +803,12 @@ void LLTextEditor::getSelectedSegments(std::vector<const LLTextSegment*>& segmen | |||
800 | 803 | ||
801 | S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const | 804 | S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const |
802 | { | 805 | { |
803 | // If round is true, if the position is on the right half of a character, the cursor | 806 | if(mShowLineNumbers) |
807 | { | ||
808 | local_x -= UI_TEXTEDITOR_LINE_NUMBER_MARGIN; | ||
809 | } | ||
810 | |||
811 | // If round is true, if the position is on the right half of a character, the cursor | ||
804 | // will be put to its right. If round is false, the cursor will always be put to the | 812 | // will be put to its right. If round is false, the cursor will always be put to the |
805 | // character's left. | 813 | // character's left. |
806 | 814 | ||
@@ -1061,7 +1069,7 @@ void LLTextEditor::selectAll() | |||
1061 | } | 1069 | } |
1062 | 1070 | ||
1063 | 1071 | ||
1064 | BOOL LLTextEditor::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) | 1072 | BOOL LLTextEditor::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) |
1065 | { | 1073 | { |
1066 | for ( child_list_const_iter_t child_it = getChildList()->begin(); | 1074 | for ( child_list_const_iter_t child_it = getChildList()->begin(); |
1067 | child_it != getChildList()->end(); ++child_it) | 1075 | child_it != getChildList()->end(); ++child_it) |
@@ -1392,7 +1400,7 @@ BOOL LLTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
1392 | BOOL LLTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, | 1400 | BOOL LLTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, |
1393 | BOOL drop, EDragAndDropType cargo_type, void *cargo_data, | 1401 | BOOL drop, EDragAndDropType cargo_type, void *cargo_data, |
1394 | EAcceptance *accept, | 1402 | EAcceptance *accept, |
1395 | LLString& tooltip_msg) | 1403 | std::string& tooltip_msg) |
1396 | { | 1404 | { |
1397 | *accept = ACCEPT_NO; | 1405 | *accept = ACCEPT_NO; |
1398 | 1406 | ||
@@ -1879,7 +1887,7 @@ void LLTextEditor::paste() | |||
1879 | 1887 | ||
1880 | // Clean up string (replace tabs and remove characters that our fonts don't support). | 1888 | // Clean up string (replace tabs and remove characters that our fonts don't support). |
1881 | LLWString clean_string(paste); | 1889 | LLWString clean_string(paste); |
1882 | LLWString::replaceTabsWithSpaces(clean_string, SPACES_PER_TAB); | 1890 | LLWStringUtil::replaceTabsWithSpaces(clean_string, SPACES_PER_TAB); |
1883 | if( mAllowEmbeddedItems ) | 1891 | if( mAllowEmbeddedItems ) |
1884 | { | 1892 | { |
1885 | const llwchar LF = 10; | 1893 | const llwchar LF = 10; |
@@ -2469,20 +2477,15 @@ void LLTextEditor::drawBackground() | |||
2469 | S32 right = getRect().getWidth(); | 2477 | S32 right = getRect().getWidth(); |
2470 | S32 bottom = 0; | 2478 | S32 bottom = 0; |
2471 | 2479 | ||
2472 | LLColor4 bg_color = mReadOnlyBgColor; | 2480 | LLColor4 bg_color = mReadOnly ? mReadOnlyBgColor |
2473 | 2481 | : gFocusMgr.getKeyboardFocus() == this ? mFocusBgColor : mWriteableBgColor; | |
2474 | if( !mReadOnly ) | 2482 | if( mShowLineNumbers ) { |
2475 | { | 2483 | gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor ); // line number area always read-only |
2476 | if (gFocusMgr.getKeyboardFocus() == this) | 2484 | gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, right, bottom, bg_color); // body text area to the right of line numbers |
2477 | { | 2485 | gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator |
2478 | bg_color = mFocusBgColor; | 2486 | } else { |
2479 | } | 2487 | gl_rect_2d(left, top, right, bottom, bg_color); // body text area |
2480 | else | ||
2481 | { | ||
2482 | bg_color = mWriteableBgColor; | ||
2483 | } | ||
2484 | } | 2488 | } |
2485 | gl_rect_2d(left, top, right, bottom, bg_color); | ||
2486 | 2489 | ||
2487 | LLView::draw(); | 2490 | LLView::draw(); |
2488 | } | 2491 | } |
@@ -2570,7 +2573,7 @@ void LLTextEditor::drawSelectionBackground() | |||
2570 | { | 2573 | { |
2571 | // extend selection slightly beyond end of line | 2574 | // extend selection slightly beyond end of line |
2572 | // to indicate selection of newline character (use "n" character to determine width) | 2575 | // to indicate selection of newline character (use "n" character to determine width) |
2573 | const LLWString nstr(utf8str_to_wstring(LLString("n"))); | 2576 | const LLWString nstr(utf8str_to_wstring(std::string("n"))); |
2574 | line_endings.push(mTextRect.mLeft + mGLFont->getWidth(line, 0, line_end - line_start, mAllowEmbeddedItems) + mGLFont->getWidth(nstr.c_str())); | 2577 | line_endings.push(mTextRect.mLeft + mGLFont->getWidth(line, 0, line_end - line_start, mAllowEmbeddedItems) + mGLFont->getWidth(nstr.c_str())); |
2575 | } | 2578 | } |
2576 | 2579 | ||
@@ -2595,12 +2598,13 @@ void LLTextEditor::drawSelectionBackground() | |||
2595 | const LLColor4& color = mReadOnly ? mReadOnlyBgColor : mWriteableBgColor; | 2598 | const LLColor4& color = mReadOnly ? mReadOnlyBgColor : mWriteableBgColor; |
2596 | F32 alpha = hasFocus() ? 1.f : 0.5f; | 2599 | F32 alpha = hasFocus() ? 1.f : 0.5f; |
2597 | gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); | 2600 | gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); |
2601 | S32 margin_offset = mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0; | ||
2598 | 2602 | ||
2599 | if( selection_left_y == selection_right_y ) | 2603 | if( selection_left_y == selection_right_y ) |
2600 | { | 2604 | { |
2601 | // Draw from selection start to selection end | 2605 | // Draw from selection start to selection end |
2602 | gl_rect_2d( selection_left_x, selection_left_y + line_height + 1, | 2606 | gl_rect_2d( selection_left_x + margin_offset, selection_left_y + line_height + 1, |
2603 | selection_right_x, selection_right_y); | 2607 | selection_right_x + margin_offset, selection_right_y); |
2604 | } | 2608 | } |
2605 | else | 2609 | else |
2606 | { | 2610 | { |
@@ -2612,16 +2616,16 @@ void LLTextEditor::drawSelectionBackground() | |||
2612 | 2616 | ||
2613 | S32 line_end = line_endings.front(); | 2617 | S32 line_end = line_endings.front(); |
2614 | line_endings.pop(); | 2618 | line_endings.pop(); |
2615 | gl_rect_2d( selection_left_x, selection_left_y + line_height + 1, | 2619 | gl_rect_2d( selection_left_x + margin_offset, selection_left_y + line_height + 1, |
2616 | line_end, selection_left_y ); | 2620 | line_end + margin_offset, selection_left_y ); |
2617 | 2621 | ||
2618 | S32 line_num = left_line_num + 1; | 2622 | S32 line_num = left_line_num + 1; |
2619 | while(line_endings.size()) | 2623 | while(line_endings.size()) |
2620 | { | 2624 | { |
2621 | S32 vert_offset = -(line_num - left_line_num) * line_height; | 2625 | S32 vert_offset = -(line_num - left_line_num) * line_height; |
2622 | // Draw the block between the two lines | 2626 | // Draw the block between the two lines |
2623 | gl_rect_2d( mTextRect.mLeft, selection_left_y + vert_offset + line_height + 1, | 2627 | gl_rect_2d( mTextRect.mLeft + margin_offset, selection_left_y + vert_offset + line_height + 1, |
2624 | line_endings.front(), selection_left_y + vert_offset); | 2628 | line_endings.front() + margin_offset, selection_left_y + vert_offset); |
2625 | line_endings.pop(); | 2629 | line_endings.pop(); |
2626 | line_num++; | 2630 | line_num++; |
2627 | } | 2631 | } |
@@ -2631,8 +2635,8 @@ void LLTextEditor::drawSelectionBackground() | |||
2631 | { | 2635 | { |
2632 | selection_right_x += CURSOR_THICKNESS; | 2636 | selection_right_x += CURSOR_THICKNESS; |
2633 | } | 2637 | } |
2634 | gl_rect_2d( mTextRect.mLeft, selection_right_y + line_height + 1, | 2638 | gl_rect_2d( mTextRect.mLeft + margin_offset, selection_right_y + line_height + 1, |
2635 | selection_right_x, selection_right_y ); | 2639 | selection_right_x + margin_offset, selection_right_y ); |
2636 | } | 2640 | } |
2637 | } | 2641 | } |
2638 | } | 2642 | } |
@@ -2695,6 +2699,11 @@ void LLTextEditor::drawCursor() | |||
2695 | cur_pos++; | 2699 | cur_pos++; |
2696 | } | 2700 | } |
2697 | 2701 | ||
2702 | if(mShowLineNumbers) | ||
2703 | { | ||
2704 | cursor_left += UI_TEXTEDITOR_LINE_NUMBER_MARGIN; | ||
2705 | } | ||
2706 | |||
2698 | // Draw the cursor | 2707 | // Draw the cursor |
2699 | if( cursor_visible ) | 2708 | if( cursor_visible ) |
2700 | { | 2709 | { |
@@ -2707,7 +2716,7 @@ void LLTextEditor::drawCursor() | |||
2707 | if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) | 2716 | if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) |
2708 | { | 2717 | { |
2709 | cursor_left += CURSOR_THICKNESS; | 2718 | cursor_left += CURSOR_THICKNESS; |
2710 | const LLWString space(utf8str_to_wstring(LLString(" "))); | 2719 | const LLWString space(utf8str_to_wstring(std::string(" "))); |
2711 | F32 spacew = mGLFont->getWidthF32(space.c_str()); | 2720 | F32 spacew = mGLFont->getWidthF32(space.c_str()); |
2712 | if (mCursorPos == line_end) | 2721 | if (mCursorPos == line_end) |
2713 | { | 2722 | { |
@@ -2861,10 +2870,7 @@ void LLTextEditor::drawText() | |||
2861 | { | 2870 | { |
2862 | const LLWString &text = mWText; | 2871 | const LLWString &text = mWText; |
2863 | const S32 text_len = getLength(); | 2872 | const S32 text_len = getLength(); |
2864 | if( text_len <= 0 ) | 2873 | if( text_len <= 0 ) return; |
2865 | { | ||
2866 | return; | ||
2867 | } | ||
2868 | S32 selection_left = -1; | 2874 | S32 selection_left = -1; |
2869 | S32 selection_right = -1; | 2875 | S32 selection_right = -1; |
2870 | // Draw selection even if we don't have keyboard focus for search/replace | 2876 | // Draw selection even if we don't have keyboard focus for search/replace |
@@ -2876,14 +2882,26 @@ void LLTextEditor::drawText() | |||
2876 | 2882 | ||
2877 | LLGLSUIDefault gls_ui; | 2883 | LLGLSUIDefault gls_ui; |
2878 | 2884 | ||
2879 | S32 cur_line = mScrollbar->getDocPos(); | 2885 | // There are several concepts that are important for understanding the following drawing code. |
2886 | // The document is logically a sequence of characters (stored in a LLWString). | ||
2887 | // Variables below with "start" or "end" in their names refer to positions or offsets into it. | ||
2888 | // Next there are two kinds of "line" variables to understand. Newline characters in the | ||
2889 | // character sequence represent logical lines. These are what get numbered and so variables | ||
2890 | // representing this kind of line have "num" in their names. | ||
2891 | // The others represent line fragments or displayed lines which the scrollbar deals with. | ||
2892 | // When the "show line numbers" property is turned on, we draw line numbers to the left of the | ||
2893 | // beginning of each logical line and not in front of wrapped "continuation" display lines. -MG | ||
2894 | |||
2895 | S32 cur_line = mScrollbar->getDocPos(); // scrollbar counts each wrap as a new line. | ||
2880 | S32 num_lines = getLineCount(); | 2896 | S32 num_lines = getLineCount(); |
2881 | if (cur_line >= num_lines) | 2897 | if (cur_line >= num_lines) return; |
2882 | { | ||
2883 | return; | ||
2884 | } | ||
2885 | |||
2886 | S32 line_start = getLineStart(cur_line); | 2898 | S32 line_start = getLineStart(cur_line); |
2899 | S32 prev_start = getLineStart(cur_line-1); | ||
2900 | S32 cur_line_num = getLineForPosition(line_start); // doesn't count wraps. i.e. only counts newlines. | ||
2901 | S32 prev_line_num = getLineForPosition(prev_start); | ||
2902 | BOOL cur_line_is_continuation = cur_line_num > 0 && cur_line_num == prev_line_num; | ||
2903 | BOOL line_wraps = FALSE; | ||
2904 | |||
2887 | LLTextSegment t(line_start); | 2905 | LLTextSegment t(line_start); |
2888 | segment_list_t::iterator seg_iter; | 2906 | segment_list_t::iterator seg_iter; |
2889 | seg_iter = std::upper_bound(mSegments.begin(), mSegments.end(), &t, LLTextSegment::compare()); | 2907 | seg_iter = std::upper_bound(mSegments.begin(), mSegments.end(), &t, LLTextSegment::compare()); |
@@ -2902,12 +2920,36 @@ void LLTextEditor::drawText() | |||
2902 | next_start = getLineStart(cur_line + 1); | 2920 | next_start = getLineStart(cur_line + 1); |
2903 | line_end = next_start; | 2921 | line_end = next_start; |
2904 | } | 2922 | } |
2905 | if ( text[line_end-1] == '\n' ) | 2923 | line_wraps = text[line_end-1] != '\n'; |
2924 | if ( ! line_wraps ) | ||
2906 | { | 2925 | { |
2907 | --line_end; | 2926 | --line_end; // don't attempt to draw the newline char. |
2908 | } | 2927 | } |
2909 | 2928 | ||
2910 | F32 text_x = (F32)mTextRect.mLeft; | 2929 | F32 text_start = (F32)mTextRect.mLeft; |
2930 | F32 text_x = text_start + (mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0); | ||
2931 | |||
2932 | // draw the line numbers | ||
2933 | if( mShowLineNumbers && !cur_line_is_continuation) | ||
2934 | { | ||
2935 | const LLFontGL *num_font = LLFontGL::sMonospace; | ||
2936 | F32 y_top = text_y + ((F32)llround(num_font->getLineHeight()) / 2); | ||
2937 | const LLWString ltext = utf8str_to_wstring(llformat("%*d", UI_TEXTEDITOR_LINE_NUMBER_DIGITS, cur_line_num )); | ||
2938 | BOOL is_cur_line = getCurrentLine() == cur_line_num; | ||
2939 | const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL; | ||
2940 | const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor; | ||
2941 | num_font->render( | ||
2942 | ltext, // string to draw | ||
2943 | 0, // begin offset | ||
2944 | 3., // x | ||
2945 | y_top, // y | ||
2946 | fg_color, | ||
2947 | LLFontGL::LEFT, // horizontal alignment | ||
2948 | LLFontGL::VCENTER, // vertical alignment | ||
2949 | style, | ||
2950 | S32_MAX, // max chars | ||
2951 | UI_TEXTEDITOR_LINE_NUMBER_MARGIN); // max pixels | ||
2952 | } | ||
2911 | 2953 | ||
2912 | S32 seg_start = line_start; | 2954 | S32 seg_start = line_start; |
2913 | while( seg_start < line_end ) | 2955 | while( seg_start < line_end ) |
@@ -2952,16 +2994,28 @@ void LLTextEditor::drawText() | |||
2952 | 2994 | ||
2953 | drawClippedSegment( text, seg_start, clipped_end, text_x, text_y, selection_left, selection_right, style, &text_x ); | 2995 | drawClippedSegment( text, seg_start, clipped_end, text_x, text_y, selection_left, selection_right, style, &text_x ); |
2954 | 2996 | ||
2997 | if( text_x == text_start && mShowLineNumbers ) | ||
2998 | { | ||
2999 | text_x += UI_TEXTEDITOR_LINE_NUMBER_MARGIN; | ||
3000 | } | ||
3001 | |||
2955 | // Note: text_x is incremented by drawClippedSegment() | 3002 | // Note: text_x is incremented by drawClippedSegment() |
2956 | seg_start += clipped_len; | 3003 | seg_start += clipped_len; |
2957 | } | 3004 | } |
2958 | } | 3005 | } |
2959 | 3006 | ||
2960 | // move down one line | 3007 | // move down one line |
2961 | text_y -= (F32)line_height; | 3008 | text_y -= (F32)line_height; |
3009 | |||
3010 | if( line_wraps ) | ||
3011 | { | ||
3012 | cur_line_num--; | ||
3013 | } | ||
3014 | cur_line_is_continuation = line_wraps; // so as to not not number the continuation lines | ||
2962 | 3015 | ||
2963 | line_start = next_start; | 3016 | line_start = next_start; |
2964 | cur_line++; | 3017 | cur_line++; |
3018 | cur_line_num++; | ||
2965 | } | 3019 | } |
2966 | } | 3020 | } |
2967 | 3021 | ||
@@ -3083,7 +3137,7 @@ void LLTextEditor::onTabInto() | |||
3083 | // virtual | 3137 | // virtual |
3084 | void LLTextEditor::clear() | 3138 | void LLTextEditor::clear() |
3085 | { | 3139 | { |
3086 | setText(LLString::null); | 3140 | setText(LLStringUtil::null); |
3087 | } | 3141 | } |
3088 | 3142 | ||
3089 | // Start or stop the editor from accepting text-editing keystrokes | 3143 | // Start or stop the editor from accepting text-editing keystrokes |
@@ -3260,8 +3314,7 @@ void LLTextEditor::setCursorAndScrollToEnd() | |||
3260 | updateScrollFromCursor(); | 3314 | updateScrollFromCursor(); |
3261 | } | 3315 | } |
3262 | 3316 | ||
3263 | 3317 | void LLTextEditor::getLineAndColumnForPosition( S32 position, S32* line, S32* col, BOOL include_wordwrap ) | |
3264 | void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ) | ||
3265 | { | 3318 | { |
3266 | if( include_wordwrap ) | 3319 | if( include_wordwrap ) |
3267 | { | 3320 | { |
@@ -3273,7 +3326,7 @@ void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wo | |||
3273 | S32 line_count = 0; | 3326 | S32 line_count = 0; |
3274 | S32 line_start = 0; | 3327 | S32 line_start = 0; |
3275 | S32 i; | 3328 | S32 i; |
3276 | for( i = 0; text[i] && (i < mCursorPos); i++ ) | 3329 | for( i = 0; text[i] && (i < position); i++ ) |
3277 | { | 3330 | { |
3278 | if( '\n' == text[i] ) | 3331 | if( '\n' == text[i] ) |
3279 | { | 3332 | { |
@@ -3286,6 +3339,23 @@ void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wo | |||
3286 | } | 3339 | } |
3287 | } | 3340 | } |
3288 | 3341 | ||
3342 | void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ) | ||
3343 | { | ||
3344 | getLineAndColumnForPosition(mCursorPos, line, col, include_wordwrap); | ||
3345 | } | ||
3346 | |||
3347 | S32 LLTextEditor::getCurrentLine() | ||
3348 | { | ||
3349 | return getLineForPosition(mCursorPos); | ||
3350 | } | ||
3351 | |||
3352 | S32 LLTextEditor::getLineForPosition(S32 position) | ||
3353 | { | ||
3354 | S32 line, col; | ||
3355 | getLineAndColumnForPosition(position, &line, &col, FALSE); | ||
3356 | return line; | ||
3357 | } | ||
3358 | |||
3289 | 3359 | ||
3290 | void LLTextEditor::endOfLine() | 3360 | void LLTextEditor::endOfLine() |
3291 | { | 3361 | { |
@@ -3364,20 +3434,26 @@ void LLTextEditor::reshape(S32 width, S32 height, BOOL called_from_parent) | |||
3364 | { | 3434 | { |
3365 | LLView::reshape( width, height, called_from_parent ); | 3435 | LLView::reshape( width, height, called_from_parent ); |
3366 | 3436 | ||
3367 | // if scrolled to bottom, stay at bottom | 3437 | // do this first after reshape, because other things depend on |
3368 | // unless user is editing text | 3438 | // up-to-date mTextRect |
3369 | if (mScrolledToBottom && mTrackBottom && !hasFocus()) | ||
3370 | { | ||
3371 | endOfDoc(); | ||
3372 | } | ||
3373 | |||
3374 | updateTextRect(); | 3439 | updateTextRect(); |
3440 | |||
3441 | updateLineStartList(); | ||
3442 | |||
3443 | // propagate shape information to scrollbar | ||
3444 | mScrollbar->setDocSize( getLineCount() ); | ||
3375 | 3445 | ||
3376 | S32 line_height = llround( mGLFont->getLineHeight() ); | 3446 | S32 line_height = llround( mGLFont->getLineHeight() ); |
3377 | S32 page_lines = mTextRect.getHeight() / line_height; | 3447 | S32 page_lines = mTextRect.getHeight() / line_height; |
3378 | mScrollbar->setPageSize( page_lines ); | 3448 | mScrollbar->setPageSize( page_lines ); |
3379 | 3449 | ||
3380 | updateLineStartList(); | 3450 | // if scrolled to bottom, stay at bottom |
3451 | // unless user is editing text | ||
3452 | // do this after updating page size | ||
3453 | if (mScrolledToBottom && mTrackBottom && !hasFocus()) | ||
3454 | { | ||
3455 | endOfDoc(); | ||
3456 | } | ||
3381 | } | 3457 | } |
3382 | 3458 | ||
3383 | void LLTextEditor::autoIndent() | 3459 | void LLTextEditor::autoIndent() |
@@ -3411,7 +3487,7 @@ void LLTextEditor::autoIndent() | |||
3411 | } | 3487 | } |
3412 | 3488 | ||
3413 | // Inserts new text at the cursor position | 3489 | // Inserts new text at the cursor position |
3414 | void LLTextEditor::insertText(const LLString &new_text) | 3490 | void LLTextEditor::insertText(const std::string &new_text) |
3415 | { | 3491 | { |
3416 | BOOL enabled = getEnabled(); | 3492 | BOOL enabled = getEnabled(); |
3417 | setEnabled( TRUE ); | 3493 | setEnabled( TRUE ); |
@@ -3431,11 +3507,11 @@ void LLTextEditor::insertText(const LLString &new_text) | |||
3431 | } | 3507 | } |
3432 | 3508 | ||
3433 | 3509 | ||
3434 | void LLTextEditor::appendColoredText(const LLString &new_text, | 3510 | void LLTextEditor::appendColoredText(const std::string &new_text, |
3435 | bool allow_undo, | 3511 | bool allow_undo, |
3436 | bool prepend_newline, | 3512 | bool prepend_newline, |
3437 | const LLColor4 &color, | 3513 | const LLColor4 &color, |
3438 | const LLString& font_name) | 3514 | const std::string& font_name) |
3439 | { | 3515 | { |
3440 | LLStyleSP style(new LLStyle); | 3516 | LLStyleSP style(new LLStyle); |
3441 | style->setVisible(true); | 3517 | style->setVisible(true); |
@@ -3444,7 +3520,7 @@ void LLTextEditor::appendColoredText(const LLString &new_text, | |||
3444 | appendStyledText(new_text, allow_undo, prepend_newline, &style); | 3520 | appendStyledText(new_text, allow_undo, prepend_newline, &style); |
3445 | } | 3521 | } |
3446 | 3522 | ||
3447 | void LLTextEditor::appendStyledText(const LLString &new_text, | 3523 | void LLTextEditor::appendStyledText(const std::string &new_text, |
3448 | bool allow_undo, | 3524 | bool allow_undo, |
3449 | bool prepend_newline, | 3525 | bool prepend_newline, |
3450 | const LLStyleSP *stylep) | 3526 | const LLStyleSP *stylep) |
@@ -3453,7 +3529,7 @@ void LLTextEditor::appendStyledText(const LLString &new_text, | |||
3453 | { | 3529 | { |
3454 | 3530 | ||
3455 | S32 start=0,end=0; | 3531 | S32 start=0,end=0; |
3456 | LLString text = new_text; | 3532 | std::string text = new_text; |
3457 | while ( findHTML(text, &start, &end) ) | 3533 | while ( findHTML(text, &start, &end) ) |
3458 | { | 3534 | { |
3459 | LLStyleSP html(new LLStyle); | 3535 | LLStyleSP html(new LLStyle); |
@@ -3487,7 +3563,7 @@ void LLTextEditor::appendStyledText(const LLString &new_text, | |||
3487 | } | 3563 | } |
3488 | 3564 | ||
3489 | // Appends new text to end of document | 3565 | // Appends new text to end of document |
3490 | void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool prepend_newline, | 3566 | void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline, |
3491 | const LLStyleSP *stylep) | 3567 | const LLStyleSP *stylep) |
3492 | { | 3568 | { |
3493 | // Save old state | 3569 | // Save old state |
@@ -3507,7 +3583,7 @@ void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool pr | |||
3507 | if (getLength() != 0 | 3583 | if (getLength() != 0 |
3508 | && prepend_newline) | 3584 | && prepend_newline) |
3509 | { | 3585 | { |
3510 | LLString final_text = "\n"; | 3586 | std::string final_text = "\n"; |
3511 | final_text += new_text; | 3587 | final_text += new_text; |
3512 | append(utf8str_to_wstring(final_text), TRUE); | 3588 | append(utf8str_to_wstring(final_text), TRUE); |
3513 | } | 3589 | } |
@@ -3543,6 +3619,10 @@ void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool pr | |||
3543 | { | 3619 | { |
3544 | mSelectionStart = selection_start; | 3620 | mSelectionStart = selection_start; |
3545 | mSelectionEnd = selection_end; | 3621 | mSelectionEnd = selection_end; |
3622 | |||
3623 | |||
3624 | |||
3625 | |||
3546 | mIsSelecting = was_selecting; | 3626 | mIsSelecting = was_selecting; |
3547 | setCursorPos(cursor_pos); | 3627 | setCursorPos(cursor_pos); |
3548 | } | 3628 | } |
@@ -3559,6 +3639,14 @@ void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool pr | |||
3559 | { | 3639 | { |
3560 | blockUndo(); | 3640 | blockUndo(); |
3561 | } | 3641 | } |
3642 | |||
3643 | // if scrolled to bottom, stay at bottom | ||
3644 | // unless user is editing text | ||
3645 | // do this after updating page size | ||
3646 | if (mScrolledToBottom && mTrackBottom && !hasFocus()) | ||
3647 | { | ||
3648 | endOfDoc(); | ||
3649 | } | ||
3562 | } | 3650 | } |
3563 | 3651 | ||
3564 | void LLTextEditor::removeTextFromEnd(S32 num_chars) | 3652 | void LLTextEditor::removeTextFromEnd(S32 num_chars) |
@@ -3688,20 +3776,18 @@ void LLTextEditor::updateTextRect() | |||
3688 | getRect().getHeight() - 2 * UI_TEXTEDITOR_BORDER - UI_TEXTEDITOR_V_PAD_TOP ); | 3776 | getRect().getHeight() - 2 * UI_TEXTEDITOR_BORDER - UI_TEXTEDITOR_V_PAD_TOP ); |
3689 | } | 3777 | } |
3690 | 3778 | ||
3691 | void LLTextEditor::loadKeywords(const LLString& filename, | 3779 | void LLTextEditor::loadKeywords(const std::string& filename, |
3692 | const LLDynamicArray<const char*>& funcs, | 3780 | const std::vector<std::string>& funcs, |
3693 | const LLDynamicArray<const char*>& tooltips, | 3781 | const std::vector<std::string>& tooltips, |
3694 | const LLColor3& color) | 3782 | const LLColor3& color) |
3695 | { | 3783 | { |
3696 | if(mKeywords.loadFromFile(filename)) | 3784 | if(mKeywords.loadFromFile(filename)) |
3697 | { | 3785 | { |
3698 | S32 count = funcs.count(); | 3786 | S32 count = llmin(funcs.size(), tooltips.size()); |
3699 | LLString name; | ||
3700 | for(S32 i = 0; i < count; i++) | 3787 | for(S32 i = 0; i < count; i++) |
3701 | { | 3788 | { |
3702 | name = funcs.get(i); | 3789 | std::string name = utf8str_trim(funcs[i]); |
3703 | name = utf8str_trim(name); | 3790 | mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] ); |
3704 | mKeywords.addToken(LLKeywordToken::WORD, name.c_str(), color, tooltips.get(i) ); | ||
3705 | } | 3791 | } |
3706 | 3792 | ||
3707 | mKeywords.findSegments( &mSegments, mWText, mDefaultColor ); | 3793 | mKeywords.findSegments( &mSegments, mWText, mDefaultColor ); |
@@ -3843,9 +3929,9 @@ BOOL LLTextEditor::handleMouseUpOverSegment(S32 x, S32 y, MASK mask) | |||
3843 | //Special handling for slurls | 3929 | //Special handling for slurls |
3844 | if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) | 3930 | if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) |
3845 | { | 3931 | { |
3846 | if (mURLcallback!=NULL) (*mURLcallback)(mHTML.c_str()); | 3932 | if (mURLcallback!=NULL) (*mURLcallback)(mHTML); |
3847 | } | 3933 | } |
3848 | mHTML=""; | 3934 | mHTML.clear(); |
3849 | } | 3935 | } |
3850 | } | 3936 | } |
3851 | 3937 | ||
@@ -3897,7 +3983,7 @@ void LLTextEditor::setOnScrollEndCallback(void (*callback)(void*), void* userdat | |||
3897 | /////////////////////////////////////////////////////////////////// | 3983 | /////////////////////////////////////////////////////////////////// |
3898 | // Hack for Notecards | 3984 | // Hack for Notecards |
3899 | 3985 | ||
3900 | BOOL LLTextEditor::importBuffer(const LLString& buffer ) | 3986 | BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) |
3901 | { | 3987 | { |
3902 | std::istringstream instream(buffer); | 3988 | std::istringstream instream(buffer); |
3903 | 3989 | ||
@@ -3986,7 +4072,7 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) | |||
3986 | return success; | 4072 | return success; |
3987 | } | 4073 | } |
3988 | 4074 | ||
3989 | BOOL LLTextEditor::exportBuffer(LLString &buffer ) | 4075 | BOOL LLTextEditor::exportBuffer(std::string &buffer ) |
3990 | { | 4076 | { |
3991 | std::ostringstream outstream(buffer); | 4077 | std::ostringstream outstream(buffer); |
3992 | 4078 | ||
@@ -4003,7 +4089,11 @@ BOOL LLTextEditor::exportBuffer(LLString &buffer ) | |||
4003 | ////////////////////////////////////////////////////////////////////////// | 4089 | ////////////////////////////////////////////////////////////////////////// |
4004 | // LLTextSegment | 4090 | // LLTextSegment |
4005 | 4091 | ||
4006 | LLTextSegment::LLTextSegment(S32 start) : mStart(start) | 4092 | LLTextSegment::LLTextSegment(S32 start) : |
4093 | mStart(start), | ||
4094 | mEnd(0), | ||
4095 | mToken(NULL), | ||
4096 | mIsDefault(FALSE) | ||
4007 | { | 4097 | { |
4008 | } | 4098 | } |
4009 | LLTextSegment::LLTextSegment( const LLStyleSP& style, S32 start, S32 end ) : | 4099 | LLTextSegment::LLTextSegment( const LLStyleSP& style, S32 start, S32 end ) : |
@@ -4015,7 +4105,7 @@ LLTextSegment::LLTextSegment( const LLStyleSP& style, S32 start, S32 end ) : | |||
4015 | { | 4105 | { |
4016 | } | 4106 | } |
4017 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible) : | 4107 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible) : |
4018 | mStyle(new LLStyle(is_visible,color,"")), | 4108 | mStyle(new LLStyle(is_visible,color,LLStringUtil::null)), |
4019 | mStart( start), | 4109 | mStart( start), |
4020 | mEnd( end ), | 4110 | mEnd( end ), |
4021 | mToken(NULL), | 4111 | mToken(NULL), |
@@ -4023,7 +4113,7 @@ LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is | |||
4023 | { | 4113 | { |
4024 | } | 4114 | } |
4025 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : | 4115 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : |
4026 | mStyle(new LLStyle(TRUE, color,"" )), | 4116 | mStyle(new LLStyle(TRUE, color,LLStringUtil::null )), |
4027 | mStart( start), | 4117 | mStart( start), |
4028 | mEnd( end ), | 4118 | mEnd( end ), |
4029 | mToken(NULL), | 4119 | mToken(NULL), |
@@ -4031,7 +4121,7 @@ LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : | |||
4031 | { | 4121 | { |
4032 | } | 4122 | } |
4033 | LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : | 4123 | LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : |
4034 | mStyle(new LLStyle(TRUE, color,"" )), | 4124 | mStyle(new LLStyle(TRUE, color,LLStringUtil::null )), |
4035 | mStart( start), | 4125 | mStart( start), |
4036 | mEnd( end ), | 4126 | mEnd( end ), |
4037 | mToken(NULL), | 4127 | mToken(NULL), |
@@ -4039,7 +4129,7 @@ LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : | |||
4039 | { | 4129 | { |
4040 | } | 4130 | } |
4041 | 4131 | ||
4042 | BOOL LLTextSegment::getToolTip(LLString& msg) const | 4132 | BOOL LLTextSegment::getToolTip(std::string& msg) const |
4043 | { | 4133 | { |
4044 | if (mToken && !mToken->getToolTip().empty()) | 4134 | if (mToken && !mToken->getToolTip().empty()) |
4045 | { | 4135 | { |
@@ -4094,7 +4184,7 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const | |||
4094 | // static | 4184 | // static |
4095 | LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 4185 | LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
4096 | { | 4186 | { |
4097 | LLString name("text_editor"); | 4187 | std::string name("text_editor"); |
4098 | node->getAttributeString("name", name); | 4188 | node->getAttributeString("name", name); |
4099 | 4189 | ||
4100 | LLRect rect; | 4190 | LLRect rect; |
@@ -4108,7 +4198,7 @@ LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory | |||
4108 | 4198 | ||
4109 | LLFontGL* font = LLView::selectFont(node); | 4199 | LLFontGL* font = LLView::selectFont(node); |
4110 | 4200 | ||
4111 | LLString text = node->getTextContents().substr(0, max_text_length - 1); | 4201 | std::string text = node->getTextContents().substr(0, max_text_length - 1); |
4112 | 4202 | ||
4113 | LLTextEditor* text_editor = new LLTextEditor(name, | 4203 | LLTextEditor* text_editor = new LLTextEditor(name, |
4114 | rect, | 4204 | rect, |
@@ -4134,6 +4224,8 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node) | |||
4134 | node->getAttributeBOOL("word_wrap", word_wrap); | 4224 | node->getAttributeBOOL("word_wrap", word_wrap); |
4135 | setWordWrap(word_wrap); | 4225 | setWordWrap(word_wrap); |
4136 | 4226 | ||
4227 | node->getAttributeBOOL("show_line_numbers", mShowLineNumbers); | ||
4228 | |||
4137 | node->getAttributeBOOL("track_bottom", mTrackBottom); | 4229 | node->getAttributeBOOL("track_bottom", mTrackBottom); |
4138 | 4230 | ||
4139 | LLColor4 color; | 4231 | LLColor4 color; |
@@ -4160,26 +4252,29 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node) | |||
4160 | } | 4252 | } |
4161 | 4253 | ||
4162 | /////////////////////////////////////////////////////////////////// | 4254 | /////////////////////////////////////////////////////////////////// |
4163 | S32 LLTextEditor::findHTMLToken(const LLString &line, S32 pos, BOOL reverse) const | 4255 | // Refactoring note: We may eventually want to replace this with boost::regex or |
4256 | // boost::tokenizer capabilities since we've already fixed at least two JIRAs | ||
4257 | // concerning logic issues associated with this function. | ||
4258 | S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) const | ||
4164 | { | 4259 | { |
4165 | LLString openers=" \t('\"[{<>"; | 4260 | std::string openers=" \t\n('\"[{<>"; |
4166 | LLString closers=" \t)'\"]}><;"; | 4261 | std::string closers=" \t\n)'\"]}><;"; |
4167 | 4262 | ||
4168 | S32 m2; | 4263 | S32 m2 = 0; |
4169 | S32 retval; | 4264 | S32 retval = 0; |
4170 | 4265 | ||
4171 | if (reverse) | 4266 | if (reverse) |
4172 | { | 4267 | { |
4173 | 4268 | ||
4174 | for (retval=pos; retval>0; retval--) | 4269 | for (retval=pos; retval >= 0; retval--) |
4175 | { | 4270 | { |
4176 | m2 = openers.find(line.substr(retval,1)); | 4271 | m2 = openers.find(line.substr(retval,1)); |
4177 | if (m2 >= 0) | 4272 | if (m2 >= 0) |
4178 | { | 4273 | { |
4179 | retval++; | ||
4180 | break; | 4274 | break; |
4181 | } | 4275 | } |
4182 | } | 4276 | } |
4277 | return retval+1; | ||
4183 | } | 4278 | } |
4184 | else | 4279 | else |
4185 | { | 4280 | { |
@@ -4192,12 +4287,11 @@ S32 LLTextEditor::findHTMLToken(const LLString &line, S32 pos, BOOL reverse) con | |||
4192 | break; | 4287 | break; |
4193 | } | 4288 | } |
4194 | } | 4289 | } |
4195 | } | 4290 | return retval; |
4196 | 4291 | } | |
4197 | return retval; | ||
4198 | } | 4292 | } |
4199 | 4293 | ||
4200 | BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const | 4294 | BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const |
4201 | { | 4295 | { |
4202 | 4296 | ||
4203 | S32 m1,m2,m3; | 4297 | S32 m1,m2,m3; |
@@ -4214,7 +4308,7 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const | |||
4214 | m2 = line.substr(*begin,(m1 - *begin)).find("http"); | 4308 | m2 = line.substr(*begin,(m1 - *begin)).find("http"); |
4215 | m3 = line.substr(*begin,(m1 - *begin)).find("secondlife"); | 4309 | m3 = line.substr(*begin,(m1 - *begin)).find("secondlife"); |
4216 | 4310 | ||
4217 | LLString badneighbors=".,<>?';\"][}{=-+_)(*&^%$#@!~`\t\r\n\\"; | 4311 | std::string badneighbors=".,<>?';\"][}{=-+_)(*&^%$#@!~`\t\r\n\\"; |
4218 | 4312 | ||
4219 | if (m2 >= 0 || m3>=0) | 4313 | if (m2 >= 0 || m3>=0) |
4220 | { | 4314 | { |
@@ -4240,7 +4334,7 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const | |||
4240 | 4334 | ||
4241 | if ( ( *end - m1 ) > 2 && m1 > *begin) | 4335 | if ( ( *end - m1 ) > 2 && m1 > *begin) |
4242 | { | 4336 | { |
4243 | LLString badneighbors=".,<>/?';\"][}{=-+_)(*&^%$#@!~`"; | 4337 | std::string badneighbors=".,<>/?';\"][}{=-+_)(*&^%$#@!~`"; |
4244 | m2 = badneighbors.find(line.substr(m1+1,1)); | 4338 | m2 = badneighbors.find(line.substr(m1+1,1)); |
4245 | m3 = badneighbors.find(line.substr(m1-1,1)); | 4339 | m3 = badneighbors.find(line.substr(m1-1,1)); |
4246 | if (m3<0 && m2<0) | 4340 | if (m3<0 && m2<0) |
@@ -4256,8 +4350,8 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) const | |||
4256 | { | 4350 | { |
4257 | S32 strpos, strpos2; | 4351 | S32 strpos, strpos2; |
4258 | 4352 | ||
4259 | LLString url = line.substr(*begin,*end - *begin); | 4353 | std::string url = line.substr(*begin,*end - *begin); |
4260 | LLString slurlID = "slurl.com/secondlife/"; | 4354 | std::string slurlID = "slurl.com/secondlife/"; |
4261 | strpos = url.find(slurlID); | 4355 | strpos = url.find(slurlID); |
4262 | 4356 | ||
4263 | if (strpos < 0) | 4357 | if (strpos < 0) |
diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index d5a68ca..3cff91d 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h | |||
@@ -62,10 +62,10 @@ public: | |||
62 | static const llwchar LAST_EMBEDDED_CHAR = 0x10ffff; | 62 | static const llwchar LAST_EMBEDDED_CHAR = 0x10ffff; |
63 | static const S32 MAX_EMBEDDED_ITEMS = LAST_EMBEDDED_CHAR - FIRST_EMBEDDED_CHAR + 1; | 63 | static const S32 MAX_EMBEDDED_ITEMS = LAST_EMBEDDED_CHAR - FIRST_EMBEDDED_CHAR + 1; |
64 | 64 | ||
65 | LLTextEditor(const LLString& name, | 65 | LLTextEditor(const std::string& name, |
66 | const LLRect& rect, | 66 | const LLRect& rect, |
67 | S32 max_length, | 67 | S32 max_length, |
68 | const LLString &default_text, | 68 | const std::string &default_text, |
69 | const LLFontGL* glfont = NULL, | 69 | const LLFontGL* glfont = NULL, |
70 | BOOL allow_embedded_items = FALSE); | 70 | BOOL allow_embedded_items = FALSE); |
71 | 71 | ||
@@ -85,10 +85,10 @@ public: | |||
85 | virtual BOOL handleKeyHere(KEY key, MASK mask ); | 85 | virtual BOOL handleKeyHere(KEY key, MASK mask ); |
86 | virtual BOOL handleUnicodeCharHere(llwchar uni_char); | 86 | virtual BOOL handleUnicodeCharHere(llwchar uni_char); |
87 | 87 | ||
88 | virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | 88 | virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); |
89 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 89 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
90 | EDragAndDropType cargo_type, void *cargo_data, | 90 | EDragAndDropType cargo_type, void *cargo_data, |
91 | EAcceptance *accept, LLString& tooltip_msg); | 91 | EAcceptance *accept, std::string& tooltip_msg); |
92 | virtual void onMouseCaptureLost(); | 92 | virtual void onMouseCaptureLost(); |
93 | 93 | ||
94 | // view overrides | 94 | // view overrides |
@@ -123,9 +123,9 @@ public: | |||
123 | virtual void deselect(); | 123 | virtual void deselect(); |
124 | virtual BOOL canDeselect() const; | 124 | virtual BOOL canDeselect() const; |
125 | 125 | ||
126 | void selectNext(const LLString& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE); | 126 | void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE); |
127 | BOOL replaceText(const LLString& search_text, const LLString& replace_text, BOOL case_insensitive, BOOL wrap = TRUE); | 127 | BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE); |
128 | void replaceTextAll(const LLString& search_text, const LLString& replace_text, BOOL case_insensitive); | 128 | void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive); |
129 | 129 | ||
130 | // Undo/redo stack | 130 | // Undo/redo stack |
131 | void blockUndo(); | 131 | void blockUndo(); |
@@ -136,17 +136,17 @@ public: | |||
136 | BOOL allowsEmbeddedItems() const { return mAllowEmbeddedItems; } | 136 | BOOL allowsEmbeddedItems() const { return mAllowEmbeddedItems; } |
137 | 137 | ||
138 | // inserts text at cursor | 138 | // inserts text at cursor |
139 | void insertText(const LLString &text); | 139 | void insertText(const std::string &text); |
140 | // appends text at end | 140 | // appends text at end |
141 | void appendText(const LLString &wtext, bool allow_undo, bool prepend_newline, | 141 | void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline, |
142 | const LLStyleSP *stylep = NULL); | 142 | const LLStyleSP *stylep = NULL); |
143 | 143 | ||
144 | void appendColoredText(const LLString &wtext, bool allow_undo, | 144 | void appendColoredText(const std::string &wtext, bool allow_undo, |
145 | bool prepend_newline, | 145 | bool prepend_newline, |
146 | const LLColor4 &color, | 146 | const LLColor4 &color, |
147 | const LLString& font_name = LLString::null); | 147 | const std::string& font_name = LLStringUtil::null); |
148 | // if styled text starts a line, you need to prepend a newline. | 148 | // if styled text starts a line, you need to prepend a newline. |
149 | void appendStyledText(const LLString &new_text, bool allow_undo, | 149 | void appendStyledText(const std::string &new_text, bool allow_undo, |
150 | bool prepend_newline, | 150 | bool prepend_newline, |
151 | const LLStyleSP *stylep = NULL); | 151 | const LLStyleSP *stylep = NULL); |
152 | 152 | ||
@@ -160,12 +160,14 @@ public: | |||
160 | void setCursorPos(S32 offset); | 160 | void setCursorPos(S32 offset); |
161 | void setCursorAndScrollToEnd(); | 161 | void setCursorAndScrollToEnd(); |
162 | 162 | ||
163 | void getLineAndColumnForPosition( S32 position, S32* line, S32* col, BOOL include_wordwrap ); | ||
163 | void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ); | 164 | void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ); |
165 | S32 getLineForPosition(S32 position); | ||
166 | S32 getCurrentLine(); | ||
164 | 167 | ||
165 | // Keywords support | 168 | void loadKeywords(const std::string& filename, |
166 | void loadKeywords(const LLString& filename, | 169 | const std::vector<std::string>& funcs, |
167 | const LLDynamicArray<const char*>& funcs, | 170 | const std::vector<std::string>& tooltips, |
168 | const LLDynamicArray<const char*>& tooltips, | ||
169 | const LLColor3& func_color); | 171 | const LLColor3& func_color); |
170 | LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } | 172 | LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } |
171 | LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } | 173 | LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } |
@@ -195,8 +197,8 @@ public: | |||
195 | void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; } | 197 | void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; } |
196 | 198 | ||
197 | // Hack to handle Notecards | 199 | // Hack to handle Notecards |
198 | virtual BOOL importBuffer(const LLString& buffer ); | 200 | virtual BOOL importBuffer(const char* buffer, S32 length ); |
199 | virtual BOOL exportBuffer(LLString& buffer ); | 201 | virtual BOOL exportBuffer(std::string& buffer ); |
200 | 202 | ||
201 | // If takes focus, will take keyboard focus on click. | 203 | // If takes focus, will take keyboard focus on click. |
202 | void setTakesFocus(BOOL b) { mTakesFocus = b; } | 204 | void setTakesFocus(BOOL b) { mTakesFocus = b; } |
@@ -210,7 +212,7 @@ public: | |||
210 | 212 | ||
211 | // Callbacks | 213 | // Callbacks |
212 | static void setLinkColor(LLColor4 color) { mLinkColor = color; } | 214 | static void setLinkColor(LLColor4 color) { mLinkColor = color; } |
213 | static void setURLCallbacks(void (*callback1) (const char* url), | 215 | static void setURLCallbacks(void (*callback1) (const std::string& url), |
214 | bool (*callback2) (const std::string& url), | 216 | bool (*callback2) (const std::string& url), |
215 | bool (*callback3) (const std::string& url) ) | 217 | bool (*callback3) (const std::string& url) ) |
216 | { mURLcallback = callback1; mSecondlifeURLcallback = callback2; mSecondlifeURLcallbackRightClick = callback3;} | 218 | { mURLcallback = callback1; mSecondlifeURLcallback = callback2; mSecondlifeURLcallbackRightClick = callback3;} |
@@ -221,7 +223,7 @@ public: | |||
221 | void setValue(const LLSD& value); | 223 | void setValue(const LLSD& value); |
222 | LLSD getValue() const; | 224 | LLSD getValue() const; |
223 | 225 | ||
224 | const LLString& getText() const; | 226 | const std::string& getText() const; |
225 | 227 | ||
226 | // Non-undoable | 228 | // Non-undoable |
227 | void setText(const LLStringExplicit &utf8str); | 229 | void setText(const LLStringExplicit &utf8str); |
@@ -261,7 +263,7 @@ protected: | |||
261 | void updateTextRect(); | 263 | void updateTextRect(); |
262 | const LLRect& getTextRect() const { return mTextRect; } | 264 | const LLRect& getTextRect() const { return mTextRect; } |
263 | 265 | ||
264 | void assignEmbedded(const LLString &s); | 266 | void assignEmbedded(const std::string &s); |
265 | BOOL truncate(); // Returns true if truncation occurs | 267 | BOOL truncate(); // Returns true if truncation occurs |
266 | 268 | ||
267 | static BOOL isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } | 269 | static BOOL isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } |
@@ -313,8 +315,8 @@ protected: | |||
313 | virtual void bindEmbeddedChars(LLFontGL* font) const {} | 315 | virtual void bindEmbeddedChars(LLFontGL* font) const {} |
314 | virtual void unbindEmbeddedChars(LLFontGL* font) const {} | 316 | virtual void unbindEmbeddedChars(LLFontGL* font) const {} |
315 | 317 | ||
316 | S32 findHTMLToken(const LLString &line, S32 pos, BOOL reverse) const; | 318 | S32 findHTMLToken(const std::string &line, S32 pos, BOOL reverse) const; |
317 | BOOL findHTML(const LLString &line, S32 *begin, S32 *end) const; | 319 | BOOL findHTML(const std::string &line, S32 *begin, S32 *end) const; |
318 | 320 | ||
319 | // Abstract inner base class representing an undoable editor command. | 321 | // Abstract inner base class representing an undoable editor command. |
320 | // Concrete sub-classes can be defined for operations such as insert, remove, etc. | 322 | // Concrete sub-classes can be defined for operations such as insert, remove, etc. |
@@ -399,7 +401,7 @@ protected: | |||
399 | S32 mLastSelectionY; | 401 | S32 mLastSelectionY; |
400 | 402 | ||
401 | BOOL mParseHTML; | 403 | BOOL mParseHTML; |
402 | LLString mHTML; | 404 | std::string mHTML; |
403 | 405 | ||
404 | typedef std::vector<LLTextSegment *> segment_list_t; | 406 | typedef std::vector<LLTextSegment *> segment_list_t; |
405 | segment_list_t mSegments; | 407 | segment_list_t mSegments; |
@@ -436,7 +438,7 @@ private: | |||
436 | // | 438 | // |
437 | LLKeywords mKeywords; | 439 | LLKeywords mKeywords; |
438 | static LLColor4 mLinkColor; | 440 | static LLColor4 mLinkColor; |
439 | static void (*mURLcallback) (const char* url); | 441 | static void (*mURLcallback) (const std::string& url); |
440 | static bool (*mSecondlifeURLcallback) (const std::string& url); | 442 | static bool (*mSecondlifeURLcallback) (const std::string& url); |
441 | static bool (*mSecondlifeURLcallbackRightClick) (const std::string& url); | 443 | static bool (*mSecondlifeURLcallbackRightClick) (const std::string& url); |
442 | 444 | ||
@@ -447,7 +449,7 @@ private: | |||
447 | class LLTextCmdRemove; | 449 | class LLTextCmdRemove; |
448 | 450 | ||
449 | LLWString mWText; | 451 | LLWString mWText; |
450 | mutable LLString mUTF8Text; | 452 | mutable std::string mUTF8Text; |
451 | mutable BOOL mTextIsUpToDate; | 453 | mutable BOOL mTextIsUpToDate; |
452 | 454 | ||
453 | S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes | 455 | S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes |
@@ -501,6 +503,7 @@ private: | |||
501 | 503 | ||
502 | BOOL mReadOnly; | 504 | BOOL mReadOnly; |
503 | BOOL mWordWrap; | 505 | BOOL mWordWrap; |
506 | BOOL mShowLineNumbers; | ||
504 | 507 | ||
505 | BOOL mTabsToNextField; // if true, tab moves focus to next field, else inserts spaces | 508 | BOOL mTabsToNextField; // if true, tab moves focus to next field, else inserts spaces |
506 | BOOL mCommitOnFocusLost; | 509 | BOOL mCommitOnFocusLost; |
@@ -544,7 +547,7 @@ public: | |||
544 | BOOL getIsDefault() const { return mIsDefault; } | 547 | BOOL getIsDefault() const { return mIsDefault; } |
545 | void setToken( LLKeywordToken* token ) { mToken = token; } | 548 | void setToken( LLKeywordToken* token ) { mToken = token; } |
546 | LLKeywordToken* getToken() const { return mToken; } | 549 | LLKeywordToken* getToken() const { return mToken; } |
547 | BOOL getToolTip( LLString& msg ) const; | 550 | BOOL getToolTip( std::string& msg ) const; |
548 | 551 | ||
549 | void dump() const; | 552 | void dump() const; |
550 | 553 | ||
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 11889be..1fc9244 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp | |||
@@ -41,25 +41,19 @@ | |||
41 | #include "audioengine.h" | 41 | #include "audioengine.h" |
42 | #include "v2math.h" | 42 | #include "v2math.h" |
43 | #include "v4color.h" | 43 | #include "v4color.h" |
44 | #include "llgl.h" | ||
45 | #include "llrender.h" | 44 | #include "llrender.h" |
46 | #include "llrect.h" | 45 | #include "llrect.h" |
47 | #include "llimagegl.h" | 46 | #include "llimagegl.h" |
48 | //#include "llviewerimage.h" | ||
49 | #include "lldir.h" | 47 | #include "lldir.h" |
50 | #include "llfontgl.h" | 48 | #include "llfontgl.h" |
51 | 49 | ||
52 | // Project includes | 50 | // Project includes |
53 | //#include "audioengine.h" | ||
54 | #include "llcontrol.h" | 51 | #include "llcontrol.h" |
55 | //#include "llstartup.h" | ||
56 | #include "llui.h" | 52 | #include "llui.h" |
57 | #include "llview.h" | 53 | #include "llview.h" |
58 | #include "lllineeditor.h" | 54 | #include "lllineeditor.h" |
59 | #include "llwindow.h" | 55 | #include "llwindow.h" |
60 | 56 | ||
61 | #include "llglheaders.h" | ||
62 | |||
63 | // | 57 | // |
64 | // Globals | 58 | // Globals |
65 | // | 59 | // |
@@ -69,8 +63,8 @@ const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f); | |||
69 | BOOL gShowTextEditCursor = TRUE; | 63 | BOOL gShowTextEditCursor = TRUE; |
70 | 64 | ||
71 | // Language for UI construction | 65 | // Language for UI construction |
72 | std::map<LLString, LLString> gTranslation; | 66 | std::map<std::string, std::string> gTranslation; |
73 | std::list<LLString> gUntranslated; | 67 | std::list<std::string> gUntranslated; |
74 | 68 | ||
75 | LLControlGroup* LLUI::sConfigGroup = NULL; | 69 | LLControlGroup* LLUI::sConfigGroup = NULL; |
76 | LLControlGroup* LLUI::sColorsGroup = NULL; | 70 | LLControlGroup* LLUI::sColorsGroup = NULL; |
@@ -86,8 +80,9 @@ BOOL LLUI::sQAMode = FALSE; | |||
86 | // | 80 | // |
87 | // Functions | 81 | // Functions |
88 | // | 82 | // |
89 | void make_ui_sound(const LLString& name) | 83 | void make_ui_sound(const char* namep) |
90 | { | 84 | { |
85 | std::string name = ll_safe_string(namep); | ||
91 | if (!LLUI::sConfigGroup->controlExists(name)) | 86 | if (!LLUI::sConfigGroup->controlExists(name)) |
92 | { | 87 | { |
93 | llwarns << "tried to make ui sound for unknown sound name: " << name << llendl; | 88 | llwarns << "tried to make ui sound for unknown sound name: " << name << llendl; |
@@ -1563,7 +1558,7 @@ void LLUI::initClass(LLControlGroup* config, | |||
1563 | LLImageProviderInterface* image_provider, | 1558 | LLImageProviderInterface* image_provider, |
1564 | LLUIAudioCallback audio_callback, | 1559 | LLUIAudioCallback audio_callback, |
1565 | const LLVector2* scale_factor, | 1560 | const LLVector2* scale_factor, |
1566 | const LLString& language) | 1561 | const std::string& language) |
1567 | { | 1562 | { |
1568 | sConfigGroup = config; | 1563 | sConfigGroup = config; |
1569 | sColorsGroup = colors; | 1564 | sColorsGroup = colors; |
@@ -1653,10 +1648,10 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y) | |||
1653 | } | 1648 | } |
1654 | 1649 | ||
1655 | //static | 1650 | //static |
1656 | LLString LLUI::locateSkin(const LLString& filename) | 1651 | std::string LLUI::locateSkin(const std::string& filename) |
1657 | { | 1652 | { |
1658 | LLString slash = gDirUtilp->getDirDelimiter(); | 1653 | std::string slash = gDirUtilp->getDirDelimiter(); |
1659 | LLString found_file = filename; | 1654 | std::string found_file = filename; |
1660 | if (!gDirUtilp->fileExists(found_file)) | 1655 | if (!gDirUtilp->fileExists(found_file)) |
1661 | { | 1656 | { |
1662 | found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS? | 1657 | found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS? |
@@ -1665,18 +1660,18 @@ LLString LLUI::locateSkin(const LLString& filename) | |||
1665 | { | 1660 | { |
1666 | if (!gDirUtilp->fileExists(found_file)) | 1661 | if (!gDirUtilp->fileExists(found_file)) |
1667 | { | 1662 | { |
1668 | LLString localization(sConfigGroup->getString("Language")); | 1663 | std::string localization(sConfigGroup->getString("Language")); |
1669 | if(localization == "default") | 1664 | if(localization == "default") |
1670 | { | 1665 | { |
1671 | localization = sConfigGroup->getString("SystemLanguage"); | 1666 | localization = sConfigGroup->getString("SystemLanguage"); |
1672 | } | 1667 | } |
1673 | LLString local_skin = "xui" + slash + localization + slash + filename; | 1668 | std::string local_skin = "xui" + slash + localization + slash + filename; |
1674 | found_file = gDirUtilp->findSkinnedFilename(local_skin); | 1669 | found_file = gDirUtilp->findSkinnedFilename(local_skin); |
1675 | } | 1670 | } |
1676 | } | 1671 | } |
1677 | if (!gDirUtilp->fileExists(found_file)) | 1672 | if (!gDirUtilp->fileExists(found_file)) |
1678 | { | 1673 | { |
1679 | LLString local_skin = "xui" + slash + "en-us" + slash + filename; | 1674 | std::string local_skin = "xui" + slash + "en-us" + slash + filename; |
1680 | found_file = gDirUtilp->findSkinnedFilename(local_skin); | 1675 | found_file = gDirUtilp->findSkinnedFilename(local_skin); |
1681 | } | 1676 | } |
1682 | if (!gDirUtilp->fileExists(found_file)) | 1677 | if (!gDirUtilp->fileExists(found_file)) |
@@ -1724,7 +1719,7 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) | |||
1724 | } | 1719 | } |
1725 | 1720 | ||
1726 | //static | 1721 | //static |
1727 | LLUIImage* LLUI::getUIImage(const LLString& name) | 1722 | LLUIImage* LLUI::getUIImage(const std::string& name) |
1728 | { | 1723 | { |
1729 | if (!name.empty()) | 1724 | if (!name.empty()) |
1730 | return sImageProvider->getUIImage(name); | 1725 | return sImageProvider->getUIImage(name); |
@@ -1812,7 +1807,7 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled) | |||
1812 | // LLUIImage | 1807 | // LLUIImage |
1813 | // | 1808 | // |
1814 | 1809 | ||
1815 | LLUIImage::LLUIImage(const LLString& name, LLPointer<LLImageGL> image) : | 1810 | LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) : |
1816 | mName(name), | 1811 | mName(name), |
1817 | mImage(image), | 1812 | mImage(image), |
1818 | mScaleRegion(0.f, 1.f, 1.f, 0.f), | 1813 | mScaleRegion(0.f, 1.f, 1.f, 0.f), |
diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h index 0b06913..4c1bb22 100644 --- a/linden/indra/llui/llui.h +++ b/linden/indra/llui/llui.h | |||
@@ -56,7 +56,7 @@ class LLUIImage; | |||
56 | 56 | ||
57 | // UI colors | 57 | // UI colors |
58 | extern const LLColor4 UI_VERTEX_COLOR; | 58 | extern const LLColor4 UI_VERTEX_COLOR; |
59 | void make_ui_sound(const LLString& name); | 59 | void make_ui_sound(const char* name); |
60 | 60 | ||
61 | BOOL ui_point_in_rect(S32 x, S32 y, S32 left, S32 top, S32 right, S32 bottom); | 61 | BOOL ui_point_in_rect(S32 x, S32 y, S32 left, S32 top, S32 right, S32 bottom); |
62 | void gl_state_for_2d(S32 width, S32 height); | 62 | void gl_state_for_2d(S32 width, S32 height); |
@@ -144,7 +144,7 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL | |||
144 | // void init_tr(); | 144 | // void init_tr(); |
145 | 145 | ||
146 | // Returns a string from the string table in the correct language | 146 | // Returns a string from the string table in the correct language |
147 | // LLString tr(const LLString& english_chars); | 147 | // std::string tr(const std::string& english_chars); |
148 | 148 | ||
149 | // Used to hide the flashing text cursor when window doesn't have focus. | 149 | // Used to hide the flashing text cursor when window doesn't have focus. |
150 | extern BOOL gShowTextEditCursor; | 150 | extern BOOL gShowTextEditCursor; |
@@ -164,7 +164,7 @@ public: | |||
164 | LLImageProviderInterface* image_provider, | 164 | LLImageProviderInterface* image_provider, |
165 | LLUIAudioCallback audio_callback = NULL, | 165 | LLUIAudioCallback audio_callback = NULL, |
166 | const LLVector2 *scale_factor = NULL, | 166 | const LLVector2 *scale_factor = NULL, |
167 | const LLString& language = LLString::null); | 167 | const std::string& language = LLStringUtil::null); |
168 | static void cleanupClass(); | 168 | static void cleanupClass(); |
169 | 169 | ||
170 | static void pushMatrix(); | 170 | static void pushMatrix(); |
@@ -173,12 +173,12 @@ public: | |||
173 | static void translate(F32 x, F32 y, F32 z = 0.0f); | 173 | static void translate(F32 x, F32 y, F32 z = 0.0f); |
174 | 174 | ||
175 | //helper functions (should probably move free standing rendering helper functions here) | 175 | //helper functions (should probably move free standing rendering helper functions here) |
176 | static LLString locateSkin(const LLString& filename); | 176 | static std::string locateSkin(const std::string& filename); |
177 | static void setCursorPositionScreen(S32 x, S32 y); | 177 | static void setCursorPositionScreen(S32 x, S32 y); |
178 | static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y); | 178 | static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y); |
179 | static void setScaleFactor(const LLVector2& scale_factor); | 179 | static void setScaleFactor(const LLVector2& scale_factor); |
180 | static void setLineWidth(F32 width); | 180 | static void setLineWidth(F32 width); |
181 | static LLUIImage* getUIImage(const LLString& name); | 181 | static LLUIImage* getUIImage(const std::string& name); |
182 | static LLVector2 getWindowSize(); | 182 | static LLVector2 getWindowSize(); |
183 | static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); | 183 | static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); |
184 | static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); | 184 | static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); |
@@ -411,7 +411,7 @@ public: | |||
411 | class LLUIImage : public LLRefCount | 411 | class LLUIImage : public LLRefCount |
412 | { | 412 | { |
413 | public: | 413 | public: |
414 | LLUIImage(const LLString& name, LLPointer<LLImageGL> image); | 414 | LLUIImage(const std::string& name, LLPointer<LLImageGL> image); |
415 | 415 | ||
416 | void setClipRegion(const LLRectf& region); | 416 | void setClipRegion(const LLRectf& region); |
417 | void setScaleRegion(const LLRectf& region); | 417 | void setScaleRegion(const LLRectf& region); |
@@ -431,7 +431,7 @@ public: | |||
431 | void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); } | 431 | void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); } |
432 | void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); } | 432 | void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); } |
433 | 433 | ||
434 | const LLString& getName() const { return mName; } | 434 | const std::string& getName() const { return mName; } |
435 | 435 | ||
436 | S32 getWidth() const; | 436 | S32 getWidth() const; |
437 | S32 getHeight() const; | 437 | S32 getHeight() const; |
@@ -441,7 +441,7 @@ public: | |||
441 | S32 getTextureHeight() const; | 441 | S32 getTextureHeight() const; |
442 | 442 | ||
443 | protected: | 443 | protected: |
444 | LLString mName; | 444 | std::string mName; |
445 | LLRectf mScaleRegion; | 445 | LLRectf mScaleRegion; |
446 | LLRectf mClipRegion; | 446 | LLRectf mClipRegion; |
447 | LLPointer<LLImageGL> mImage; | 447 | LLPointer<LLImageGL> mImage; |
@@ -592,7 +592,7 @@ public: | |||
592 | LLImageProviderInterface() {}; | 592 | LLImageProviderInterface() {}; |
593 | virtual ~LLImageProviderInterface() {}; | 593 | virtual ~LLImageProviderInterface() {}; |
594 | 594 | ||
595 | virtual LLUIImagePtr getUIImage(const LLString& name) = 0; | 595 | virtual LLUIImagePtr getUIImage(const std::string& name) = 0; |
596 | virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0; | 596 | virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0; |
597 | virtual void cleanUp() = 0; | 597 | virtual void cleanUp() = 0; |
598 | }; | 598 | }; |
diff --git a/linden/indra/llui/llui.vcproj b/linden/indra/llui/llui.vcproj deleted file mode 100644 index f5e7df5..0000000 --- a/linden/indra/llui/llui.vcproj +++ /dev/null | |||
@@ -1,446 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="7.10" | ||
5 | Name="llui" | ||
6 | ProjectGUID="{DE55D666-6A3D-476C-937F-109269B83681}" | ||
7 | Keyword="Win32Proj"> | ||
8 | <Platforms> | ||
9 | <Platform | ||
10 | Name="Win32"/> | ||
11 | </Platforms> | ||
12 | <Configurations> | ||
13 | <Configuration | ||
14 | Name="Debug|Win32" | ||
15 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
16 | IntermediateDirectory="Debug" | ||
17 | ConfigurationType="4" | ||
18 | CharacterSet="1"> | ||
19 | <Tool | ||
20 | Name="VCCLCompilerTool" | ||
21 | Optimization="0" | ||
22 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
23 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG" | ||
24 | MinimalRebuild="TRUE" | ||
25 | BasicRuntimeChecks="3" | ||
26 | RuntimeLibrary="1" | ||
27 | StructMemberAlignment="4" | ||
28 | ForceConformanceInForLoopScope="TRUE" | ||
29 | RuntimeTypeInfo="TRUE" | ||
30 | UsePrecompiledHeader="0" | ||
31 | WarningLevel="3" | ||
32 | WarnAsError="TRUE" | ||
33 | Detect64BitPortabilityProblems="FALSE" | ||
34 | DebugInformationFormat="4"/> | ||
35 | <Tool | ||
36 | Name="VCCustomBuildTool"/> | ||
37 | <Tool | ||
38 | Name="VCLibrarianTool" | ||
39 | OutputFile="$(OutDir)/llui.lib"/> | ||
40 | <Tool | ||
41 | Name="VCMIDLTool"/> | ||
42 | <Tool | ||
43 | Name="VCPostBuildEventTool"/> | ||
44 | <Tool | ||
45 | Name="VCPreBuildEventTool"/> | ||
46 | <Tool | ||
47 | Name="VCPreLinkEventTool"/> | ||
48 | <Tool | ||
49 | Name="VCResourceCompilerTool"/> | ||
50 | <Tool | ||
51 | Name="VCWebServiceProxyGeneratorTool"/> | ||
52 | <Tool | ||
53 | Name="VCXMLDataGeneratorTool"/> | ||
54 | <Tool | ||
55 | Name="VCManagedWrapperGeneratorTool"/> | ||
56 | <Tool | ||
57 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
58 | </Configuration> | ||
59 | <Configuration | ||
60 | Name="Release|Win32" | ||
61 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
62 | IntermediateDirectory="Release" | ||
63 | ConfigurationType="4" | ||
64 | CharacterSet="1"> | ||
65 | <Tool | ||
66 | Name="VCCLCompilerTool" | ||
67 | AdditionalOptions="/Oy-" | ||
68 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
69 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" | ||
70 | RuntimeLibrary="0" | ||
71 | StructMemberAlignment="0" | ||
72 | ForceConformanceInForLoopScope="TRUE" | ||
73 | RuntimeTypeInfo="TRUE" | ||
74 | UsePrecompiledHeader="0" | ||
75 | WarningLevel="3" | ||
76 | WarnAsError="TRUE" | ||
77 | Detect64BitPortabilityProblems="FALSE" | ||
78 | DebugInformationFormat="3"/> | ||
79 | <Tool | ||
80 | Name="VCCustomBuildTool"/> | ||
81 | <Tool | ||
82 | Name="VCLibrarianTool" | ||
83 | OutputFile="$(OutDir)/llui.lib"/> | ||
84 | <Tool | ||
85 | Name="VCMIDLTool"/> | ||
86 | <Tool | ||
87 | Name="VCPostBuildEventTool"/> | ||
88 | <Tool | ||
89 | Name="VCPreBuildEventTool"/> | ||
90 | <Tool | ||
91 | Name="VCPreLinkEventTool"/> | ||
92 | <Tool | ||
93 | Name="VCResourceCompilerTool"/> | ||
94 | <Tool | ||
95 | Name="VCWebServiceProxyGeneratorTool"/> | ||
96 | <Tool | ||
97 | Name="VCXMLDataGeneratorTool"/> | ||
98 | <Tool | ||
99 | Name="VCManagedWrapperGeneratorTool"/> | ||
100 | <Tool | ||
101 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
102 | </Configuration> | ||
103 | <Configuration | ||
104 | Name="ReleaseNoOpt|Win32" | ||
105 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
106 | IntermediateDirectory="$(ConfigurationName)" | ||
107 | ConfigurationType="4" | ||
108 | CharacterSet="1"> | ||
109 | <Tool | ||
110 | Name="VCCLCompilerTool" | ||
111 | AdditionalOptions="/Oy-" | ||
112 | Optimization="0" | ||
113 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
114 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" | ||
115 | RuntimeLibrary="0" | ||
116 | StructMemberAlignment="0" | ||
117 | ForceConformanceInForLoopScope="TRUE" | ||
118 | RuntimeTypeInfo="TRUE" | ||
119 | UsePrecompiledHeader="0" | ||
120 | WarningLevel="3" | ||
121 | WarnAsError="TRUE" | ||
122 | Detect64BitPortabilityProblems="FALSE" | ||
123 | DebugInformationFormat="3"/> | ||
124 | <Tool | ||
125 | Name="VCCustomBuildTool"/> | ||
126 | <Tool | ||
127 | Name="VCLibrarianTool" | ||
128 | OutputFile="$(OutDir)/llui.lib"/> | ||
129 | <Tool | ||
130 | Name="VCMIDLTool"/> | ||
131 | <Tool | ||
132 | Name="VCPostBuildEventTool"/> | ||
133 | <Tool | ||
134 | Name="VCPreBuildEventTool"/> | ||
135 | <Tool | ||
136 | Name="VCPreLinkEventTool"/> | ||
137 | <Tool | ||
138 | Name="VCResourceCompilerTool"/> | ||
139 | <Tool | ||
140 | Name="VCWebServiceProxyGeneratorTool"/> | ||
141 | <Tool | ||
142 | Name="VCXMLDataGeneratorTool"/> | ||
143 | <Tool | ||
144 | Name="VCManagedWrapperGeneratorTool"/> | ||
145 | <Tool | ||
146 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
147 | </Configuration> | ||
148 | </Configurations> | ||
149 | <References> | ||
150 | </References> | ||
151 | <Files> | ||
152 | <Filter | ||
153 | Name="Source Files" | ||
154 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
155 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> | ||
156 | <File | ||
157 | RelativePath=".\llalertdialog.cpp"> | ||
158 | </File> | ||
159 | <File | ||
160 | RelativePath=".\llbutton.cpp"> | ||
161 | </File> | ||
162 | <File | ||
163 | RelativePath=".\llcheckboxctrl.cpp"> | ||
164 | </File> | ||
165 | <File | ||
166 | RelativePath=".\llclipboard.cpp"> | ||
167 | </File> | ||
168 | <File | ||
169 | RelativePath=".\llcombobox.cpp"> | ||
170 | </File> | ||
171 | <File | ||
172 | RelativePath=".\llctrlselectioninterface.cpp"> | ||
173 | </File> | ||
174 | <File | ||
175 | RelativePath=".\lldraghandle.cpp"> | ||
176 | </File> | ||
177 | <File | ||
178 | RelativePath=".\lleditmenuhandler.cpp"> | ||
179 | </File> | ||
180 | <File | ||
181 | RelativePath=".\llfloater.cpp"> | ||
182 | </File> | ||
183 | <File | ||
184 | RelativePath=".\llfocusmgr.cpp"> | ||
185 | </File> | ||
186 | <File | ||
187 | RelativePath=".\lliconctrl.cpp"> | ||
188 | </File> | ||
189 | <File | ||
190 | RelativePath=".\llkeywords.cpp"> | ||
191 | </File> | ||
192 | <File | ||
193 | RelativePath=".\lllineeditor.cpp"> | ||
194 | </File> | ||
195 | <File | ||
196 | RelativePath=".\llmenugl.cpp"> | ||
197 | </File> | ||
198 | <File | ||
199 | RelativePath=".\llmodaldialog.cpp"> | ||
200 | </File> | ||
201 | <File | ||
202 | RelativePath=".\llmultislider.cpp"> | ||
203 | </File> | ||
204 | <File | ||
205 | RelativePath=".\llmultisliderctrl.cpp"> | ||
206 | </File> | ||
207 | <File | ||
208 | RelativePath=".\llpanel.cpp"> | ||
209 | </File> | ||
210 | <File | ||
211 | RelativePath=".\llradiogroup.cpp"> | ||
212 | </File> | ||
213 | <File | ||
214 | RelativePath=".\llresizebar.cpp"> | ||
215 | </File> | ||
216 | <File | ||
217 | RelativePath=".\llresizehandle.cpp"> | ||
218 | </File> | ||
219 | <File | ||
220 | RelativePath=".\llresmgr.cpp"> | ||
221 | </File> | ||
222 | <File | ||
223 | RelativePath=".\llrootview.cpp"> | ||
224 | </File> | ||
225 | <File | ||
226 | RelativePath=".\llscrollbar.cpp"> | ||
227 | </File> | ||
228 | <File | ||
229 | RelativePath=".\llscrollcontainer.cpp"> | ||
230 | </File> | ||
231 | <File | ||
232 | RelativePath=".\llscrollingpanellist.cpp"> | ||
233 | </File> | ||
234 | <File | ||
235 | RelativePath=".\llscrolllistctrl.cpp"> | ||
236 | </File> | ||
237 | <File | ||
238 | RelativePath=".\llslider.cpp"> | ||
239 | </File> | ||
240 | <File | ||
241 | RelativePath=".\llsliderctrl.cpp"> | ||
242 | </File> | ||
243 | <File | ||
244 | RelativePath=".\llspinctrl.cpp"> | ||
245 | </File> | ||
246 | <File | ||
247 | RelativePath=".\llstyle.cpp"> | ||
248 | </File> | ||
249 | <File | ||
250 | RelativePath=".\lltabcontainer.cpp"> | ||
251 | </File> | ||
252 | <File | ||
253 | RelativePath=".\lltabcontainervertical.cpp"> | ||
254 | </File> | ||
255 | <File | ||
256 | RelativePath=".\lltextbox.cpp"> | ||
257 | </File> | ||
258 | <File | ||
259 | RelativePath=".\lltexteditor.cpp"> | ||
260 | </File> | ||
261 | <File | ||
262 | RelativePath=".\llui.cpp"> | ||
263 | </File> | ||
264 | <File | ||
265 | RelativePath=".\lluictrl.cpp"> | ||
266 | </File> | ||
267 | <File | ||
268 | RelativePath=".\lluictrlfactory.cpp"> | ||
269 | </File> | ||
270 | <File | ||
271 | RelativePath=".\lluistring.cpp"> | ||
272 | </File> | ||
273 | <File | ||
274 | RelativePath=".\llundo.cpp"> | ||
275 | </File> | ||
276 | <File | ||
277 | RelativePath=".\llview.cpp"> | ||
278 | </File> | ||
279 | <File | ||
280 | RelativePath=".\llviewborder.cpp"> | ||
281 | </File> | ||
282 | <File | ||
283 | RelativePath=".\llviewquery.cpp"> | ||
284 | </File> | ||
285 | </Filter> | ||
286 | <Filter | ||
287 | Name="Header Files" | ||
288 | Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
289 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> | ||
290 | <File | ||
291 | RelativePath=".\llalertdialog.h"> | ||
292 | </File> | ||
293 | <File | ||
294 | RelativePath=".\llbutton.h"> | ||
295 | </File> | ||
296 | <File | ||
297 | RelativePath=".\llcallbackmap.h"> | ||
298 | </File> | ||
299 | <File | ||
300 | RelativePath=".\llcheckboxctrl.h"> | ||
301 | </File> | ||
302 | <File | ||
303 | RelativePath=".\llclipboard.h"> | ||
304 | </File> | ||
305 | <File | ||
306 | RelativePath=".\llcombobox.h"> | ||
307 | </File> | ||
308 | <File | ||
309 | RelativePath=".\llctrlselectioninterface.h"> | ||
310 | </File> | ||
311 | <File | ||
312 | RelativePath=".\lldraghandle.h"> | ||
313 | </File> | ||
314 | <File | ||
315 | RelativePath=".\lleditmenuhandler.h"> | ||
316 | </File> | ||
317 | <File | ||
318 | RelativePath=".\llfloater.h"> | ||
319 | </File> | ||
320 | <File | ||
321 | RelativePath=".\llfocusmgr.h"> | ||
322 | </File> | ||
323 | <File | ||
324 | RelativePath=".\llhtmlhelp.h"> | ||
325 | </File> | ||
326 | <File | ||
327 | RelativePath=".\lliconctrl.h"> | ||
328 | </File> | ||
329 | <File | ||
330 | RelativePath=".\llkeywords.h"> | ||
331 | </File> | ||
332 | <File | ||
333 | RelativePath=".\lllineeditor.h"> | ||
334 | </File> | ||
335 | <File | ||
336 | RelativePath=".\llmemberlistener.h"> | ||
337 | </File> | ||
338 | <File | ||
339 | RelativePath=".\llmenugl.h"> | ||
340 | </File> | ||
341 | <File | ||
342 | RelativePath=".\llmodaldialog.h"> | ||
343 | </File> | ||
344 | <File | ||
345 | RelativePath=".\llmultislider.h"> | ||
346 | </File> | ||
347 | <File | ||
348 | RelativePath=".\llmultisliderctrl.h"> | ||
349 | </File> | ||
350 | <File | ||
351 | RelativePath=".\llpanel.h"> | ||
352 | </File> | ||
353 | <File | ||
354 | RelativePath=".\llradiogroup.h"> | ||
355 | </File> | ||
356 | <File | ||
357 | RelativePath=".\llresizebar.h"> | ||
358 | </File> | ||
359 | <File | ||
360 | RelativePath=".\llresizehandle.h"> | ||
361 | </File> | ||
362 | <File | ||
363 | RelativePath=".\llresmgr.h"> | ||
364 | </File> | ||
365 | <File | ||
366 | RelativePath=".\llrootview.h"> | ||
367 | </File> | ||
368 | <File | ||
369 | RelativePath=".\llscrollbar.h"> | ||
370 | </File> | ||
371 | <File | ||
372 | RelativePath=".\llscrollcontainer.h"> | ||
373 | </File> | ||
374 | <File | ||
375 | RelativePath=".\llscrollingpanellist.h"> | ||
376 | </File> | ||
377 | <File | ||
378 | RelativePath=".\llscrolllistctrl.h"> | ||
379 | </File> | ||
380 | <File | ||
381 | RelativePath=".\llslider.h"> | ||
382 | </File> | ||
383 | <File | ||
384 | RelativePath=".\llsliderctrl.h"> | ||
385 | </File> | ||
386 | <File | ||
387 | RelativePath=".\llspinctrl.h"> | ||
388 | </File> | ||
389 | <File | ||
390 | RelativePath=".\llstyle.h"> | ||
391 | </File> | ||
392 | <File | ||
393 | RelativePath=".\lltabcontainer.h"> | ||
394 | </File> | ||
395 | <File | ||
396 | RelativePath=".\lltabcontainervertical.h"> | ||
397 | </File> | ||
398 | <File | ||
399 | RelativePath=".\lltextbox.h"> | ||
400 | </File> | ||
401 | <File | ||
402 | RelativePath=".\lltexteditor.h"> | ||
403 | </File> | ||
404 | <File | ||
405 | RelativePath=".\llui.h"> | ||
406 | </File> | ||
407 | <File | ||
408 | RelativePath=".\lluiconstants.h"> | ||
409 | </File> | ||
410 | <File | ||
411 | RelativePath=".\lluictrl.h"> | ||
412 | </File> | ||
413 | <File | ||
414 | RelativePath=".\lluictrlfactory.h"> | ||
415 | </File> | ||
416 | <File | ||
417 | RelativePath=".\lluifwd.h"> | ||
418 | </File> | ||
419 | <File | ||
420 | RelativePath=".\lluistring.h"> | ||
421 | </File> | ||
422 | <File | ||
423 | RelativePath=".\lluixmltags.h"> | ||
424 | </File> | ||
425 | <File | ||
426 | RelativePath=".\llundo.h"> | ||
427 | </File> | ||
428 | <File | ||
429 | RelativePath=".\llview.h"> | ||
430 | </File> | ||
431 | <File | ||
432 | RelativePath=".\llviewborder.h"> | ||
433 | </File> | ||
434 | <File | ||
435 | RelativePath=".\llviewquery.h"> | ||
436 | </File> | ||
437 | </Filter> | ||
438 | <Filter | ||
439 | Name="Resource Files" | ||
440 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
441 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> | ||
442 | </Filter> | ||
443 | </Files> | ||
444 | <Globals> | ||
445 | </Globals> | ||
446 | </VisualStudioProject> | ||
diff --git a/linden/indra/llui/llui_vc8.vcproj b/linden/indra/llui/llui_vc8.vcproj deleted file mode 100644 index daef3f6..0000000 --- a/linden/indra/llui/llui_vc8.vcproj +++ /dev/null | |||
@@ -1,611 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="8.00" | ||
5 | Name="llui" | ||
6 | ProjectGUID="{DE55D666-6A3D-476C-937F-109269B83681}" | ||
7 | RootNamespace="llui" | ||
8 | Keyword="Win32Proj" | ||
9 | > | ||
10 | <Platforms> | ||
11 | <Platform | ||
12 | Name="Win32" | ||
13 | /> | ||
14 | </Platforms> | ||
15 | <ToolFiles> | ||
16 | </ToolFiles> | ||
17 | <Configurations> | ||
18 | <Configuration | ||
19 | Name="Debug|Win32" | ||
20 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
21 | IntermediateDirectory="Debug" | ||
22 | ConfigurationType="4" | ||
23 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
24 | CharacterSet="1" | ||
25 | > | ||
26 | <Tool | ||
27 | Name="VCPreBuildEventTool" | ||
28 | /> | ||
29 | <Tool | ||
30 | Name="VCCustomBuildTool" | ||
31 | /> | ||
32 | <Tool | ||
33 | Name="VCXMLDataGeneratorTool" | ||
34 | /> | ||
35 | <Tool | ||
36 | Name="VCWebServiceProxyGeneratorTool" | ||
37 | /> | ||
38 | <Tool | ||
39 | Name="VCMIDLTool" | ||
40 | /> | ||
41 | <Tool | ||
42 | Name="VCCLCompilerTool" | ||
43 | Optimization="0" | ||
44 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
45 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" | ||
46 | MinimalRebuild="true" | ||
47 | BasicRuntimeChecks="3" | ||
48 | RuntimeLibrary="1" | ||
49 | StructMemberAlignment="4" | ||
50 | TreatWChar_tAsBuiltInType="false" | ||
51 | ForceConformanceInForLoopScope="true" | ||
52 | UsePrecompiledHeader="0" | ||
53 | WarningLevel="3" | ||
54 | WarnAsError="true" | ||
55 | Detect64BitPortabilityProblems="false" | ||
56 | DebugInformationFormat="4" | ||
57 | /> | ||
58 | <Tool | ||
59 | Name="VCManagedResourceCompilerTool" | ||
60 | /> | ||
61 | <Tool | ||
62 | Name="VCResourceCompilerTool" | ||
63 | /> | ||
64 | <Tool | ||
65 | Name="VCPreLinkEventTool" | ||
66 | /> | ||
67 | <Tool | ||
68 | Name="VCLibrarianTool" | ||
69 | OutputFile="$(OutDir)/llui.lib" | ||
70 | /> | ||
71 | <Tool | ||
72 | Name="VCALinkTool" | ||
73 | /> | ||
74 | <Tool | ||
75 | Name="VCXDCMakeTool" | ||
76 | /> | ||
77 | <Tool | ||
78 | Name="VCBscMakeTool" | ||
79 | /> | ||
80 | <Tool | ||
81 | Name="VCFxCopTool" | ||
82 | /> | ||
83 | <Tool | ||
84 | Name="VCPostBuildEventTool" | ||
85 | /> | ||
86 | </Configuration> | ||
87 | <Configuration | ||
88 | Name="Release|Win32" | ||
89 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
90 | IntermediateDirectory="Release" | ||
91 | ConfigurationType="4" | ||
92 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
93 | CharacterSet="1" | ||
94 | > | ||
95 | <Tool | ||
96 | Name="VCPreBuildEventTool" | ||
97 | /> | ||
98 | <Tool | ||
99 | Name="VCCustomBuildTool" | ||
100 | /> | ||
101 | <Tool | ||
102 | Name="VCXMLDataGeneratorTool" | ||
103 | /> | ||
104 | <Tool | ||
105 | Name="VCWebServiceProxyGeneratorTool" | ||
106 | /> | ||
107 | <Tool | ||
108 | Name="VCMIDLTool" | ||
109 | /> | ||
110 | <Tool | ||
111 | Name="VCCLCompilerTool" | ||
112 | AdditionalOptions="/Oy-" | ||
113 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
114 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
115 | RuntimeLibrary="0" | ||
116 | StructMemberAlignment="0" | ||
117 | TreatWChar_tAsBuiltInType="false" | ||
118 | ForceConformanceInForLoopScope="true" | ||
119 | UsePrecompiledHeader="0" | ||
120 | WarningLevel="3" | ||
121 | WarnAsError="true" | ||
122 | Detect64BitPortabilityProblems="false" | ||
123 | DebugInformationFormat="3" | ||
124 | /> | ||
125 | <Tool | ||
126 | Name="VCManagedResourceCompilerTool" | ||
127 | /> | ||
128 | <Tool | ||
129 | Name="VCResourceCompilerTool" | ||
130 | /> | ||
131 | <Tool | ||
132 | Name="VCPreLinkEventTool" | ||
133 | /> | ||
134 | <Tool | ||
135 | Name="VCLibrarianTool" | ||
136 | OutputFile="$(OutDir)/llui.lib" | ||
137 | /> | ||
138 | <Tool | ||
139 | Name="VCALinkTool" | ||
140 | /> | ||
141 | <Tool | ||
142 | Name="VCXDCMakeTool" | ||
143 | /> | ||
144 | <Tool | ||
145 | Name="VCBscMakeTool" | ||
146 | /> | ||
147 | <Tool | ||
148 | Name="VCFxCopTool" | ||
149 | /> | ||
150 | <Tool | ||
151 | Name="VCPostBuildEventTool" | ||
152 | /> | ||
153 | </Configuration> | ||
154 | <Configuration | ||
155 | Name="ReleaseNoOpt|Win32" | ||
156 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
157 | IntermediateDirectory="$(ConfigurationName)" | ||
158 | ConfigurationType="4" | ||
159 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
160 | CharacterSet="1" | ||
161 | > | ||
162 | <Tool | ||
163 | Name="VCPreBuildEventTool" | ||
164 | /> | ||
165 | <Tool | ||
166 | Name="VCCustomBuildTool" | ||
167 | /> | ||
168 | <Tool | ||
169 | Name="VCXMLDataGeneratorTool" | ||
170 | /> | ||
171 | <Tool | ||
172 | Name="VCWebServiceProxyGeneratorTool" | ||
173 | /> | ||
174 | <Tool | ||
175 | Name="VCMIDLTool" | ||
176 | /> | ||
177 | <Tool | ||
178 | Name="VCCLCompilerTool" | ||
179 | AdditionalOptions="/Oy-" | ||
180 | Optimization="0" | ||
181 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
182 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
183 | RuntimeLibrary="0" | ||
184 | StructMemberAlignment="0" | ||
185 | TreatWChar_tAsBuiltInType="false" | ||
186 | ForceConformanceInForLoopScope="true" | ||
187 | UsePrecompiledHeader="0" | ||
188 | WarningLevel="3" | ||
189 | WarnAsError="true" | ||
190 | Detect64BitPortabilityProblems="false" | ||
191 | DebugInformationFormat="3" | ||
192 | /> | ||
193 | <Tool | ||
194 | Name="VCManagedResourceCompilerTool" | ||
195 | /> | ||
196 | <Tool | ||
197 | Name="VCResourceCompilerTool" | ||
198 | /> | ||
199 | <Tool | ||
200 | Name="VCPreLinkEventTool" | ||
201 | /> | ||
202 | <Tool | ||
203 | Name="VCLibrarianTool" | ||
204 | OutputFile="$(OutDir)/llui.lib" | ||
205 | /> | ||
206 | <Tool | ||
207 | Name="VCALinkTool" | ||
208 | /> | ||
209 | <Tool | ||
210 | Name="VCXDCMakeTool" | ||
211 | /> | ||
212 | <Tool | ||
213 | Name="VCBscMakeTool" | ||
214 | /> | ||
215 | <Tool | ||
216 | Name="VCFxCopTool" | ||
217 | /> | ||
218 | <Tool | ||
219 | Name="VCPostBuildEventTool" | ||
220 | /> | ||
221 | </Configuration> | ||
222 | </Configurations> | ||
223 | <References> | ||
224 | </References> | ||
225 | <Files> | ||
226 | <Filter | ||
227 | Name="Source Files" | ||
228 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
229 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||
230 | > | ||
231 | <File | ||
232 | RelativePath=".\llalertdialog.cpp" | ||
233 | > | ||
234 | </File> | ||
235 | <File | ||
236 | RelativePath=".\llbutton.cpp" | ||
237 | > | ||
238 | </File> | ||
239 | <File | ||
240 | RelativePath=".\llcheckboxctrl.cpp" | ||
241 | > | ||
242 | </File> | ||
243 | <File | ||
244 | RelativePath=".\llclipboard.cpp" | ||
245 | > | ||
246 | </File> | ||
247 | <File | ||
248 | RelativePath=".\llcombobox.cpp" | ||
249 | > | ||
250 | </File> | ||
251 | <File | ||
252 | RelativePath=".\llctrlselectioninterface.cpp" | ||
253 | > | ||
254 | </File> | ||
255 | <File | ||
256 | RelativePath=".\lldraghandle.cpp" | ||
257 | > | ||
258 | </File> | ||
259 | <File | ||
260 | RelativePath=".\lleditmenuhandler.cpp" | ||
261 | > | ||
262 | </File> | ||
263 | <File | ||
264 | RelativePath=".\llfloater.cpp" | ||
265 | > | ||
266 | </File> | ||
267 | <File | ||
268 | RelativePath=".\llfocusmgr.cpp" | ||
269 | > | ||
270 | </File> | ||
271 | <File | ||
272 | RelativePath=".\lliconctrl.cpp" | ||
273 | > | ||
274 | </File> | ||
275 | <File | ||
276 | RelativePath=".\llkeywords.cpp" | ||
277 | > | ||
278 | </File> | ||
279 | <File | ||
280 | RelativePath=".\lllineeditor.cpp" | ||
281 | > | ||
282 | </File> | ||
283 | <File | ||
284 | RelativePath=".\llmenugl.cpp" | ||
285 | > | ||
286 | </File> | ||
287 | <File | ||
288 | RelativePath=".\llmodaldialog.cpp" | ||
289 | > | ||
290 | </File> | ||
291 | <File | ||
292 | RelativePath=".\llmultislider.cpp" | ||
293 | > | ||
294 | </File> | ||
295 | <File | ||
296 | RelativePath=".\llmultisliderctrl.cpp" | ||
297 | > | ||
298 | </File> | ||
299 | <File | ||
300 | RelativePath=".\llpanel.cpp" | ||
301 | > | ||
302 | </File> | ||
303 | <File | ||
304 | RelativePath=".\llradiogroup.cpp" | ||
305 | > | ||
306 | </File> | ||
307 | <File | ||
308 | RelativePath=".\llresizebar.cpp" | ||
309 | > | ||
310 | </File> | ||
311 | <File | ||
312 | RelativePath=".\llresizehandle.cpp" | ||
313 | > | ||
314 | </File> | ||
315 | <File | ||
316 | RelativePath=".\llresmgr.cpp" | ||
317 | > | ||
318 | </File> | ||
319 | <File | ||
320 | RelativePath=".\llrootview.cpp" | ||
321 | > | ||
322 | </File> | ||
323 | <File | ||
324 | RelativePath=".\llscrollbar.cpp" | ||
325 | > | ||
326 | </File> | ||
327 | <File | ||
328 | RelativePath=".\llscrollcontainer.cpp" | ||
329 | > | ||
330 | </File> | ||
331 | <File | ||
332 | RelativePath=".\llscrollingpanellist.cpp" | ||
333 | > | ||
334 | </File> | ||
335 | <File | ||
336 | RelativePath=".\llscrolllistctrl.cpp" | ||
337 | > | ||
338 | </File> | ||
339 | <File | ||
340 | RelativePath=".\llslider.cpp" | ||
341 | > | ||
342 | </File> | ||
343 | <File | ||
344 | RelativePath=".\llsliderctrl.cpp" | ||
345 | > | ||
346 | </File> | ||
347 | <File | ||
348 | RelativePath=".\llspinctrl.cpp" | ||
349 | > | ||
350 | </File> | ||
351 | <File | ||
352 | RelativePath=".\llstyle.cpp" | ||
353 | > | ||
354 | </File> | ||
355 | <File | ||
356 | RelativePath=".\lltabcontainer.cpp" | ||
357 | > | ||
358 | </File> | ||
359 | <File | ||
360 | RelativePath=".\lltabcontainervertical.cpp" | ||
361 | > | ||
362 | </File> | ||
363 | <File | ||
364 | RelativePath=".\lltextbox.cpp" | ||
365 | > | ||
366 | </File> | ||
367 | <File | ||
368 | RelativePath=".\lltexteditor.cpp" | ||
369 | > | ||
370 | </File> | ||
371 | <File | ||
372 | RelativePath=".\llui.cpp" | ||
373 | > | ||
374 | </File> | ||
375 | <File | ||
376 | RelativePath=".\lluictrl.cpp" | ||
377 | > | ||
378 | </File> | ||
379 | <File | ||
380 | RelativePath=".\lluictrlfactory.cpp" | ||
381 | > | ||
382 | </File> | ||
383 | <File | ||
384 | RelativePath=".\lluistring.cpp" | ||
385 | > | ||
386 | </File> | ||
387 | <File | ||
388 | RelativePath=".\llundo.cpp" | ||
389 | > | ||
390 | </File> | ||
391 | <File | ||
392 | RelativePath=".\llview.cpp" | ||
393 | > | ||
394 | </File> | ||
395 | <File | ||
396 | RelativePath=".\llviewborder.cpp" | ||
397 | > | ||
398 | </File> | ||
399 | <File | ||
400 | RelativePath=".\llviewquery.cpp" | ||
401 | > | ||
402 | </File> | ||
403 | </Filter> | ||
404 | <Filter | ||
405 | Name="Header Files" | ||
406 | Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
407 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||
408 | > | ||
409 | <File | ||
410 | RelativePath=".\llalertdialog.h" | ||
411 | > | ||
412 | </File> | ||
413 | <File | ||
414 | RelativePath=".\llbutton.h" | ||
415 | > | ||
416 | </File> | ||
417 | <File | ||
418 | RelativePath=".\llcallbackmap.h" | ||
419 | > | ||
420 | </File> | ||
421 | <File | ||
422 | RelativePath=".\llcheckboxctrl.h" | ||
423 | > | ||
424 | </File> | ||
425 | <File | ||
426 | RelativePath=".\llclipboard.h" | ||
427 | > | ||
428 | </File> | ||
429 | <File | ||
430 | RelativePath=".\llcombobox.h" | ||
431 | > | ||
432 | </File> | ||
433 | <File | ||
434 | RelativePath=".\llctrlselectioninterface.h" | ||
435 | > | ||
436 | </File> | ||
437 | <File | ||
438 | RelativePath=".\lldraghandle.h" | ||
439 | > | ||
440 | </File> | ||
441 | <File | ||
442 | RelativePath=".\lleditmenuhandler.h" | ||
443 | > | ||
444 | </File> | ||
445 | <File | ||
446 | RelativePath=".\llfloater.h" | ||
447 | > | ||
448 | </File> | ||
449 | <File | ||
450 | RelativePath=".\llfocusmgr.h" | ||
451 | > | ||
452 | </File> | ||
453 | <File | ||
454 | RelativePath=".\llhtmlhelp.h" | ||
455 | > | ||
456 | </File> | ||
457 | <File | ||
458 | RelativePath=".\lliconctrl.h" | ||
459 | > | ||
460 | </File> | ||
461 | <File | ||
462 | RelativePath=".\llkeywords.h" | ||
463 | > | ||
464 | </File> | ||
465 | <File | ||
466 | RelativePath=".\lllineeditor.h" | ||
467 | > | ||
468 | </File> | ||
469 | <File | ||
470 | RelativePath=".\llmemberlistener.h" | ||
471 | > | ||
472 | </File> | ||
473 | <File | ||
474 | RelativePath=".\llmenugl.h" | ||
475 | > | ||
476 | </File> | ||
477 | <File | ||
478 | RelativePath=".\llmodaldialog.h" | ||
479 | > | ||
480 | </File> | ||
481 | <File | ||
482 | RelativePath=".\llmultislider.h" | ||
483 | > | ||
484 | </File> | ||
485 | <File | ||
486 | RelativePath=".\llmultisliderctrl.h" | ||
487 | > | ||
488 | </File> | ||
489 | <File | ||
490 | RelativePath=".\llpanel.h" | ||
491 | > | ||
492 | </File> | ||
493 | <File | ||
494 | RelativePath=".\llradiogroup.h" | ||
495 | > | ||
496 | </File> | ||
497 | <File | ||
498 | RelativePath=".\llresizebar.h" | ||
499 | > | ||
500 | </File> | ||
501 | <File | ||
502 | RelativePath=".\llresizehandle.h" | ||
503 | > | ||
504 | </File> | ||
505 | <File | ||
506 | RelativePath=".\llresmgr.h" | ||
507 | > | ||
508 | </File> | ||
509 | <File | ||
510 | RelativePath=".\llrootview.h" | ||
511 | > | ||
512 | </File> | ||
513 | <File | ||
514 | RelativePath=".\llscrollbar.h" | ||
515 | > | ||
516 | </File> | ||
517 | <File | ||
518 | RelativePath=".\llscrollcontainer.h" | ||
519 | > | ||
520 | </File> | ||
521 | <File | ||
522 | RelativePath=".\llscrollingpanellist.h" | ||
523 | > | ||
524 | </File> | ||
525 | <File | ||
526 | RelativePath=".\llscrolllistctrl.h" | ||
527 | > | ||
528 | </File> | ||
529 | <File | ||
530 | RelativePath=".\llslider.h" | ||
531 | > | ||
532 | </File> | ||
533 | <File | ||
534 | RelativePath=".\llsliderctrl.h" | ||
535 | > | ||
536 | </File> | ||
537 | <File | ||
538 | RelativePath=".\llspinctrl.h" | ||
539 | > | ||
540 | </File> | ||
541 | <File | ||
542 | RelativePath=".\llstyle.h" | ||
543 | > | ||
544 | </File> | ||
545 | <File | ||
546 | RelativePath=".\lltabcontainer.h" | ||
547 | > | ||
548 | </File> | ||
549 | <File | ||
550 | RelativePath=".\lltabcontainervertical.h" | ||
551 | > | ||
552 | </File> | ||
553 | <File | ||
554 | RelativePath=".\lltextbox.h" | ||
555 | > | ||
556 | </File> | ||
557 | <File | ||
558 | RelativePath=".\lltexteditor.h" | ||
559 | > | ||
560 | </File> | ||
561 | <File | ||
562 | RelativePath=".\llui.h" | ||
563 | > | ||
564 | </File> | ||
565 | <File | ||
566 | RelativePath=".\lluiconstants.h" | ||
567 | > | ||
568 | </File> | ||
569 | <File | ||
570 | RelativePath=".\lluictrl.h" | ||
571 | > | ||
572 | </File> | ||
573 | <File | ||
574 | RelativePath=".\lluictrlfactory.h" | ||
575 | > | ||
576 | </File> | ||
577 | <File | ||
578 | RelativePath=".\lluistring.h" | ||
579 | > | ||
580 | </File> | ||
581 | <File | ||
582 | RelativePath=".\lluixmltags.h" | ||
583 | > | ||
584 | </File> | ||
585 | <File | ||
586 | RelativePath=".\llundo.h" | ||
587 | > | ||
588 | </File> | ||
589 | <File | ||
590 | RelativePath=".\llview.h" | ||
591 | > | ||
592 | </File> | ||
593 | <File | ||
594 | RelativePath=".\llviewborder.h" | ||
595 | > | ||
596 | </File> | ||
597 | <File | ||
598 | RelativePath=".\llviewquery.h" | ||
599 | > | ||
600 | </File> | ||
601 | </Filter> | ||
602 | <Filter | ||
603 | Name="Resource Files" | ||
604 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
605 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||
606 | > | ||
607 | </Filter> | ||
608 | </Files> | ||
609 | <Globals> | ||
610 | </Globals> | ||
611 | </VisualStudioProject> | ||
diff --git a/linden/indra/llui/llui_vc9.vcproj b/linden/indra/llui/llui_vc9.vcproj deleted file mode 100644 index cedc726..0000000 --- a/linden/indra/llui/llui_vc9.vcproj +++ /dev/null | |||
@@ -1,612 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="9.00" | ||
5 | Name="llui" | ||
6 | ProjectGUID="{DE55D666-6A3D-476C-937F-109269B83681}" | ||
7 | RootNamespace="llui" | ||
8 | Keyword="Win32Proj" | ||
9 | TargetFrameworkVersion="131072" | ||
10 | > | ||
11 | <Platforms> | ||
12 | <Platform | ||
13 | Name="Win32" | ||
14 | /> | ||
15 | </Platforms> | ||
16 | <ToolFiles> | ||
17 | </ToolFiles> | ||
18 | <Configurations> | ||
19 | <Configuration | ||
20 | Name="Debug|Win32" | ||
21 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
22 | IntermediateDirectory="Debug" | ||
23 | ConfigurationType="4" | ||
24 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
25 | CharacterSet="1" | ||
26 | > | ||
27 | <Tool | ||
28 | Name="VCPreBuildEventTool" | ||
29 | /> | ||
30 | <Tool | ||
31 | Name="VCCustomBuildTool" | ||
32 | /> | ||
33 | <Tool | ||
34 | Name="VCXMLDataGeneratorTool" | ||
35 | /> | ||
36 | <Tool | ||
37 | Name="VCWebServiceProxyGeneratorTool" | ||
38 | /> | ||
39 | <Tool | ||
40 | Name="VCMIDLTool" | ||
41 | /> | ||
42 | <Tool | ||
43 | Name="VCCLCompilerTool" | ||
44 | Optimization="0" | ||
45 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
46 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" | ||
47 | MinimalRebuild="true" | ||
48 | BasicRuntimeChecks="3" | ||
49 | RuntimeLibrary="1" | ||
50 | StructMemberAlignment="4" | ||
51 | TreatWChar_tAsBuiltInType="false" | ||
52 | ForceConformanceInForLoopScope="true" | ||
53 | UsePrecompiledHeader="0" | ||
54 | WarningLevel="3" | ||
55 | WarnAsError="true" | ||
56 | Detect64BitPortabilityProblems="false" | ||
57 | DebugInformationFormat="4" | ||
58 | /> | ||
59 | <Tool | ||
60 | Name="VCManagedResourceCompilerTool" | ||
61 | /> | ||
62 | <Tool | ||
63 | Name="VCResourceCompilerTool" | ||
64 | /> | ||
65 | <Tool | ||
66 | Name="VCPreLinkEventTool" | ||
67 | /> | ||
68 | <Tool | ||
69 | Name="VCLibrarianTool" | ||
70 | OutputFile="$(OutDir)/llui.lib" | ||
71 | /> | ||
72 | <Tool | ||
73 | Name="VCALinkTool" | ||
74 | /> | ||
75 | <Tool | ||
76 | Name="VCXDCMakeTool" | ||
77 | /> | ||
78 | <Tool | ||
79 | Name="VCBscMakeTool" | ||
80 | /> | ||
81 | <Tool | ||
82 | Name="VCFxCopTool" | ||
83 | /> | ||
84 | <Tool | ||
85 | Name="VCPostBuildEventTool" | ||
86 | /> | ||
87 | </Configuration> | ||
88 | <Configuration | ||
89 | Name="Release|Win32" | ||
90 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
91 | IntermediateDirectory="Release" | ||
92 | ConfigurationType="4" | ||
93 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
94 | CharacterSet="1" | ||
95 | > | ||
96 | <Tool | ||
97 | Name="VCPreBuildEventTool" | ||
98 | /> | ||
99 | <Tool | ||
100 | Name="VCCustomBuildTool" | ||
101 | /> | ||
102 | <Tool | ||
103 | Name="VCXMLDataGeneratorTool" | ||
104 | /> | ||
105 | <Tool | ||
106 | Name="VCWebServiceProxyGeneratorTool" | ||
107 | /> | ||
108 | <Tool | ||
109 | Name="VCMIDLTool" | ||
110 | /> | ||
111 | <Tool | ||
112 | Name="VCCLCompilerTool" | ||
113 | AdditionalOptions="/Oy-" | ||
114 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
115 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
116 | RuntimeLibrary="0" | ||
117 | StructMemberAlignment="0" | ||
118 | TreatWChar_tAsBuiltInType="false" | ||
119 | ForceConformanceInForLoopScope="true" | ||
120 | UsePrecompiledHeader="0" | ||
121 | WarningLevel="3" | ||
122 | WarnAsError="true" | ||
123 | Detect64BitPortabilityProblems="false" | ||
124 | DebugInformationFormat="3" | ||
125 | /> | ||
126 | <Tool | ||
127 | Name="VCManagedResourceCompilerTool" | ||
128 | /> | ||
129 | <Tool | ||
130 | Name="VCResourceCompilerTool" | ||
131 | /> | ||
132 | <Tool | ||
133 | Name="VCPreLinkEventTool" | ||
134 | /> | ||
135 | <Tool | ||
136 | Name="VCLibrarianTool" | ||
137 | OutputFile="$(OutDir)/llui.lib" | ||
138 | /> | ||
139 | <Tool | ||
140 | Name="VCALinkTool" | ||
141 | /> | ||
142 | <Tool | ||
143 | Name="VCXDCMakeTool" | ||
144 | /> | ||
145 | <Tool | ||
146 | Name="VCBscMakeTool" | ||
147 | /> | ||
148 | <Tool | ||
149 | Name="VCFxCopTool" | ||
150 | /> | ||
151 | <Tool | ||
152 | Name="VCPostBuildEventTool" | ||
153 | /> | ||
154 | </Configuration> | ||
155 | <Configuration | ||
156 | Name="ReleaseNoOpt|Win32" | ||
157 | OutputDirectory="../lib_$(ConfigurationName)/i686-win32" | ||
158 | IntermediateDirectory="$(ConfigurationName)" | ||
159 | ConfigurationType="4" | ||
160 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||
161 | CharacterSet="1" | ||
162 | > | ||
163 | <Tool | ||
164 | Name="VCPreBuildEventTool" | ||
165 | /> | ||
166 | <Tool | ||
167 | Name="VCCustomBuildTool" | ||
168 | /> | ||
169 | <Tool | ||
170 | Name="VCXMLDataGeneratorTool" | ||
171 | /> | ||
172 | <Tool | ||
173 | Name="VCWebServiceProxyGeneratorTool" | ||
174 | /> | ||
175 | <Tool | ||
176 | Name="VCMIDLTool" | ||
177 | /> | ||
178 | <Tool | ||
179 | Name="VCCLCompilerTool" | ||
180 | AdditionalOptions="/Oy-" | ||
181 | Optimization="0" | ||
182 | AdditionalIncludeDirectories="..\llmath;..\llvfs;..\llcommon;..\llprimitive;..\llwindow;..\llrender;..\llimage;..\llaudio;..\llxml;..\llmessage;"..\..\libraries\i686-win32\include";..\..\libraries\include\" | ||
183 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | ||
184 | RuntimeLibrary="0" | ||
185 | StructMemberAlignment="0" | ||
186 | TreatWChar_tAsBuiltInType="false" | ||
187 | ForceConformanceInForLoopScope="true" | ||
188 | UsePrecompiledHeader="0" | ||
189 | WarningLevel="3" | ||
190 | WarnAsError="true" | ||
191 | Detect64BitPortabilityProblems="false" | ||
192 | DebugInformationFormat="3" | ||
193 | /> | ||
194 | <Tool | ||
195 | Name="VCManagedResourceCompilerTool" | ||
196 | /> | ||
197 | <Tool | ||
198 | Name="VCResourceCompilerTool" | ||
199 | /> | ||
200 | <Tool | ||
201 | Name="VCPreLinkEventTool" | ||
202 | /> | ||
203 | <Tool | ||
204 | Name="VCLibrarianTool" | ||
205 | OutputFile="$(OutDir)/llui.lib" | ||
206 | /> | ||
207 | <Tool | ||
208 | Name="VCALinkTool" | ||
209 | /> | ||
210 | <Tool | ||
211 | Name="VCXDCMakeTool" | ||
212 | /> | ||
213 | <Tool | ||
214 | Name="VCBscMakeTool" | ||
215 | /> | ||
216 | <Tool | ||
217 | Name="VCFxCopTool" | ||
218 | /> | ||
219 | <Tool | ||
220 | Name="VCPostBuildEventTool" | ||
221 | /> | ||
222 | </Configuration> | ||
223 | </Configurations> | ||
224 | <References> | ||
225 | </References> | ||
226 | <Files> | ||
227 | <Filter | ||
228 | Name="Source Files" | ||
229 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
230 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||
231 | > | ||
232 | <File | ||
233 | RelativePath=".\llalertdialog.cpp" | ||
234 | > | ||
235 | </File> | ||
236 | <File | ||
237 | RelativePath=".\llbutton.cpp" | ||
238 | > | ||
239 | </File> | ||
240 | <File | ||
241 | RelativePath=".\llcheckboxctrl.cpp" | ||
242 | > | ||
243 | </File> | ||
244 | <File | ||
245 | RelativePath=".\llclipboard.cpp" | ||
246 | > | ||
247 | </File> | ||
248 | <File | ||
249 | RelativePath=".\llcombobox.cpp" | ||
250 | > | ||
251 | </File> | ||
252 | <File | ||
253 | RelativePath=".\llctrlselectioninterface.cpp" | ||
254 | > | ||
255 | </File> | ||
256 | <File | ||
257 | RelativePath=".\lldraghandle.cpp" | ||
258 | > | ||
259 | </File> | ||
260 | <File | ||
261 | RelativePath=".\lleditmenuhandler.cpp" | ||
262 | > | ||
263 | </File> | ||
264 | <File | ||
265 | RelativePath=".\llfloater.cpp" | ||
266 | > | ||
267 | </File> | ||
268 | <File | ||
269 | RelativePath=".\llfocusmgr.cpp" | ||
270 | > | ||
271 | </File> | ||
272 | <File | ||
273 | RelativePath=".\lliconctrl.cpp" | ||
274 | > | ||
275 | </File> | ||
276 | <File | ||
277 | RelativePath=".\llkeywords.cpp" | ||
278 | > | ||
279 | </File> | ||
280 | <File | ||
281 | RelativePath=".\lllineeditor.cpp" | ||
282 | > | ||
283 | </File> | ||
284 | <File | ||
285 | RelativePath=".\llmenugl.cpp" | ||
286 | > | ||
287 | </File> | ||
288 | <File | ||
289 | RelativePath=".\llmodaldialog.cpp" | ||
290 | > | ||
291 | </File> | ||
292 | <File | ||
293 | RelativePath=".\llmultislider.cpp" | ||
294 | > | ||
295 | </File> | ||
296 | <File | ||
297 | RelativePath=".\llmultisliderctrl.cpp" | ||
298 | > | ||
299 | </File> | ||
300 | <File | ||
301 | RelativePath=".\llpanel.cpp" | ||
302 | > | ||
303 | </File> | ||
304 | <File | ||
305 | RelativePath=".\llradiogroup.cpp" | ||
306 | > | ||
307 | </File> | ||
308 | <File | ||
309 | RelativePath=".\llresizebar.cpp" | ||
310 | > | ||
311 | </File> | ||
312 | <File | ||
313 | RelativePath=".\llresizehandle.cpp" | ||
314 | > | ||
315 | </File> | ||
316 | <File | ||
317 | RelativePath=".\llresmgr.cpp" | ||
318 | > | ||
319 | </File> | ||
320 | <File | ||
321 | RelativePath=".\llrootview.cpp" | ||
322 | > | ||
323 | </File> | ||
324 | <File | ||
325 | RelativePath=".\llscrollbar.cpp" | ||
326 | > | ||
327 | </File> | ||
328 | <File | ||
329 | RelativePath=".\llscrollcontainer.cpp" | ||
330 | > | ||
331 | </File> | ||
332 | <File | ||
333 | RelativePath=".\llscrollingpanellist.cpp" | ||
334 | > | ||
335 | </File> | ||
336 | <File | ||
337 | RelativePath=".\llscrolllistctrl.cpp" | ||
338 | > | ||
339 | </File> | ||
340 | <File | ||
341 | RelativePath=".\llslider.cpp" | ||
342 | > | ||
343 | </File> | ||
344 | <File | ||
345 | RelativePath=".\llsliderctrl.cpp" | ||
346 | > | ||
347 | </File> | ||
348 | <File | ||
349 | RelativePath=".\llspinctrl.cpp" | ||
350 | > | ||
351 | </File> | ||
352 | <File | ||
353 | RelativePath=".\llstyle.cpp" | ||
354 | > | ||
355 | </File> | ||
356 | <File | ||
357 | RelativePath=".\lltabcontainer.cpp" | ||
358 | > | ||
359 | </File> | ||
360 | <File | ||
361 | RelativePath=".\lltabcontainervertical.cpp" | ||
362 | > | ||
363 | </File> | ||
364 | <File | ||
365 | RelativePath=".\lltextbox.cpp" | ||
366 | > | ||
367 | </File> | ||
368 | <File | ||
369 | RelativePath=".\lltexteditor.cpp" | ||
370 | > | ||
371 | </File> | ||
372 | <File | ||
373 | RelativePath=".\llui.cpp" | ||
374 | > | ||
375 | </File> | ||
376 | <File | ||
377 | RelativePath=".\lluictrl.cpp" | ||
378 | > | ||
379 | </File> | ||
380 | <File | ||
381 | RelativePath=".\lluictrlfactory.cpp" | ||
382 | > | ||
383 | </File> | ||
384 | <File | ||
385 | RelativePath=".\lluistring.cpp" | ||
386 | > | ||
387 | </File> | ||
388 | <File | ||
389 | RelativePath=".\llundo.cpp" | ||
390 | > | ||
391 | </File> | ||
392 | <File | ||
393 | RelativePath=".\llview.cpp" | ||
394 | > | ||
395 | </File> | ||
396 | <File | ||
397 | RelativePath=".\llviewborder.cpp" | ||
398 | > | ||
399 | </File> | ||
400 | <File | ||
401 | RelativePath=".\llviewquery.cpp" | ||
402 | > | ||
403 | </File> | ||
404 | </Filter> | ||
405 | <Filter | ||
406 | Name="Header Files" | ||
407 | Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
408 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||
409 | > | ||
410 | <File | ||
411 | RelativePath=".\llalertdialog.h" | ||
412 | > | ||
413 | </File> | ||
414 | <File | ||
415 | RelativePath=".\llbutton.h" | ||
416 | > | ||
417 | </File> | ||
418 | <File | ||
419 | RelativePath=".\llcallbackmap.h" | ||
420 | > | ||
421 | </File> | ||
422 | <File | ||
423 | RelativePath=".\llcheckboxctrl.h" | ||
424 | > | ||
425 | </File> | ||
426 | <File | ||
427 | RelativePath=".\llclipboard.h" | ||
428 | > | ||
429 | </File> | ||
430 | <File | ||
431 | RelativePath=".\llcombobox.h" | ||
432 | > | ||
433 | </File> | ||
434 | <File | ||
435 | RelativePath=".\llctrlselectioninterface.h" | ||
436 | > | ||
437 | </File> | ||
438 | <File | ||
439 | RelativePath=".\lldraghandle.h" | ||
440 | > | ||
441 | </File> | ||
442 | <File | ||
443 | RelativePath=".\lleditmenuhandler.h" | ||
444 | > | ||
445 | </File> | ||
446 | <File | ||
447 | RelativePath=".\llfloater.h" | ||
448 | > | ||
449 | </File> | ||
450 | <File | ||
451 | RelativePath=".\llfocusmgr.h" | ||
452 | > | ||
453 | </File> | ||
454 | <File | ||
455 | RelativePath=".\llhtmlhelp.h" | ||
456 | > | ||
457 | </File> | ||
458 | <File | ||
459 | RelativePath=".\lliconctrl.h" | ||
460 | > | ||
461 | </File> | ||
462 | <File | ||
463 | RelativePath=".\llkeywords.h" | ||
464 | > | ||
465 | </File> | ||
466 | <File | ||
467 | RelativePath=".\lllineeditor.h" | ||
468 | > | ||
469 | </File> | ||
470 | <File | ||
471 | RelativePath=".\llmemberlistener.h" | ||
472 | > | ||
473 | </File> | ||
474 | <File | ||
475 | RelativePath=".\llmenugl.h" | ||
476 | > | ||
477 | </File> | ||
478 | <File | ||
479 | RelativePath=".\llmodaldialog.h" | ||
480 | > | ||
481 | </File> | ||
482 | <File | ||
483 | RelativePath=".\llmultislider.h" | ||
484 | > | ||
485 | </File> | ||
486 | <File | ||
487 | RelativePath=".\llmultisliderctrl.h" | ||
488 | > | ||
489 | </File> | ||
490 | <File | ||
491 | RelativePath=".\llpanel.h" | ||
492 | > | ||
493 | </File> | ||
494 | <File | ||
495 | RelativePath=".\llradiogroup.h" | ||
496 | > | ||
497 | </File> | ||
498 | <File | ||
499 | RelativePath=".\llresizebar.h" | ||
500 | > | ||
501 | </File> | ||
502 | <File | ||
503 | RelativePath=".\llresizehandle.h" | ||
504 | > | ||
505 | </File> | ||
506 | <File | ||
507 | RelativePath=".\llresmgr.h" | ||
508 | > | ||
509 | </File> | ||
510 | <File | ||
511 | RelativePath=".\llrootview.h" | ||
512 | > | ||
513 | </File> | ||
514 | <File | ||
515 | RelativePath=".\llscrollbar.h" | ||
516 | > | ||
517 | </File> | ||
518 | <File | ||
519 | RelativePath=".\llscrollcontainer.h" | ||
520 | > | ||
521 | </File> | ||
522 | <File | ||
523 | RelativePath=".\llscrollingpanellist.h" | ||
524 | > | ||
525 | </File> | ||
526 | <File | ||
527 | RelativePath=".\llscrolllistctrl.h" | ||
528 | > | ||
529 | </File> | ||
530 | <File | ||
531 | RelativePath=".\llslider.h" | ||
532 | > | ||
533 | </File> | ||
534 | <File | ||
535 | RelativePath=".\llsliderctrl.h" | ||
536 | > | ||
537 | </File> | ||
538 | <File | ||
539 | RelativePath=".\llspinctrl.h" | ||
540 | > | ||
541 | </File> | ||
542 | <File | ||
543 | RelativePath=".\llstyle.h" | ||
544 | > | ||
545 | </File> | ||
546 | <File | ||
547 | RelativePath=".\lltabcontainer.h" | ||
548 | > | ||
549 | </File> | ||
550 | <File | ||
551 | RelativePath=".\lltabcontainervertical.h" | ||
552 | > | ||
553 | </File> | ||
554 | <File | ||
555 | RelativePath=".\lltextbox.h" | ||
556 | > | ||
557 | </File> | ||
558 | <File | ||
559 | RelativePath=".\lltexteditor.h" | ||
560 | > | ||
561 | </File> | ||
562 | <File | ||
563 | RelativePath=".\llui.h" | ||
564 | > | ||
565 | </File> | ||
566 | <File | ||
567 | RelativePath=".\lluiconstants.h" | ||
568 | > | ||
569 | </File> | ||
570 | <File | ||
571 | RelativePath=".\lluictrl.h" | ||
572 | > | ||
573 | </File> | ||
574 | <File | ||
575 | RelativePath=".\lluictrlfactory.h" | ||
576 | > | ||
577 | </File> | ||
578 | <File | ||
579 | RelativePath=".\lluistring.h" | ||
580 | > | ||
581 | </File> | ||
582 | <File | ||
583 | RelativePath=".\lluixmltags.h" | ||
584 | > | ||
585 | </File> | ||
586 | <File | ||
587 | RelativePath=".\llundo.h" | ||
588 | > | ||
589 | </File> | ||
590 | <File | ||
591 | RelativePath=".\llview.h" | ||
592 | > | ||
593 | </File> | ||
594 | <File | ||
595 | RelativePath=".\llviewborder.h" | ||
596 | > | ||
597 | </File> | ||
598 | <File | ||
599 | RelativePath=".\llviewquery.h" | ||
600 | > | ||
601 | </File> | ||
602 | </Filter> | ||
603 | <Filter | ||
604 | Name="Resource Files" | ||
605 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
606 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||
607 | > | ||
608 | </Filter> | ||
609 | </Files> | ||
610 | <Globals> | ||
611 | </Globals> | ||
612 | </VisualStudioProject> | ||
diff --git a/linden/indra/llui/lluictrl.cpp b/linden/indra/llui/lluictrl.cpp index 66504b7..ddafa74 100644 --- a/linden/indra/llui/lluictrl.cpp +++ b/linden/indra/llui/lluictrl.cpp | |||
@@ -98,7 +98,7 @@ LLUICtrl::LLUICtrl() : | |||
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | LLUICtrl::LLUICtrl(const LLString& name, const LLRect& rect, BOOL mouse_opaque, | 101 | LLUICtrl::LLUICtrl(const std::string& name, const LLRect& rect, BOOL mouse_opaque, |
102 | void (*on_commit_callback)(LLUICtrl*, void*), | 102 | void (*on_commit_callback)(LLUICtrl*, void*), |
103 | void* callback_userdata, | 103 | void* callback_userdata, |
104 | U32 reshape) | 104 | U32 reshape) |
@@ -147,13 +147,13 @@ LLSD LLUICtrl::getValue() const | |||
147 | } | 147 | } |
148 | 148 | ||
149 | // virtual | 149 | // virtual |
150 | BOOL LLUICtrl::setTextArg( const LLString& key, const LLStringExplicit& text ) | 150 | BOOL LLUICtrl::setTextArg( const std::string& key, const LLStringExplicit& text ) |
151 | { | 151 | { |
152 | return FALSE; | 152 | return FALSE; |
153 | } | 153 | } |
154 | 154 | ||
155 | // virtual | 155 | // virtual |
156 | BOOL LLUICtrl::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 156 | BOOL LLUICtrl::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
157 | { | 157 | { |
158 | return FALSE; | 158 | return FALSE; |
159 | } | 159 | } |
@@ -495,7 +495,7 @@ LLUICtrl* LLUICtrl::findRootMostFocusRoot() const | |||
495 | 495 | ||
496 | /* | 496 | /* |
497 | // Don't let the children handle the tool tip. Handle it here instead. | 497 | // Don't let the children handle the tool tip. Handle it here instead. |
498 | BOOL LLUICtrl::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) | 498 | BOOL LLUICtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) |
499 | { | 499 | { |
500 | BOOL handled = FALSE; | 500 | BOOL handled = FALSE; |
501 | if (getVisible() && pointInView( x, y ) ) | 501 | if (getVisible() && pointInView( x, y ) ) |
diff --git a/linden/indra/llui/lluictrl.h b/linden/indra/llui/lluictrl.h index 7bc5eeb..b63f79b 100644 --- a/linden/indra/llui/lluictrl.h +++ b/linden/indra/llui/lluictrl.h | |||
@@ -69,7 +69,7 @@ public: | |||
69 | typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata); | 69 | typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata); |
70 | 70 | ||
71 | LLUICtrl(); | 71 | LLUICtrl(); |
72 | LLUICtrl( const LLString& name, const LLRect& rect, BOOL mouse_opaque, | 72 | LLUICtrl( const std::string& name, const LLRect& rect, BOOL mouse_opaque, |
73 | LLUICtrlCallback callback, | 73 | LLUICtrlCallback callback, |
74 | void* callback_userdata, | 74 | void* callback_userdata, |
75 | U32 reshape=FOLLOWS_NONE); | 75 | U32 reshape=FOLLOWS_NONE); |
@@ -78,7 +78,7 @@ public: | |||
78 | // LLView interface | 78 | // LLView interface |
79 | /*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent); | 79 | /*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent); |
80 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; | 80 | /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; |
81 | /*virtual*/ BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 81 | /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
82 | /*virtual*/ void onFocusReceived(); | 82 | /*virtual*/ void onFocusReceived(); |
83 | /*virtual*/ void onFocusLost(); | 83 | /*virtual*/ void onFocusLost(); |
84 | /*virtual*/ BOOL isCtrl() const; | 84 | /*virtual*/ BOOL isCtrl() const; |
@@ -97,7 +97,7 @@ public: | |||
97 | virtual class LLCtrlScrollInterface* getScrollInterface(); | 97 | virtual class LLCtrlScrollInterface* getScrollInterface(); |
98 | 98 | ||
99 | virtual LLSD getValue() const; | 99 | virtual LLSD getValue() const; |
100 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 100 | virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
101 | virtual void setIsChrome(BOOL is_chrome); | 101 | virtual void setIsChrome(BOOL is_chrome); |
102 | 102 | ||
103 | virtual BOOL acceptsTextInput() const; // Defaults to false | 103 | virtual BOOL acceptsTextInput() const; // Defaults to false |
diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index 212c1c5..bcd4876 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp | |||
@@ -76,18 +76,18 @@ const S32 VPAD = 4; | |||
76 | const S32 FLOATER_H_MARGIN = 15; | 76 | const S32 FLOATER_H_MARGIN = 15; |
77 | const S32 MIN_WIDGET_HEIGHT = 10; | 77 | const S32 MIN_WIDGET_HEIGHT = 10; |
78 | 78 | ||
79 | std::vector<LLString> LLUICtrlFactory::sXUIPaths; | 79 | std::vector<std::string> LLUICtrlFactory::sXUIPaths; |
80 | 80 | ||
81 | // UI Ctrl class for padding | 81 | // UI Ctrl class for padding |
82 | class LLUICtrlLocate : public LLUICtrl | 82 | class LLUICtrlLocate : public LLUICtrl |
83 | { | 83 | { |
84 | public: | 84 | public: |
85 | LLUICtrlLocate() : LLUICtrl("locate", LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } | 85 | LLUICtrlLocate() : LLUICtrl(std::string("locate"), LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } |
86 | virtual void draw() { } | 86 | virtual void draw() { } |
87 | 87 | ||
88 | static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 88 | static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
89 | { | 89 | { |
90 | LLString name("pad"); | 90 | std::string name("pad"); |
91 | node->getAttributeString("name", name); | 91 | node->getAttributeString("name", name); |
92 | 92 | ||
93 | LLUICtrlLocate *new_ctrl = new LLUICtrlLocate(); | 93 | LLUICtrlLocate *new_ctrl = new LLUICtrlLocate(); |
@@ -117,7 +117,7 @@ LLUICtrlFactory::~LLUICtrlFactory() | |||
117 | 117 | ||
118 | void LLUICtrlFactory::setupPaths() | 118 | void LLUICtrlFactory::setupPaths() |
119 | { | 119 | { |
120 | LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); | 120 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); |
121 | 121 | ||
122 | LLXMLNodePtr root; | 122 | LLXMLNodePtr root; |
123 | BOOL success = LLXMLNode::parseFile(filename, root, NULL); | 123 | BOOL success = LLXMLNode::parseFile(filename, root, NULL); |
@@ -130,7 +130,7 @@ void LLUICtrlFactory::setupPaths() | |||
130 | for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) | 130 | for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) |
131 | { | 131 | { |
132 | LLUIString path_val_ui(path->getValue()); | 132 | LLUIString path_val_ui(path->getValue()); |
133 | LLString language = "en-us"; | 133 | std::string language = "en-us"; |
134 | if (LLUI::sConfigGroup) | 134 | if (LLUI::sConfigGroup) |
135 | { | 135 | { |
136 | language = LLUI::sConfigGroup->getString("Language"); | 136 | language = LLUI::sConfigGroup->getString("Language"); |
@@ -149,8 +149,8 @@ void LLUICtrlFactory::setupPaths() | |||
149 | } | 149 | } |
150 | else // parsing failed | 150 | else // parsing failed |
151 | { | 151 | { |
152 | LLString slash = gDirUtilp->getDirDelimiter(); | 152 | std::string slash = gDirUtilp->getDirDelimiter(); |
153 | LLString dir = "xui" + slash + "en-us"; | 153 | std::string dir = "xui" + slash + "en-us"; |
154 | llwarns << "XUI::config file unable to open: " << filename << llendl; | 154 | llwarns << "XUI::config file unable to open: " << filename << llendl; |
155 | sXUIPaths.push_back(dir); | 155 | sXUIPaths.push_back(dir); |
156 | } | 156 | } |
@@ -161,7 +161,7 @@ void LLUICtrlFactory::setupPaths() | |||
161 | //----------------------------------------------------------------------------- | 161 | //----------------------------------------------------------------------------- |
162 | // getLayeredXMLNode() | 162 | // getLayeredXMLNode() |
163 | //----------------------------------------------------------------------------- | 163 | //----------------------------------------------------------------------------- |
164 | bool LLUICtrlFactory::getLayeredXMLNode(const LLString &xui_filename, LLXMLNodePtr& root) | 164 | bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root) |
165 | { | 165 | { |
166 | std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename); | 166 | std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename); |
167 | if (full_filename.empty()) | 167 | if (full_filename.empty()) |
@@ -182,12 +182,12 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &xui_filename, LLXMLNodeP | |||
182 | 182 | ||
183 | LLXMLNodePtr updateRoot; | 183 | LLXMLNodePtr updateRoot; |
184 | 184 | ||
185 | std::vector<LLString>::const_iterator itor; | 185 | std::vector<std::string>::const_iterator itor; |
186 | 186 | ||
187 | for (itor = sXUIPaths.begin(), ++itor; itor != sXUIPaths.end(); ++itor) | 187 | for (itor = sXUIPaths.begin(), ++itor; itor != sXUIPaths.end(); ++itor) |
188 | { | 188 | { |
189 | LLString nodeName; | 189 | std::string nodeName; |
190 | LLString updateName; | 190 | std::string updateName; |
191 | 191 | ||
192 | std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename); | 192 | std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename); |
193 | if(layer_filename.empty()) | 193 | if(layer_filename.empty()) |
@@ -218,7 +218,7 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &xui_filename, LLXMLNodeP | |||
218 | //----------------------------------------------------------------------------- | 218 | //----------------------------------------------------------------------------- |
219 | // buildFloater() | 219 | // buildFloater() |
220 | //----------------------------------------------------------------------------- | 220 | //----------------------------------------------------------------------------- |
221 | void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename, | 221 | void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, |
222 | const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */ | 222 | const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */ |
223 | { | 223 | { |
224 | LLXMLNodePtr root; | 224 | LLXMLNodePtr root; |
@@ -259,9 +259,9 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename | |||
259 | //----------------------------------------------------------------------------- | 259 | //----------------------------------------------------------------------------- |
260 | // saveToXML() | 260 | // saveToXML() |
261 | //----------------------------------------------------------------------------- | 261 | //----------------------------------------------------------------------------- |
262 | S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename) | 262 | S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) |
263 | { | 263 | { |
264 | llofstream out(filename.c_str()); | 264 | llofstream out(filename); |
265 | if (!out.good()) | 265 | if (!out.good()) |
266 | { | 266 | { |
267 | llwarns << "Unable to open " << filename << " for output." << llendl; | 267 | llwarns << "Unable to open " << filename << " for output." << llendl; |
@@ -281,7 +281,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename) | |||
281 | //----------------------------------------------------------------------------- | 281 | //----------------------------------------------------------------------------- |
282 | // buildPanel() | 282 | // buildPanel() |
283 | //----------------------------------------------------------------------------- | 283 | //----------------------------------------------------------------------------- |
284 | BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, | 284 | BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, |
285 | const LLCallbackMap::map_t* factory_map) | 285 | const LLCallbackMap::map_t* factory_map) |
286 | { | 286 | { |
287 | BOOL didPost = FALSE; | 287 | BOOL didPost = FALSE; |
@@ -325,7 +325,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, | |||
325 | //----------------------------------------------------------------------------- | 325 | //----------------------------------------------------------------------------- |
326 | // buildMenu() | 326 | // buildMenu() |
327 | //----------------------------------------------------------------------------- | 327 | //----------------------------------------------------------------------------- |
328 | LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp) | 328 | LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parentp) |
329 | { | 329 | { |
330 | // TomY TODO: Break this function into buildMenu and buildMenuBar | 330 | // TomY TODO: Break this function into buildMenu and buildMenuBar |
331 | LLXMLNodePtr root; | 331 | LLXMLNodePtr root; |
@@ -363,7 +363,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp) | |||
363 | //----------------------------------------------------------------------------- | 363 | //----------------------------------------------------------------------------- |
364 | // buildMenu() | 364 | // buildMenu() |
365 | //----------------------------------------------------------------------------- | 365 | //----------------------------------------------------------------------------- |
366 | LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* parentp) | 366 | LLPieMenu *LLUICtrlFactory::buildPieMenu(const std::string &filename, LLView* parentp) |
367 | { | 367 | { |
368 | LLXMLNodePtr root; | 368 | LLXMLNodePtr root; |
369 | 369 | ||
@@ -379,7 +379,7 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* paren | |||
379 | return NULL; | 379 | return NULL; |
380 | } | 380 | } |
381 | 381 | ||
382 | LLString name("menu"); | 382 | std::string name("menu"); |
383 | root->getAttributeString("name", name); | 383 | root->getAttributeString("name", name); |
384 | 384 | ||
385 | LLPieMenu *menu = new LLPieMenu(name); | 385 | LLPieMenu *menu = new LLPieMenu(name); |
@@ -404,7 +404,7 @@ void LLUICtrlFactory::rebuild() | |||
404 | built_panel_it != mBuiltPanels.end(); | 404 | built_panel_it != mBuiltPanels.end(); |
405 | ++built_panel_it) | 405 | ++built_panel_it) |
406 | { | 406 | { |
407 | LLString filename = built_panel_it->second; | 407 | std::string filename = built_panel_it->second; |
408 | LLPanel* panelp = built_panel_it->first.get(); | 408 | LLPanel* panelp = built_panel_it->first.get(); |
409 | if (!panelp) | 409 | if (!panelp) |
410 | { | 410 | { |
@@ -432,7 +432,7 @@ void LLUICtrlFactory::rebuild() | |||
432 | { | 432 | { |
433 | continue; | 433 | continue; |
434 | } | 434 | } |
435 | LLString filename = built_floater_it->second; | 435 | std::string filename = built_floater_it->second; |
436 | llinfos << "Rebuilding UI floater " << floaterp->getName() | 436 | llinfos << "Rebuilding UI floater " << floaterp->getName() |
437 | << " from " << filename | 437 | << " from " << filename |
438 | << llendl; | 438 | << llendl; |
@@ -452,8 +452,8 @@ void LLUICtrlFactory::rebuild() | |||
452 | 452 | ||
453 | LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) | 453 | LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) |
454 | { | 454 | { |
455 | LLString ctrl_type = node->getName()->mString; | 455 | std::string ctrl_type = node->getName()->mString; |
456 | LLString::toLower(ctrl_type); | 456 | LLStringUtil::toLower(ctrl_type); |
457 | 457 | ||
458 | LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type); | 458 | LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type); |
459 | 459 | ||
@@ -494,7 +494,7 @@ LLView* LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node) | |||
494 | //----------------------------------------------------------------------------- | 494 | //----------------------------------------------------------------------------- |
495 | // createFactoryPanel() | 495 | // createFactoryPanel() |
496 | //----------------------------------------------------------------------------- | 496 | //----------------------------------------------------------------------------- |
497 | LLPanel* LLUICtrlFactory::createFactoryPanel(LLString name) | 497 | LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name) |
498 | { | 498 | { |
499 | std::deque<const LLCallbackMap::map_t*>::iterator itor; | 499 | std::deque<const LLCallbackMap::map_t*>::iterator itor; |
500 | for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor) | 500 | for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor) |
@@ -516,10 +516,10 @@ LLPanel* LLUICtrlFactory::createFactoryPanel(LLString name) | |||
516 | //----------------------------------------------------------------------------- | 516 | //----------------------------------------------------------------------------- |
517 | 517 | ||
518 | //static | 518 | //static |
519 | BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color) | 519 | BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color) |
520 | { | 520 | { |
521 | LLString colorstring; | 521 | std::string colorstring; |
522 | BOOL res = node->getAttributeString(name, colorstring); | 522 | BOOL res = node->getAttributeString(name.c_str(), colorstring); |
523 | if (res && LLUI::sColorsGroup) | 523 | if (res && LLUI::sColorsGroup) |
524 | { | 524 | { |
525 | if (LLUI::sColorsGroup->controlExists(colorstring)) | 525 | if (LLUI::sColorsGroup->controlExists(colorstring)) |
@@ -533,11 +533,11 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name, | |||
533 | } | 533 | } |
534 | if (!res) | 534 | if (!res) |
535 | { | 535 | { |
536 | res = LLColor4::parseColor(colorstring.c_str(), &color); | 536 | res = LLColor4::parseColor(colorstring, &color); |
537 | } | 537 | } |
538 | if (!res) | 538 | if (!res) |
539 | { | 539 | { |
540 | res = node->getAttributeColor(name, color); | 540 | res = node->getAttributeColor(name.c_str(), color); |
541 | } | 541 | } |
542 | return res; | 542 | return res; |
543 | } | 543 | } |
diff --git a/linden/indra/llui/lluictrlfactory.h b/linden/indra/llui/lluictrlfactory.h index 16170ac..559c8e5 100644 --- a/linden/indra/llui/lluictrlfactory.h +++ b/linden/indra/llui/lluictrlfactory.h | |||
@@ -50,44 +50,44 @@ public: | |||
50 | 50 | ||
51 | void setupPaths(); | 51 | void setupPaths(); |
52 | 52 | ||
53 | void buildFloater(LLFloater* floaterp, const LLString &filename, | 53 | void buildFloater(LLFloater* floaterp, const std::string &filename, |
54 | const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); | 54 | const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); |
55 | BOOL buildPanel(LLPanel* panelp, const LLString &filename, | 55 | BOOL buildPanel(LLPanel* panelp, const std::string &filename, |
56 | const LLCallbackMap::map_t* factory_map = NULL); | 56 | const LLCallbackMap::map_t* factory_map = NULL); |
57 | 57 | ||
58 | void removePanel(LLPanel* panelp) { mBuiltPanels.erase(panelp->getHandle()); } | 58 | void removePanel(LLPanel* panelp) { mBuiltPanels.erase(panelp->getHandle()); } |
59 | void removeFloater(LLFloater* floaterp) { mBuiltFloaters.erase(floaterp->getHandle()); } | 59 | void removeFloater(LLFloater* floaterp) { mBuiltFloaters.erase(floaterp->getHandle()); } |
60 | 60 | ||
61 | class LLMenuGL *buildMenu(const LLString &filename, LLView* parentp); | 61 | class LLMenuGL *buildMenu(const std::string &filename, LLView* parentp); |
62 | class LLPieMenu *buildPieMenu(const LLString &filename, LLView* parentp); | 62 | class LLPieMenu *buildPieMenu(const std::string &filename, LLView* parentp); |
63 | 63 | ||
64 | // Does what you want for LLFloaters and LLPanels | 64 | // Does what you want for LLFloaters and LLPanels |
65 | // Returns 0 on success | 65 | // Returns 0 on success |
66 | S32 saveToXML(LLView* viewp, const LLString& filename); | 66 | S32 saveToXML(LLView* viewp, const std::string& filename); |
67 | 67 | ||
68 | // Rebuilds all currently built panels. | 68 | // Rebuilds all currently built panels. |
69 | void rebuild(); | 69 | void rebuild(); |
70 | 70 | ||
71 | static BOOL getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color); | 71 | static BOOL getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color); |
72 | 72 | ||
73 | LLPanel* createFactoryPanel(LLString name); | 73 | LLPanel* createFactoryPanel(const std::string& name); |
74 | 74 | ||
75 | virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node); | 75 | virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node); |
76 | virtual LLView* createWidget(LLPanel *parent, LLXMLNodePtr node); | 76 | virtual LLView* createWidget(LLPanel *parent, LLXMLNodePtr node); |
77 | 77 | ||
78 | static bool getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root); | 78 | static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root); |
79 | 79 | ||
80 | private: | 80 | private: |
81 | 81 | ||
82 | typedef std::map<LLHandle<LLPanel>, LLString> built_panel_t; | 82 | typedef std::map<LLHandle<LLPanel>, std::string> built_panel_t; |
83 | built_panel_t mBuiltPanels; | 83 | built_panel_t mBuiltPanels; |
84 | 84 | ||
85 | typedef std::map<LLHandle<LLFloater>, LLString> built_floater_t; | 85 | typedef std::map<LLHandle<LLFloater>, std::string> built_floater_t; |
86 | built_floater_t mBuiltFloaters; | 86 | built_floater_t mBuiltFloaters; |
87 | 87 | ||
88 | std::deque<const LLCallbackMap::map_t*> mFactoryStack; | 88 | std::deque<const LLCallbackMap::map_t*> mFactoryStack; |
89 | 89 | ||
90 | static std::vector<LLString> sXUIPaths; | 90 | static std::vector<std::string> sXUIPaths; |
91 | 91 | ||
92 | LLPanel* mDummyPanel; | 92 | LLPanel* mDummyPanel; |
93 | }; | 93 | }; |
diff --git a/linden/indra/llui/lluistring.cpp b/linden/indra/llui/lluistring.cpp index 2eb7f28..52b83bd 100644 --- a/linden/indra/llui/lluistring.cpp +++ b/linden/indra/llui/lluistring.cpp | |||
@@ -32,29 +32,29 @@ | |||
32 | #include "linden_common.h" | 32 | #include "linden_common.h" |
33 | #include "lluistring.h" | 33 | #include "lluistring.h" |
34 | 34 | ||
35 | const LLString::format_map_t LLUIString::sNullArgs; | 35 | const LLStringUtil::format_map_t LLUIString::sNullArgs; |
36 | 36 | ||
37 | 37 | ||
38 | LLUIString::LLUIString(const LLString& instring, const LLString::format_map_t& args) | 38 | LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) |
39 | : mOrig(instring), | 39 | : mOrig(instring), |
40 | mArgs(args) | 40 | mArgs(args) |
41 | { | 41 | { |
42 | format(); | 42 | format(); |
43 | } | 43 | } |
44 | 44 | ||
45 | void LLUIString::assign(const LLString& s) | 45 | void LLUIString::assign(const std::string& s) |
46 | { | 46 | { |
47 | mOrig = s; | 47 | mOrig = s; |
48 | format(); | 48 | format(); |
49 | } | 49 | } |
50 | 50 | ||
51 | void LLUIString::setArgList(const LLString::format_map_t& args) | 51 | void LLUIString::setArgList(const LLStringUtil::format_map_t& args) |
52 | { | 52 | { |
53 | mArgs = args; | 53 | mArgs = args; |
54 | format(); | 54 | format(); |
55 | } | 55 | } |
56 | 56 | ||
57 | void LLUIString::setArg(const LLString& key, const LLString& replacement) | 57 | void LLUIString::setArg(const std::string& key, const std::string& replacement) |
58 | { | 58 | { |
59 | mArgs[key] = replacement; | 59 | mArgs[key] = replacement; |
60 | format(); | 60 | format(); |
@@ -64,7 +64,7 @@ void LLUIString::truncate(S32 maxchars) | |||
64 | { | 64 | { |
65 | if (mWResult.size() > (size_t)maxchars) | 65 | if (mWResult.size() > (size_t)maxchars) |
66 | { | 66 | { |
67 | LLWString::truncate(mWResult, maxchars); | 67 | LLWStringUtil::truncate(mWResult, maxchars); |
68 | mResult = wstring_to_utf8str(mWResult); | 68 | mResult = wstring_to_utf8str(mWResult); |
69 | } | 69 | } |
70 | } | 70 | } |
@@ -98,6 +98,6 @@ void LLUIString::clear() | |||
98 | void LLUIString::format() | 98 | void LLUIString::format() |
99 | { | 99 | { |
100 | mResult = mOrig; | 100 | mResult = mOrig; |
101 | LLString::format(mResult, mArgs); | 101 | LLStringUtil::format(mResult, mArgs); |
102 | mWResult = utf8str_to_wstring(mResult); | 102 | mWResult = utf8str_to_wstring(mResult); |
103 | } | 103 | } |
diff --git a/linden/indra/llui/lluistring.h b/linden/indra/llui/lluistring.h index e8a86f4..b6c715f 100644 --- a/linden/indra/llui/lluistring.h +++ b/linden/indra/llui/lluistring.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | * @file lluistring.h | 2 | * @file lluistring.h |
3 | * @author: Steve Bennetts | 3 | * @author: Steve Bennetts |
4 | * @brief A fancy wrapper for LLString supporting argument substitutions. | 4 | * @brief A fancy wrapper for std::string supporting argument substitutions. |
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2006&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2006&license=viewergpl$ |
7 | * | 7 | * |
@@ -47,15 +47,15 @@ | |||
47 | // LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!"); | 47 | // LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!"); |
48 | // mMessage.setArg("[USERNAME]", "Steve"); | 48 | // mMessage.setArg("[USERNAME]", "Steve"); |
49 | // mMessage.setArg("[SECONDLIFE]", "Second Life"); | 49 | // mMessage.setArg("[SECONDLIFE]", "Second Life"); |
50 | // llinfos << mMessage.getString().c_str() << llendl; // outputs "Welcome Steve to Second Life" | 50 | // llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life" |
51 | // mMessage.setArg("[USERNAME]", "Joe"); | 51 | // mMessage.setArg("[USERNAME]", "Joe"); |
52 | // llinfos << mMessage.getString().c_str() << llendl; // outputs "Welcome Joe to Second Life" | 52 | // llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life" |
53 | // mMessage = "Recepción a la [SECONDLIFE] [USERNAME]" | 53 | // mMessage = "Recepción a la [SECONDLIFE] [USERNAME]" |
54 | // mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); | 54 | // mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); |
55 | // llinfos << mMessage.getString().c_str() << llendl; // outputs "Recepción a la Segunda Vida Joe" | 55 | // llinfos << mMessage.getString() << llendl; // outputs "Recepción a la Segunda Vida Joe" |
56 | 56 | ||
57 | // Implementation Notes: | 57 | // Implementation Notes: |
58 | // Attempting to have operator[](const LLString& s) return mArgs[s] fails because we have | 58 | // Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have |
59 | // to call format() after the assignment happens. | 59 | // to call format() after the assignment happens. |
60 | 60 | ||
61 | class LLUIString | 61 | class LLUIString |
@@ -64,17 +64,17 @@ public: | |||
64 | // These methods all perform appropriate argument substitution | 64 | // These methods all perform appropriate argument substitution |
65 | // and modify mOrig where appropriate | 65 | // and modify mOrig where appropriate |
66 | LLUIString() {} | 66 | LLUIString() {} |
67 | LLUIString(const LLString& instring, const LLString::format_map_t& args); | 67 | LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); |
68 | LLUIString(const LLString& instring) { assign(instring); } | 68 | LLUIString(const std::string& instring) { assign(instring); } |
69 | 69 | ||
70 | void assign(const LLString& instring); | 70 | void assign(const std::string& instring); |
71 | LLUIString& operator=(const LLString& s) { assign(s); return *this; } | 71 | LLUIString& operator=(const std::string& s) { assign(s); return *this; } |
72 | 72 | ||
73 | void setArgList(const LLString::format_map_t& args); | 73 | void setArgList(const LLStringUtil::format_map_t& args); |
74 | void setArg(const LLString& key, const LLString& replacement); | 74 | void setArg(const std::string& key, const std::string& replacement); |
75 | 75 | ||
76 | const LLString& getString() const { return mResult; } | 76 | const std::string& getString() const { return mResult; } |
77 | operator LLString() const { return mResult; } | 77 | operator std::string() const { return mResult; } |
78 | 78 | ||
79 | const LLWString& getWString() const { return mWResult; } | 79 | const LLWString& getWString() const { return mWResult; } |
80 | operator LLWString() const { return mWResult; } | 80 | operator LLWString() const { return mWResult; } |
@@ -92,15 +92,15 @@ public: | |||
92 | void insert(S32 charidx, const LLWString& wchars); | 92 | void insert(S32 charidx, const LLWString& wchars); |
93 | void replace(S32 charidx, llwchar wc); | 93 | void replace(S32 charidx, llwchar wc); |
94 | 94 | ||
95 | static const LLString::format_map_t sNullArgs; | 95 | static const LLStringUtil::format_map_t sNullArgs; |
96 | 96 | ||
97 | private: | 97 | private: |
98 | void format(); | 98 | void format(); |
99 | 99 | ||
100 | LLString mOrig; | 100 | std::string mOrig; |
101 | LLString mResult; | 101 | std::string mResult; |
102 | LLWString mWResult; // for displaying | 102 | LLWString mWResult; // for displaying |
103 | LLString::format_map_t mArgs; | 103 | LLStringUtil::format_map_t mArgs; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | #endif // LL_LLUISTRING_H | 106 | #endif // LL_LLUISTRING_H |
diff --git a/linden/indra/llui/lluixmltags.h b/linden/indra/llui/lluixmltags.h index cfc57b1..5209199 100644 --- a/linden/indra/llui/lluixmltags.h +++ b/linden/indra/llui/lluixmltags.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #ifndef LL_UI_XML_TAGS_H | 31 | #ifndef LL_UI_XML_TAGS_H |
32 | #define LL_UI_XML_TAGS_H | 32 | #define LL_UI_XML_TAGS_H |
33 | 33 | ||
34 | const LLString | 34 | const std::string |
35 | LL_BUTTON_TAG("button"), | 35 | LL_BUTTON_TAG("button"), |
36 | LL_UI_CTRL_LOCATE_TAG("locate"), | 36 | LL_UI_CTRL_LOCATE_TAG("locate"), |
37 | LL_PAD_TAG("pad"), | 37 | LL_PAD_TAG("pad"), |
@@ -120,6 +120,6 @@ const LLString | |||
120 | LL_JOYSTICK_SLIDE("joystick_slide"), | 120 | LL_JOYSTICK_SLIDE("joystick_slide"), |
121 | LL_JOYSTICK_TURN("joystick_turn"), | 121 | LL_JOYSTICK_TURN("joystick_turn"), |
122 | LL_GROUP_DROP_TARGET_TAG("group_drop_target"), | 122 | LL_GROUP_DROP_TARGET_TAG("group_drop_target"), |
123 | LL_LAYOUT_STACK_TAG("layout_stack"); | 123 | LL_LAYOUT_STACK_TAG("layout_stack"), |
124 | #define LL_FLYOUT_BUTTON_TAG "flyout_button" | 124 | LL_FLYOUT_BUTTON_TAG("flyout_button"); |
125 | #endif | 125 | #endif |
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 91c9564..034c49b 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp | |||
@@ -41,8 +41,6 @@ | |||
41 | #include "llevent.h" | 41 | #include "llevent.h" |
42 | #include "llfontgl.h" | 42 | #include "llfontgl.h" |
43 | #include "llfocusmgr.h" | 43 | #include "llfocusmgr.h" |
44 | #include "llgl.h" | ||
45 | #include "llglheaders.h" | ||
46 | #include "llrect.h" | 44 | #include "llrect.h" |
47 | #include "llstl.h" | 45 | #include "llstl.h" |
48 | #include "llui.h" // colors saved settings | 46 | #include "llui.h" // colors saved settings |
@@ -64,8 +62,7 @@ BOOL LLView::sDebugRects = FALSE; | |||
64 | BOOL LLView::sDebugKeys = FALSE; | 62 | BOOL LLView::sDebugKeys = FALSE; |
65 | S32 LLView::sDepth = 0; | 63 | S32 LLView::sDepth = 0; |
66 | BOOL LLView::sDebugMouseHandling = FALSE; | 64 | BOOL LLView::sDebugMouseHandling = FALSE; |
67 | LLString LLView::sMouseHandlerMessage; | 65 | std::string LLView::sMouseHandlerMessage; |
68 | S32 LLView::sSelectID = GL_NAME_UI_RESERVED; | ||
69 | BOOL LLView::sEditingUI = FALSE; | 66 | BOOL LLView::sEditingUI = FALSE; |
70 | BOOL LLView::sForceReshape = FALSE; | 67 | BOOL LLView::sForceReshape = FALSE; |
71 | LLView* LLView::sEditingUIView = NULL; | 68 | LLView* LLView::sEditingUIView = NULL; |
@@ -92,7 +89,7 @@ LLView::LLView() : | |||
92 | { | 89 | { |
93 | } | 90 | } |
94 | 91 | ||
95 | LLView::LLView(const LLString& name, BOOL mouse_opaque) : | 92 | LLView::LLView(const std::string& name, BOOL mouse_opaque) : |
96 | mParentView(NULL), | 93 | mParentView(NULL), |
97 | mName(name), | 94 | mName(name), |
98 | mReshapeFlags(FOLLOWS_NONE), | 95 | mReshapeFlags(FOLLOWS_NONE), |
@@ -111,7 +108,7 @@ LLView::LLView(const LLString& name, BOOL mouse_opaque) : | |||
111 | 108 | ||
112 | 109 | ||
113 | LLView::LLView( | 110 | LLView::LLView( |
114 | const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 reshape) : | 111 | const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 reshape) : |
115 | mParentView(NULL), | 112 | mParentView(NULL), |
116 | mName(name), | 113 | mName(name), |
117 | mRect(rect), | 114 | mRect(rect), |
@@ -196,7 +193,7 @@ BOOL LLView::setToolTipArg(const LLStringExplicit& key, const LLStringExplicit& | |||
196 | return TRUE; | 193 | return TRUE; |
197 | } | 194 | } |
198 | 195 | ||
199 | void LLView::setToolTipArgs( const LLString::format_map_t& args ) | 196 | void LLView::setToolTipArgs( const LLStringUtil::format_map_t& args ) |
200 | { | 197 | { |
201 | mToolTipMsg.setArgList(args); | 198 | mToolTipMsg.setArgList(args); |
202 | } | 199 | } |
@@ -223,9 +220,9 @@ BOOL LLView::getUseBoundingRect() | |||
223 | } | 220 | } |
224 | 221 | ||
225 | // virtual | 222 | // virtual |
226 | const LLString& LLView::getName() const | 223 | const std::string& LLView::getName() const |
227 | { | 224 | { |
228 | static const LLString unnamed("(no name)"); | 225 | static const std::string unnamed("(no name)"); |
229 | return mName.empty() ? unnamed : mName; | 226 | return mName.empty() ? unnamed : mName; |
230 | } | 227 | } |
231 | 228 | ||
@@ -462,7 +459,7 @@ void LLView::setEnabled(BOOL enabled) | |||
462 | } | 459 | } |
463 | 460 | ||
464 | //virtual | 461 | //virtual |
465 | BOOL LLView::setLabelArg( const LLString& key, const LLStringExplicit& text ) | 462 | BOOL LLView::setLabelArg( const std::string& key, const LLStringExplicit& text ) |
466 | { | 463 | { |
467 | return FALSE; | 464 | return FALSE; |
468 | } | 465 | } |
@@ -668,11 +665,11 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask) | |||
668 | return handled; | 665 | return handled; |
669 | } | 666 | } |
670 | 667 | ||
671 | LLString LLView::getShowNamesToolTip() | 668 | std::string LLView::getShowNamesToolTip() |
672 | { | 669 | { |
673 | LLView* view = getParent(); | 670 | LLView* view = getParent(); |
674 | LLString name; | 671 | std::string name; |
675 | LLString tool_tip = mName; | 672 | std::string tool_tip = mName; |
676 | 673 | ||
677 | while (view) | 674 | while (view) |
678 | { | 675 | { |
@@ -680,7 +677,7 @@ LLString LLView::getShowNamesToolTip() | |||
680 | 677 | ||
681 | if (name == "root") break; | 678 | if (name == "root") break; |
682 | 679 | ||
683 | if (view->getToolTip().find(".xml") != LLString::npos) | 680 | if (view->getToolTip().find(".xml") != std::string::npos) |
684 | { | 681 | { |
685 | tool_tip = view->getToolTip() + "/" + tool_tip; | 682 | tool_tip = view->getToolTip() + "/" + tool_tip; |
686 | break; | 683 | break; |
@@ -697,11 +694,11 @@ LLString LLView::getShowNamesToolTip() | |||
697 | } | 694 | } |
698 | 695 | ||
699 | 696 | ||
700 | BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) | 697 | BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) |
701 | { | 698 | { |
702 | BOOL handled = FALSE; | 699 | BOOL handled = FALSE; |
703 | 700 | ||
704 | LLString tool_tip; | 701 | std::string tool_tip; |
705 | 702 | ||
706 | for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) | 703 | for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) |
707 | { | 704 | { |
@@ -721,15 +718,15 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre | |||
721 | tool_tip = mToolTipMsg.getString(); | 718 | tool_tip = mToolTipMsg.getString(); |
722 | if ( | 719 | if ( |
723 | LLUI::sShowXUINames && | 720 | LLUI::sShowXUINames && |
724 | (tool_tip.find(".xml", 0) == LLString::npos) && | 721 | (tool_tip.find(".xml", 0) == std::string::npos) && |
725 | (mName.find("Drag", 0) == LLString::npos)) | 722 | (mName.find("Drag", 0) == std::string::npos)) |
726 | { | 723 | { |
727 | tool_tip = getShowNamesToolTip(); | 724 | tool_tip = getShowNamesToolTip(); |
728 | } | 725 | } |
729 | 726 | ||
730 | BOOL showNamesTextBox = LLUI::sShowXUINames && dynamic_cast<LLTextBox*>(this) != NULL; | 727 | BOOL show_names_text_box = LLUI::sShowXUINames && dynamic_cast<LLTextBox*>(this) != NULL; |
731 | 728 | ||
732 | if( !handled && (blockMouseEvent(x, y) || showNamesTextBox) && !tool_tip.empty()) | 729 | if( !handled && (blockMouseEvent(x, y) || show_names_text_box)) |
733 | { | 730 | { |
734 | 731 | ||
735 | msg = tool_tip; | 732 | msg = tool_tip; |
@@ -826,7 +823,7 @@ BOOL LLView::handleUnicodeCharHere(llwchar uni_char ) | |||
826 | BOOL LLView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 823 | BOOL LLView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
827 | EDragAndDropType cargo_type, void* cargo_data, | 824 | EDragAndDropType cargo_type, void* cargo_data, |
828 | EAcceptance* accept, | 825 | EAcceptance* accept, |
829 | LLString& tooltip_msg) | 826 | std::string& tooltip_msg) |
830 | { | 827 | { |
831 | // CRO this is an experiment to allow drag and drop into object inventory based on the DragAndDrop tool's permissions rather than the parent | 828 | // CRO this is an experiment to allow drag and drop into object inventory based on the DragAndDrop tool's permissions rather than the parent |
832 | BOOL handled = childrenHandleDragAndDrop( x, y, mask, drop, | 829 | BOOL handled = childrenHandleDragAndDrop( x, y, mask, drop, |
@@ -849,7 +846,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, | |||
849 | EDragAndDropType cargo_type, | 846 | EDragAndDropType cargo_type, |
850 | void* cargo_data, | 847 | void* cargo_data, |
851 | EAcceptance* accept, | 848 | EAcceptance* accept, |
852 | LLString& tooltip_msg) | 849 | std::string& tooltip_msg) |
853 | { | 850 | { |
854 | LLView* handled_view = FALSE; | 851 | LLView* handled_view = FALSE; |
855 | // CRO this is an experiment to allow drag and drop into object inventory based on the DragAndDrop tool's permissions rather than the parent | 852 | // CRO this is an experiment to allow drag and drop into object inventory based on the DragAndDrop tool's permissions rather than the parent |
@@ -989,7 +986,7 @@ LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks) | |||
989 | { | 986 | { |
990 | if (sDebugMouseHandling) | 987 | if (sDebugMouseHandling) |
991 | { | 988 | { |
992 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 989 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
993 | } | 990 | } |
994 | 991 | ||
995 | handled_view = viewp; | 992 | handled_view = viewp; |
@@ -1017,7 +1014,7 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) | |||
1017 | { | 1014 | { |
1018 | if (sDebugMouseHandling) | 1015 | if (sDebugMouseHandling) |
1019 | { | 1016 | { |
1020 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 1017 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
1021 | } | 1018 | } |
1022 | 1019 | ||
1023 | handled_view = viewp; | 1020 | handled_view = viewp; |
@@ -1095,7 +1092,7 @@ LLView* LLView::childrenHandleMouseDown(S32 x, S32 y, MASK mask) | |||
1095 | { | 1092 | { |
1096 | if (sDebugMouseHandling) | 1093 | if (sDebugMouseHandling) |
1097 | { | 1094 | { |
1098 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 1095 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
1099 | } | 1096 | } |
1100 | handled_view = viewp; | 1097 | handled_view = viewp; |
1101 | break; | 1098 | break; |
@@ -1122,7 +1119,7 @@ LLView* LLView::childrenHandleRightMouseDown(S32 x, S32 y, MASK mask) | |||
1122 | { | 1119 | { |
1123 | if (sDebugMouseHandling) | 1120 | if (sDebugMouseHandling) |
1124 | { | 1121 | { |
1125 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 1122 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
1126 | } | 1123 | } |
1127 | handled_view = viewp; | 1124 | handled_view = viewp; |
1128 | break; | 1125 | break; |
@@ -1150,7 +1147,7 @@ LLView* LLView::childrenHandleDoubleClick(S32 x, S32 y, MASK mask) | |||
1150 | { | 1147 | { |
1151 | if (sDebugMouseHandling) | 1148 | if (sDebugMouseHandling) |
1152 | { | 1149 | { |
1153 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 1150 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
1154 | } | 1151 | } |
1155 | handled_view = viewp; | 1152 | handled_view = viewp; |
1156 | break; | 1153 | break; |
@@ -1180,7 +1177,7 @@ LLView* LLView::childrenHandleMouseUp(S32 x, S32 y, MASK mask) | |||
1180 | { | 1177 | { |
1181 | if (sDebugMouseHandling) | 1178 | if (sDebugMouseHandling) |
1182 | { | 1179 | { |
1183 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 1180 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
1184 | } | 1181 | } |
1185 | handled_view = viewp; | 1182 | handled_view = viewp; |
1186 | break; | 1183 | break; |
@@ -1207,7 +1204,7 @@ LLView* LLView::childrenHandleRightMouseUp(S32 x, S32 y, MASK mask) | |||
1207 | { | 1204 | { |
1208 | if (sDebugMouseHandling) | 1205 | if (sDebugMouseHandling) |
1209 | { | 1206 | { |
1210 | sMouseHandlerMessage = LLString("->") + viewp->mName.c_str() + sMouseHandlerMessage; | 1207 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; |
1211 | } | 1208 | } |
1212 | handled_view = viewp; | 1209 | handled_view = viewp; |
1213 | break; | 1210 | break; |
@@ -1328,7 +1325,7 @@ void LLView::drawDebugRect() | |||
1328 | gGL.color4fv( border_color.mV ); | 1325 | gGL.color4fv( border_color.mV ); |
1329 | x = debug_rect.getWidth()/2; | 1326 | x = debug_rect.getWidth()/2; |
1330 | y = debug_rect.getHeight()/2; | 1327 | y = debug_rect.getHeight()/2; |
1331 | LLString debug_text = llformat("%s (%d x %d)", getName().c_str(), | 1328 | std::string debug_text = llformat("%s (%d x %d)", getName().c_str(), |
1332 | debug_rect.getWidth(), debug_rect.getHeight()); | 1329 | debug_rect.getWidth(), debug_rect.getHeight()); |
1333 | LLFontGL::sSansSerifSmall->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, | 1330 | LLFontGL::sSansSerifSmall->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, |
1334 | LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, | 1331 | LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, |
@@ -1539,7 +1536,7 @@ BOOL LLView::hasAncestor(const LLView* parentp) const | |||
1539 | 1536 | ||
1540 | //----------------------------------------------------------------------------- | 1537 | //----------------------------------------------------------------------------- |
1541 | 1538 | ||
1542 | BOOL LLView::childHasKeyboardFocus( const LLString& childname ) const | 1539 | BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const |
1543 | { | 1540 | { |
1544 | LLView *child = getChildView(childname, TRUE, FALSE); | 1541 | LLView *child = getChildView(childname, TRUE, FALSE); |
1545 | if (child) | 1542 | if (child) |
@@ -1554,7 +1551,7 @@ BOOL LLView::childHasKeyboardFocus( const LLString& childname ) const | |||
1554 | 1551 | ||
1555 | //----------------------------------------------------------------------------- | 1552 | //----------------------------------------------------------------------------- |
1556 | 1553 | ||
1557 | BOOL LLView::hasChild(const LLString& childname, BOOL recurse) const | 1554 | BOOL LLView::hasChild(const std::string& childname, BOOL recurse) const |
1558 | { | 1555 | { |
1559 | return getChildView(childname, recurse, FALSE) != NULL; | 1556 | return getChildView(childname, recurse, FALSE) != NULL; |
1560 | } | 1557 | } |
@@ -1562,7 +1559,7 @@ BOOL LLView::hasChild(const LLString& childname, BOOL recurse) const | |||
1562 | //----------------------------------------------------------------------------- | 1559 | //----------------------------------------------------------------------------- |
1563 | // getChildView() | 1560 | // getChildView() |
1564 | //----------------------------------------------------------------------------- | 1561 | //----------------------------------------------------------------------------- |
1565 | LLView* LLView::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const | 1562 | LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const |
1566 | { | 1563 | { |
1567 | //richard: should we allow empty names? | 1564 | //richard: should we allow empty names? |
1568 | //if(name.empty()) | 1565 | //if(name.empty()) |
@@ -1925,33 +1922,18 @@ LLView* LLView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fact | |||
1925 | 1922 | ||
1926 | // static | 1923 | // static |
1927 | void LLView::addColorXML(LLXMLNodePtr node, const LLColor4& color, | 1924 | void LLView::addColorXML(LLXMLNodePtr node, const LLColor4& color, |
1928 | const LLString& xml_name, const LLString& control_name) | 1925 | const char* xml_name, const char* control_name) |
1929 | { | 1926 | { |
1930 | if (color != LLUI::sColorsGroup->getColor(control_name)) | 1927 | if (color != LLUI::sColorsGroup->getColor(ll_safe_string(control_name))) |
1931 | { | 1928 | { |
1932 | node->createChild(xml_name, TRUE)->setFloatValue(4, color.mV); | 1929 | node->createChild(xml_name, TRUE)->setFloatValue(4, color.mV); |
1933 | } | 1930 | } |
1934 | } | 1931 | } |
1935 | 1932 | ||
1936 | // static | ||
1937 | void LLView::saveColorToXML(std::ostream& out, const LLColor4& color, | ||
1938 | const LLString& xml_name, const LLString& control_name, | ||
1939 | const LLString& indent) | ||
1940 | { | ||
1941 | if (color != LLUI::sColorsGroup->getColor(control_name)) | ||
1942 | { | ||
1943 | out << indent << xml_name << "=\"" | ||
1944 | << color.mV[VRED] << ", " | ||
1945 | << color.mV[VGREEN] << ", " | ||
1946 | << color.mV[VBLUE] << ", " | ||
1947 | << color.mV[VALPHA] << "\"\n"; | ||
1948 | } | ||
1949 | } | ||
1950 | |||
1951 | //static | 1933 | //static |
1952 | LLString LLView::escapeXML(const LLString& xml, LLString& indent) | 1934 | std::string LLView::escapeXML(const std::string& xml, std::string& indent) |
1953 | { | 1935 | { |
1954 | LLString ret = indent + "\"" + LLXMLNode::escapeXML(xml); | 1936 | std::string ret = indent + "\"" + LLXMLNode::escapeXML(xml); |
1955 | 1937 | ||
1956 | //replace every newline with a close quote, new line, indent, open quote | 1938 | //replace every newline with a close quote, new line, indent, open quote |
1957 | size_t index = ret.size()-1; | 1939 | size_t index = ret.size()-1; |
@@ -2406,12 +2388,12 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna | |||
2406 | // Listener dispatch functions | 2388 | // Listener dispatch functions |
2407 | //----------------------------------------------------------------------------- | 2389 | //----------------------------------------------------------------------------- |
2408 | 2390 | ||
2409 | void LLView::registerEventListener(LLString name, LLSimpleListener* function) | 2391 | void LLView::registerEventListener(std::string name, LLSimpleListener* function) |
2410 | { | 2392 | { |
2411 | mDispatchList.insert(std::pair<LLString, LLSimpleListener*>(name, function)); | 2393 | mDispatchList.insert(std::pair<std::string, LLSimpleListener*>(name, function)); |
2412 | } | 2394 | } |
2413 | 2395 | ||
2414 | void LLView::deregisterEventListener(LLString name) | 2396 | void LLView::deregisterEventListener(std::string name) |
2415 | { | 2397 | { |
2416 | dispatch_list_t::iterator itor = mDispatchList.find(name); | 2398 | dispatch_list_t::iterator itor = mDispatchList.find(name); |
2417 | if (itor != mDispatchList.end()) | 2399 | if (itor != mDispatchList.end()) |
@@ -2420,7 +2402,7 @@ void LLView::deregisterEventListener(LLString name) | |||
2420 | } | 2402 | } |
2421 | } | 2403 | } |
2422 | 2404 | ||
2423 | LLString LLView::findEventListener(LLSimpleListener *listener) const | 2405 | std::string LLView::findEventListener(LLSimpleListener *listener) const |
2424 | { | 2406 | { |
2425 | dispatch_list_t::const_iterator itor; | 2407 | dispatch_list_t::const_iterator itor; |
2426 | for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) | 2408 | for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) |
@@ -2434,10 +2416,10 @@ LLString LLView::findEventListener(LLSimpleListener *listener) const | |||
2434 | { | 2416 | { |
2435 | return mParentView->findEventListener(listener); | 2417 | return mParentView->findEventListener(listener); |
2436 | } | 2418 | } |
2437 | return LLString::null; | 2419 | return LLStringUtil::null; |
2438 | } | 2420 | } |
2439 | 2421 | ||
2440 | LLSimpleListener* LLView::getListenerByName(const LLString& callback_name) | 2422 | LLSimpleListener* LLView::getListenerByName(const std::string& callback_name) |
2441 | { | 2423 | { |
2442 | LLSimpleListener* callback = NULL; | 2424 | LLSimpleListener* callback = NULL; |
2443 | dispatch_list_t::iterator itor = mDispatchList.find(callback_name); | 2425 | dispatch_list_t::iterator itor = mDispatchList.find(callback_name); |
@@ -2452,7 +2434,7 @@ LLSimpleListener* LLView::getListenerByName(const LLString& callback_name) | |||
2452 | return callback; | 2434 | return callback; |
2453 | } | 2435 | } |
2454 | 2436 | ||
2455 | LLControlVariable *LLView::findControl(LLString name) | 2437 | LLControlVariable *LLView::findControl(const std::string& name) |
2456 | { | 2438 | { |
2457 | control_map_t::iterator itor = mFloaterControls.find(name); | 2439 | control_map_t::iterator itor = mFloaterControls.find(name); |
2458 | if (itor != mFloaterControls.end()) | 2440 | if (itor != mFloaterControls.end()) |
@@ -2496,7 +2478,7 @@ U32 LLView::createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, con | |||
2496 | } | 2478 | } |
2497 | } | 2479 | } |
2498 | 2480 | ||
2499 | LLString rect_control; | 2481 | std::string rect_control; |
2500 | node->getAttributeString("rect_control", rect_control); | 2482 | node->getAttributeString("rect_control", rect_control); |
2501 | if (! rect_control.empty()) | 2483 | if (! rect_control.empty()) |
2502 | { | 2484 | { |
@@ -2657,14 +2639,14 @@ void LLView::initFromXML(LLXMLNodePtr node, LLView* parent) | |||
2657 | 2639 | ||
2658 | if (node->hasAttribute("control_name")) | 2640 | if (node->hasAttribute("control_name")) |
2659 | { | 2641 | { |
2660 | LLString control_name; | 2642 | std::string control_name; |
2661 | node->getAttributeString("control_name", control_name); | 2643 | node->getAttributeString("control_name", control_name); |
2662 | setControlName(control_name, NULL); | 2644 | setControlName(control_name, NULL); |
2663 | } | 2645 | } |
2664 | 2646 | ||
2665 | if (node->hasAttribute("tool_tip")) | 2647 | if (node->hasAttribute("tool_tip")) |
2666 | { | 2648 | { |
2667 | LLString tool_tip_msg(""); | 2649 | std::string tool_tip_msg; |
2668 | node->getAttributeString("tool_tip", tool_tip_msg); | 2650 | node->getAttributeString("tool_tip", tool_tip_msg); |
2669 | setToolTip(tool_tip_msg); | 2651 | setToolTip(tool_tip_msg); |
2670 | } | 2652 | } |
@@ -2697,7 +2679,7 @@ void LLView::parseFollowsFlags(LLXMLNodePtr node) | |||
2697 | { | 2679 | { |
2698 | setFollowsNone(); | 2680 | setFollowsNone(); |
2699 | 2681 | ||
2700 | LLString follows; | 2682 | std::string follows; |
2701 | node->getAttributeString("follows", follows); | 2683 | node->getAttributeString("follows", follows); |
2702 | 2684 | ||
2703 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 2685 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; |
@@ -2741,10 +2723,10 @@ LLFontGL* LLView::selectFont(LLXMLNodePtr node) | |||
2741 | 2723 | ||
2742 | if (node->hasAttribute("font")) | 2724 | if (node->hasAttribute("font")) |
2743 | { | 2725 | { |
2744 | LLString font_name; | 2726 | std::string font_name; |
2745 | node->getAttributeString("font", font_name); | 2727 | node->getAttributeString("font", font_name); |
2746 | 2728 | ||
2747 | gl_font = LLFontGL::fontFromName(font_name.c_str()); | 2729 | gl_font = LLFontGL::fontFromName(font_name); |
2748 | } | 2730 | } |
2749 | return gl_font; | 2731 | return gl_font; |
2750 | } | 2732 | } |
@@ -2756,7 +2738,7 @@ LLFontGL::HAlign LLView::selectFontHAlign(LLXMLNodePtr node) | |||
2756 | 2738 | ||
2757 | if (node->hasAttribute("halign")) | 2739 | if (node->hasAttribute("halign")) |
2758 | { | 2740 | { |
2759 | LLString horizontal_align_name; | 2741 | std::string horizontal_align_name; |
2760 | node->getAttributeString("halign", horizontal_align_name); | 2742 | node->getAttributeString("halign", horizontal_align_name); |
2761 | gl_hfont_align = LLFontGL::hAlignFromName(horizontal_align_name); | 2743 | gl_hfont_align = LLFontGL::hAlignFromName(horizontal_align_name); |
2762 | } | 2744 | } |
@@ -2770,7 +2752,7 @@ LLFontGL::VAlign LLView::selectFontVAlign(LLXMLNodePtr node) | |||
2770 | 2752 | ||
2771 | if (node->hasAttribute("valign")) | 2753 | if (node->hasAttribute("valign")) |
2772 | { | 2754 | { |
2773 | LLString vert_align_name; | 2755 | std::string vert_align_name; |
2774 | node->getAttributeString("valign", vert_align_name); | 2756 | node->getAttributeString("valign", vert_align_name); |
2775 | gl_vfont_align = LLFontGL::vAlignFromName(vert_align_name); | 2757 | gl_vfont_align = LLFontGL::vAlignFromName(vert_align_name); |
2776 | } | 2758 | } |
@@ -2784,7 +2766,7 @@ LLFontGL::StyleFlags LLView::selectFontStyle(LLXMLNodePtr node) | |||
2784 | 2766 | ||
2785 | if (node->hasAttribute("style")) | 2767 | if (node->hasAttribute("style")) |
2786 | { | 2768 | { |
2787 | LLString style_flags_name; | 2769 | std::string style_flags_name; |
2788 | node->getAttributeString("style", style_flags_name); | 2770 | node->getAttributeString("style", style_flags_name); |
2789 | 2771 | ||
2790 | if (style_flags_name == "normal") | 2772 | if (style_flags_name == "normal") |
@@ -2810,7 +2792,7 @@ LLFontGL::StyleFlags LLView::selectFontStyle(LLXMLNodePtr node) | |||
2810 | 2792 | ||
2811 | bool LLView::setControlValue(const LLSD& value) | 2793 | bool LLView::setControlValue(const LLSD& value) |
2812 | { | 2794 | { |
2813 | LLString ctrlname = getControlName(); | 2795 | std::string ctrlname = getControlName(); |
2814 | if (!ctrlname.empty()) | 2796 | if (!ctrlname.empty()) |
2815 | { | 2797 | { |
2816 | LLUI::sConfigGroup->setValue(ctrlname, value); | 2798 | LLUI::sConfigGroup->setValue(ctrlname, value); |
@@ -2820,7 +2802,7 @@ bool LLView::setControlValue(const LLSD& value) | |||
2820 | } | 2802 | } |
2821 | 2803 | ||
2822 | //virtual | 2804 | //virtual |
2823 | void LLView::setControlName(const LLString& control_name, LLView *context) | 2805 | void LLView::setControlName(const std::string& control_name, LLView *context) |
2824 | { | 2806 | { |
2825 | if (context == NULL) | 2807 | if (context == NULL) |
2826 | { | 2808 | { |
@@ -2872,12 +2854,12 @@ bool LLView::controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std: | |||
2872 | return false; | 2854 | return false; |
2873 | } | 2855 | } |
2874 | 2856 | ||
2875 | void LLView::addBoolControl(LLString name, bool initial_value) | 2857 | void LLView::addBoolControl(const std::string& name, bool initial_value) |
2876 | { | 2858 | { |
2877 | mFloaterControls[name] = new LLControlVariable(name, TYPE_BOOLEAN, initial_value, "Internal floater control"); | 2859 | mFloaterControls[name] = new LLControlVariable(name, TYPE_BOOLEAN, initial_value, std::string("Internal floater control")); |
2878 | } | 2860 | } |
2879 | 2861 | ||
2880 | LLControlVariable *LLView::getControl(LLString name) | 2862 | LLControlVariable *LLView::getControl(const std::string& name) |
2881 | { | 2863 | { |
2882 | control_map_t::iterator itor = mFloaterControls.find(name); | 2864 | control_map_t::iterator itor = mFloaterControls.find(name); |
2883 | if (itor != mFloaterControls.end()) | 2865 | if (itor != mFloaterControls.end()) |
@@ -2912,20 +2894,20 @@ LLWidgetClassRegistry::LLWidgetClassRegistry() | |||
2912 | { | 2894 | { |
2913 | } | 2895 | } |
2914 | 2896 | ||
2915 | void LLWidgetClassRegistry::registerCtrl(const LLString& tag, LLWidgetClassRegistry::factory_func_t function) | 2897 | void LLWidgetClassRegistry::registerCtrl(const std::string& tag, LLWidgetClassRegistry::factory_func_t function) |
2916 | { | 2898 | { |
2917 | LLString lower_case_tag = tag; | 2899 | std::string lower_case_tag = tag; |
2918 | LLString::toLower(lower_case_tag); | 2900 | LLStringUtil::toLower(lower_case_tag); |
2919 | 2901 | ||
2920 | mCreatorFunctions[lower_case_tag] = function; | 2902 | mCreatorFunctions[lower_case_tag] = function; |
2921 | } | 2903 | } |
2922 | 2904 | ||
2923 | BOOL LLWidgetClassRegistry::isTagRegistered(const LLString &tag) | 2905 | BOOL LLWidgetClassRegistry::isTagRegistered(const std::string &tag) |
2924 | { | 2906 | { |
2925 | return mCreatorFunctions.find(tag) != mCreatorFunctions.end(); | 2907 | return mCreatorFunctions.find(tag) != mCreatorFunctions.end(); |
2926 | } | 2908 | } |
2927 | 2909 | ||
2928 | LLWidgetClassRegistry::factory_func_t LLWidgetClassRegistry::getCreatorFunc(const LLString& ctrl_type) | 2910 | LLWidgetClassRegistry::factory_func_t LLWidgetClassRegistry::getCreatorFunc(const std::string& ctrl_type) |
2929 | { | 2911 | { |
2930 | factory_map_t::const_iterator found_it = mCreatorFunctions.find(ctrl_type); | 2912 | factory_map_t::const_iterator found_it = mCreatorFunctions.find(ctrl_type); |
2931 | if (found_it == mCreatorFunctions.end()) | 2913 | if (found_it == mCreatorFunctions.end()) |
diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index 9a04ed7..b65edd7 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h | |||
@@ -89,7 +89,7 @@ virtual void setVisible(BOOL visible); | |||
89 | LLFloater, LLAlertDialog, LLMenuItemGL, LLModalDialog | 89 | LLFloater, LLAlertDialog, LLMenuItemGL, LLModalDialog |
90 | virtual void setEnabled(BOOL enabled) { mEnabled = enabled; } | 90 | virtual void setEnabled(BOOL enabled) { mEnabled = enabled; } |
91 | LLCheckBoxCtrl, LLComboBox, LLLineEditor, LLMenuGL, LLRadioGroup, etc | 91 | LLCheckBoxCtrl, LLComboBox, LLLineEditor, LLMenuGL, LLRadioGroup, etc |
92 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ) { return FALSE; } | 92 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) { return FALSE; } |
93 | LLUICtrl, LLButton, LLCheckBoxCtrl, LLLineEditor, LLMenuGL, LLSliderCtrl | 93 | LLUICtrl, LLButton, LLCheckBoxCtrl, LLLineEditor, LLMenuGL, LLSliderCtrl |
94 | virtual void onVisibilityChange ( BOOL curVisibilityIn ); | 94 | virtual void onVisibilityChange ( BOOL curVisibilityIn ); |
95 | LLMenuGL | 95 | LLMenuGL |
@@ -114,7 +114,7 @@ virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); | |||
114 | * | 114 | * |
115 | virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); | 115 | virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); |
116 | * | 116 | * |
117 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,EDragAndDropType cargo_type,void* cargo_data,EAcceptance* accept,LLString& tooltip_msg); | 117 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,EDragAndDropType cargo_type,void* cargo_data,EAcceptance* accept,std::string& tooltip_msg); |
118 | * | 118 | * |
119 | virtual void draw(); | 119 | virtual void draw(); |
120 | * | 120 | * |
@@ -128,11 +128,11 @@ virtual void onFocusLost() {} | |||
128 | LLUICtrl, LLScrollListCtrl, LLMenuGL, LLLineEditor, LLComboBox | 128 | LLUICtrl, LLScrollListCtrl, LLMenuGL, LLLineEditor, LLComboBox |
129 | virtual void onFocusReceived() {} | 129 | virtual void onFocusReceived() {} |
130 | LLUICtrl, LLTextEditor, LLScrollListVtrl, LLMenuGL, LLLineEditor | 130 | LLUICtrl, LLTextEditor, LLScrollListVtrl, LLMenuGL, LLLineEditor |
131 | virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; | 131 | virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; |
132 | LLTabContainer, LLPanel, LLMenuGL | 132 | LLTabContainer, LLPanel, LLMenuGL |
133 | virtual void setControlName(const LLString& control, LLView *context); | 133 | virtual void setControlName(const std::string& control, LLView *context); |
134 | LLSliderCtrl, LLCheckBoxCtrl | 134 | LLSliderCtrl, LLCheckBoxCtrl |
135 | virtual LLString getControlName() const { return mControlName; } | 135 | virtual std::string getControlName() const { return mControlName; } |
136 | LLSliderCtrl, LLCheckBoxCtrl | 136 | LLSliderCtrl, LLCheckBoxCtrl |
137 | virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | 137 | virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); |
138 | LLMenuItem | 138 | LLMenuItem |
@@ -154,11 +154,11 @@ class LLWidgetClassRegistry : public LLSingleton<LLWidgetClassRegistry> | |||
154 | friend class LLSingleton<LLWidgetClassRegistry>; | 154 | friend class LLSingleton<LLWidgetClassRegistry>; |
155 | public: | 155 | public: |
156 | typedef LLView* (*factory_func_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | 156 | typedef LLView* (*factory_func_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); |
157 | typedef std::map<LLString, factory_func_t> factory_map_t; | 157 | typedef std::map<std::string, factory_func_t> factory_map_t; |
158 | 158 | ||
159 | void registerCtrl(const LLString& xml_tag, factory_func_t function); | 159 | void registerCtrl(const std::string& xml_tag, factory_func_t function); |
160 | BOOL isTagRegistered(const LLString& xml_tag); | 160 | BOOL isTagRegistered(const std::string& xml_tag); |
161 | factory_func_t getCreatorFunc(const LLString& xml_tag); | 161 | factory_func_t getCreatorFunc(const std::string& xml_tag); |
162 | 162 | ||
163 | // get (first) xml tag for a given class | 163 | // get (first) xml tag for a given class |
164 | template <class T> std::string getTag() | 164 | template <class T> std::string getTag() |
@@ -179,7 +179,7 @@ private: | |||
179 | LLWidgetClassRegistry(); | 179 | LLWidgetClassRegistry(); |
180 | virtual ~LLWidgetClassRegistry() {}; | 180 | virtual ~LLWidgetClassRegistry() {}; |
181 | 181 | ||
182 | typedef std::set<LLString> ctrl_name_set_t; | 182 | typedef std::set<std::string> ctrl_name_set_t; |
183 | ctrl_name_set_t mUICtrlNames; | 183 | ctrl_name_set_t mUICtrlNames; |
184 | 184 | ||
185 | // map of xml tags to widget creator functions | 185 | // map of xml tags to widget creator functions |
@@ -252,8 +252,8 @@ public: | |||
252 | typedef child_tab_order_t::const_reverse_iterator child_tab_order_const_reverse_iter_t; | 252 | typedef child_tab_order_t::const_reverse_iterator child_tab_order_const_reverse_iter_t; |
253 | 253 | ||
254 | LLView(); | 254 | LLView(); |
255 | LLView(const LLString& name, BOOL mouse_opaque); | 255 | LLView(const std::string& name, BOOL mouse_opaque); |
256 | LLView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); | 256 | LLView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); |
257 | 257 | ||
258 | virtual ~LLView(); | 258 | virtual ~LLView(); |
259 | 259 | ||
@@ -274,7 +274,7 @@ public: | |||
274 | BOOL getMouseOpaque() const { return mMouseOpaque; } | 274 | BOOL getMouseOpaque() const { return mMouseOpaque; } |
275 | void setToolTip( const LLStringExplicit& msg ); | 275 | void setToolTip( const LLStringExplicit& msg ); |
276 | BOOL setToolTipArg( const LLStringExplicit& key, const LLStringExplicit& text ); | 276 | BOOL setToolTipArg( const LLStringExplicit& key, const LLStringExplicit& text ); |
277 | void setToolTipArgs( const LLString::format_map_t& args ); | 277 | void setToolTipArgs( const LLStringUtil::format_map_t& args ); |
278 | 278 | ||
279 | virtual void setRect(const LLRect &rect); | 279 | virtual void setRect(const LLRect &rect); |
280 | void setFollows(U32 flags) { mReshapeFlags = flags; } | 280 | void setFollows(U32 flags) { mReshapeFlags = flags; } |
@@ -288,11 +288,11 @@ public: | |||
288 | void setFollowsAll() { mReshapeFlags |= FOLLOWS_ALL; } | 288 | void setFollowsAll() { mReshapeFlags |= FOLLOWS_ALL; } |
289 | 289 | ||
290 | void setSoundFlags(U8 flags) { mSoundFlags = flags; } | 290 | void setSoundFlags(U8 flags) { mSoundFlags = flags; } |
291 | void setName(LLString name) { mName = name; } | 291 | void setName(std::string name) { mName = name; } |
292 | void setUseBoundingRect( BOOL use_bounding_rect ); | 292 | void setUseBoundingRect( BOOL use_bounding_rect ); |
293 | BOOL getUseBoundingRect(); | 293 | BOOL getUseBoundingRect(); |
294 | 294 | ||
295 | const LLString& getToolTip() const { return mToolTipMsg.getString(); } | 295 | const std::string& getToolTip() const { return mToolTipMsg.getString(); } |
296 | 296 | ||
297 | void sendChildToFront(LLView* child); | 297 | void sendChildToFront(LLView* child); |
298 | void sendChildToBack(LLView* child); | 298 | void sendChildToBack(LLView* child); |
@@ -340,7 +340,7 @@ public: | |||
340 | BOOL getEnabled() const { return mEnabled; } | 340 | BOOL getEnabled() const { return mEnabled; } |
341 | U8 getSoundFlags() const { return mSoundFlags; } | 341 | U8 getSoundFlags() const { return mSoundFlags; } |
342 | 342 | ||
343 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 343 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
344 | 344 | ||
345 | virtual void onVisibilityChange ( BOOL curVisibilityIn ); | 345 | virtual void onVisibilityChange ( BOOL curVisibilityIn ); |
346 | 346 | ||
@@ -374,8 +374,8 @@ public: | |||
374 | S32 getChildCount() const { return (S32)mChildList.size(); } | 374 | S32 getChildCount() const { return (S32)mChildList.size(); } |
375 | template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); } | 375 | template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); } |
376 | BOOL hasAncestor(const LLView* parentp) const; | 376 | BOOL hasAncestor(const LLView* parentp) const; |
377 | BOOL hasChild(const LLString& childname, BOOL recurse = FALSE) const; | 377 | BOOL hasChild(const std::string& childname, BOOL recurse = FALSE) const; |
378 | BOOL childHasKeyboardFocus( const LLString& childname ) const; | 378 | BOOL childHasKeyboardFocus( const std::string& childname ) const; |
379 | 379 | ||
380 | 380 | ||
381 | // | 381 | // |
@@ -403,9 +403,9 @@ public: | |||
403 | EDragAndDropType cargo_type, | 403 | EDragAndDropType cargo_type, |
404 | void* cargo_data, | 404 | void* cargo_data, |
405 | EAcceptance* accept, | 405 | EAcceptance* accept, |
406 | LLString& tooltip_msg); | 406 | std::string& tooltip_msg); |
407 | 407 | ||
408 | LLString getShowNamesToolTip(); | 408 | std::string getShowNamesToolTip(); |
409 | 409 | ||
410 | virtual void draw(); | 410 | virtual void draw(); |
411 | 411 | ||
@@ -439,19 +439,19 @@ public: | |||
439 | void localRectToScreen( const LLRect& local, LLRect* screen ) const; | 439 | void localRectToScreen( const LLRect& local, LLRect* screen ) const; |
440 | 440 | ||
441 | // Listener dispatching functions (Dispatcher deletes pointers to listeners on deregistration or destruction) | 441 | // Listener dispatching functions (Dispatcher deletes pointers to listeners on deregistration or destruction) |
442 | LLSimpleListener* getListenerByName(const LLString &callback_name); | 442 | LLSimpleListener* getListenerByName(const std::string& callback_name); |
443 | void registerEventListener(LLString name, LLSimpleListener* function); | 443 | void registerEventListener(std::string name, LLSimpleListener* function); |
444 | void deregisterEventListener(LLString name); | 444 | void deregisterEventListener(std::string name); |
445 | LLString findEventListener(LLSimpleListener *listener) const; | 445 | std::string findEventListener(LLSimpleListener *listener) const; |
446 | void addListenerToControl(LLEventDispatcher *observer, const LLString& name, LLSD filter, LLSD userdata); | 446 | void addListenerToControl(LLEventDispatcher *observer, const std::string& name, LLSD filter, LLSD userdata); |
447 | 447 | ||
448 | void addBoolControl(LLString name, bool initial_value); | 448 | void addBoolControl(const std::string& name, bool initial_value); |
449 | LLControlVariable *getControl(LLString name); | 449 | LLControlVariable *getControl(const std::string& name); |
450 | LLControlVariable *findControl(LLString name); | 450 | LLControlVariable *findControl(const std::string& name); |
451 | 451 | ||
452 | bool setControlValue(const LLSD& value); | 452 | bool setControlValue(const LLSD& value); |
453 | virtual void setControlName(const LLString& control, LLView *context); | 453 | virtual void setControlName(const std::string& control, LLView *context); |
454 | virtual LLString getControlName() const { return mControlName; } | 454 | virtual std::string getControlName() const { return mControlName; } |
455 | // virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | 455 | // virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); |
456 | virtual void setValue(const LLSD& value); | 456 | virtual void setValue(const LLSD& value); |
457 | virtual LLSD getValue() const; | 457 | virtual LLSD getValue() const; |
@@ -467,15 +467,15 @@ public: | |||
467 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 467 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
468 | /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); | 468 | /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); |
469 | /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); | 469 | /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); |
470 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); // Display mToolTipMsg if no child handles it. | 470 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); // Display mToolTipMsg if no child handles it. |
471 | /*virtual*/ const LLString& getName() const; | 471 | /*virtual*/ const std::string& getName() const; |
472 | /*virtual*/ void onMouseCaptureLost(); | 472 | /*virtual*/ void onMouseCaptureLost(); |
473 | /*virtual*/ BOOL hasMouseCapture(); | 473 | /*virtual*/ BOOL hasMouseCapture(); |
474 | /*virtual*/ BOOL isView(); // Hack to support LLFocusMgr | 474 | /*virtual*/ BOOL isView(); // Hack to support LLFocusMgr |
475 | /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; | 475 | /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; |
476 | /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; | 476 | /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; |
477 | 477 | ||
478 | template <class T> T* getChild(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const | 478 | template <class T> T* getChild(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const |
479 | { | 479 | { |
480 | LLView* child = getChildView(name, recurse, FALSE); | 480 | LLView* child = getChildView(name, recurse, FALSE); |
481 | T* result = dynamic_cast<T*>(child); | 481 | T* result = dynamic_cast<T*>(child); |
@@ -495,22 +495,22 @@ public: | |||
495 | return result; | 495 | return result; |
496 | } | 496 | } |
497 | 497 | ||
498 | virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; | 498 | virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; |
499 | 499 | ||
500 | template <class T> T* createDummyWidget(const LLString& name) const | 500 | template <class T> T* createDummyWidget(const std::string& name) const |
501 | { | 501 | { |
502 | T* widget = getDummyWidget<T>(name); | 502 | T* widget = getDummyWidget<T>(name); |
503 | if (!widget) | 503 | if (!widget) |
504 | { | 504 | { |
505 | // get xml tag name corresponding to requested widget type (e.g. "button") | 505 | // get xml tag name corresponding to requested widget type (e.g. "button") |
506 | LLString xml_tag = LLWidgetClassRegistry::getInstance()->getTag<T>(); | 506 | std::string xml_tag = LLWidgetClassRegistry::getInstance()->getTag<T>(); |
507 | if (xml_tag.empty()) | 507 | if (xml_tag.empty()) |
508 | { | 508 | { |
509 | llwarns << "No xml tag registered for this class " << llendl; | 509 | llwarns << "No xml tag registered for this class " << llendl; |
510 | return NULL; | 510 | return NULL; |
511 | } | 511 | } |
512 | // create dummy xml node (<button name="foo"/>) | 512 | // create dummy xml node (<button name="foo"/>) |
513 | LLXMLNodePtr new_node_ptr = new LLXMLNode(xml_tag, FALSE); | 513 | LLXMLNodePtr new_node_ptr = new LLXMLNode(xml_tag.c_str(), FALSE); |
514 | new_node_ptr->createChild("name", TRUE)->setStringValue(name); | 514 | new_node_ptr->createChild("name", TRUE)->setStringValue(name); |
515 | 515 | ||
516 | widget = dynamic_cast<T*>(createWidget(new_node_ptr)); | 516 | widget = dynamic_cast<T*>(createWidget(new_node_ptr)); |
@@ -518,7 +518,7 @@ public: | |||
518 | { | 518 | { |
519 | // need non-const to update private dummy widget cache | 519 | // need non-const to update private dummy widget cache |
520 | llwarns << "Making dummy " << xml_tag << " named " << name << " in " << getName() << llendl; | 520 | llwarns << "Making dummy " << xml_tag << " named " << name << " in " << getName() << llendl; |
521 | const_cast<LLView*>(this)->mDummyWidgets.insert(std::make_pair(name, widget)); | 521 | mDummyWidgets.insert(std::make_pair(name, widget)); |
522 | } | 522 | } |
523 | else | 523 | else |
524 | { | 524 | { |
@@ -530,7 +530,7 @@ public: | |||
530 | return widget; | 530 | return widget; |
531 | } | 531 | } |
532 | 532 | ||
533 | template <class T> T* getDummyWidget(const LLString& name) const | 533 | template <class T> T* getDummyWidget(const std::string& name) const |
534 | { | 534 | { |
535 | dummy_widget_map_t::const_iterator found_it = mDummyWidgets.find(name); | 535 | dummy_widget_map_t::const_iterator found_it = mDummyWidgets.find(name); |
536 | if (found_it == mDummyWidgets.end()) | 536 | if (found_it == mDummyWidgets.end()) |
@@ -554,17 +554,14 @@ public: | |||
554 | 554 | ||
555 | // Only saves color if different from default setting. | 555 | // Only saves color if different from default setting. |
556 | static void addColorXML(LLXMLNodePtr node, const LLColor4& color, | 556 | static void addColorXML(LLXMLNodePtr node, const LLColor4& color, |
557 | const LLString& xml_name, const LLString& control_name); | 557 | const char* xml_name, const char* control_name); |
558 | static void saveColorToXML(std::ostream& out, const LLColor4& color, | ||
559 | const LLString& xml_name, const LLString& control_name, | ||
560 | const LLString& indent); // DEPRECATED | ||
561 | // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) | 558 | // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) |
562 | //static LLString escapeXML(const LLString& xml); | 559 | //static std::string escapeXML(const std::string& xml); |
563 | static LLWString escapeXML(const LLWString& xml); | 560 | static LLWString escapeXML(const LLWString& xml); |
564 | 561 | ||
565 | //same as above, but wraps multiple lines in quotes and prepends | 562 | //same as above, but wraps multiple lines in quotes and prepends |
566 | //indent as leading white space on each line | 563 | //indent as leading white space on each line |
567 | static LLString escapeXML(const LLString& xml, LLString& indent); | 564 | static std::string escapeXML(const std::string& xml, std::string& indent); |
568 | 565 | ||
569 | // focuses the item in the list after the currently-focused item, wrapping if necessary | 566 | // focuses the item in the list after the currently-focused item, wrapping if necessary |
570 | static BOOL focusNext(LLView::child_list_t & result); | 567 | static BOOL focusNext(LLView::child_list_t & result); |
@@ -594,7 +591,7 @@ protected: | |||
594 | EDragAndDropType type, | 591 | EDragAndDropType type, |
595 | void* data, | 592 | void* data, |
596 | EAcceptance* accept, | 593 | EAcceptance* accept, |
597 | LLString& tooltip_msg); | 594 | std::string& tooltip_msg); |
598 | 595 | ||
599 | LLView* childrenHandleHover(S32 x, S32 y, MASK mask); | 596 | LLView* childrenHandleHover(S32 x, S32 y, MASK mask); |
600 | LLView* childrenHandleMouseUp(S32 x, S32 y, MASK mask); | 597 | LLView* childrenHandleMouseUp(S32 x, S32 y, MASK mask); |
@@ -606,14 +603,14 @@ protected: | |||
606 | 603 | ||
607 | static bool controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std::string type); | 604 | static bool controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std::string type); |
608 | 605 | ||
609 | typedef std::map<LLString, LLControlVariable*> control_map_t; | 606 | typedef std::map<std::string, LLControlVariable*> control_map_t; |
610 | control_map_t mFloaterControls; | 607 | control_map_t mFloaterControls; |
611 | 608 | ||
612 | private: | 609 | private: |
613 | LLView* mParentView; | 610 | LLView* mParentView; |
614 | child_list_t mChildList; | 611 | child_list_t mChildList; |
615 | 612 | ||
616 | LLString mName; | 613 | std::string mName; |
617 | // location in pixels, relative to surrounding structure, bottom,left=0,0 | 614 | // location in pixels, relative to surrounding structure, bottom,left=0,0 |
618 | LLRect mRect; | 615 | LLRect mRect; |
619 | LLRect mBoundingRect; | 616 | LLRect mBoundingRect; |
@@ -643,13 +640,13 @@ private: | |||
643 | 640 | ||
644 | static LLWindow* sWindow; // All root views must know about their window. | 641 | static LLWindow* sWindow; // All root views must know about their window. |
645 | 642 | ||
646 | typedef std::map<LLString, LLPointer<LLSimpleListener> > dispatch_list_t; | 643 | typedef std::map<std::string, LLPointer<LLSimpleListener> > dispatch_list_t; |
647 | dispatch_list_t mDispatchList; | 644 | dispatch_list_t mDispatchList; |
648 | 645 | ||
649 | LLString mControlName; | 646 | std::string mControlName; |
650 | 647 | ||
651 | typedef std::map<LLString, LLView*> dummy_widget_map_t; | 648 | typedef std::map<std::string, LLView*> dummy_widget_map_t; |
652 | dummy_widget_map_t mDummyWidgets; | 649 | mutable dummy_widget_map_t mDummyWidgets; |
653 | 650 | ||
654 | boost::signals::connection mControlConnection; | 651 | boost::signals::connection mControlConnection; |
655 | 652 | ||
@@ -658,7 +655,7 @@ public: | |||
658 | static BOOL sDebugKeys; | 655 | static BOOL sDebugKeys; |
659 | static S32 sDepth; | 656 | static S32 sDepth; |
660 | static BOOL sDebugMouseHandling; | 657 | static BOOL sDebugMouseHandling; |
661 | static LLString sMouseHandlerMessage; | 658 | static std::string sMouseHandlerMessage; |
662 | static S32 sSelectID; | 659 | static S32 sSelectID; |
663 | static BOOL sEditingUI; | 660 | static BOOL sEditingUI; |
664 | static LLView* sEditingUIView; | 661 | static LLView* sEditingUIView; |
diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index c354ac5..8a5beea 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | static LLRegisterWidget<LLViewBorder> r("view_border"); | 36 | static LLRegisterWidget<LLViewBorder> r("view_border"); |
37 | 37 | ||
38 | LLViewBorder::LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) | 38 | LLViewBorder::LLViewBorder( const std::string& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) |
39 | : | 39 | : |
40 | LLView( name, rect, FALSE ), | 40 | LLView( name, rect, FALSE ), |
41 | mBevel( bevel ), | 41 | mBevel( bevel ), |
@@ -277,9 +277,9 @@ BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel | |||
277 | { | 277 | { |
278 | if (node->hasAttribute("bevel_style")) | 278 | if (node->hasAttribute("bevel_style")) |
279 | { | 279 | { |
280 | LLString bevel_string; | 280 | std::string bevel_string; |
281 | node->getAttributeString("bevel_style", bevel_string); | 281 | node->getAttributeString("bevel_style", bevel_string); |
282 | LLString::toLower(bevel_string); | 282 | LLStringUtil::toLower(bevel_string); |
283 | 283 | ||
284 | if (bevel_string == "none") | 284 | if (bevel_string == "none") |
285 | { | 285 | { |
@@ -306,7 +306,7 @@ BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel | |||
306 | // static | 306 | // static |
307 | LLView* LLViewBorder::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 307 | LLView* LLViewBorder::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
308 | { | 308 | { |
309 | LLString name("view_border"); | 309 | std::string name("view_border"); |
310 | node->getAttributeString("name", name); | 310 | node->getAttributeString("name", name); |
311 | 311 | ||
312 | LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; | 312 | LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; |
diff --git a/linden/indra/llui/llviewborder.h b/linden/indra/llui/llviewborder.h index eacb2b5..2297491 100644 --- a/linden/indra/llui/llviewborder.h +++ b/linden/indra/llui/llviewborder.h | |||
@@ -41,7 +41,7 @@ public: | |||
41 | enum EBevel { BEVEL_IN, BEVEL_OUT, BEVEL_BRIGHT, BEVEL_NONE }; | 41 | enum EBevel { BEVEL_IN, BEVEL_OUT, BEVEL_BRIGHT, BEVEL_NONE }; |
42 | enum EStyle { STYLE_LINE, STYLE_TEXTURE }; | 42 | enum EStyle { STYLE_LINE, STYLE_TEXTURE }; |
43 | 43 | ||
44 | LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 ); | 44 | LLViewBorder( const std::string& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 ); |
45 | 45 | ||
46 | virtual void setValue(const LLSD& val) { setRect(LLRect(val)); } | 46 | virtual void setValue(const LLSD& val) { setRect(LLRect(val)); } |
47 | 47 | ||