xref: /haiku/src/tests/kits/interface/balert/AlertTest.cpp (revision aa44f14baa9acc5347016ec2eb78012325e09791)
1baccf4d7SMatthew Wilber // AlertTest.cpp
2baccf4d7SMatthew Wilber #include "AlertTest.h"
3baccf4d7SMatthew Wilber #include <cppunit/Test.h>
4baccf4d7SMatthew Wilber #include <cppunit/TestCaller.h>
5baccf4d7SMatthew Wilber #include <cppunit/TestSuite.h>
6855c5b57SMatthew Wilber #include <iostream.h>
7baccf4d7SMatthew Wilber #include <stdio.h>
8baccf4d7SMatthew Wilber #include <string.h>
9baccf4d7SMatthew Wilber #include <Application.h>
10baccf4d7SMatthew Wilber #include <Alert.h>
11855c5b57SMatthew Wilber #include <Point.h>
12baccf4d7SMatthew Wilber #include <TextView.h>
13baccf4d7SMatthew Wilber #include <Button.h>
14baccf4d7SMatthew Wilber #include <Rect.h>
15baccf4d7SMatthew Wilber 
16855c5b57SMatthew Wilber #define ASSERT_DEQUAL(x,y) CPPUNIT_ASSERT_DOUBLES_EQUAL((x),(y),0.01)
17855c5b57SMatthew Wilber 
18*aa44f14bSMatthew Wilber const char *k20X = "XXXXXXXXXXXXXXXXXXXX";
19*aa44f14bSMatthew Wilber const char *k40X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
20*aa44f14bSMatthew Wilber const char *k60X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
21*aa44f14bSMatthew Wilber 
22855c5b57SMatthew Wilber // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color)
23855c5b57SMatthew Wilber bool operator==(const rgb_color &left, const rgb_color &right)
24855c5b57SMatthew Wilber {
25855c5b57SMatthew Wilber 	if (left.red == right.red && left.green == right.green &&
26855c5b57SMatthew Wilber 	    left.blue == right.blue && left.alpha == right.alpha)
27855c5b57SMatthew Wilber 	    return true;
28855c5b57SMatthew Wilber 	else
29855c5b57SMatthew Wilber 		return false;
30855c5b57SMatthew Wilber }
31855c5b57SMatthew Wilber // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color)
32855c5b57SMatthew Wilber ostream &operator<<(ostream &stream, const rgb_color &clr)
33855c5b57SMatthew Wilber {
34855c5b57SMatthew Wilber 	return stream << "rgb_color(" << clr.red << ", " <<
35855c5b57SMatthew Wilber 		clr.green << ", " << clr.blue << ", " << clr.alpha << ")";
36855c5b57SMatthew Wilber }
37855c5b57SMatthew Wilber 
38855c5b57SMatthew Wilber // For storing expected state of windows or views.
39855c5b57SMatthew Wilber struct GuiInfo {
40855c5b57SMatthew Wilber 	const char*	label;
41855c5b57SMatthew Wilber 	float		width;
42855c5b57SMatthew Wilber 	float		height;
43855c5b57SMatthew Wilber 	BPoint		topleft;
44855c5b57SMatthew Wilber };
45855c5b57SMatthew Wilber 
46855c5b57SMatthew Wilber // For storing all the information required to create and
47855c5b57SMatthew Wilber // verify the state of a BAlert object.
48855c5b57SMatthew Wilber class AlertTestInfo {
49855c5b57SMatthew Wilber public:
50855c5b57SMatthew Wilber 	AlertTestInfo(AlertTest *pTest);
51855c5b57SMatthew Wilber 	~AlertTestInfo();
52855c5b57SMatthew Wilber 
53855c5b57SMatthew Wilber 	void SetWinInfo(const GuiInfo &winInfo);
54855c5b57SMatthew Wilber 	void SetTextViewInfo(const GuiInfo &textInfo);
55855c5b57SMatthew Wilber 	void SetButtonInfo(int32 btn, const GuiInfo &btnInfo);
56855c5b57SMatthew Wilber 
57855c5b57SMatthew Wilber 	void SetButtonWidthMode(button_width widthMode);
58855c5b57SMatthew Wilber 	void SetButtonSpacingMode(button_spacing spacingMode);
59855c5b57SMatthew Wilber 	void SetAlertType(alert_type alertType);
60855c5b57SMatthew Wilber 
61855c5b57SMatthew Wilber 	void GuiInfoTest();
62855c5b57SMatthew Wilber 
63855c5b57SMatthew Wilber private:
64855c5b57SMatthew Wilber 	AlertTest*		fTest;
65855c5b57SMatthew Wilber 	GuiInfo			fWinInfo;
66855c5b57SMatthew Wilber 	GuiInfo			fTextInfo;
67855c5b57SMatthew Wilber 	GuiInfo			fButtonInfo[3];
68855c5b57SMatthew Wilber 	int32 			fButtonCount;
69855c5b57SMatthew Wilber 	button_width	fWidthMode;
70855c5b57SMatthew Wilber 	button_spacing	fSpacingMode;
71855c5b57SMatthew Wilber 	alert_type		fAlertType;
72855c5b57SMatthew Wilber };
73855c5b57SMatthew Wilber 
74855c5b57SMatthew Wilber AlertTestInfo::AlertTestInfo(AlertTest *pTest)
75855c5b57SMatthew Wilber {
76855c5b57SMatthew Wilber 	memset(this, 0, sizeof(AlertTestInfo));
77855c5b57SMatthew Wilber 
78855c5b57SMatthew Wilber 	fTest = pTest;
79855c5b57SMatthew Wilber 	fWidthMode = B_WIDTH_AS_USUAL;
80855c5b57SMatthew Wilber 	fSpacingMode = B_EVEN_SPACING;
81855c5b57SMatthew Wilber 	fAlertType = B_INFO_ALERT;
82855c5b57SMatthew Wilber }
83855c5b57SMatthew Wilber 
84855c5b57SMatthew Wilber AlertTestInfo::~AlertTestInfo()
85855c5b57SMatthew Wilber {
86855c5b57SMatthew Wilber 	fTest = NULL;
87855c5b57SMatthew Wilber 	fButtonCount = 0;
88855c5b57SMatthew Wilber }
89855c5b57SMatthew Wilber 
90855c5b57SMatthew Wilber void
91855c5b57SMatthew Wilber AlertTestInfo::SetWinInfo(const GuiInfo &winInfo)
92855c5b57SMatthew Wilber {
93855c5b57SMatthew Wilber 	fWinInfo = winInfo;
94855c5b57SMatthew Wilber }
95855c5b57SMatthew Wilber 
96855c5b57SMatthew Wilber void
97855c5b57SMatthew Wilber AlertTestInfo::SetTextViewInfo(const GuiInfo &textInfo)
98855c5b57SMatthew Wilber {
99855c5b57SMatthew Wilber 	fTextInfo = textInfo;
100855c5b57SMatthew Wilber }
101855c5b57SMatthew Wilber 
102855c5b57SMatthew Wilber void
103855c5b57SMatthew Wilber AlertTestInfo::SetButtonInfo(int32 btn, const GuiInfo &btnInfo)
104855c5b57SMatthew Wilber {
105855c5b57SMatthew Wilber 	if (btn < 0 || btn > 2 || btn > fButtonCount) {
106855c5b57SMatthew Wilber 		CPPUNIT_ASSERT(false);
107855c5b57SMatthew Wilber 		return;
108855c5b57SMatthew Wilber 	}
109855c5b57SMatthew Wilber 	fButtonInfo[btn] = btnInfo;
110855c5b57SMatthew Wilber 	if (btn == fButtonCount && fButtonCount < 3)
111855c5b57SMatthew Wilber 		fButtonCount++;
112855c5b57SMatthew Wilber }
113855c5b57SMatthew Wilber 
114855c5b57SMatthew Wilber void
115855c5b57SMatthew Wilber AlertTestInfo::SetButtonWidthMode(button_width widthMode)
116855c5b57SMatthew Wilber {
117855c5b57SMatthew Wilber 	fWidthMode = widthMode;
118855c5b57SMatthew Wilber }
119855c5b57SMatthew Wilber 
120855c5b57SMatthew Wilber void
121855c5b57SMatthew Wilber AlertTestInfo::SetButtonSpacingMode(button_spacing spacingMode)
122855c5b57SMatthew Wilber {
123855c5b57SMatthew Wilber 	fSpacingMode = spacingMode;
124855c5b57SMatthew Wilber }
125855c5b57SMatthew Wilber 
126855c5b57SMatthew Wilber void
127855c5b57SMatthew Wilber AlertTestInfo::SetAlertType(alert_type alertType)
128855c5b57SMatthew Wilber {
129855c5b57SMatthew Wilber 	fAlertType = alertType;
130855c5b57SMatthew Wilber }
131855c5b57SMatthew Wilber 
132855c5b57SMatthew Wilber void
133855c5b57SMatthew Wilber AlertTestInfo::GuiInfoTest()
134855c5b57SMatthew Wilber {
135855c5b57SMatthew Wilber 	fTest->NextSubTest();
136855c5b57SMatthew Wilber 	// Dummy application object required to create Window objects.
137855c5b57SMatthew Wilber 	BApplication app("application/x-vnd.Haiku-interfacekit_alerttest");
138855c5b57SMatthew Wilber 	BAlert *pAlert = new BAlert(
139855c5b57SMatthew Wilber 		fWinInfo.label,
140855c5b57SMatthew Wilber 		fTextInfo.label,
141855c5b57SMatthew Wilber 		fButtonInfo[0].label,
142855c5b57SMatthew Wilber 		fButtonInfo[1].label,
143855c5b57SMatthew Wilber 		fButtonInfo[2].label,
144855c5b57SMatthew Wilber 		fWidthMode,
145855c5b57SMatthew Wilber 		fSpacingMode,
146855c5b57SMatthew Wilber 		fAlertType
147855c5b57SMatthew Wilber 	);
148855c5b57SMatthew Wilber 	CPPUNIT_ASSERT(pAlert);
149855c5b57SMatthew Wilber 
150855c5b57SMatthew Wilber 	// Alert Window Width/Height
151855c5b57SMatthew Wilber 	fTest->NextSubTest();
152855c5b57SMatthew Wilber 	ASSERT_DEQUAL(fWinInfo.width, pAlert->Bounds().Width());
153855c5b57SMatthew Wilber 	ASSERT_DEQUAL(fWinInfo.height, pAlert->Bounds().Height());
154855c5b57SMatthew Wilber 
155855c5b57SMatthew Wilber 	// [k] MasterView
156855c5b57SMatthew Wilber 	fTest->NextSubTest();
157855c5b57SMatthew Wilber 	BView *masterView = pAlert->ChildAt(0);
158855c5b57SMatthew Wilber 	CPPUNIT_ASSERT(masterView);
159855c5b57SMatthew Wilber 
160855c5b57SMatthew Wilber 	// [k] MasterView Color
161855c5b57SMatthew Wilber 	fTest->NextSubTest();
162855c5b57SMatthew Wilber 	CPPUNIT_ASSERT_EQUAL(ui_color(B_PANEL_BACKGROUND_COLOR),
163855c5b57SMatthew Wilber 		masterView->ViewColor());
164855c5b57SMatthew Wilber 
165855c5b57SMatthew Wilber 	// Test all the buttons
166855c5b57SMatthew Wilber 	BButton *btns[3] = { NULL };
167855c5b57SMatthew Wilber 	for (int32 i = 0; i < 3; i++) {
168855c5b57SMatthew Wilber 		fTest->NextSubTest();
169855c5b57SMatthew Wilber 		btns[i] = pAlert->ButtonAt(i);
170855c5b57SMatthew Wilber 
171855c5b57SMatthew Wilber 		if (i >= fButtonCount) {
172855c5b57SMatthew Wilber 			// If there is should be no button at this index
173855c5b57SMatthew Wilber 			CPPUNIT_ASSERT_EQUAL((BButton*)NULL, btns[i]);
174855c5b57SMatthew Wilber 		} else {
175855c5b57SMatthew Wilber 			// If there should be a button at this index
176855c5b57SMatthew Wilber 			CPPUNIT_ASSERT(btns[i]);
177855c5b57SMatthew Wilber 
178855c5b57SMatthew Wilber 			CPPUNIT_ASSERT(
179855c5b57SMatthew Wilber 				strcmp(fButtonInfo[i].label, btns[i]->Label()) == 0);
180855c5b57SMatthew Wilber 
181855c5b57SMatthew Wilber 			ASSERT_DEQUAL(fButtonInfo[i].width, btns[i]->Bounds().Width());
182855c5b57SMatthew Wilber 
183855c5b57SMatthew Wilber 			ASSERT_DEQUAL(fButtonInfo[i].height, btns[i]->Bounds().Height());
184855c5b57SMatthew Wilber 
185855c5b57SMatthew Wilber 			BPoint pt = btns[i]->ConvertToParent(BPoint(0, 0));
186855c5b57SMatthew Wilber 			ASSERT_DEQUAL(fButtonInfo[i].topleft.x, pt.x);
187855c5b57SMatthew Wilber 			ASSERT_DEQUAL(fButtonInfo[i].topleft.y, pt.y);
188855c5b57SMatthew Wilber 
189855c5b57SMatthew Wilber 			if (i == fButtonCount - 1) {
190855c5b57SMatthew Wilber 				// Default button
191855c5b57SMatthew Wilber 				CPPUNIT_ASSERT_EQUAL(true, btns[i]->IsDefault());
192855c5b57SMatthew Wilber 			}
193855c5b57SMatthew Wilber 		}
194855c5b57SMatthew Wilber 	}
195855c5b57SMatthew Wilber 
196855c5b57SMatthew Wilber 	// [k] TextView
197855c5b57SMatthew Wilber 	fTest->NextSubTest();
198855c5b57SMatthew Wilber 	BTextView *textView = pAlert->TextView();
199855c5b57SMatthew Wilber 	CPPUNIT_ASSERT(textView);
200855c5b57SMatthew Wilber 
201855c5b57SMatthew Wilber 	// [k] TextView ViewColor()
202855c5b57SMatthew Wilber 	fTest->NextSubTest();
203855c5b57SMatthew Wilber 	CPPUNIT_ASSERT_EQUAL(ui_color(B_PANEL_BACKGROUND_COLOR), textView->ViewColor());
204855c5b57SMatthew Wilber 
205855c5b57SMatthew Wilber 	// [k] TextView IsEditable()
206855c5b57SMatthew Wilber 	fTest->NextSubTest();
207855c5b57SMatthew Wilber 	CPPUNIT_ASSERT_EQUAL(false, textView->IsEditable());
208855c5b57SMatthew Wilber 
209855c5b57SMatthew Wilber 	// [k] TextView IsSelectable()
210855c5b57SMatthew Wilber 	fTest->NextSubTest();
211855c5b57SMatthew Wilber 	CPPUNIT_ASSERT_EQUAL(false, textView->IsSelectable());
212855c5b57SMatthew Wilber 
213855c5b57SMatthew Wilber 	// [k] TextView DoesWordWrap()
214855c5b57SMatthew Wilber 	fTest->NextSubTest();
215855c5b57SMatthew Wilber 	CPPUNIT_ASSERT_EQUAL(true, textView->DoesWordWrap());
216855c5b57SMatthew Wilber 
217855c5b57SMatthew Wilber 	// TextView Text
218855c5b57SMatthew Wilber 	fTest->NextSubTest();
219855c5b57SMatthew Wilber 	CPPUNIT_ASSERT(strcmp(fTextInfo.label, textView->Text()) == 0);
220855c5b57SMatthew Wilber 
221855c5b57SMatthew Wilber 	// TextView Width/Height
222855c5b57SMatthew Wilber 	fTest->NextSubTest();
223855c5b57SMatthew Wilber 	ASSERT_DEQUAL(fTextInfo.width, textView->Bounds().Width());
224855c5b57SMatthew Wilber 	ASSERT_DEQUAL(fTextInfo.height, textView->Bounds().Height());
225855c5b57SMatthew Wilber 
226855c5b57SMatthew Wilber 	// TextView Position
227855c5b57SMatthew Wilber 	fTest->NextSubTest();
228855c5b57SMatthew Wilber 	BPoint pt = textView->ConvertToParent(BPoint(0, 0));
229855c5b57SMatthew Wilber 	ASSERT_DEQUAL(fTextInfo.topleft.x, pt.x);
230855c5b57SMatthew Wilber 	ASSERT_DEQUAL(fTextInfo.topleft.y, pt.y);
231855c5b57SMatthew Wilber 
232855c5b57SMatthew Wilber 	delete pAlert;
233855c5b57SMatthew Wilber 	pAlert = NULL;
234855c5b57SMatthew Wilber }
235855c5b57SMatthew Wilber 
236baccf4d7SMatthew Wilber // Suite
237baccf4d7SMatthew Wilber CppUnit::Test *
238baccf4d7SMatthew Wilber AlertTest::Suite()
239baccf4d7SMatthew Wilber {
240baccf4d7SMatthew Wilber 	CppUnit::TestSuite *suite = new CppUnit::TestSuite();
241baccf4d7SMatthew Wilber 	typedef CppUnit::TestCaller<AlertTest> TC;
242baccf4d7SMatthew Wilber 
243*aa44f14bSMatthew Wilber 	////// UW_ES_IA - One Button //////
244baccf4d7SMatthew Wilber 	suite->addTest(
245855c5b57SMatthew Wilber 		new TC("Alert empty_empty_UW_ES_IA",
246855c5b57SMatthew Wilber 			&AlertTest::empty_empty_UW_ES_IA));
247855c5b57SMatthew Wilber 	suite->addTest(
248855c5b57SMatthew Wilber 		new TC("Alert OK_X_UW_ES_IA",
249855c5b57SMatthew Wilber 			&AlertTest::OK_X_UW_ES_IA));
250855c5b57SMatthew Wilber 	suite->addTest(
251855c5b57SMatthew Wilber 		new TC("Alert OK_60X_UW_ES_IA",
252855c5b57SMatthew Wilber 			&AlertTest::OK_60X_UW_ES_IA));
253*aa44f14bSMatthew Wilber 	suite->addTest(
254*aa44f14bSMatthew Wilber 		new TC("Alert twentyX_60X_UW_ES_IA",
255*aa44f14bSMatthew Wilber 			&AlertTest::twentyX_60X_UW_ES_IA));
256*aa44f14bSMatthew Wilber 	suite->addTest(
257*aa44f14bSMatthew Wilber 		new TC("Alert fortyX_60X_UW_ES_IA",
258*aa44f14bSMatthew Wilber 			&AlertTest::fortyX_60X_UW_ES_IA));
259*aa44f14bSMatthew Wilber 
260*aa44f14bSMatthew Wilber 
261*aa44f14bSMatthew Wilber 	////// UW_ES_IA - Two Button //////
262*aa44f14bSMatthew Wilber 	suite->addTest(
263*aa44f14bSMatthew Wilber 		new TC("Alert OK_Cancel_60X_UW_ES_IA",
264*aa44f14bSMatthew Wilber 			&AlertTest::OK_Cancel_60X_UW_ES_IA));
265*aa44f14bSMatthew Wilber 	suite->addTest(
266*aa44f14bSMatthew Wilber 		new TC("Alert twentyX_Cancel_60X_UW_ES_IA",
267*aa44f14bSMatthew Wilber 			&AlertTest::twentyX_Cancel_60X_UW_ES_IA));
268*aa44f14bSMatthew Wilber 	suite->addTest(
269*aa44f14bSMatthew Wilber 		new TC("Alert twentyX_20X_60X_UW_ES_IA",
270*aa44f14bSMatthew Wilber 			&AlertTest::twentyX_20X_60X_UW_ES_IA));
271*aa44f14bSMatthew Wilber 
272*aa44f14bSMatthew Wilber 	////// UW_ES_IA - Three Button //////
273*aa44f14bSMatthew Wilber 	suite->addTest(
274*aa44f14bSMatthew Wilber 		new TC("Alert twentyX_20X_20X_60X_UW_ES_IA",
275*aa44f14bSMatthew Wilber 			&AlertTest::twentyX_20X_20X_60X_UW_ES_IA));
276baccf4d7SMatthew Wilber 
277baccf4d7SMatthew Wilber 	return suite;
278baccf4d7SMatthew Wilber }
279baccf4d7SMatthew Wilber 
280baccf4d7SMatthew Wilber // setUp
281baccf4d7SMatthew Wilber void
282baccf4d7SMatthew Wilber AlertTest::setUp()
283baccf4d7SMatthew Wilber {
284baccf4d7SMatthew Wilber 	BTestCase::setUp();
285baccf4d7SMatthew Wilber }
286baccf4d7SMatthew Wilber 
287baccf4d7SMatthew Wilber // tearDown
288baccf4d7SMatthew Wilber void
289baccf4d7SMatthew Wilber AlertTest::tearDown()
290baccf4d7SMatthew Wilber {
291baccf4d7SMatthew Wilber 	BTestCase::tearDown();
292baccf4d7SMatthew Wilber }
293baccf4d7SMatthew Wilber 
294*aa44f14bSMatthew Wilber ////// UW_ES_IA - One Button //////
295*aa44f14bSMatthew Wilber 
296baccf4d7SMatthew Wilber void
297855c5b57SMatthew Wilber AlertTest::empty_empty_UW_ES_IA()
298baccf4d7SMatthew Wilber {
299855c5b57SMatthew Wilber 	AlertTestInfo ati(this);
300855c5b57SMatthew Wilber 	GuiInfo wi, ti, bi;
301855c5b57SMatthew Wilber 	wi.label = "alert1";
302855c5b57SMatthew Wilber 	wi.width = 310.0f;
303855c5b57SMatthew Wilber 	wi.height = 64.0f;
304855c5b57SMatthew Wilber 	ati.SetWinInfo(wi);
305baccf4d7SMatthew Wilber 
306855c5b57SMatthew Wilber 	ti.label = "";
307855c5b57SMatthew Wilber 	ti.width = 245.0f;
308855c5b57SMatthew Wilber 	ti.height = 13.0f;
309855c5b57SMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
310855c5b57SMatthew Wilber 	ati.SetTextViewInfo(ti);
311baccf4d7SMatthew Wilber 
312855c5b57SMatthew Wilber 	bi.label = "";
313855c5b57SMatthew Wilber 	bi.width = 75.0f;
314855c5b57SMatthew Wilber 	bi.height = 30.0f;
315855c5b57SMatthew Wilber 	bi.topleft.Set(229.0f, 28.0f);
316855c5b57SMatthew Wilber 	ati.SetButtonInfo(0, bi);
317baccf4d7SMatthew Wilber 
318855c5b57SMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
319855c5b57SMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
320855c5b57SMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
321baccf4d7SMatthew Wilber 
322855c5b57SMatthew Wilber 	ati.GuiInfoTest();
323855c5b57SMatthew Wilber }
324baccf4d7SMatthew Wilber 
325855c5b57SMatthew Wilber void
326855c5b57SMatthew Wilber AlertTest::OK_X_UW_ES_IA()
327855c5b57SMatthew Wilber {
328855c5b57SMatthew Wilber 	AlertTestInfo ati(this);
329855c5b57SMatthew Wilber 	GuiInfo wi, ti, bi;
330855c5b57SMatthew Wilber 	wi.label = "alert1";
331855c5b57SMatthew Wilber 	wi.width = 310.0f;
332855c5b57SMatthew Wilber 	wi.height = 64.0f;
333855c5b57SMatthew Wilber 	ati.SetWinInfo(wi);
334baccf4d7SMatthew Wilber 
335855c5b57SMatthew Wilber 	ti.label = "X";
336855c5b57SMatthew Wilber 	ti.width = 245.0f;
337855c5b57SMatthew Wilber 	ti.height = 13.0f;
338855c5b57SMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
339855c5b57SMatthew Wilber 	ati.SetTextViewInfo(ti);
340baccf4d7SMatthew Wilber 
341855c5b57SMatthew Wilber 	bi.label = "OK";
342855c5b57SMatthew Wilber 	bi.width = 75.0f;
343855c5b57SMatthew Wilber 	bi.height = 30.0f;
344855c5b57SMatthew Wilber 	bi.topleft.Set(229.0f, 28.0f);
345855c5b57SMatthew Wilber 	ati.SetButtonInfo(0, bi);
346855c5b57SMatthew Wilber 
347855c5b57SMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
348855c5b57SMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
349855c5b57SMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
350855c5b57SMatthew Wilber 
351855c5b57SMatthew Wilber 	ati.GuiInfoTest();
352855c5b57SMatthew Wilber }
353855c5b57SMatthew Wilber 
354855c5b57SMatthew Wilber void
355855c5b57SMatthew Wilber AlertTest::OK_60X_UW_ES_IA()
356855c5b57SMatthew Wilber {
357855c5b57SMatthew Wilber 	AlertTestInfo ati(this);
358855c5b57SMatthew Wilber 	GuiInfo wi, ti, bi;
359855c5b57SMatthew Wilber 	wi.label = "alert1";
360855c5b57SMatthew Wilber 	wi.width = 310.0f;
361855c5b57SMatthew Wilber 	wi.height = 77.0f;
362855c5b57SMatthew Wilber 	ati.SetWinInfo(wi);
363855c5b57SMatthew Wilber 
364*aa44f14bSMatthew Wilber 	ti.label = k60X;
365855c5b57SMatthew Wilber 	ti.width = 245.0f;
366855c5b57SMatthew Wilber 	ti.height = 26.0f;
367855c5b57SMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
368855c5b57SMatthew Wilber 	ati.SetTextViewInfo(ti);
369855c5b57SMatthew Wilber 
370855c5b57SMatthew Wilber 	bi.label = "OK";
371855c5b57SMatthew Wilber 	bi.width = 75.0f;
372855c5b57SMatthew Wilber 	bi.height = 30.0f;
373855c5b57SMatthew Wilber 	bi.topleft.Set(229.0f, 41.0f);
374855c5b57SMatthew Wilber 	ati.SetButtonInfo(0, bi);
375855c5b57SMatthew Wilber 
376855c5b57SMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
377855c5b57SMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
378855c5b57SMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
379855c5b57SMatthew Wilber 
380855c5b57SMatthew Wilber 	ati.GuiInfoTest();
381baccf4d7SMatthew Wilber }
382baccf4d7SMatthew Wilber 
383*aa44f14bSMatthew Wilber void
384*aa44f14bSMatthew Wilber AlertTest::twentyX_60X_UW_ES_IA()
385*aa44f14bSMatthew Wilber {
386*aa44f14bSMatthew Wilber 	AlertTestInfo ati(this);
387*aa44f14bSMatthew Wilber 	GuiInfo wi, ti, bi;
388*aa44f14bSMatthew Wilber 	wi.label = "alert1";
389*aa44f14bSMatthew Wilber 	wi.width = 310.0f;
390*aa44f14bSMatthew Wilber 	wi.height = 77.0f;
391*aa44f14bSMatthew Wilber 	ati.SetWinInfo(wi);
392*aa44f14bSMatthew Wilber 
393*aa44f14bSMatthew Wilber 	ti.label = k60X;
394*aa44f14bSMatthew Wilber 	ti.width = 245.0f;
395*aa44f14bSMatthew Wilber 	ti.height = 26.0f;
396*aa44f14bSMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
397*aa44f14bSMatthew Wilber 	ati.SetTextViewInfo(ti);
398*aa44f14bSMatthew Wilber 
399*aa44f14bSMatthew Wilber 	bi.label = k20X;
400*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
401*aa44f14bSMatthew Wilber 	bi.height = 30.0f;
402*aa44f14bSMatthew Wilber 	bi.topleft.Set(144.0f, 41.0f);
403*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(0, bi);
404*aa44f14bSMatthew Wilber 
405*aa44f14bSMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
406*aa44f14bSMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
407*aa44f14bSMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
408*aa44f14bSMatthew Wilber 
409*aa44f14bSMatthew Wilber 	ati.GuiInfoTest();
410*aa44f14bSMatthew Wilber }
411*aa44f14bSMatthew Wilber 
412*aa44f14bSMatthew Wilber void
413*aa44f14bSMatthew Wilber AlertTest::fortyX_60X_UW_ES_IA()
414*aa44f14bSMatthew Wilber {
415*aa44f14bSMatthew Wilber 	AlertTestInfo ati(this);
416*aa44f14bSMatthew Wilber 	GuiInfo wi, ti, bi;
417*aa44f14bSMatthew Wilber 	wi.label = "alert1";
418*aa44f14bSMatthew Wilber 	wi.width = 365.0f;
419*aa44f14bSMatthew Wilber 	wi.height = 77.0f;
420*aa44f14bSMatthew Wilber 	ati.SetWinInfo(wi);
421*aa44f14bSMatthew Wilber 
422*aa44f14bSMatthew Wilber 	ti.label = k60X;
423*aa44f14bSMatthew Wilber 	ti.width = 300.0f;
424*aa44f14bSMatthew Wilber 	ti.height = 26.0f;
425*aa44f14bSMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
426*aa44f14bSMatthew Wilber 	ati.SetTextViewInfo(ti);
427*aa44f14bSMatthew Wilber 
428*aa44f14bSMatthew Wilber 	bi.label = k40X;
429*aa44f14bSMatthew Wilber 	bi.width = 300.0f;
430*aa44f14bSMatthew Wilber 	bi.height = 30.0f;
431*aa44f14bSMatthew Wilber 	bi.topleft.Set(59.0f, 41.0f);
432*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(0, bi);
433*aa44f14bSMatthew Wilber 
434*aa44f14bSMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
435*aa44f14bSMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
436*aa44f14bSMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
437*aa44f14bSMatthew Wilber 
438*aa44f14bSMatthew Wilber 	ati.GuiInfoTest();
439*aa44f14bSMatthew Wilber }
440*aa44f14bSMatthew Wilber 
441*aa44f14bSMatthew Wilber ////// UW_ES_IA - Two Button //////
442*aa44f14bSMatthew Wilber 
443*aa44f14bSMatthew Wilber void
444*aa44f14bSMatthew Wilber AlertTest::OK_Cancel_60X_UW_ES_IA()
445*aa44f14bSMatthew Wilber {
446*aa44f14bSMatthew Wilber 	AlertTestInfo ati(this);
447*aa44f14bSMatthew Wilber 	GuiInfo wi, ti, bi;
448*aa44f14bSMatthew Wilber 	wi.label = "alert1";
449*aa44f14bSMatthew Wilber 	wi.width = 310.0f;
450*aa44f14bSMatthew Wilber 	wi.height = 77.0f;
451*aa44f14bSMatthew Wilber 	ati.SetWinInfo(wi);
452*aa44f14bSMatthew Wilber 
453*aa44f14bSMatthew Wilber 	ti.label = k60X;
454*aa44f14bSMatthew Wilber 	ti.width = 245.0f;
455*aa44f14bSMatthew Wilber 	ti.height = 26.0f;
456*aa44f14bSMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
457*aa44f14bSMatthew Wilber 	ati.SetTextViewInfo(ti);
458*aa44f14bSMatthew Wilber 
459*aa44f14bSMatthew Wilber 	bi.label = "OK";
460*aa44f14bSMatthew Wilber 	bi.width = 75.0f;
461*aa44f14bSMatthew Wilber 	bi.height = 24.0f;
462*aa44f14bSMatthew Wilber 	bi.topleft.Set(148.0f, 44.0f);
463*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(0, bi);
464*aa44f14bSMatthew Wilber 	bi.label = "Cancel";
465*aa44f14bSMatthew Wilber 	bi.width = 75.0f;
466*aa44f14bSMatthew Wilber 	bi.height = 30.0f;
467*aa44f14bSMatthew Wilber 	bi.topleft.Set(229.0f, 41.0f);
468*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(1, bi);
469*aa44f14bSMatthew Wilber 
470*aa44f14bSMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
471*aa44f14bSMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
472*aa44f14bSMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
473*aa44f14bSMatthew Wilber 
474*aa44f14bSMatthew Wilber 	ati.GuiInfoTest();
475*aa44f14bSMatthew Wilber }
476*aa44f14bSMatthew Wilber 
477*aa44f14bSMatthew Wilber void
478*aa44f14bSMatthew Wilber AlertTest::twentyX_Cancel_60X_UW_ES_IA()
479*aa44f14bSMatthew Wilber {
480*aa44f14bSMatthew Wilber 	AlertTestInfo ati(this);
481*aa44f14bSMatthew Wilber 	GuiInfo wi, ti, bi;
482*aa44f14bSMatthew Wilber 	wi.label = "alert1";
483*aa44f14bSMatthew Wilber 	wi.width = 310.0f;
484*aa44f14bSMatthew Wilber 	wi.height = 77.0f;
485*aa44f14bSMatthew Wilber 	ati.SetWinInfo(wi);
486*aa44f14bSMatthew Wilber 
487*aa44f14bSMatthew Wilber 	ti.label = k60X;
488*aa44f14bSMatthew Wilber 	ti.width = 245.0f;
489*aa44f14bSMatthew Wilber 	ti.height = 26.0f;
490*aa44f14bSMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
491*aa44f14bSMatthew Wilber 	ati.SetTextViewInfo(ti);
492*aa44f14bSMatthew Wilber 
493*aa44f14bSMatthew Wilber 	bi.label = k20X;
494*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
495*aa44f14bSMatthew Wilber 	bi.height = 24.0f;
496*aa44f14bSMatthew Wilber 	bi.topleft.Set(63.0f, 44.0f);
497*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(0, bi);
498*aa44f14bSMatthew Wilber 	bi.label = "Cancel";
499*aa44f14bSMatthew Wilber 	bi.width = 75.0f;
500*aa44f14bSMatthew Wilber 	bi.height = 30.0f;
501*aa44f14bSMatthew Wilber 	bi.topleft.Set(229.0f, 41.0f);
502*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(1, bi);
503*aa44f14bSMatthew Wilber 
504*aa44f14bSMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
505*aa44f14bSMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
506*aa44f14bSMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
507*aa44f14bSMatthew Wilber 
508*aa44f14bSMatthew Wilber 	ati.GuiInfoTest();
509*aa44f14bSMatthew Wilber }
510*aa44f14bSMatthew Wilber 
511*aa44f14bSMatthew Wilber void
512*aa44f14bSMatthew Wilber AlertTest::twentyX_20X_60X_UW_ES_IA()
513*aa44f14bSMatthew Wilber {
514*aa44f14bSMatthew Wilber 	AlertTestInfo ati(this);
515*aa44f14bSMatthew Wilber 	GuiInfo wi, ti, bi;
516*aa44f14bSMatthew Wilber 	wi.label = "alert1";
517*aa44f14bSMatthew Wilber 	wi.width = 394.0f;
518*aa44f14bSMatthew Wilber 	wi.height = 77.0f;
519*aa44f14bSMatthew Wilber 	ati.SetWinInfo(wi);
520*aa44f14bSMatthew Wilber 
521*aa44f14bSMatthew Wilber 	ti.label = k60X;
522*aa44f14bSMatthew Wilber 	ti.width = 329.0f;
523*aa44f14bSMatthew Wilber 	ti.height = 26.0f;
524*aa44f14bSMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
525*aa44f14bSMatthew Wilber 	ati.SetTextViewInfo(ti);
526*aa44f14bSMatthew Wilber 
527*aa44f14bSMatthew Wilber 	bi.label = k20X;
528*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
529*aa44f14bSMatthew Wilber 	bi.height = 24.0f;
530*aa44f14bSMatthew Wilber 	bi.topleft.Set(62.0f, 44.0f);
531*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(0, bi);
532*aa44f14bSMatthew Wilber 	bi.label = k20X;
533*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
534*aa44f14bSMatthew Wilber 	bi.height = 30.0f;
535*aa44f14bSMatthew Wilber 	bi.topleft.Set(228.0f, 41.0f);
536*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(1, bi);
537*aa44f14bSMatthew Wilber 
538*aa44f14bSMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
539*aa44f14bSMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
540*aa44f14bSMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
541*aa44f14bSMatthew Wilber 
542*aa44f14bSMatthew Wilber 	ati.GuiInfoTest();
543*aa44f14bSMatthew Wilber }
544*aa44f14bSMatthew Wilber 
545*aa44f14bSMatthew Wilber ////// UW_ES_IA - Three Button //////
546*aa44f14bSMatthew Wilber 
547*aa44f14bSMatthew Wilber void
548*aa44f14bSMatthew Wilber AlertTest::twentyX_20X_20X_60X_UW_ES_IA()
549*aa44f14bSMatthew Wilber {
550*aa44f14bSMatthew Wilber 	AlertTestInfo ati(this);
551*aa44f14bSMatthew Wilber 	GuiInfo wi, ti, bi;
552*aa44f14bSMatthew Wilber 	wi.label = "alert1";
553*aa44f14bSMatthew Wilber 	wi.width = 563.0f;
554*aa44f14bSMatthew Wilber 	wi.height = 64.0f;
555*aa44f14bSMatthew Wilber 	ati.SetWinInfo(wi);
556*aa44f14bSMatthew Wilber 
557*aa44f14bSMatthew Wilber 	ti.label = k60X;
558*aa44f14bSMatthew Wilber 	ti.width = 498.0f;
559*aa44f14bSMatthew Wilber 	ti.height = 13.0f;
560*aa44f14bSMatthew Wilber 	ti.topleft.Set(55.0f, 6.0f);
561*aa44f14bSMatthew Wilber 	ati.SetTextViewInfo(ti);
562*aa44f14bSMatthew Wilber 
563*aa44f14bSMatthew Wilber 	bi.label = k20X;
564*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
565*aa44f14bSMatthew Wilber 	bi.height = 24.0f;
566*aa44f14bSMatthew Wilber 	bi.topleft.Set(62.0f, 31.0f);
567*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(0, bi);
568*aa44f14bSMatthew Wilber 	bi.label = k20X;
569*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
570*aa44f14bSMatthew Wilber 	bi.height = 24.0f;
571*aa44f14bSMatthew Wilber 	bi.topleft.Set(231.0f, 31.0f);
572*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(1, bi);
573*aa44f14bSMatthew Wilber 	bi.label = k20X;
574*aa44f14bSMatthew Wilber 	bi.width = 160.0f;
575*aa44f14bSMatthew Wilber 	bi.height = 30.0f;
576*aa44f14bSMatthew Wilber 	bi.topleft.Set(397.0f, 28.0f);
577*aa44f14bSMatthew Wilber 	ati.SetButtonInfo(2, bi);
578*aa44f14bSMatthew Wilber 
579*aa44f14bSMatthew Wilber 	ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
580*aa44f14bSMatthew Wilber 	ati.SetButtonSpacingMode(B_EVEN_SPACING);
581*aa44f14bSMatthew Wilber 	ati.SetAlertType(B_INFO_ALERT);
582*aa44f14bSMatthew Wilber 
583*aa44f14bSMatthew Wilber 	ati.GuiInfoTest();
584*aa44f14bSMatthew Wilber }
585baccf4d7SMatthew Wilber 
586baccf4d7SMatthew Wilber 
587