1 // AlertTest.cpp
2 #include "AlertTest.h"
3 #include <cppunit/Test.h>
4 #include <cppunit/TestCaller.h>
5 #include <cppunit/TestSuite.h>
6 #include <stdio.h>
7 #include <string.h>
8 #include <Application.h>
9 #include <Alert.h>
10 #include <Point.h>
11 #include <TextView.h>
12 #include <Button.h>
13 #include <Rect.h>
14
15 #include <iostream>
16 using std::ostream;
17
18 #define ASSERT_DEQUAL(x,y) CPPUNIT_ASSERT_DOUBLES_EQUAL((x),(y),0.01)
19
20 const char *k20X = "XXXXXXXXXXXXXXXXXXXX";
21 const char *k40X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
22 const char *k60X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
23
24 // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color)
25 #if TEST_R5
operator ==(const rgb_color & left,const rgb_color & right)26 bool operator==(const rgb_color &left, const rgb_color &right)
27 {
28 if (left.red == right.red && left.green == right.green &&
29 left.blue == right.blue && left.alpha == right.alpha)
30 return true;
31 else
32 return false;
33 }
34 #endif // TEST_R5
35
36 // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color)
operator <<(ostream & stream,const rgb_color & clr)37 ostream &operator<<(ostream &stream, const rgb_color &clr)
38 {
39 return stream << "rgb_color(" << clr.red << ", " <<
40 clr.green << ", " << clr.blue << ", " << clr.alpha << ")";
41 }
42
43 // For storing expected state of windows or views.
44 struct GuiInfo {
45 const char* label;
46 float width;
47 float height;
48 BPoint topleft;
49 };
50
51 // For storing all the information required to create and
52 // verify the state of a BAlert object.
53 class AlertTestInfo {
54 public:
55 AlertTestInfo(AlertTest *pTest);
56 ~AlertTestInfo();
57
58 void SetWinInfo(const GuiInfo &winInfo);
59 void SetTextViewInfo(const GuiInfo &textInfo);
60 void SetButtonInfo(int32 btn, const GuiInfo &btnInfo);
61
62 void SetButtonWidthMode(button_width widthMode);
63 void SetButtonSpacingMode(button_spacing spacingMode);
64 void SetAlertType(alert_type alertType);
65
66 void GuiInfoTest();
67
68 private:
69 AlertTest* fTest;
70 GuiInfo fWinInfo;
71 GuiInfo fTextInfo;
72 GuiInfo fButtonInfo[3];
73 int32 fButtonCount;
74 button_width fWidthMode;
75 button_spacing fSpacingMode;
76 alert_type fAlertType;
77 };
78
AlertTestInfo(AlertTest * pTest)79 AlertTestInfo::AlertTestInfo(AlertTest *pTest)
80 {
81 memset(this, 0, sizeof(AlertTestInfo));
82
83 fTest = pTest;
84 fWidthMode = B_WIDTH_AS_USUAL;
85 fSpacingMode = B_EVEN_SPACING;
86 fAlertType = B_INFO_ALERT;
87 }
88
~AlertTestInfo()89 AlertTestInfo::~AlertTestInfo()
90 {
91 fTest = NULL;
92 fButtonCount = 0;
93 }
94
95 void
SetWinInfo(const GuiInfo & winInfo)96 AlertTestInfo::SetWinInfo(const GuiInfo &winInfo)
97 {
98 fWinInfo = winInfo;
99 }
100
101 void
SetTextViewInfo(const GuiInfo & textInfo)102 AlertTestInfo::SetTextViewInfo(const GuiInfo &textInfo)
103 {
104 fTextInfo = textInfo;
105 }
106
107 void
SetButtonInfo(int32 btn,const GuiInfo & btnInfo)108 AlertTestInfo::SetButtonInfo(int32 btn, const GuiInfo &btnInfo)
109 {
110 if (btn < 0 || btn > 2 || btn > fButtonCount) {
111 CPPUNIT_ASSERT(false);
112 return;
113 }
114 fButtonInfo[btn] = btnInfo;
115 if (btn == fButtonCount && fButtonCount < 3)
116 fButtonCount++;
117 }
118
119 void
SetButtonWidthMode(button_width widthMode)120 AlertTestInfo::SetButtonWidthMode(button_width widthMode)
121 {
122 fWidthMode = widthMode;
123 }
124
125 void
SetButtonSpacingMode(button_spacing spacingMode)126 AlertTestInfo::SetButtonSpacingMode(button_spacing spacingMode)
127 {
128 fSpacingMode = spacingMode;
129 }
130
131 void
SetAlertType(alert_type alertType)132 AlertTestInfo::SetAlertType(alert_type alertType)
133 {
134 fAlertType = alertType;
135 }
136
137 void
GuiInfoTest()138 AlertTestInfo::GuiInfoTest()
139 {
140 fTest->NextSubTest();
141 // Dummy application object required to create Window objects.
142 BApplication app("application/x-vnd.Haiku-interfacekit_alerttest");
143 BAlert *pAlert = new BAlert(
144 fWinInfo.label,
145 fTextInfo.label,
146 fButtonInfo[0].label,
147 fButtonInfo[1].label,
148 fButtonInfo[2].label,
149 fWidthMode,
150 fSpacingMode,
151 fAlertType
152 );
153 CPPUNIT_ASSERT(pAlert);
154
155 // Alert Window Width/Height
156 fTest->NextSubTest();
157 ASSERT_DEQUAL(fWinInfo.width, pAlert->Bounds().Width());
158 ASSERT_DEQUAL(fWinInfo.height, pAlert->Bounds().Height());
159
160 // [k] MasterView
161 fTest->NextSubTest();
162 BView *masterView = pAlert->ChildAt(0);
163 CPPUNIT_ASSERT(masterView);
164
165 // [k] MasterView Color
166 fTest->NextSubTest();
167 CPPUNIT_ASSERT_EQUAL(ui_color(B_PANEL_BACKGROUND_COLOR),
168 masterView->ViewColor());
169
170 // Test all the buttons
171 BButton *btns[3] = { NULL };
172 for (int32 i = 0; i < 3; i++) {
173 fTest->NextSubTest();
174 btns[i] = pAlert->ButtonAt(i);
175
176 if (i >= fButtonCount) {
177 // If there is should be no button at this index
178 CPPUNIT_ASSERT_EQUAL((BButton*)NULL, btns[i]);
179 } else {
180 // If there should be a button at this index
181 CPPUNIT_ASSERT(btns[i]);
182
183 CPPUNIT_ASSERT(
184 strcmp(fButtonInfo[i].label, btns[i]->Label()) == 0);
185
186 ASSERT_DEQUAL(fButtonInfo[i].width, btns[i]->Bounds().Width());
187
188 ASSERT_DEQUAL(fButtonInfo[i].height, btns[i]->Bounds().Height());
189
190 BPoint pt = btns[i]->ConvertToParent(BPoint(0, 0));
191 ASSERT_DEQUAL(fButtonInfo[i].topleft.x, pt.x);
192 ASSERT_DEQUAL(fButtonInfo[i].topleft.y, pt.y);
193
194 if (i == fButtonCount - 1) {
195 // Default button
196 CPPUNIT_ASSERT_EQUAL(true, btns[i]->IsDefault());
197 }
198 }
199 }
200
201 // [k] TextView
202 fTest->NextSubTest();
203 BTextView *textView = pAlert->TextView();
204 CPPUNIT_ASSERT(textView);
205
206 // [k] TextView ViewColor()
207 fTest->NextSubTest();
208 CPPUNIT_ASSERT_EQUAL(ui_color(B_PANEL_BACKGROUND_COLOR), textView->ViewColor());
209
210 // [k] TextView IsEditable()
211 fTest->NextSubTest();
212 CPPUNIT_ASSERT_EQUAL(false, textView->IsEditable());
213
214 // [k] TextView IsSelectable()
215 fTest->NextSubTest();
216 CPPUNIT_ASSERT_EQUAL(false, textView->IsSelectable());
217
218 // [k] TextView DoesWordWrap()
219 fTest->NextSubTest();
220 CPPUNIT_ASSERT_EQUAL(true, textView->DoesWordWrap());
221
222 // TextView Text
223 fTest->NextSubTest();
224 CPPUNIT_ASSERT(strcmp(fTextInfo.label, textView->Text()) == 0);
225
226 // TextView Width/Height
227 fTest->NextSubTest();
228 ASSERT_DEQUAL(fTextInfo.width, textView->Bounds().Width());
229 ASSERT_DEQUAL(fTextInfo.height, textView->Bounds().Height());
230
231 // TextView Position
232 fTest->NextSubTest();
233 BPoint pt = textView->ConvertToParent(BPoint(0, 0));
234 ASSERT_DEQUAL(fTextInfo.topleft.x, pt.x);
235 ASSERT_DEQUAL(fTextInfo.topleft.y, pt.y);
236
237 delete pAlert;
238 pAlert = NULL;
239 }
240
241 // Suite
242 CppUnit::Test *
Suite()243 AlertTest::Suite()
244 {
245 CppUnit::TestSuite *suite = new CppUnit::TestSuite();
246 typedef CppUnit::TestCaller<AlertTest> TC;
247
248 #define AT_ADDTEST(fn) (suite->addTest(new TC("Alert " #fn, &AlertTest::fn)))
249
250 ////// UW_ES_IA - One Button //////
251 AT_ADDTEST(empty_empty_UW_ES_IA);
252 AT_ADDTEST(OK_X_UW_ES_IA);
253 AT_ADDTEST(OK_60X_UW_ES_IA);
254 AT_ADDTEST(twentyX_60X_UW_ES_IA);
255 AT_ADDTEST(fortyX_60X_UW_ES_IA);
256
257 ////// LW_ES_IA - One Button //////
258 AT_ADDTEST(empty_empty_LW_ES_IA);
259 AT_ADDTEST(OK_X_LW_ES_IA);
260 AT_ADDTEST(twentyX_60X_LW_ES_IA);
261 AT_ADDTEST(fortyX_60X_LW_ES_IA);
262
263 ////// WW_ES_IA - One Button //////
264 AT_ADDTEST(empty_empty_WW_ES_IA);
265 AT_ADDTEST(OK_X_WW_ES_IA);
266 AT_ADDTEST(twentyX_60X_WW_ES_IA);
267
268 ////// UW_ES_EA - One Button //////
269 AT_ADDTEST(OK_X_UW_ES_EA);
270 AT_ADDTEST(fortyX_60X_UW_ES_EA);
271
272 ////// UW_OS_IA - One Button //////
273 AT_ADDTEST(OK_X_UW_OS_IA);
274 AT_ADDTEST(fortyX_60X_UW_OS_IA);
275
276 ////// LW_OS_IA - One Button //////
277 AT_ADDTEST(OK_X_LW_OS_IA);
278
279 ////// UW_OS_EA - One Button //////
280 AT_ADDTEST(OK_X_UW_OS_EA);
281
282 ////// UW_ES_IA - Two Button //////
283 AT_ADDTEST(OK_Cancel_60X_UW_ES_IA);
284 AT_ADDTEST(twentyX_Cancel_60X_UW_ES_IA);
285 AT_ADDTEST(twentyX_20X_60X_UW_ES_IA);
286
287 ////// LW_ES_IA - Two Button //////
288 AT_ADDTEST(empty_empty_X_LW_ES_IA);
289 AT_ADDTEST(OK_Cancel_60X_LW_ES_IA);
290
291 ////// WW_ES_IA - Two Button //////
292 AT_ADDTEST(empty_empty_X_WW_ES_IA);
293 AT_ADDTEST(OK_Cancel_60X_WW_ES_IA);
294 AT_ADDTEST(twentyX_Cancel_60X_WW_ES_IA);
295 AT_ADDTEST(twentyX_20X_WW_ES_IA);
296
297 ////// UW_ES_EA - Two Button //////
298 AT_ADDTEST(OK_Cancel_60X_UW_ES_EA);
299 AT_ADDTEST(twentyX_20X_60X_UW_ES_EA);
300
301 ////// UW_OS_IA - Two Button //////
302 AT_ADDTEST(OK_Cancel_60X_UW_OS_IA);
303
304 ////// LW_OS_IA - Two Button //////
305 AT_ADDTEST(OK_Cancel_60X_LW_OS_IA);
306
307 ////// LW_OS_EA - Two Button //////
308 AT_ADDTEST(twentyX_OK_60X_LW_OS_EA);
309
310 ////// UW_ES_IA - Three Button //////
311 AT_ADDTEST(twentyX_20X_20X_60X_UW_ES_IA);
312
313 ////// LW_ES_IA - Three Button //////
314 AT_ADDTEST(empty_empty_empty_X_LW_ES_IA);
315 AT_ADDTEST(Yes_No_Cancel_X_LW_ES_IA);
316 AT_ADDTEST(twentyX_20X_20X_60X_LW_ES_IA);
317
318 ////// WW_ES_IA - Three Button //////
319 AT_ADDTEST(empty_empty_empty_X_WW_ES_IA);
320 AT_ADDTEST(Monkey_Dog_Cat_X_WW_ES_IA);
321 AT_ADDTEST(X_20X_X_WW_ES_IA);
322 AT_ADDTEST(Yes_No_Cancel_X_WW_ES_IA);
323 AT_ADDTEST(twentyX_20X_20X_60X_WW_ES_IA);
324
325 ////// UW_ES_EA - Three Button //////
326 AT_ADDTEST(twentyX_20X_20X_60X_UW_ES_EA);
327
328 ////// UW_OS_IA - Three Button //////
329 AT_ADDTEST(Yes_No_Cancel_60X_UW_OS_IA);
330
331 ////// LW_OS_IA - Three Button //////
332 AT_ADDTEST(Yes_No_Cancel_60X_LW_OS_IA);
333
334 ////// WW_OS_IA - Three Button //////
335 AT_ADDTEST(Monkey_Dog_Cat_60X_WW_OS_IA);
336
337 ////// UW_OS_EA - Three Button //////
338 AT_ADDTEST(twentyX_OK_Cancel_60X_UW_OS_EA);
339
340 return suite;
341 }
342
343 // setUp
344 void
setUp()345 AlertTest::setUp()
346 {
347 BTestCase::setUp();
348 }
349
350 // tearDown
351 void
tearDown()352 AlertTest::tearDown()
353 {
354 BTestCase::tearDown();
355 }
356
357 ////// UW_ES_IA - One Button //////
358
359 void
empty_empty_UW_ES_IA()360 AlertTest::empty_empty_UW_ES_IA()
361 {
362 AlertTestInfo ati(this);
363 GuiInfo wi, ti, bi;
364 wi.label = "alert1";
365 wi.width = 310.0f;
366 wi.height = 64.0f;
367 ati.SetWinInfo(wi);
368
369 ti.label = "";
370 ti.width = 245.0f;
371 ti.height = 13.0f;
372 ti.topleft.Set(55.0f, 6.0f);
373 ati.SetTextViewInfo(ti);
374
375 bi.label = "";
376 bi.width = 75.0f;
377 bi.height = 30.0f;
378 bi.topleft.Set(229.0f, 28.0f);
379 ati.SetButtonInfo(0, bi);
380
381 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
382 ati.SetButtonSpacingMode(B_EVEN_SPACING);
383 ati.SetAlertType(B_INFO_ALERT);
384
385 ati.GuiInfoTest();
386 }
387
388 void
OK_X_UW_ES_IA()389 AlertTest::OK_X_UW_ES_IA()
390 {
391 AlertTestInfo ati(this);
392 GuiInfo wi, ti, bi;
393 wi.label = "alert1";
394 wi.width = 310.0f;
395 wi.height = 64.0f;
396 ati.SetWinInfo(wi);
397
398 ti.label = "X";
399 ti.width = 245.0f;
400 ti.height = 13.0f;
401 ti.topleft.Set(55.0f, 6.0f);
402 ati.SetTextViewInfo(ti);
403
404 bi.label = "OK";
405 bi.width = 75.0f;
406 bi.height = 30.0f;
407 bi.topleft.Set(229.0f, 28.0f);
408 ati.SetButtonInfo(0, bi);
409
410 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
411 ati.SetButtonSpacingMode(B_EVEN_SPACING);
412 ati.SetAlertType(B_INFO_ALERT);
413
414 ati.GuiInfoTest();
415 }
416
417 void
OK_60X_UW_ES_IA()418 AlertTest::OK_60X_UW_ES_IA()
419 {
420 AlertTestInfo ati(this);
421 GuiInfo wi, ti, bi;
422 wi.label = "alert1";
423 wi.width = 310.0f;
424 wi.height = 77.0f;
425 ati.SetWinInfo(wi);
426
427 ti.label = k60X;
428 ti.width = 245.0f;
429 ti.height = 26.0f;
430 ti.topleft.Set(55.0f, 6.0f);
431 ati.SetTextViewInfo(ti);
432
433 bi.label = "OK";
434 bi.width = 75.0f;
435 bi.height = 30.0f;
436 bi.topleft.Set(229.0f, 41.0f);
437 ati.SetButtonInfo(0, bi);
438
439 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
440 ati.SetButtonSpacingMode(B_EVEN_SPACING);
441 ati.SetAlertType(B_INFO_ALERT);
442
443 ati.GuiInfoTest();
444 }
445
446 void
twentyX_60X_UW_ES_IA()447 AlertTest::twentyX_60X_UW_ES_IA()
448 {
449 AlertTestInfo ati(this);
450 GuiInfo wi, ti, bi;
451 wi.label = "alert1";
452 wi.width = 310.0f;
453 wi.height = 77.0f;
454 ati.SetWinInfo(wi);
455
456 ti.label = k60X;
457 ti.width = 245.0f;
458 ti.height = 26.0f;
459 ti.topleft.Set(55.0f, 6.0f);
460 ati.SetTextViewInfo(ti);
461
462 bi.label = k20X;
463 bi.width = 160.0f;
464 bi.height = 30.0f;
465 bi.topleft.Set(144.0f, 41.0f);
466 ati.SetButtonInfo(0, bi);
467
468 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
469 ati.SetButtonSpacingMode(B_EVEN_SPACING);
470 ati.SetAlertType(B_INFO_ALERT);
471
472 ati.GuiInfoTest();
473 }
474
475 void
fortyX_60X_UW_ES_IA()476 AlertTest::fortyX_60X_UW_ES_IA()
477 {
478 AlertTestInfo ati(this);
479 GuiInfo wi, ti, bi;
480 wi.label = "alert1";
481 wi.width = 365.0f;
482 wi.height = 77.0f;
483 ati.SetWinInfo(wi);
484
485 ti.label = k60X;
486 ti.width = 300.0f;
487 ti.height = 26.0f;
488 ti.topleft.Set(55.0f, 6.0f);
489 ati.SetTextViewInfo(ti);
490
491 bi.label = k40X;
492 bi.width = 300.0f;
493 bi.height = 30.0f;
494 bi.topleft.Set(59.0f, 41.0f);
495 ati.SetButtonInfo(0, bi);
496
497 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
498 ati.SetButtonSpacingMode(B_EVEN_SPACING);
499 ati.SetAlertType(B_INFO_ALERT);
500
501 ati.GuiInfoTest();
502 }
503
504 ////// LW_ES_IA - One Button //////
505
506 void
empty_empty_LW_ES_IA()507 AlertTest::empty_empty_LW_ES_IA()
508 {
509 AlertTestInfo ati(this);
510 GuiInfo wi, ti, bi;
511 wi.label = "alert1";
512 wi.width = 310.0f;
513 wi.height = 64.0f;
514 ati.SetWinInfo(wi);
515
516 ti.label = "";
517 ti.width = 245.0f;
518 ti.height = 13.0f;
519 ti.topleft.Set(55.0f, 6.0f);
520 ati.SetTextViewInfo(ti);
521
522 bi.label = "";
523 bi.width = 20.0f;
524 bi.height = 30.0f;
525 bi.topleft.Set(284.0f, 28.0f);
526 ati.SetButtonInfo(0, bi);
527
528 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
529 ati.SetButtonSpacingMode(B_EVEN_SPACING);
530 ati.SetAlertType(B_INFO_ALERT);
531
532 ati.GuiInfoTest();
533 }
534
535 void
OK_X_LW_ES_IA()536 AlertTest::OK_X_LW_ES_IA()
537 {
538 AlertTestInfo ati(this);
539 GuiInfo wi, ti, bi;
540 wi.label = "alert1";
541 wi.width = 310.0f;
542 wi.height = 64.0f;
543 ati.SetWinInfo(wi);
544
545 ti.label = "X";
546 ti.width = 245.0f;
547 ti.height = 13.0f;
548 ti.topleft.Set(55.0f, 6.0f);
549 ati.SetTextViewInfo(ti);
550
551 bi.label = "OK";
552 bi.width = 35.0f;
553 bi.height = 30.0f;
554 bi.topleft.Set(269.0f, 28.0f);
555 ati.SetButtonInfo(0, bi);
556
557 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
558 ati.SetButtonSpacingMode(B_EVEN_SPACING);
559 ati.SetAlertType(B_INFO_ALERT);
560
561 ati.GuiInfoTest();
562 }
563
564 void
twentyX_60X_LW_ES_IA()565 AlertTest::twentyX_60X_LW_ES_IA()
566 {
567 AlertTestInfo ati(this);
568 GuiInfo wi, ti, bi;
569 wi.label = "alert1";
570 wi.width = 310.0f;
571 wi.height = 77.0f;
572 ati.SetWinInfo(wi);
573
574 ti.label = k60X;
575 ti.width = 245.0f;
576 ti.height = 26.0f;
577 ti.topleft.Set(55.0f, 6.0f);
578 ati.SetTextViewInfo(ti);
579
580 bi.label = k20X;
581 bi.width = 160.0f;
582 bi.height = 30.0f;
583 bi.topleft.Set(144.0f, 41.0f);
584 ati.SetButtonInfo(0, bi);
585
586 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
587 ati.SetButtonSpacingMode(B_EVEN_SPACING);
588 ati.SetAlertType(B_INFO_ALERT);
589
590 ati.GuiInfoTest();
591 }
592
593 void
fortyX_60X_LW_ES_IA()594 AlertTest::fortyX_60X_LW_ES_IA()
595 {
596 AlertTestInfo ati(this);
597 GuiInfo wi, ti, bi;
598 wi.label = "alert1";
599 wi.width = 365.0f;
600 wi.height = 77.0f;
601 ati.SetWinInfo(wi);
602
603 ti.label = k60X;
604 ti.width = 300.0f;
605 ti.height = 26.0f;
606 ti.topleft.Set(55.0f, 6.0f);
607 ati.SetTextViewInfo(ti);
608
609 bi.label = k40X;
610 bi.width = 300.0f;
611 bi.height = 30.0f;
612 bi.topleft.Set(59.0f, 41.0f);
613 ati.SetButtonInfo(0, bi);
614
615 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
616 ati.SetButtonSpacingMode(B_EVEN_SPACING);
617 ati.SetAlertType(B_INFO_ALERT);
618
619 ati.GuiInfoTest();
620 }
621
622 ////// WW_ES_IA - One Button //////
623
624 void
empty_empty_WW_ES_IA()625 AlertTest::empty_empty_WW_ES_IA()
626 {
627 AlertTestInfo ati(this);
628 GuiInfo wi, ti, bi;
629 wi.width = 310.0f;
630 wi.height = 64.0f;
631 ati.SetWinInfo(wi);
632
633 ti.label = "";
634 ti.width = 245.0f;
635 ti.height = 13.0f;
636 ti.topleft.Set(55.0f, 6.0f);
637 ati.SetTextViewInfo(ti);
638
639 bi.label = "";
640 bi.width = 20.0f;
641 bi.height = 30.0f;
642 bi.topleft.Set(284.0f, 28.0f);
643 ati.SetButtonInfo(0, bi);
644
645 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
646 ati.SetButtonSpacingMode(B_EVEN_SPACING);
647 ati.SetAlertType(B_INFO_ALERT);
648
649 ati.GuiInfoTest();
650 }
651
652 void
OK_X_WW_ES_IA()653 AlertTest::OK_X_WW_ES_IA()
654 {
655 AlertTestInfo ati(this);
656 GuiInfo wi, ti, bi;
657 wi.width = 310.0f;
658 wi.height = 64.0f;
659 ati.SetWinInfo(wi);
660
661 ti.label = "X";
662 ti.width = 245.0f;
663 ti.height = 13.0f;
664 ti.topleft.Set(55.0f, 6.0f);
665 ati.SetTextViewInfo(ti);
666
667 bi.label = "OK";
668 bi.width = 35.0f;
669 bi.height = 30.0f;
670 bi.topleft.Set(269.0f, 28.0f);
671 ati.SetButtonInfo(0, bi);
672
673 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
674 ati.SetButtonSpacingMode(B_EVEN_SPACING);
675 ati.SetAlertType(B_INFO_ALERT);
676
677 ati.GuiInfoTest();
678 }
679
680 void
twentyX_60X_WW_ES_IA()681 AlertTest::twentyX_60X_WW_ES_IA()
682 {
683 AlertTestInfo ati(this);
684 GuiInfo wi, ti, bi;
685 wi.width = 310.0f;
686 wi.height = 77.0f;
687 ati.SetWinInfo(wi);
688
689 ti.label = k60X;
690 ti.width = 245.0f;
691 ti.height = 26.0f;
692 ti.topleft.Set(55.0f, 6.0f);
693 ati.SetTextViewInfo(ti);
694
695 bi.label = k20X;
696 bi.width = 160.0f;
697 bi.height = 30.0f;
698 bi.topleft.Set(144.0f, 41.0f);
699 ati.SetButtonInfo(0, bi);
700
701 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
702 ati.SetButtonSpacingMode(B_EVEN_SPACING);
703 ati.SetAlertType(B_INFO_ALERT);
704
705 ati.GuiInfoTest();
706 }
707
708 ////// UW_ES_EA - One Button //////
709
710 void
OK_X_UW_ES_EA()711 AlertTest::OK_X_UW_ES_EA()
712 {
713 AlertTestInfo ati(this);
714 GuiInfo wi, ti, bi;
715 wi.label = "alert1";
716 wi.width = 310.0f;
717 wi.height = 64.0f;
718 ati.SetWinInfo(wi);
719
720 ti.label = "X";
721 ti.width = 290.0f;
722 ti.height = 13.0f;
723 ti.topleft.Set(10.0f, 6.0f);
724 ati.SetTextViewInfo(ti);
725
726 bi.label = "OK";
727 bi.width = 75.0f;
728 bi.height = 30.0f;
729 bi.topleft.Set(229.0f, 28.0f);
730 ati.SetButtonInfo(0, bi);
731
732 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
733 ati.SetButtonSpacingMode(B_EVEN_SPACING);
734 ati.SetAlertType(B_EMPTY_ALERT);
735
736 ati.GuiInfoTest();
737 }
738
739 void
fortyX_60X_UW_ES_EA()740 AlertTest::fortyX_60X_UW_ES_EA()
741 {
742 AlertTestInfo ati(this);
743 GuiInfo wi, ti, bi;
744 wi.label = "alert1";
745 wi.width = 320.0f;
746 wi.height = 77.0f;
747 ati.SetWinInfo(wi);
748
749 ti.label = k60X;
750 ti.width = 300.0f;
751 ti.height = 26.0f;
752 ti.topleft.Set(10.0f, 6.0f);
753 ati.SetTextViewInfo(ti);
754
755 bi.label = k40X;
756 bi.width = 300.0f;
757 bi.height = 30.0f;
758 bi.topleft.Set(14.0f, 41.0f);
759 ati.SetButtonInfo(0, bi);
760
761 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
762 ati.SetButtonSpacingMode(B_EVEN_SPACING);
763 ati.SetAlertType(B_EMPTY_ALERT);
764
765 ati.GuiInfoTest();
766 }
767
768 ////// UW_OS_IA - One Button //////
769
770 void
OK_X_UW_OS_IA()771 AlertTest::OK_X_UW_OS_IA()
772 {
773 AlertTestInfo ati(this);
774 GuiInfo wi, ti, bi;
775 wi.label = "alert1";
776 wi.width = 310.0f;
777 wi.height = 64.0f;
778 ati.SetWinInfo(wi);
779
780 ti.label = "X";
781 ti.width = 245.0f;
782 ti.height = 13.0f;
783 ti.topleft.Set(55.0f, 6.0f);
784 ati.SetTextViewInfo(ti);
785
786 bi.label = "OK";
787 bi.width = 75.0f;
788 bi.height = 30.0f;
789 bi.topleft.Set(229.0f, 28.0f);
790 ati.SetButtonInfo(0, bi);
791
792 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
793 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
794 ati.SetAlertType(B_INFO_ALERT);
795
796 ati.GuiInfoTest();
797 }
798
799 void
fortyX_60X_UW_OS_IA()800 AlertTest::fortyX_60X_UW_OS_IA()
801 {
802 AlertTestInfo ati(this);
803 GuiInfo wi, ti, bi;
804 wi.width = 365.0f;
805 wi.height = 77.0f;
806 ati.SetWinInfo(wi);
807
808 ti.label = k60X;
809 ti.width = 300.0f;
810 ti.height = 26.0f;
811 ti.topleft.Set(55.0f, 6.0f);
812 ati.SetTextViewInfo(ti);
813
814 bi.label = k40X;
815 bi.width = 300.0f;
816 bi.height = 30.0f;
817 bi.topleft.Set(59.0f, 41.0f);
818 ati.SetButtonInfo(0, bi);
819
820 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
821 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
822 ati.SetAlertType(B_INFO_ALERT);
823
824 ati.GuiInfoTest();
825 }
826
827 ////// LW_OS_IA - One Button //////
828
829 void
OK_X_LW_OS_IA()830 AlertTest::OK_X_LW_OS_IA()
831 {
832 AlertTestInfo ati(this);
833 GuiInfo wi, ti, bi;
834 wi.label = "alert1";
835 wi.width = 310.0f;
836 wi.height = 64.0f;
837 ati.SetWinInfo(wi);
838
839 ti.label = "X";
840 ti.width = 245.0f;
841 ti.height = 13.0f;
842 ti.topleft.Set(55.0f, 6.0f);
843 ati.SetTextViewInfo(ti);
844
845 bi.label = "OK";
846 bi.width = 35.0f;
847 bi.height = 30.0f;
848 bi.topleft.Set(269.0f, 28.0f);
849 ati.SetButtonInfo(0, bi);
850
851 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
852 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
853 ati.SetAlertType(B_INFO_ALERT);
854
855 ati.GuiInfoTest();
856 }
857
858 ////// UW_OS_EA - One Button //////
859
860 void
OK_X_UW_OS_EA()861 AlertTest::OK_X_UW_OS_EA()
862 {
863 AlertTestInfo ati(this);
864 GuiInfo wi, ti, bi;
865 wi.label = "alert1";
866 wi.width = 310.0f;
867 wi.height = 64.0f;
868 ati.SetWinInfo(wi);
869
870 ti.label = "X";
871 ti.width = 290.0f;
872 ti.height = 13.0f;
873 ti.topleft.Set(10.0f, 6.0f);
874 ati.SetTextViewInfo(ti);
875
876 bi.label = "OK";
877 bi.width = 75.0f;
878 bi.height = 30.0f;
879 bi.topleft.Set(229.0f, 28.0f);
880 ati.SetButtonInfo(0, bi);
881
882 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
883 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
884 ati.SetAlertType(B_EMPTY_ALERT);
885
886 ati.GuiInfoTest();
887 }
888
889 ////// UW_ES_IA - Two Button //////
890
891 void
OK_Cancel_60X_UW_ES_IA()892 AlertTest::OK_Cancel_60X_UW_ES_IA()
893 {
894 AlertTestInfo ati(this);
895 GuiInfo wi, ti, bi;
896 wi.label = "alert1";
897 wi.width = 310.0f;
898 wi.height = 77.0f;
899 ati.SetWinInfo(wi);
900
901 ti.label = k60X;
902 ti.width = 245.0f;
903 ti.height = 26.0f;
904 ti.topleft.Set(55.0f, 6.0f);
905 ati.SetTextViewInfo(ti);
906
907 bi.label = "OK";
908 bi.width = 75.0f;
909 bi.height = 24.0f;
910 bi.topleft.Set(148.0f, 44.0f);
911 ati.SetButtonInfo(0, bi);
912 bi.label = "Cancel";
913 bi.width = 75.0f;
914 bi.height = 30.0f;
915 bi.topleft.Set(229.0f, 41.0f);
916 ati.SetButtonInfo(1, bi);
917
918 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
919 ati.SetButtonSpacingMode(B_EVEN_SPACING);
920 ati.SetAlertType(B_INFO_ALERT);
921
922 ati.GuiInfoTest();
923 }
924
925 void
twentyX_Cancel_60X_UW_ES_IA()926 AlertTest::twentyX_Cancel_60X_UW_ES_IA()
927 {
928 AlertTestInfo ati(this);
929 GuiInfo wi, ti, bi;
930 wi.label = "alert1";
931 wi.width = 310.0f;
932 wi.height = 77.0f;
933 ati.SetWinInfo(wi);
934
935 ti.label = k60X;
936 ti.width = 245.0f;
937 ti.height = 26.0f;
938 ti.topleft.Set(55.0f, 6.0f);
939 ati.SetTextViewInfo(ti);
940
941 bi.label = k20X;
942 bi.width = 160.0f;
943 bi.height = 24.0f;
944 bi.topleft.Set(63.0f, 44.0f);
945 ati.SetButtonInfo(0, bi);
946 bi.label = "Cancel";
947 bi.width = 75.0f;
948 bi.height = 30.0f;
949 bi.topleft.Set(229.0f, 41.0f);
950 ati.SetButtonInfo(1, bi);
951
952 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
953 ati.SetButtonSpacingMode(B_EVEN_SPACING);
954 ati.SetAlertType(B_INFO_ALERT);
955
956 ati.GuiInfoTest();
957 }
958
959 void
twentyX_20X_60X_UW_ES_IA()960 AlertTest::twentyX_20X_60X_UW_ES_IA()
961 {
962 AlertTestInfo ati(this);
963 GuiInfo wi, ti, bi;
964 wi.label = "alert1";
965 wi.width = 394.0f;
966 wi.height = 77.0f;
967 ati.SetWinInfo(wi);
968
969 ti.label = k60X;
970 ti.width = 329.0f;
971 ti.height = 26.0f;
972 ti.topleft.Set(55.0f, 6.0f);
973 ati.SetTextViewInfo(ti);
974
975 bi.label = k20X;
976 bi.width = 160.0f;
977 bi.height = 24.0f;
978 bi.topleft.Set(62.0f, 44.0f);
979 ati.SetButtonInfo(0, bi);
980 bi.label = k20X;
981 bi.width = 160.0f;
982 bi.height = 30.0f;
983 bi.topleft.Set(228.0f, 41.0f);
984 ati.SetButtonInfo(1, bi);
985
986 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
987 ati.SetButtonSpacingMode(B_EVEN_SPACING);
988 ati.SetAlertType(B_INFO_ALERT);
989
990 ati.GuiInfoTest();
991 }
992
993 ////// LW_ES_IA - Two Button //////
994
995 void
empty_empty_X_LW_ES_IA()996 AlertTest::empty_empty_X_LW_ES_IA()
997 {
998 AlertTestInfo ati(this);
999 GuiInfo wi, ti, bi;
1000 wi.label = "alert1";
1001 wi.width = 310.0f;
1002 wi.height = 64.0f;
1003 ati.SetWinInfo(wi);
1004
1005 ti.label = "X";
1006 ti.width = 245.0f;
1007 ti.height = 13.0f;
1008 ti.topleft.Set(55.0f, 6.0f);
1009 ati.SetTextViewInfo(ti);
1010
1011 bi.label = "";
1012 bi.width = 20.0f;
1013 bi.height = 24.0f;
1014 bi.topleft.Set(258.0f, 31.0f);
1015 ati.SetButtonInfo(0, bi);
1016 bi.label = "";
1017 bi.width = 20.0f;
1018 bi.height = 30.0f;
1019 bi.topleft.Set(284.0f, 28.0f);
1020 ati.SetButtonInfo(1, bi);
1021
1022 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1023 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1024 ati.SetAlertType(B_INFO_ALERT);
1025
1026 ati.GuiInfoTest();
1027 }
1028
1029 void
OK_Cancel_60X_LW_ES_IA()1030 AlertTest::OK_Cancel_60X_LW_ES_IA()
1031 {
1032 AlertTestInfo ati(this);
1033 GuiInfo wi, ti, bi;
1034 wi.label = "alert1";
1035 wi.width = 310.0f;
1036 wi.height = 77.0f;
1037 ati.SetWinInfo(wi);
1038
1039 ti.label = k60X;
1040 ti.width = 245.0f;
1041 ti.height = 26.0f;
1042 ti.topleft.Set(55.0f, 6.0f);
1043 ati.SetTextViewInfo(ti);
1044
1045 bi.label = "OK";
1046 bi.width = 35.0f;
1047 bi.height = 24.0f;
1048 bi.topleft.Set(211.0f, 44.0f);
1049 ati.SetButtonInfo(0, bi);
1050 bi.label = "Cancel";
1051 bi.width = 52.0f;
1052 bi.height = 30.0f;
1053 bi.topleft.Set(252.0f, 41.0f);
1054 ati.SetButtonInfo(1, bi);
1055
1056 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1057 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1058 ati.SetAlertType(B_INFO_ALERT);
1059
1060 ati.GuiInfoTest();
1061 }
1062
1063 ////// WW_ES_IA - Two Button //////
1064
1065 void
empty_empty_X_WW_ES_IA()1066 AlertTest::empty_empty_X_WW_ES_IA()
1067 {
1068 AlertTestInfo ati(this);
1069 GuiInfo wi, ti, bi;
1070 wi.width = 310.0f;
1071 wi.height = 64.0f;
1072 ati.SetWinInfo(wi);
1073
1074 ti.label = "X";
1075 ti.width = 245.0f;
1076 ti.height = 13.0f;
1077 ti.topleft.Set(55.0f, 6.0f);
1078 ati.SetTextViewInfo(ti);
1079
1080 bi.label = "";
1081 bi.width = 20.0f;
1082 bi.height = 24.0f;
1083 bi.topleft.Set(258.0f, 31.0f);
1084 ati.SetButtonInfo(0, bi);
1085 bi.label = "";
1086 bi.width = 20.0f;
1087 bi.height = 30.0f;
1088 bi.topleft.Set(284.0f, 28.0f);
1089 ati.SetButtonInfo(1, bi);
1090
1091 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1092 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1093 ati.SetAlertType(B_INFO_ALERT);
1094
1095 ati.GuiInfoTest();
1096 }
1097
1098 void
OK_Cancel_60X_WW_ES_IA()1099 AlertTest::OK_Cancel_60X_WW_ES_IA()
1100 {
1101 AlertTestInfo ati(this);
1102 GuiInfo wi, ti, bi;
1103 wi.width = 310.0f;
1104 wi.height = 77.0f;
1105 ati.SetWinInfo(wi);
1106
1107 ti.label = k60X;
1108 ti.width = 245.0f;
1109 ti.height = 26.0f;
1110 ti.topleft.Set(55.0f, 6.0f);
1111 ati.SetTextViewInfo(ti);
1112
1113 bi.label = "OK";
1114 bi.width = 52.0f;
1115 bi.height = 24.0f;
1116 bi.topleft.Set(194.0f, 44.0f);
1117 ati.SetButtonInfo(0, bi);
1118 bi.label = "Cancel";
1119 bi.width = 52.0f;
1120 bi.height = 30.0f;
1121 bi.topleft.Set(252.0f, 41.0f);
1122 ati.SetButtonInfo(1, bi);
1123
1124 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1125 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1126 ati.SetAlertType(B_INFO_ALERT);
1127
1128 ati.GuiInfoTest();
1129 }
1130
1131 void
twentyX_Cancel_60X_WW_ES_IA()1132 AlertTest::twentyX_Cancel_60X_WW_ES_IA()
1133 {
1134 AlertTestInfo ati(this);
1135 GuiInfo wi, ti, bi;
1136 wi.width = 394.0f;
1137 wi.height = 77.0f;
1138 ati.SetWinInfo(wi);
1139
1140 ti.label = k60X;
1141 ti.width = 329.0f;
1142 ti.height = 26.0f;
1143 ti.topleft.Set(55.0f, 6.0f);
1144 ati.SetTextViewInfo(ti);
1145
1146 bi.label = k20X;
1147 bi.width = 160.0f;
1148 bi.height = 24.0f;
1149 bi.topleft.Set(62.0f, 44.0f);
1150 ati.SetButtonInfo(0, bi);
1151 bi.label = "Cancel";
1152 bi.width = 160.0f;
1153 bi.height = 30.0f;
1154 bi.topleft.Set(228.0f, 41.0f);
1155 ati.SetButtonInfo(1, bi);
1156
1157 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1158 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1159 ati.SetAlertType(B_INFO_ALERT);
1160
1161 ati.GuiInfoTest();
1162 }
1163
1164 void
twentyX_20X_WW_ES_IA()1165 AlertTest::twentyX_20X_WW_ES_IA()
1166 {
1167 AlertTestInfo ati(this);
1168 GuiInfo wi, ti, bi;
1169 wi.width = 394.0f;
1170 wi.height = 77.0f;
1171 ati.SetWinInfo(wi);
1172
1173 ti.label = k60X;
1174 ti.width = 329.0f;
1175 ti.height = 26.0f;
1176 ti.topleft.Set(55.0f, 6.0f);
1177 ati.SetTextViewInfo(ti);
1178
1179 bi.label = k20X;
1180 bi.width = 160.0f;
1181 bi.height = 24.0f;
1182 bi.topleft.Set(62.0f, 44.0f);
1183 ati.SetButtonInfo(0, bi);
1184 bi.label = k20X;
1185 bi.width = 160.0f;
1186 bi.height = 30.0f;
1187 bi.topleft.Set(228.0f, 41.0f);
1188 ati.SetButtonInfo(1, bi);
1189
1190 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1191 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1192 ati.SetAlertType(B_INFO_ALERT);
1193
1194 ati.GuiInfoTest();
1195 }
1196
1197 ////// UW_ES_EA - Two Button //////
1198
1199 void
OK_Cancel_60X_UW_ES_EA()1200 AlertTest::OK_Cancel_60X_UW_ES_EA()
1201 {
1202 AlertTestInfo ati(this);
1203 GuiInfo wi, ti, bi;
1204 wi.label = "alert1";
1205 wi.width = 310.0f;
1206 wi.height = 77.0f;
1207 ati.SetWinInfo(wi);
1208
1209 ti.label = k60X;
1210 ti.width = 290.0f;
1211 ti.height = 26.0f;
1212 ti.topleft.Set(10.0f, 6.0f);
1213 ati.SetTextViewInfo(ti);
1214
1215 bi.label = "OK";
1216 bi.width = 75.0f;
1217 bi.height = 24.0f;
1218 bi.topleft.Set(148.0f, 44.0f);
1219 ati.SetButtonInfo(0, bi);
1220 bi.label = "Cancel";
1221 bi.width = 75.0f;
1222 bi.height = 30.0f;
1223 bi.topleft.Set(229.0f, 41.0f);
1224 ati.SetButtonInfo(1, bi);
1225
1226 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1227 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1228 ati.SetAlertType(B_EMPTY_ALERT);
1229
1230 ati.GuiInfoTest();
1231 }
1232
1233 void
twentyX_20X_60X_UW_ES_EA()1234 AlertTest::twentyX_20X_60X_UW_ES_EA()
1235 {
1236 AlertTestInfo ati(this);
1237 GuiInfo wi, ti, bi;
1238 wi.label = "alert1";
1239 wi.width = 349.0f;
1240 wi.height = 77.0f;
1241 ati.SetWinInfo(wi);
1242
1243 ti.label = k60X;
1244 ti.width = 329.0f;
1245 ti.height = 26.0f;
1246 ti.topleft.Set(10.0f, 6.0f);
1247 ati.SetTextViewInfo(ti);
1248
1249 bi.label = k20X;
1250 bi.width = 160.0f;
1251 bi.height = 24.0f;
1252 bi.topleft.Set(17.0f, 44.0f);
1253 ati.SetButtonInfo(0, bi);
1254 bi.label = k20X;
1255 bi.width = 160.0f;
1256 bi.height = 30.0f;
1257 bi.topleft.Set(183.0f, 41.0f);
1258 ati.SetButtonInfo(1, bi);
1259
1260 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1261 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1262 ati.SetAlertType(B_EMPTY_ALERT);
1263
1264 ati.GuiInfoTest();
1265 }
1266
1267 ////// UW_OS_IA - Two Button //////
1268
1269 void
OK_Cancel_60X_UW_OS_IA()1270 AlertTest::OK_Cancel_60X_UW_OS_IA()
1271 {
1272 AlertTestInfo ati(this);
1273 GuiInfo wi, ti, bi;
1274 wi.label = "alert";
1275 wi.width = 310.0f;
1276 wi.height = 77.0f;
1277 ati.SetWinInfo(wi);
1278
1279 ti.label = k60X;
1280 ti.width = 245.0f;
1281 ti.height = 26.0f;
1282 ti.topleft.Set(55.0f, 6.0f);
1283 ati.SetTextViewInfo(ti);
1284
1285 bi.label = "OK";
1286 bi.width = 75.0f;
1287 bi.height = 24.0f;
1288 bi.topleft.Set(55.0f, 44.0f);
1289 ati.SetButtonInfo(0, bi);
1290 bi.label = "Cancel";
1291 bi.width = 75.0f;
1292 bi.height = 30.0f;
1293 bi.topleft.Set(229.0f, 41.0f);
1294 ati.SetButtonInfo(1, bi);
1295
1296 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1297 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1298 ati.SetAlertType(B_INFO_ALERT);
1299
1300 ati.GuiInfoTest();
1301 }
1302
1303 ////// LW_OS_IA - Two Button //////
1304
1305 void
OK_Cancel_60X_LW_OS_IA()1306 AlertTest::OK_Cancel_60X_LW_OS_IA()
1307 {
1308 AlertTestInfo ati(this);
1309 GuiInfo wi, ti, bi;
1310 wi.label = "alert";
1311 wi.width = 310.0f;
1312 wi.height = 77.0f;
1313 ati.SetWinInfo(wi);
1314
1315 ti.label = k60X;
1316 ti.width = 245.0f;
1317 ti.height = 26.0f;
1318 ti.topleft.Set(55.0f, 6.0f);
1319 ati.SetTextViewInfo(ti);
1320
1321 bi.label = "OK";
1322 bi.width = 35.0f;
1323 bi.height = 24.0f;
1324 bi.topleft.Set(55.0f, 44.0f);
1325 ati.SetButtonInfo(0, bi);
1326 bi.label = "Cancel";
1327 bi.width = 52.0f;
1328 bi.height = 30.0f;
1329 bi.topleft.Set(252.0f, 41.0f);
1330 ati.SetButtonInfo(1, bi);
1331
1332 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1333 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1334 ati.SetAlertType(B_INFO_ALERT);
1335
1336 ati.GuiInfoTest();
1337 }
1338
1339 ////// LW_OS_EA - Two Button //////
1340
1341 void
twentyX_OK_60X_LW_OS_EA()1342 AlertTest::twentyX_OK_60X_LW_OS_EA()
1343 {
1344 AlertTestInfo ati(this);
1345 GuiInfo wi, ti, bi;
1346 wi.label = "alert";
1347 wi.width = 310.0f;
1348 wi.height = 77.0f;
1349 ati.SetWinInfo(wi);
1350
1351 ti.label = k60X;
1352 ti.width = 290.0f;
1353 ti.height = 26.0f;
1354 ti.topleft.Set(10.0f, 6.0f);
1355 ati.SetTextViewInfo(ti);
1356
1357 bi.label = k20X;
1358 bi.width = 160.0f;
1359 bi.height = 24.0f;
1360 bi.topleft.Set(10.0f, 44.0f);
1361 ati.SetButtonInfo(0, bi);
1362 bi.label = "OK";
1363 bi.width = 35.0f;
1364 bi.height = 30.0f;
1365 bi.topleft.Set(269.0f, 41.0f);
1366 ati.SetButtonInfo(1, bi);
1367
1368 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1369 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1370 ati.SetAlertType(B_EMPTY_ALERT);
1371
1372 ati.GuiInfoTest();
1373 }
1374
1375 ////// UW_ES_IA - Three Button //////
1376
1377 void
twentyX_20X_20X_60X_UW_ES_IA()1378 AlertTest::twentyX_20X_20X_60X_UW_ES_IA()
1379 {
1380 AlertTestInfo ati(this);
1381 GuiInfo wi, ti, bi;
1382 wi.label = "alert1";
1383 wi.width = 563.0f;
1384 wi.height = 64.0f;
1385 ati.SetWinInfo(wi);
1386
1387 ti.label = k60X;
1388 ti.width = 498.0f;
1389 ti.height = 13.0f;
1390 ti.topleft.Set(55.0f, 6.0f);
1391 ati.SetTextViewInfo(ti);
1392
1393 bi.label = k20X;
1394 bi.width = 160.0f;
1395 bi.height = 24.0f;
1396 bi.topleft.Set(62.0f, 31.0f);
1397 ati.SetButtonInfo(0, bi);
1398 bi.label = k20X;
1399 bi.width = 160.0f;
1400 bi.height = 24.0f;
1401 bi.topleft.Set(231.0f, 31.0f);
1402 ati.SetButtonInfo(1, bi);
1403 bi.label = k20X;
1404 bi.width = 160.0f;
1405 bi.height = 30.0f;
1406 bi.topleft.Set(397.0f, 28.0f);
1407 ati.SetButtonInfo(2, bi);
1408
1409 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1410 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1411 ati.SetAlertType(B_INFO_ALERT);
1412
1413 ati.GuiInfoTest();
1414 }
1415
1416 ////// LW_ES_IA - Three Button //////
1417
1418 void
empty_empty_empty_X_LW_ES_IA()1419 AlertTest::empty_empty_empty_X_LW_ES_IA()
1420 {
1421 AlertTestInfo ati(this);
1422 GuiInfo wi, ti, bi;
1423 wi.label = "alert1";
1424 wi.width = 310.0f;
1425 wi.height = 64.0f;
1426 ati.SetWinInfo(wi);
1427
1428 ti.label = "X";
1429 ti.width = 245.0f;
1430 ti.height = 13.0f;
1431 ti.topleft.Set(55.0f, 6.0f);
1432 ati.SetTextViewInfo(ti);
1433
1434 bi.label = "";
1435 bi.width = 20.0f;
1436 bi.height = 24.0f;
1437 bi.topleft.Set(229.0f, 31.0f);
1438 ati.SetButtonInfo(0, bi);
1439 bi.label = "";
1440 bi.width = 20.0f;
1441 bi.height = 24.0f;
1442 bi.topleft.Set(258.0f, 31.0f);
1443 ati.SetButtonInfo(1, bi);
1444 bi.label = "";
1445 bi.width = 20.0f;
1446 bi.height = 30.0f;
1447 bi.topleft.Set(284.0f, 28.0f);
1448 ati.SetButtonInfo(2, bi);
1449
1450 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1451 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1452 ati.SetAlertType(B_INFO_ALERT);
1453
1454 ati.GuiInfoTest();
1455 }
1456
1457 void
Yes_No_Cancel_X_LW_ES_IA()1458 AlertTest::Yes_No_Cancel_X_LW_ES_IA()
1459 {
1460 AlertTestInfo ati(this);
1461 GuiInfo wi, ti, bi;
1462 wi.label = "alert1";
1463 wi.width = 310.0f;
1464 wi.height = 64.0f;
1465 ati.SetWinInfo(wi);
1466
1467 ti.label = "X";
1468 ti.width = 245.0f;
1469 ti.height = 13.0f;
1470 ti.topleft.Set(55.0f, 6.0f);
1471 ati.SetTextViewInfo(ti);
1472
1473 bi.label = "Yes";
1474 bi.width = 37.0f;
1475 bi.height = 24.0f;
1476 bi.topleft.Set(167.0f, 31.0f);
1477 ati.SetButtonInfo(0, bi);
1478 bi.label = "No";
1479 bi.width = 33.0f;
1480 bi.height = 24.0f;
1481 bi.topleft.Set(213.0f, 31.0f);
1482 ati.SetButtonInfo(1, bi);
1483 bi.label = "Cancel";
1484 bi.width = 52.0f;
1485 bi.height = 30.0f;
1486 bi.topleft.Set(252.0f, 28.0f);
1487 ati.SetButtonInfo(2, bi);
1488
1489 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1490 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1491 ati.SetAlertType(B_INFO_ALERT);
1492
1493 ati.GuiInfoTest();
1494 }
1495
1496 void
twentyX_20X_20X_60X_LW_ES_IA()1497 AlertTest::twentyX_20X_20X_60X_LW_ES_IA()
1498 {
1499 AlertTestInfo ati(this);
1500 GuiInfo wi, ti, bi;
1501 wi.label = "alert1";
1502 wi.width = 563.0f;
1503 wi.height = 64.0f;
1504 ati.SetWinInfo(wi);
1505
1506 ti.label = k60X;
1507 ti.width = 498.0f;
1508 ti.height = 13.0f;
1509 ti.topleft.Set(55.0f, 6.0f);
1510 ati.SetTextViewInfo(ti);
1511
1512 bi.label = k20X;
1513 bi.width = 160.0f;
1514 bi.height = 24.0f;
1515 bi.topleft.Set(62.0f, 31.0f);
1516 ati.SetButtonInfo(0, bi);
1517 bi.label = k20X;
1518 bi.width = 160.0f;
1519 bi.height = 24.0f;
1520 bi.topleft.Set(231.0f, 31.0f);
1521 ati.SetButtonInfo(1, bi);
1522 bi.label = k20X;
1523 bi.width = 160.0f;
1524 bi.height = 30.0f;
1525 bi.topleft.Set(397.0f, 28.0f);
1526 ati.SetButtonInfo(2, bi);
1527
1528 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1529 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1530 ati.SetAlertType(B_INFO_ALERT);
1531
1532 ati.GuiInfoTest();
1533 }
1534
1535 ////// WW_ES_IA - Three Button //////
1536
1537 void
empty_empty_empty_X_WW_ES_IA()1538 AlertTest::empty_empty_empty_X_WW_ES_IA()
1539 {
1540 AlertTestInfo ati(this);
1541 GuiInfo wi, ti, bi;
1542 wi.width = 310.0f;
1543 wi.height = 64.0f;
1544 ati.SetWinInfo(wi);
1545
1546 ti.label = "X";
1547 ti.width = 245.0f;
1548 ti.height = 13.0f;
1549 ti.topleft.Set(55.0f, 6.0f);
1550 ati.SetTextViewInfo(ti);
1551
1552 bi.label = "";
1553 bi.width = 20.0f;
1554 bi.height = 24.0f;
1555 bi.topleft.Set(229.0f, 31.0f);
1556 ati.SetButtonInfo(0, bi);
1557 bi.label = "";
1558 bi.width = 20.0f;
1559 bi.height = 24.0f;
1560 bi.topleft.Set(258.0f, 31.0f);
1561 ati.SetButtonInfo(1, bi);
1562 bi.label = "";
1563 bi.width = 20.0f;
1564 bi.height = 30.0f;
1565 bi.topleft.Set(284.0f, 28.0f);
1566 ati.SetButtonInfo(2, bi);
1567
1568 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1569 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1570 ati.SetAlertType(B_INFO_ALERT);
1571
1572 ati.GuiInfoTest();
1573 }
1574
1575 void
Monkey_Dog_Cat_X_WW_ES_IA()1576 AlertTest::Monkey_Dog_Cat_X_WW_ES_IA()
1577 {
1578 AlertTestInfo ati(this);
1579 GuiInfo wi, ti, bi;
1580 wi.width = 310.0f;
1581 wi.height = 64.0f;
1582 ati.SetWinInfo(wi);
1583
1584 ti.label = "X";
1585 ti.width = 245.0f;
1586 ti.height = 13.0f;
1587 ti.topleft.Set(55.0f, 6.0f);
1588 ati.SetTextViewInfo(ti);
1589
1590 bi.label = "Monkey";
1591 bi.width = 56.0f;
1592 bi.height = 24.0f;
1593 bi.topleft.Set(121.0f, 31.0f);
1594 ati.SetButtonInfo(0, bi);
1595 bi.label = "Dog";
1596 bi.width = 56.0f;
1597 bi.height = 24.0f;
1598 bi.topleft.Set(186.0f, 31.0f);
1599 ati.SetButtonInfo(1, bi);
1600 bi.label = "Cat";
1601 bi.width = 56.0f;
1602 bi.height = 30.0f;
1603 bi.topleft.Set(248.0f, 28.0f);
1604 ati.SetButtonInfo(2, bi);
1605
1606 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1607 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1608 ati.SetAlertType(B_INFO_ALERT);
1609
1610 ati.GuiInfoTest();
1611 }
1612
1613 void
X_20X_X_WW_ES_IA()1614 AlertTest::X_20X_X_WW_ES_IA()
1615 {
1616 AlertTestInfo ati(this);
1617 GuiInfo wi, ti, bi;
1618 wi.width = 563.0f;
1619 wi.height = 64.0f;
1620 ati.SetWinInfo(wi);
1621
1622 ti.label = "X";
1623 ti.width = 498.0f;
1624 ti.height = 13.0f;
1625 ti.topleft.Set(55.0f, 6.0f);
1626 ati.SetTextViewInfo(ti);
1627
1628 bi.label = "X";
1629 bi.width = 160.0f;
1630 bi.height = 24.0f;
1631 bi.topleft.Set(62.0f, 31.0f);
1632 ati.SetButtonInfo(0, bi);
1633 bi.label = k20X;
1634 bi.width = 160.0f;
1635 bi.height = 24.0f;
1636 bi.topleft.Set(231.0f, 31.0f);
1637 ati.SetButtonInfo(1, bi);
1638 bi.label = "X";
1639 bi.width = 160.0f;
1640 bi.height = 30.0f;
1641 bi.topleft.Set(397.0f, 28.0f);
1642 ati.SetButtonInfo(2, bi);
1643
1644 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1645 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1646 ati.SetAlertType(B_INFO_ALERT);
1647
1648 ati.GuiInfoTest();
1649 }
1650
1651 void
Yes_No_Cancel_X_WW_ES_IA()1652 AlertTest::Yes_No_Cancel_X_WW_ES_IA()
1653 {
1654 AlertTestInfo ati(this);
1655 GuiInfo wi, ti, bi;
1656 wi.width = 310.0f;
1657 wi.height = 64.0f;
1658 ati.SetWinInfo(wi);
1659
1660 ti.label = "X";
1661 ti.width = 245.0f;
1662 ti.height = 13.0f;
1663 ti.topleft.Set(55.0f, 6.0f);
1664 ati.SetTextViewInfo(ti);
1665
1666 bi.label = "Yes";
1667 bi.width = 52.0f;
1668 bi.height = 24.0f;
1669 bi.topleft.Set(133.0f, 31.0f);
1670 ati.SetButtonInfo(0, bi);
1671 bi.label = "No";
1672 bi.width = 52.0f;
1673 bi.height = 24.0f;
1674 bi.topleft.Set(194.0f, 31.0f);
1675 ati.SetButtonInfo(1, bi);
1676 bi.label = "Cancel";
1677 bi.width = 52.0f;
1678 bi.height = 30.0f;
1679 bi.topleft.Set(252.0f, 28.0f);
1680 ati.SetButtonInfo(2, bi);
1681
1682 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1683 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1684 ati.SetAlertType(B_INFO_ALERT);
1685
1686 ati.GuiInfoTest();
1687 }
1688
1689 void
twentyX_20X_20X_60X_WW_ES_IA()1690 AlertTest::twentyX_20X_20X_60X_WW_ES_IA()
1691 {
1692 AlertTestInfo ati(this);
1693 GuiInfo wi, ti, bi;
1694 wi.width = 563.0f;
1695 wi.height = 64.0f;
1696 ati.SetWinInfo(wi);
1697
1698 ti.label = k60X;
1699 ti.width = 498.0f;
1700 ti.height = 13.0f;
1701 ti.topleft.Set(55.0f, 6.0f);
1702 ati.SetTextViewInfo(ti);
1703
1704 bi.label = k20X;
1705 bi.width = 160.0f;
1706 bi.height = 24.0f;
1707 bi.topleft.Set(62.0f, 31.0f);
1708 ati.SetButtonInfo(0, bi);
1709 bi.label = k20X;
1710 bi.width = 160.0f;
1711 bi.height = 24.0f;
1712 bi.topleft.Set(231.0f, 31.0f);
1713 ati.SetButtonInfo(1, bi);
1714 bi.label = k20X;
1715 bi.width = 160.0f;
1716 bi.height = 30.0f;
1717 bi.topleft.Set(397.0f, 28.0f);
1718 ati.SetButtonInfo(2, bi);
1719
1720 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1721 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1722 ati.SetAlertType(B_INFO_ALERT);
1723
1724 ati.GuiInfoTest();
1725 }
1726
1727
1728 ////// UW_ES_EA - Three Button //////
1729
1730 void
twentyX_20X_20X_60X_UW_ES_EA()1731 AlertTest::twentyX_20X_20X_60X_UW_ES_EA()
1732 {
1733 AlertTestInfo ati(this);
1734 GuiInfo wi, ti, bi;
1735 wi.label = "alert1";
1736 wi.width = 518.0f;
1737 wi.height = 64.0f;
1738 ati.SetWinInfo(wi);
1739
1740 ti.label = k60X;
1741 ti.width = 498.0f;
1742 ti.height = 13.0f;
1743 ti.topleft.Set(10.0f, 6.0f);
1744 ati.SetTextViewInfo(ti);
1745
1746 bi.label = k20X;
1747 bi.width = 160.0f;
1748 bi.height = 24.0f;
1749 bi.topleft.Set(17.0f, 31.0f);
1750 ati.SetButtonInfo(0, bi);
1751 bi.label = k20X;
1752 bi.width = 160.0f;
1753 bi.height = 24.0f;
1754 bi.topleft.Set(186.0f, 31.0f);
1755 ati.SetButtonInfo(1, bi);
1756 bi.label = k20X;
1757 bi.width = 160.0f;
1758 bi.height = 30.0f;
1759 bi.topleft.Set(352.0f, 28.0f);
1760 ati.SetButtonInfo(2, bi);
1761
1762 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1763 ati.SetButtonSpacingMode(B_EVEN_SPACING);
1764 ati.SetAlertType(B_EMPTY_ALERT);
1765
1766 ati.GuiInfoTest();
1767 }
1768
1769 ////// UW_OS_IA - Three Button //////
1770
1771 void
Yes_No_Cancel_60X_UW_OS_IA()1772 AlertTest::Yes_No_Cancel_60X_UW_OS_IA()
1773 {
1774 AlertTestInfo ati(this);
1775 GuiInfo wi, ti, bi;
1776 wi.label = "alert1";
1777 wi.width = 335.0f;
1778 wi.height = 77.0f;
1779 ati.SetWinInfo(wi);
1780
1781 ti.label = k60X;
1782 ti.width = 270.0f;
1783 ti.height = 26.0f;
1784 ti.topleft.Set(55.0f, 6.0f);
1785 ati.SetTextViewInfo(ti);
1786
1787 bi.label = "Yes";
1788 bi.width = 75.0f;
1789 bi.height = 24.0f;
1790 bi.topleft.Set(66.0f, 44.0f);
1791 ati.SetButtonInfo(0, bi);
1792 bi.label = "No";
1793 bi.width = 75.0f;
1794 bi.height = 24.0f;
1795 bi.topleft.Set(173.0f, 44.0f);
1796 ati.SetButtonInfo(1, bi);
1797 bi.label = "Cancel";
1798 bi.width = 75.0f;
1799 bi.height = 30.0f;
1800 bi.topleft.Set(254.0f, 41.0f);
1801 ati.SetButtonInfo(2, bi);
1802
1803 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1804 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1805 ati.SetAlertType(B_INFO_ALERT);
1806
1807 ati.GuiInfoTest();
1808 }
1809
1810 ////// LW_OS_IA - Three Button //////
1811
1812 void
Yes_No_Cancel_60X_LW_OS_IA()1813 AlertTest::Yes_No_Cancel_60X_LW_OS_IA()
1814 {
1815 AlertTestInfo ati(this);
1816 GuiInfo wi, ti, bi;
1817 wi.label = "alert1";
1818 wi.width = 335.0f;
1819 wi.height = 77.0f;
1820 ati.SetWinInfo(wi);
1821
1822 ti.label = k60X;
1823 ti.width = 270.0f;
1824 ti.height = 26.0f;
1825 ti.topleft.Set(55.0f, 6.0f);
1826 ati.SetTextViewInfo(ti);
1827
1828 bi.label = "Yes";
1829 bi.width = 37.0f;
1830 bi.height = 24.0f;
1831 bi.topleft.Set(169.0f, 44.0f);
1832 ati.SetButtonInfo(0, bi);
1833 bi.label = "No";
1834 bi.width = 33.0f;
1835 bi.height = 24.0f;
1836 bi.topleft.Set(238.0f, 44.0f);
1837 ati.SetButtonInfo(1, bi);
1838 bi.label = "Cancel";
1839 bi.width = 52.0f;
1840 bi.height = 30.0f;
1841 bi.topleft.Set(277.0f, 41.0f);
1842 ati.SetButtonInfo(2, bi);
1843
1844 ati.SetButtonWidthMode(B_WIDTH_FROM_LABEL);
1845 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1846 ati.SetAlertType(B_INFO_ALERT);
1847
1848 ati.GuiInfoTest();
1849 }
1850
1851 ////// WW_OS_IA - Three Button //////
1852
1853 void
Monkey_Dog_Cat_60X_WW_OS_IA()1854 AlertTest::Monkey_Dog_Cat_60X_WW_OS_IA()
1855 {
1856 AlertTestInfo ati(this);
1857 GuiInfo wi, ti, bi;
1858 wi.label = "alert1";
1859 wi.width = 335.0f;
1860 wi.height = 77.0f;
1861 ati.SetWinInfo(wi);
1862
1863 ti.label = k60X;
1864 ti.width = 270.0f;
1865 ti.height = 26.0f;
1866 ti.topleft.Set(55.0f, 6.0f);
1867 ati.SetTextViewInfo(ti);
1868
1869 bi.label = "Monkey";
1870 bi.width = 56.0f;
1871 bi.height = 24.0f;
1872 bi.topleft.Set(123.0f, 44.0f);
1873 ati.SetButtonInfo(0, bi);
1874 bi.label = "Dog";
1875 bi.width = 56.0f;
1876 bi.height = 24.0f;
1877 bi.topleft.Set(211.0f, 44.0f);
1878 ati.SetButtonInfo(1, bi);
1879 bi.label = "Cat";
1880 bi.width = 56.0f;
1881 bi.height = 30.0f;
1882 bi.topleft.Set(273.0f, 41.0f);
1883 ati.SetButtonInfo(2, bi);
1884
1885 ati.SetButtonWidthMode(B_WIDTH_FROM_WIDEST);
1886 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1887 ati.SetAlertType(B_INFO_ALERT);
1888
1889 ati.GuiInfoTest();
1890 }
1891
1892 ////// UW_OS_EA - Three Button //////
1893
1894 void
twentyX_OK_Cancel_60X_UW_OS_EA()1895 AlertTest::twentyX_OK_Cancel_60X_UW_OS_EA()
1896 {
1897 AlertTestInfo ati(this);
1898 GuiInfo wi, ti, bi;
1899 wi.label = "alert1";
1900 wi.width = 366.0f;
1901 wi.height = 77.0f;
1902 ati.SetWinInfo(wi);
1903
1904 ti.label = k60X;
1905 ti.width = 346.0f;
1906 ti.height = 26.0f;
1907 ti.topleft.Set(10.0f, 6.0f);
1908 ati.SetTextViewInfo(ti);
1909
1910 bi.label = k20X;
1911 bi.width = 160.0f;
1912 bi.height = 24.0f;
1913 bi.topleft.Set(12.0f, 44.0f);
1914 ati.SetButtonInfo(0, bi);
1915 bi.label = "OK";
1916 bi.width = 75.0f;
1917 bi.height = 24.0f;
1918 bi.topleft.Set(204.0f, 44.0f);
1919 ati.SetButtonInfo(1, bi);
1920 bi.label = "Cancel";
1921 bi.width = 75.0f;
1922 bi.height = 30.0f;
1923 bi.topleft.Set(285.0f, 41.0f);
1924 ati.SetButtonInfo(2, bi);
1925
1926 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
1927 ati.SetButtonSpacingMode(B_OFFSET_SPACING);
1928 ati.SetAlertType(B_EMPTY_ALERT);
1929
1930 ati.GuiInfoTest();
1931 }
1932
1933