aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatertest.cpp')
-rw-r--r--linden/indra/newview/llfloatertest.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/linden/indra/newview/llfloatertest.cpp b/linden/indra/newview/llfloatertest.cpp
index b18dabb..ceba079 100644
--- a/linden/indra/newview/llfloatertest.cpp
+++ b/linden/indra/newview/llfloatertest.cpp
@@ -94,7 +94,7 @@ private:
94 94
95 95
96LLFloaterTestImpl::LLFloaterTestImpl() 96LLFloaterTestImpl::LLFloaterTestImpl()
97: LLFloater("test", LLRect(0, 500, 700, 0), "Test UI") 97: LLFloater(std::string("test"), LLRect(0, 500, 700, 0), std::string("Test UI"))
98{ 98{
99 const S32 HPAD = 5; 99 const S32 HPAD = 5;
100 const S32 VPAD = 5; 100 const S32 VPAD = 5;
@@ -114,16 +114,16 @@ LLFloaterTestImpl::LLFloaterTestImpl()
114 LLCheckBoxCtrl* check = NULL; 114 LLCheckBoxCtrl* check = NULL;
115 LLComboBox* combo = NULL; 115 LLComboBox* combo = NULL;
116 116
117 btn = new LLButton("can't click", 117 btn = new LLButton(std::string("can't click"),
118 LLRect(LEFT+150, y, LEFT+150+100, y-LINE), 118 LLRect(LEFT+150, y, LEFT+150+100, y-LINE),
119 NULL, // LLString converts to "" 119 LLStringUtil::null,
120 onClickButton, this); 120 onClickButton, this);
121 btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP); 121 btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
122 btn->setFont(LLFontGL::sSansSerifSmall); 122 btn->setFont(LLFontGL::sSansSerifSmall);
123 addChild(btn); 123 addChild(btn);
124 124
125 text = new LLTextBox("simple_text", 125 text = new LLTextBox(std::string("simple_text"),
126 "simple sans-serif text that is mouse opaque opaque opaque", 126 std::string("simple sans-serif text that is mouse opaque opaque opaque"),
127 50, // max_width 127 50, // max_width
128 LLFontGL::sSansSerifSmall, 128 LLFontGL::sSansSerifSmall,
129 TRUE); // mouse_opaque 129 TRUE); // mouse_opaque
@@ -133,25 +133,25 @@ LLFloaterTestImpl::LLFloaterTestImpl()
133 133
134 y -= VPAD + LINE; 134 y -= VPAD + LINE;
135 135
136 btn = new LLButton("can click", 136 btn = new LLButton(std::string("can click"),
137 LLRect(LEFT+150, y, LEFT+150+100, y-LINE), 137 LLRect(LEFT+150, y, LEFT+150+100, y-LINE),
138 NULL, // LLString converts to "" 138 LLStringUtil::null,
139 onClickButton, this); 139 onClickButton, this);
140 btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP); 140 btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
141 btn->setFont(LLFontGL::sSansSerifSmall); 141 btn->setFont(LLFontGL::sSansSerifSmall);
142 addChild(btn); 142 addChild(btn);
143 143
144 text = new LLTextBox("simple2_text", 144 text = new LLTextBox(std::string("simple2_text"),
145 LLRect(LEFT, y, RIGHT, y-LINE), 145 LLRect(LEFT, y, RIGHT, y-LINE),
146 "monospaced, non-opaque text with tooltip, non-opaque non-opaque", 146 std::string("monospaced, non-opaque text with tooltip, non-opaque non-opaque"),
147 LLFontGL::sMonospace, 147 LLFontGL::sMonospace,
148 FALSE); // mouse_opaque 148 FALSE); // mouse_opaque
149 text->setToolTip(LLString("I'm a tooltip")); 149 text->setToolTip(std::string("I'm a tooltip"));
150 addChild(text); 150 addChild(text);
151 151
152 y -= VPAD + LINE; 152 y -= VPAD + LINE;
153 153
154 tab = new LLTabContainer("test_tab", 154 tab = new LLTabContainer(std::string("test_tab"),
155 LLRect(LEFT, y, RIGHT, BOTTOM), 155 LLRect(LEFT, y, RIGHT, BOTTOM),
156 LLTabContainer::TOP, 156 LLTabContainer::TOP,
157 TRUE, // bordered 157 TRUE, // bordered
@@ -162,36 +162,36 @@ LLFloaterTestImpl::LLFloaterTestImpl()
162 //----------------------------------------------------------------------- 162 //-----------------------------------------------------------------------
163 // First tab container panel 163 // First tab container panel
164 //----------------------------------------------------------------------- 164 //-----------------------------------------------------------------------
165 panel = new LLPanel("first_tab_panel", 165 panel = new LLPanel(std::string("first_tab_panel"),
166 LLRect(0, 400, 400, 0), // dummy rect 166 LLRect(0, 400, 400, 0), // dummy rect
167 TRUE); // bordered 167 TRUE); // bordered
168 tab->addTabPanel(panel, "First", 168 tab->addTabPanel(panel, std::string("First"),
169 TRUE, // select 169 TRUE, // select
170 onClickTab, this); 170 onClickTab, this);
171 171
172 y = panel->getRect().getHeight() - VPAD; 172 y = panel->getRect().getHeight() - VPAD;
173 173
174 text = new LLTextBox("unicode_text", 174 text = new LLTextBox(std::string("unicode_text"),
175 LLRect(LEFT, y, RIGHT, y-LINE), 175 LLRect(LEFT, y, RIGHT, y-LINE),
176 LLString("File"), 176 std::string("File"),
177 LLFontGL::sSansSerif, 177 LLFontGL::sSansSerif,
178 TRUE); // mouse_opaque 178 TRUE); // mouse_opaque
179 text->setToolTip(LLString("This should be Unicode text")); 179 text->setToolTip(std::string("This should be Unicode text"));
180 panel->addChild(text); 180 panel->addChild(text);
181 181
182 y -= VPAD + LINE; 182 y -= VPAD + LINE;
183 183
184 btn = new LLButton("unicode_btn", LLRect(LEFT, y, LEFT+100, y-20)); 184 btn = new LLButton(std::string("unicode_btn"), LLRect(LEFT, y, LEFT+100, y-20));
185 btn->setLabel(LLString("unicode")); 185 btn->setLabel(std::string("unicode"));
186 panel->addChild(btn); 186 panel->addChild(btn);
187 187
188 y -= VPAD + 20; 188 y -= VPAD + 20;
189 189
190 btn = new LLButton("image_btn", 190 btn = new LLButton(std::string("image_btn"),
191 LLRect(LEFT, y, LEFT+32, y-32), 191 LLRect(LEFT, y, LEFT+32, y-32),
192 "tool_zoom.tga", 192 std::string("tool_zoom.tga"),
193 "tool_zoom_active.tga", 193 std::string("tool_zoom_active.tga"),
194 "", // control_name, 194 LLStringUtil::null,
195 onClickButton, this, 195 onClickButton, this,
196 LLFontGL::sSansSerifSmall); 196 LLFontGL::sSansSerifSmall);
197 btn->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); 197 btn->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
@@ -199,56 +199,56 @@ LLFloaterTestImpl::LLFloaterTestImpl()
199 199
200 y -= VPAD + 32; 200 y -= VPAD + 32;
201 201
202 check = new LLCheckBoxCtrl("simple_check", 202 check = new LLCheckBoxCtrl(std::string("simple_check"),
203 LLRect(LEFT, y, LEFT+150, y-LLCHECKBOXCTRL_HEIGHT), 203 LLRect(LEFT, y, LEFT+150, y-LLCHECKBOXCTRL_HEIGHT),
204 "Simple Checkbox", 204 std::string("Simple Checkbox"),
205 LLFontGL::sSansSerifSmall, 205 LLFontGL::sSansSerifSmall,
206 onCommitCheck, this, 206 onCommitCheck, this,
207 TRUE, // initial_value 207 TRUE, // initial_value
208 FALSE, // radio_style 208 FALSE, // radio_style
209 "UIFloaterTestBool"); // control_which 209 std::string("UIFloaterTestBool")); // control_which
210 panel->addChild(check); 210 panel->addChild(check);
211 211
212 y -= VPAD + LLCHECKBOXCTRL_HEIGHT; 212 y -= VPAD + LLCHECKBOXCTRL_HEIGHT;
213 213
214 check = new LLCheckBoxCtrl("unicode_check", 214 check = new LLCheckBoxCtrl(std::string("unicode_check"),
215 LLRect(LEFT, y, LEFT+150, y-LLCHECKBOXCTRL_HEIGHT), 215 LLRect(LEFT, y, LEFT+150, y-LLCHECKBOXCTRL_HEIGHT),
216 "TODO: Unicode Checkbox", 216 std::string("TODO: Unicode Checkbox"),
217 LLFontGL::sSansSerifSmall, 217 LLFontGL::sSansSerifSmall,
218 onCommitCheck, this, 218 onCommitCheck, this,
219 TRUE, // initial_value 219 TRUE, // initial_value
220 FALSE, // radio_style 220 FALSE, // radio_style
221 ""); // control_which 221 LLStringUtil::null); // control_which
222 panel->addChild(check); 222 panel->addChild(check);
223 mCheckUnicode = check; 223 mCheckUnicode = check;
224 224
225 y -= VPAD + LLCHECKBOXCTRL_HEIGHT; 225 y -= VPAD + LLCHECKBOXCTRL_HEIGHT;
226 226
227 combo = new LLComboBox("combo", 227 combo = new LLComboBox(std::string("combo"),
228 LLRect(LEFT, y, LEFT+100, y-LLCOMBOBOX_HEIGHT), 228 LLRect(LEFT, y, LEFT+100, y-LLCOMBOBOX_HEIGHT),
229 "Combobox Label", 229 std::string("Combobox Label"),
230 onCommitCombo, this); 230 onCommitCombo, this);
231 combo->add("first item"); 231 combo->add(std::string("first item"));
232 combo->add("second item"); 232 combo->add(std::string("second item"));
233 combo->add("should go to the top", ADD_TOP); 233 combo->add(std::string("should go to the top"), ADD_TOP);
234 combo->add("disabled item", NULL, ADD_BOTTOM, FALSE); 234 combo->add(std::string("disabled item"), NULL, ADD_BOTTOM, FALSE);
235 panel->addChild(combo); 235 panel->addChild(combo);
236 236
237 y -= VPAD + LLCOMBOBOX_HEIGHT; 237 y -= VPAD + LLCOMBOBOX_HEIGHT;
238 238
239 LLIconCtrl* icon = new LLIconCtrl( 239 LLIconCtrl* icon = new LLIconCtrl(
240 "test_icon", 240 std::string("test_icon"),
241 LLRect(LEFT, y, LEFT+32, y-32), 241 LLRect(LEFT, y, LEFT+32, y-32),
242 "object_cone.tga" ); 242 std::string("object_cone.tga") );
243 panel->addChild(icon); 243 panel->addChild(icon);
244 mIcon = icon; 244 mIcon = icon;
245 245
246 y -= VPAD + 32; 246 y -= VPAD + 32;
247 247
248 LLLineEditor* line = new LLLineEditor( 248 LLLineEditor* line = new LLLineEditor(
249 "test_line", 249 std::string("test_line"),
250 LLRect(LEFT, y, LEFT+200, y-20), 250 LLRect(LEFT, y, LEFT+200, y-20),
251 "test some unicode text here", 251 std::string("test some unicode text here"),
252 LLFontGL::sSansSerif, 252 LLFontGL::sSansSerif,
253 200, // max_length_bytes 253 200, // max_length_bytes
254 onCommitLine, 254 onCommitLine,
@@ -261,7 +261,7 @@ LLFloaterTestImpl::LLFloaterTestImpl()
261 y -= VPAD + 20; 261 y -= VPAD + 20;
262 262
263 LLRadioGroup* group = new LLRadioGroup( 263 LLRadioGroup* group = new LLRadioGroup(
264 "radio_group", 264 std::string("radio_group"),
265 LLRect(LEFT, y, LEFT+200, y - 50), 265 LLRect(LEFT, y, LEFT+200, y - 50),
266 0, // initial_index 266 0, // initial_index
267 onChangeRadioGroup, this, 267 onChangeRadioGroup, this,
@@ -269,28 +269,28 @@ LLFloaterTestImpl::LLFloaterTestImpl()
269 panel->addChild(group); 269 panel->addChild(group);
270 270
271 S32 yy = 100; 271 S32 yy = 100;
272 group->addRadioButton("Radio1", "Radio 1", LLRect(0, yy, 200, yy-LINE), LLFontGL::sSansSerifSmall); 272 group->addRadioButton(std::string("Radio1"), std::string("Radio 1"), LLRect(0, yy, 200, yy-LINE), LLFontGL::sSansSerifSmall);
273 yy -= LINE; 273 yy -= LINE;
274 group->addRadioButton("Radio2", "Radio 2", LLRect(0, yy, 200, yy-LINE), LLFontGL::sSansSerifSmall); 274 group->addRadioButton(std::string("Radio2"), std::string("Radio 2"), LLRect(0, yy, 200, yy-LINE), LLFontGL::sSansSerifSmall);
275 yy -= LINE; 275 yy -= LINE;
276 group->addRadioButton("Radio3", "Radio 3", LLRect(0, yy, 200, yy-LINE), LLFontGL::sSansSerifSmall); 276 group->addRadioButton(std::string("Radio3"), std::string("Radio 3"), LLRect(0, yy, 200, yy-LINE), LLFontGL::sSansSerifSmall);
277 yy -= LINE; 277 yy -= LINE;
278 278
279 //----------------------------------------------------------------------- 279 //-----------------------------------------------------------------------
280 // Second tab container panel 280 // Second tab container panel
281 //----------------------------------------------------------------------- 281 //-----------------------------------------------------------------------
282 panel = new LLPanel("second_tab_panel", 282 panel = new LLPanel(std::string("second_tab_panel"),
283 LLRect(0, 400, 400, 0), // dummy rect 283 LLRect(0, 400, 400, 0), // dummy rect
284 TRUE); // bordered 284 TRUE); // bordered
285 tab->addTabPanel(panel, "Second", 285 tab->addTabPanel(panel, std::string("Second"),
286 FALSE, // select 286 FALSE, // select
287 onClickTab, this); 287 onClickTab, this);
288 288
289 y = panel->getRect().getHeight() - VPAD; 289 y = panel->getRect().getHeight() - VPAD;
290 290
291 btn = new LLButton("Simple Button", 291 btn = new LLButton(std::string("Simple Button"),
292 LLRect(LEFT, y, LEFT+100, y - 20), 292 LLRect(LEFT, y, LEFT+100, y - 20),
293 "", 293 LLStringUtil::null,
294 onClickButton, this); 294 onClickButton, this);
295 btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT); 295 btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT);
296 panel->addChild(btn); 296 panel->addChild(btn);
@@ -331,7 +331,7 @@ void LLFloaterTestImpl::onCommitCheck(LLUICtrl*, void*)
331void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, void*) 331void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, void*)
332{ 332{
333 LLComboBox* combo = (LLComboBox*)ctrl; 333 LLComboBox* combo = (LLComboBox*)ctrl;
334 LLString name = combo->getSimple(); 334 std::string name = combo->getSimple();
335 LLSD value = combo->getValue(); 335 LLSD value = combo->getValue();
336 llinfos << "commit combo name " << name << " value " << value.asString() << llendl; 336 llinfos << "commit combo name " << name << " value " << value.asString() << llendl;
337} 337}