xref: /haiku/src/preferences/joysticks/CalibWin.cpp (revision 44d1fa37cd08d2a37420ed999a7b8a39ff144bac)
1*44d1fa37SRyan Leavengood /*
2*44d1fa37SRyan Leavengood  * Copyright 2007 Haiku.
3*44d1fa37SRyan Leavengood  * Distributed under the terms of the MIT License.
4*44d1fa37SRyan Leavengood  *
5*44d1fa37SRyan Leavengood  * Authors:
6*44d1fa37SRyan Leavengood  *		Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
7*44d1fa37SRyan Leavengood  *		Ryan Leavengood, leavengood@gmail.com
8*44d1fa37SRyan Leavengood  */
9*44d1fa37SRyan Leavengood 
10*44d1fa37SRyan Leavengood 
11*44d1fa37SRyan Leavengood #include "CalibWin.h"
12*44d1fa37SRyan Leavengood 
13*44d1fa37SRyan Leavengood #include <View.h>
14*44d1fa37SRyan Leavengood #include <CheckBox.h>
15*44d1fa37SRyan Leavengood #include <StringView.h>
16*44d1fa37SRyan Leavengood #include <ListView.h>
17*44d1fa37SRyan Leavengood #include <Button.h>
18*44d1fa37SRyan Leavengood #include <Box.h>
19*44d1fa37SRyan Leavengood 
20*44d1fa37SRyan Leavengood /*
21*44d1fa37SRyan Leavengood 	All this code is here is just to not have an empty view at
22*44d1fa37SRyan Leavengood 	Clicking the Calibrate function.
23*44d1fa37SRyan Leavengood 
24*44d1fa37SRyan Leavengood 	All controls in this view needs to be created and placed dynamically according
25*44d1fa37SRyan Leavengood 	with the Joystick descriptors
26*44d1fa37SRyan Leavengood */
27*44d1fa37SRyan Leavengood 
28*44d1fa37SRyan Leavengood CalibWin::CalibWin(BRect frame,const char *title, window_look look,
29*44d1fa37SRyan Leavengood 	window_feel feel, uint32 flags, uint32 workspace)
30*44d1fa37SRyan Leavengood 	: BWindow(frame,title,look,feel,flags,workspace)
31*44d1fa37SRyan Leavengood {
32*44d1fa37SRyan Leavengood 	// Allocate object
33*44d1fa37SRyan Leavengood 	fButton12 = new BButton(BRect(213.00,86.00,268.00,105.00),"Button12","Button",NULL);
34*44d1fa37SRyan Leavengood 	fButton11 = new BButton(BRect(148.00,88.00,206.00,110.00),"Button11","Button",NULL);
35*44d1fa37SRyan Leavengood 	fButton10 = new BButton(BRect(205.00,168.00,260.00,190.00),"Button10","Button",NULL);
36*44d1fa37SRyan Leavengood 	fButton9  = new BButton(BRect(213.00,137.00,263.00,163.00),"Button9","Button", NULL);
37*44d1fa37SRyan Leavengood 	fButton8  = new BButton(BRect(144.00,173.00,189.00,194.00),"Button8","Button",NULL);
38*44d1fa37SRyan Leavengood 	fButton7  = new BButton(BRect(145.00,145.00,193.00,168.00),"Button7","Button",NULL);
39*44d1fa37SRyan Leavengood 	fButton6  = new BButton(BRect(217.00,109.00,261.00,131.00),"Button6","Button",NULL);
40*44d1fa37SRyan Leavengood 	fButton5  = new BButton(BRect(147.00,116.00,194.00,139.00),"Button5","Button",NULL);
41*44d1fa37SRyan Leavengood 	fButton4 = new BButton(BRect(189.00,263.00,271.00,288.00),"Button4","Button",NULL);
42*44d1fa37SRyan Leavengood 	fButton3 = new BButton(BRect(17.00,254.00,100.00,284.00),"Button3","Button",NULL);
43*44d1fa37SRyan Leavengood 
44*44d1fa37SRyan Leavengood 	fStringView9 = new BStringView(BRect(8.00,175.00,116.00,190.00),"StringView9","Text");
45*44d1fa37SRyan Leavengood 	fStringView8 = new BStringView(BRect(10.00,154.00,112.00,172.00),"StringView8","Text");
46*44d1fa37SRyan Leavengood 	fStringView7 = new BStringView(BRect(9.00,132.00,116.00,148.00),"StringView7","Text");
47*44d1fa37SRyan Leavengood 	fStringView6 = new BStringView(BRect(11.00,114.00,120.00,128.00),"StringView6","Text");
48*44d1fa37SRyan Leavengood 	fStringView5 = new BStringView(BRect(11.00,93.00,121.00,108.00),"StringView5","Text");
49*44d1fa37SRyan Leavengood 	fStringView4 = new BStringView(BRect(12.00,73.00,121.00,88.00),"StringView4","Text");
50*44d1fa37SRyan Leavengood 	fStringView3 = new BStringView(BRect(26.00,17.00,258.00,45.00),"StringView3","Text3");
51*44d1fa37SRyan Leavengood 
52*44d1fa37SRyan Leavengood 	fBox = new BBox(BRect(12.00,7.00,280.00,67.00),"Box1",
53*44d1fa37SRyan Leavengood 		B_FOLLOW_LEFT | B_FOLLOW_TOP,B_WILL_DRAW | B_NAVIGABLE, B_FANCY_BORDER);
54*44d1fa37SRyan Leavengood 
55*44d1fa37SRyan Leavengood 	fView = new BView(Bounds(),"View3", B_FOLLOW_NONE,B_WILL_DRAW);
56*44d1fa37SRyan Leavengood 
57*44d1fa37SRyan Leavengood 	fView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
58*44d1fa37SRyan Leavengood 
59*44d1fa37SRyan Leavengood 	// Adding object
60*44d1fa37SRyan Leavengood   	fBox->AddChild(fStringView3);
61*44d1fa37SRyan Leavengood 
62*44d1fa37SRyan Leavengood 	fView->AddChild(fButton3);
63*44d1fa37SRyan Leavengood 	fView->AddChild(fButton4);
64*44d1fa37SRyan Leavengood 	fView->AddChild(fBox);
65*44d1fa37SRyan Leavengood 
66*44d1fa37SRyan Leavengood 	fView->AddChild(fStringView4);
67*44d1fa37SRyan Leavengood 	fView->AddChild(fStringView5);
68*44d1fa37SRyan Leavengood 	fView->AddChild(fStringView6);
69*44d1fa37SRyan Leavengood 	fView->AddChild(fStringView7);
70*44d1fa37SRyan Leavengood 	fView->AddChild(fStringView8);
71*44d1fa37SRyan Leavengood 	fView->AddChild(fStringView9);
72*44d1fa37SRyan Leavengood 
73*44d1fa37SRyan Leavengood 	fView->AddChild(fButton5);
74*44d1fa37SRyan Leavengood 	fView->AddChild(fButton6);
75*44d1fa37SRyan Leavengood 	fView->AddChild(fButton7);
76*44d1fa37SRyan Leavengood 	fView->AddChild(fButton8);
77*44d1fa37SRyan Leavengood 	fView->AddChild(fButton9);
78*44d1fa37SRyan Leavengood 	fView->AddChild(fButton10);
79*44d1fa37SRyan Leavengood 	fView->AddChild(fButton11);
80*44d1fa37SRyan Leavengood 	fView->AddChild(fButton12);
81*44d1fa37SRyan Leavengood 
82*44d1fa37SRyan Leavengood    AddChild(fView);
83*44d1fa37SRyan Leavengood }
84*44d1fa37SRyan Leavengood 
85*44d1fa37SRyan Leavengood 
86*44d1fa37SRyan Leavengood void CalibWin::MessageReceived(BMessage *message)
87*44d1fa37SRyan Leavengood {
88*44d1fa37SRyan Leavengood 	switch(message->what)
89*44d1fa37SRyan Leavengood 	{
90*44d1fa37SRyan Leavengood 		default:
91*44d1fa37SRyan Leavengood 			BWindow::MessageReceived(message);
92*44d1fa37SRyan Leavengood 			break;
93*44d1fa37SRyan Leavengood 	}
94*44d1fa37SRyan Leavengood }
95*44d1fa37SRyan Leavengood 
96*44d1fa37SRyan Leavengood 
97*44d1fa37SRyan Leavengood bool CalibWin::QuitRequested()
98*44d1fa37SRyan Leavengood {
99*44d1fa37SRyan Leavengood 	return BWindow::QuitRequested();
100*44d1fa37SRyan Leavengood }
101*44d1fa37SRyan Leavengood 
102