1 // AlertTest.cpp 2 #include "AlertTest.h" 3 #include <cppunit/Test.h> 4 #include <cppunit/TestCaller.h> 5 #include <cppunit/TestSuite.h> 6 #include <iostream.h> 7 #include <stdio.h> 8 #include <string.h> 9 #include <Application.h> 10 #include <Alert.h> 11 #include <Point.h> 12 #include <TextView.h> 13 #include <Button.h> 14 #include <Rect.h> 15 16 #define ASSERT_DEQUAL(x,y) CPPUNIT_ASSERT_DOUBLES_EQUAL((x),(y),0.01) 17 18 const char *k20X = "XXXXXXXXXXXXXXXXXXXX"; 19 const char *k40X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 20 const char *k60X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 21 22 // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color) 23 bool operator==(const rgb_color &left, const rgb_color &right) 24 { 25 if (left.red == right.red && left.green == right.green && 26 left.blue == right.blue && left.alpha == right.alpha) 27 return true; 28 else 29 return false; 30 } 31 // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color) 32 ostream &operator<<(ostream &stream, const rgb_color &clr) 33 { 34 return stream << "rgb_color(" << clr.red << ", " << 35 clr.green << ", " << clr.blue << ", " << clr.alpha << ")"; 36 } 37 38 // For storing expected state of windows or views. 39 struct GuiInfo { 40 const char* label; 41 float width; 42 float height; 43 BPoint topleft; 44 }; 45 46 // For storing all the information required to create and 47 // verify the state of a BAlert object. 48 class AlertTestInfo { 49 public: 50 AlertTestInfo(AlertTest *pTest); 51 ~AlertTestInfo(); 52 53 void SetWinInfo(const GuiInfo &winInfo); 54 void SetTextViewInfo(const GuiInfo &textInfo); 55 void SetButtonInfo(int32 btn, const GuiInfo &btnInfo); 56 57 void SetButtonWidthMode(button_width widthMode); 58 void SetButtonSpacingMode(button_spacing spacingMode); 59 void SetAlertType(alert_type alertType); 60 61 void GuiInfoTest(); 62 63 private: 64 AlertTest* fTest; 65 GuiInfo fWinInfo; 66 GuiInfo fTextInfo; 67 GuiInfo fButtonInfo[3]; 68 int32 fButtonCount; 69 button_width fWidthMode; 70 button_spacing fSpacingMode; 71 alert_type fAlertType; 72 }; 73 74 AlertTestInfo::AlertTestInfo(AlertTest *pTest) 75 { 76 memset(this, 0, sizeof(AlertTestInfo)); 77 78 fTest = pTest; 79 fWidthMode = B_WIDTH_AS_USUAL; 80 fSpacingMode = B_EVEN_SPACING; 81 fAlertType = B_INFO_ALERT; 82 } 83 84 AlertTestInfo::~AlertTestInfo() 85 { 86 fTest = NULL; 87 fButtonCount = 0; 88 } 89 90 void 91 AlertTestInfo::SetWinInfo(const GuiInfo &winInfo) 92 { 93 fWinInfo = winInfo; 94 } 95 96 void 97 AlertTestInfo::SetTextViewInfo(const GuiInfo &textInfo) 98 { 99 fTextInfo = textInfo; 100 } 101 102 void 103 AlertTestInfo::SetButtonInfo(int32 btn, const GuiInfo &btnInfo) 104 { 105 if (btn < 0 || btn > 2 || btn > fButtonCount) { 106 CPPUNIT_ASSERT(false); 107 return; 108 } 109 fButtonInfo[btn] = btnInfo; 110 if (btn == fButtonCount && fButtonCount < 3) 111 fButtonCount++; 112 } 113 114 void 115 AlertTestInfo::SetButtonWidthMode(button_width widthMode) 116 { 117 fWidthMode = widthMode; 118 } 119 120 void 121 AlertTestInfo::SetButtonSpacingMode(button_spacing spacingMode) 122 { 123 fSpacingMode = spacingMode; 124 } 125 126 void 127 AlertTestInfo::SetAlertType(alert_type alertType) 128 { 129 fAlertType = alertType; 130 } 131 132 void 133 AlertTestInfo::GuiInfoTest() 134 { 135 fTest->NextSubTest(); 136 // Dummy application object required to create Window objects. 137 BApplication app("application/x-vnd.Haiku-interfacekit_alerttest"); 138 BAlert *pAlert = new BAlert( 139 fWinInfo.label, 140 fTextInfo.label, 141 fButtonInfo[0].label, 142 fButtonInfo[1].label, 143 fButtonInfo[2].label, 144 fWidthMode, 145 fSpacingMode, 146 fAlertType 147 ); 148 CPPUNIT_ASSERT(pAlert); 149 150 // Alert Window Width/Height 151 fTest->NextSubTest(); 152 ASSERT_DEQUAL(fWinInfo.width, pAlert->Bounds().Width()); 153 ASSERT_DEQUAL(fWinInfo.height, pAlert->Bounds().Height()); 154 155 // [k] MasterView 156 fTest->NextSubTest(); 157 BView *masterView = pAlert->ChildAt(0); 158 CPPUNIT_ASSERT(masterView); 159 160 // [k] MasterView Color 161 fTest->NextSubTest(); 162 CPPUNIT_ASSERT_EQUAL(ui_color(B_PANEL_BACKGROUND_COLOR), 163 masterView->ViewColor()); 164 165 // Test all the buttons 166 BButton *btns[3] = { NULL }; 167 for (int32 i = 0; i < 3; i++) { 168 fTest->NextSubTest(); 169 btns[i] = pAlert->ButtonAt(i); 170 171 if (i >= fButtonCount) { 172 // If there is should be no button at this index 173 CPPUNIT_ASSERT_EQUAL((BButton*)NULL, btns[i]); 174 } else { 175 // If there should be a button at this index 176 CPPUNIT_ASSERT(btns[i]); 177 178 CPPUNIT_ASSERT( 179 strcmp(fButtonInfo[i].label, btns[i]->Label()) == 0); 180 181 ASSERT_DEQUAL(fButtonInfo[i].width, btns[i]->Bounds().Width()); 182 183 ASSERT_DEQUAL(fButtonInfo[i].height, btns[i]->Bounds().Height()); 184 185 BPoint pt = btns[i]->ConvertToParent(BPoint(0, 0)); 186 ASSERT_DEQUAL(fButtonInfo[i].topleft.x, pt.x); 187 ASSERT_DEQUAL(fButtonInfo[i].topleft.y, pt.y); 188 189 if (i == fButtonCount - 1) { 190 // Default button 191 CPPUNIT_ASSERT_EQUAL(true, btns[i]->IsDefault()); 192 } 193 } 194 } 195 196 // [k] TextView 197 fTest->NextSubTest(); 198 BTextView *textView = pAlert->TextView(); 199 CPPUNIT_ASSERT(textView); 200 201 // [k] TextView ViewColor() 202 fTest->NextSubTest(); 203 CPPUNIT_ASSERT_EQUAL(ui_color(B_PANEL_BACKGROUND_COLOR), textView->ViewColor()); 204 205 // [k] TextView IsEditable() 206 fTest->NextSubTest(); 207 CPPUNIT_ASSERT_EQUAL(false, textView->IsEditable()); 208 209 // [k] TextView IsSelectable() 210 fTest->NextSubTest(); 211 CPPUNIT_ASSERT_EQUAL(false, textView->IsSelectable()); 212 213 // [k] TextView DoesWordWrap() 214 fTest->NextSubTest(); 215 CPPUNIT_ASSERT_EQUAL(true, textView->DoesWordWrap()); 216 217 // TextView Text 218 fTest->NextSubTest(); 219 CPPUNIT_ASSERT(strcmp(fTextInfo.label, textView->Text()) == 0); 220 221 // TextView Width/Height 222 fTest->NextSubTest(); 223 ASSERT_DEQUAL(fTextInfo.width, textView->Bounds().Width()); 224 ASSERT_DEQUAL(fTextInfo.height, textView->Bounds().Height()); 225 226 // TextView Position 227 fTest->NextSubTest(); 228 BPoint pt = textView->ConvertToParent(BPoint(0, 0)); 229 ASSERT_DEQUAL(fTextInfo.topleft.x, pt.x); 230 ASSERT_DEQUAL(fTextInfo.topleft.y, pt.y); 231 232 delete pAlert; 233 pAlert = NULL; 234 } 235 236 // Suite 237 CppUnit::Test * 238 AlertTest::Suite() 239 { 240 CppUnit::TestSuite *suite = new CppUnit::TestSuite(); 241 typedef CppUnit::TestCaller<AlertTest> TC; 242 243 #define AT_ADDTEST(fn) (suite->addTest(new TC("Alert " #fn, &AlertTest::fn))) 244 245 ////// UW_ES_IA - One Button ////// 246 AT_ADDTEST(empty_empty_UW_ES_IA); 247 AT_ADDTEST(OK_X_UW_ES_IA); 248 AT_ADDTEST(OK_60X_UW_ES_IA); 249 AT_ADDTEST(twentyX_60X_UW_ES_IA); 250 AT_ADDTEST(fortyX_60X_UW_ES_IA); 251 252 ////// UW_ES_IA - Two Button ////// 253 AT_ADDTEST(OK_Cancel_60X_UW_ES_IA); 254 AT_ADDTEST(twentyX_Cancel_60X_UW_ES_IA); 255 AT_ADDTEST(twentyX_20X_60X_UW_ES_IA); 256 257 ////// UW_ES_IA - Three Button ////// 258 AT_ADDTEST(twentyX_20X_20X_60X_UW_ES_IA); 259 260 ////// UW_ES_EA - One Button ////// 261 AT_ADDTEST(OK_X_UW_ES_EA); 262 AT_ADDTEST(fortyX_60X_UW_ES_EA); 263 264 ////// UW_ES_EA - Two Button ////// 265 AT_ADDTEST(OK_Cancel_60X_UW_ES_EA); 266 AT_ADDTEST(twentyX_20X_60X_UW_ES_EA); 267 268 ////// UW_ES_EA - Three Button ////// 269 AT_ADDTEST(twentyX_20X_20X_60X_UW_ES_EA); 270 271 return suite; 272 } 273 274 // setUp 275 void 276 AlertTest::setUp() 277 { 278 BTestCase::setUp(); 279 } 280 281 // tearDown 282 void 283 AlertTest::tearDown() 284 { 285 BTestCase::tearDown(); 286 } 287 288 ////// UW_ES_IA - One Button ////// 289 290 void 291 AlertTest::empty_empty_UW_ES_IA() 292 { 293 AlertTestInfo ati(this); 294 GuiInfo wi, ti, bi; 295 wi.label = "alert1"; 296 wi.width = 310.0f; 297 wi.height = 64.0f; 298 ati.SetWinInfo(wi); 299 300 ti.label = ""; 301 ti.width = 245.0f; 302 ti.height = 13.0f; 303 ti.topleft.Set(55.0f, 6.0f); 304 ati.SetTextViewInfo(ti); 305 306 bi.label = ""; 307 bi.width = 75.0f; 308 bi.height = 30.0f; 309 bi.topleft.Set(229.0f, 28.0f); 310 ati.SetButtonInfo(0, bi); 311 312 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 313 ati.SetButtonSpacingMode(B_EVEN_SPACING); 314 ati.SetAlertType(B_INFO_ALERT); 315 316 ati.GuiInfoTest(); 317 } 318 319 void 320 AlertTest::OK_X_UW_ES_IA() 321 { 322 AlertTestInfo ati(this); 323 GuiInfo wi, ti, bi; 324 wi.label = "alert1"; 325 wi.width = 310.0f; 326 wi.height = 64.0f; 327 ati.SetWinInfo(wi); 328 329 ti.label = "X"; 330 ti.width = 245.0f; 331 ti.height = 13.0f; 332 ti.topleft.Set(55.0f, 6.0f); 333 ati.SetTextViewInfo(ti); 334 335 bi.label = "OK"; 336 bi.width = 75.0f; 337 bi.height = 30.0f; 338 bi.topleft.Set(229.0f, 28.0f); 339 ati.SetButtonInfo(0, bi); 340 341 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 342 ati.SetButtonSpacingMode(B_EVEN_SPACING); 343 ati.SetAlertType(B_INFO_ALERT); 344 345 ati.GuiInfoTest(); 346 } 347 348 void 349 AlertTest::OK_60X_UW_ES_IA() 350 { 351 AlertTestInfo ati(this); 352 GuiInfo wi, ti, bi; 353 wi.label = "alert1"; 354 wi.width = 310.0f; 355 wi.height = 77.0f; 356 ati.SetWinInfo(wi); 357 358 ti.label = k60X; 359 ti.width = 245.0f; 360 ti.height = 26.0f; 361 ti.topleft.Set(55.0f, 6.0f); 362 ati.SetTextViewInfo(ti); 363 364 bi.label = "OK"; 365 bi.width = 75.0f; 366 bi.height = 30.0f; 367 bi.topleft.Set(229.0f, 41.0f); 368 ati.SetButtonInfo(0, bi); 369 370 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 371 ati.SetButtonSpacingMode(B_EVEN_SPACING); 372 ati.SetAlertType(B_INFO_ALERT); 373 374 ati.GuiInfoTest(); 375 } 376 377 void 378 AlertTest::twentyX_60X_UW_ES_IA() 379 { 380 AlertTestInfo ati(this); 381 GuiInfo wi, ti, bi; 382 wi.label = "alert1"; 383 wi.width = 310.0f; 384 wi.height = 77.0f; 385 ati.SetWinInfo(wi); 386 387 ti.label = k60X; 388 ti.width = 245.0f; 389 ti.height = 26.0f; 390 ti.topleft.Set(55.0f, 6.0f); 391 ati.SetTextViewInfo(ti); 392 393 bi.label = k20X; 394 bi.width = 160.0f; 395 bi.height = 30.0f; 396 bi.topleft.Set(144.0f, 41.0f); 397 ati.SetButtonInfo(0, bi); 398 399 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 400 ati.SetButtonSpacingMode(B_EVEN_SPACING); 401 ati.SetAlertType(B_INFO_ALERT); 402 403 ati.GuiInfoTest(); 404 } 405 406 void 407 AlertTest::fortyX_60X_UW_ES_IA() 408 { 409 AlertTestInfo ati(this); 410 GuiInfo wi, ti, bi; 411 wi.label = "alert1"; 412 wi.width = 365.0f; 413 wi.height = 77.0f; 414 ati.SetWinInfo(wi); 415 416 ti.label = k60X; 417 ti.width = 300.0f; 418 ti.height = 26.0f; 419 ti.topleft.Set(55.0f, 6.0f); 420 ati.SetTextViewInfo(ti); 421 422 bi.label = k40X; 423 bi.width = 300.0f; 424 bi.height = 30.0f; 425 bi.topleft.Set(59.0f, 41.0f); 426 ati.SetButtonInfo(0, bi); 427 428 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 429 ati.SetButtonSpacingMode(B_EVEN_SPACING); 430 ati.SetAlertType(B_INFO_ALERT); 431 432 ati.GuiInfoTest(); 433 } 434 435 ////// UW_ES_IA - Two Button ////// 436 437 void 438 AlertTest::OK_Cancel_60X_UW_ES_IA() 439 { 440 AlertTestInfo ati(this); 441 GuiInfo wi, ti, bi; 442 wi.label = "alert1"; 443 wi.width = 310.0f; 444 wi.height = 77.0f; 445 ati.SetWinInfo(wi); 446 447 ti.label = k60X; 448 ti.width = 245.0f; 449 ti.height = 26.0f; 450 ti.topleft.Set(55.0f, 6.0f); 451 ati.SetTextViewInfo(ti); 452 453 bi.label = "OK"; 454 bi.width = 75.0f; 455 bi.height = 24.0f; 456 bi.topleft.Set(148.0f, 44.0f); 457 ati.SetButtonInfo(0, bi); 458 bi.label = "Cancel"; 459 bi.width = 75.0f; 460 bi.height = 30.0f; 461 bi.topleft.Set(229.0f, 41.0f); 462 ati.SetButtonInfo(1, bi); 463 464 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 465 ati.SetButtonSpacingMode(B_EVEN_SPACING); 466 ati.SetAlertType(B_INFO_ALERT); 467 468 ati.GuiInfoTest(); 469 } 470 471 void 472 AlertTest::twentyX_Cancel_60X_UW_ES_IA() 473 { 474 AlertTestInfo ati(this); 475 GuiInfo wi, ti, bi; 476 wi.label = "alert1"; 477 wi.width = 310.0f; 478 wi.height = 77.0f; 479 ati.SetWinInfo(wi); 480 481 ti.label = k60X; 482 ti.width = 245.0f; 483 ti.height = 26.0f; 484 ti.topleft.Set(55.0f, 6.0f); 485 ati.SetTextViewInfo(ti); 486 487 bi.label = k20X; 488 bi.width = 160.0f; 489 bi.height = 24.0f; 490 bi.topleft.Set(63.0f, 44.0f); 491 ati.SetButtonInfo(0, bi); 492 bi.label = "Cancel"; 493 bi.width = 75.0f; 494 bi.height = 30.0f; 495 bi.topleft.Set(229.0f, 41.0f); 496 ati.SetButtonInfo(1, bi); 497 498 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 499 ati.SetButtonSpacingMode(B_EVEN_SPACING); 500 ati.SetAlertType(B_INFO_ALERT); 501 502 ati.GuiInfoTest(); 503 } 504 505 void 506 AlertTest::twentyX_20X_60X_UW_ES_IA() 507 { 508 AlertTestInfo ati(this); 509 GuiInfo wi, ti, bi; 510 wi.label = "alert1"; 511 wi.width = 394.0f; 512 wi.height = 77.0f; 513 ati.SetWinInfo(wi); 514 515 ti.label = k60X; 516 ti.width = 329.0f; 517 ti.height = 26.0f; 518 ti.topleft.Set(55.0f, 6.0f); 519 ati.SetTextViewInfo(ti); 520 521 bi.label = k20X; 522 bi.width = 160.0f; 523 bi.height = 24.0f; 524 bi.topleft.Set(62.0f, 44.0f); 525 ati.SetButtonInfo(0, bi); 526 bi.label = k20X; 527 bi.width = 160.0f; 528 bi.height = 30.0f; 529 bi.topleft.Set(228.0f, 41.0f); 530 ati.SetButtonInfo(1, bi); 531 532 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 533 ati.SetButtonSpacingMode(B_EVEN_SPACING); 534 ati.SetAlertType(B_INFO_ALERT); 535 536 ati.GuiInfoTest(); 537 } 538 539 ////// UW_ES_IA - Three Button ////// 540 541 void 542 AlertTest::twentyX_20X_20X_60X_UW_ES_IA() 543 { 544 AlertTestInfo ati(this); 545 GuiInfo wi, ti, bi; 546 wi.label = "alert1"; 547 wi.width = 563.0f; 548 wi.height = 64.0f; 549 ati.SetWinInfo(wi); 550 551 ti.label = k60X; 552 ti.width = 498.0f; 553 ti.height = 13.0f; 554 ti.topleft.Set(55.0f, 6.0f); 555 ati.SetTextViewInfo(ti); 556 557 bi.label = k20X; 558 bi.width = 160.0f; 559 bi.height = 24.0f; 560 bi.topleft.Set(62.0f, 31.0f); 561 ati.SetButtonInfo(0, bi); 562 bi.label = k20X; 563 bi.width = 160.0f; 564 bi.height = 24.0f; 565 bi.topleft.Set(231.0f, 31.0f); 566 ati.SetButtonInfo(1, bi); 567 bi.label = k20X; 568 bi.width = 160.0f; 569 bi.height = 30.0f; 570 bi.topleft.Set(397.0f, 28.0f); 571 ati.SetButtonInfo(2, bi); 572 573 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 574 ati.SetButtonSpacingMode(B_EVEN_SPACING); 575 ati.SetAlertType(B_INFO_ALERT); 576 577 ati.GuiInfoTest(); 578 } 579 580 ////// UW_ES_EA - One Button ////// 581 582 void 583 AlertTest::OK_X_UW_ES_EA() 584 { 585 AlertTestInfo ati(this); 586 GuiInfo wi, ti, bi; 587 wi.label = "alert1"; 588 wi.width = 310.0f; 589 wi.height = 64.0f; 590 ati.SetWinInfo(wi); 591 592 ti.label = "X"; 593 ti.width = 290.0f; 594 ti.height = 13.0f; 595 ti.topleft.Set(10.0f, 6.0f); 596 ati.SetTextViewInfo(ti); 597 598 bi.label = "OK"; 599 bi.width = 75.0f; 600 bi.height = 30.0f; 601 bi.topleft.Set(229.0f, 28.0f); 602 ati.SetButtonInfo(0, bi); 603 604 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 605 ati.SetButtonSpacingMode(B_EVEN_SPACING); 606 ati.SetAlertType(B_EMPTY_ALERT); 607 608 ati.GuiInfoTest(); 609 } 610 611 void 612 AlertTest::fortyX_60X_UW_ES_EA() 613 { 614 AlertTestInfo ati(this); 615 GuiInfo wi, ti, bi; 616 wi.label = "alert1"; 617 wi.width = 320.0f; 618 wi.height = 77.0f; 619 ati.SetWinInfo(wi); 620 621 ti.label = k60X; 622 ti.width = 300.0f; 623 ti.height = 26.0f; 624 ti.topleft.Set(10.0f, 6.0f); 625 ati.SetTextViewInfo(ti); 626 627 bi.label = k40X; 628 bi.width = 300.0f; 629 bi.height = 30.0f; 630 bi.topleft.Set(14.0f, 41.0f); 631 ati.SetButtonInfo(0, bi); 632 633 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 634 ati.SetButtonSpacingMode(B_EVEN_SPACING); 635 ati.SetAlertType(B_EMPTY_ALERT); 636 637 ati.GuiInfoTest(); 638 } 639 640 ////// UW_ES_EA - Two Button ////// 641 642 void 643 AlertTest::OK_Cancel_60X_UW_ES_EA() 644 { 645 AlertTestInfo ati(this); 646 GuiInfo wi, ti, bi; 647 wi.label = "alert1"; 648 wi.width = 310.0f; 649 wi.height = 77.0f; 650 ati.SetWinInfo(wi); 651 652 ti.label = k60X; 653 ti.width = 290.0f; 654 ti.height = 26.0f; 655 ti.topleft.Set(10.0f, 6.0f); 656 ati.SetTextViewInfo(ti); 657 658 bi.label = "OK"; 659 bi.width = 75.0f; 660 bi.height = 24.0f; 661 bi.topleft.Set(148.0f, 44.0f); 662 ati.SetButtonInfo(0, bi); 663 bi.label = "Cancel"; 664 bi.width = 75.0f; 665 bi.height = 30.0f; 666 bi.topleft.Set(229.0f, 41.0f); 667 ati.SetButtonInfo(1, bi); 668 669 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 670 ati.SetButtonSpacingMode(B_EVEN_SPACING); 671 ati.SetAlertType(B_EMPTY_ALERT); 672 673 ati.GuiInfoTest(); 674 } 675 676 void 677 AlertTest::twentyX_20X_60X_UW_ES_EA() 678 { 679 AlertTestInfo ati(this); 680 GuiInfo wi, ti, bi; 681 wi.label = "alert1"; 682 wi.width = 349.0f; 683 wi.height = 77.0f; 684 ati.SetWinInfo(wi); 685 686 ti.label = k60X; 687 ti.width = 329.0f; 688 ti.height = 26.0f; 689 ti.topleft.Set(10.0f, 6.0f); 690 ati.SetTextViewInfo(ti); 691 692 bi.label = k20X; 693 bi.width = 160.0f; 694 bi.height = 24.0f; 695 bi.topleft.Set(17.0f, 44.0f); 696 ati.SetButtonInfo(0, bi); 697 bi.label = k20X; 698 bi.width = 160.0f; 699 bi.height = 30.0f; 700 bi.topleft.Set(183.0f, 41.0f); 701 ati.SetButtonInfo(1, bi); 702 703 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 704 ati.SetButtonSpacingMode(B_EVEN_SPACING); 705 ati.SetAlertType(B_EMPTY_ALERT); 706 707 ati.GuiInfoTest(); 708 } 709 710 void 711 AlertTest::twentyX_20X_20X_60X_UW_ES_EA() 712 { 713 AlertTestInfo ati(this); 714 GuiInfo wi, ti, bi; 715 wi.label = "alert1"; 716 wi.width = 518.0f; 717 wi.height = 64.0f; 718 ati.SetWinInfo(wi); 719 720 ti.label = k60X; 721 ti.width = 498.0f; 722 ti.height = 13.0f; 723 ti.topleft.Set(10.0f, 6.0f); 724 ati.SetTextViewInfo(ti); 725 726 bi.label = k20X; 727 bi.width = 160.0f; 728 bi.height = 24.0f; 729 bi.topleft.Set(17.0f, 31.0f); 730 ati.SetButtonInfo(0, bi); 731 bi.label = k20X; 732 bi.width = 160.0f; 733 bi.height = 24.0f; 734 bi.topleft.Set(186.0f, 31.0f); 735 ati.SetButtonInfo(1, bi); 736 bi.label = k20X; 737 bi.width = 160.0f; 738 bi.height = 30.0f; 739 bi.topleft.Set(352.0f, 28.0f); 740 ati.SetButtonInfo(2, bi); 741 742 ati.SetButtonWidthMode(B_WIDTH_AS_USUAL); 743 ati.SetButtonSpacingMode(B_EVEN_SPACING); 744 ati.SetAlertType(B_EMPTY_ALERT); 745 746 ati.GuiInfoTest(); 747 } 748 749