xref: /haiku/src/tests/kits/interface/layout/widget_layout_test/tests/RadioButtonTest.cpp (revision b2c4c4f1f7446bd270fe79eb38892ddaca2323e2)
1 /*
2  * Copyright 2008, Stephan Aßmus <superstippi@gmx.de>.
3  * Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 
7 #include "RadioButtonTest.h"
8 
9 #include <stdio.h>
10 
11 #include <RadioButton.h>
12 
13 #include "GroupView.h"
14 
15 
16 // constructor
RadioButtonTest()17 RadioButtonTest::RadioButtonTest()
18 	: ControlTest("RadioButton"),
19 	  fRadioButton(new BRadioButton("", NULL))
20 {
21 	SetView(fRadioButton);
22 }
23 
24 
25 // destructor
~RadioButtonTest()26 RadioButtonTest::~RadioButtonTest()
27 {
28 }
29 
30 
31 // CreateTest
32 Test*
CreateTest()33 RadioButtonTest::CreateTest()
34 {
35 	return new RadioButtonTest;
36 }
37 
38 
39 // ActivateTest
40 void
ActivateTest(View * controls)41 RadioButtonTest::ActivateTest(View* controls)
42 {
43 	// BControl sets its background color to that of its parent in
44 	// AttachedToWindow(). Override.
45 	rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR);
46 	fControl->SetViewColor(background);
47 	fControl->SetLowColor(background);
48 
49 	GroupView* group = new GroupView(B_VERTICAL);
50 	group->SetFrame(controls->Bounds());
51 	controls->AddChild(group);
52 
53 	ControlTest::ActivateTest(group);
54 
55 	group->AddChild(new Glue());
56 }
57 
58 
59 // DectivateTest
60 void
DectivateTest()61 RadioButtonTest::DectivateTest()
62 {
63 }
64