xref: /haiku/src/preferences/joysticks/CalibWin.cpp (revision d9b872d03c844b09c79e9647f668eef70b84fee6)
144d1fa37SRyan Leavengood /*
244d1fa37SRyan Leavengood  * Copyright 2007 Haiku.
344d1fa37SRyan Leavengood  * Distributed under the terms of the MIT License.
444d1fa37SRyan Leavengood  *
544d1fa37SRyan Leavengood  * Authors:
644d1fa37SRyan Leavengood  *		Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
744d1fa37SRyan Leavengood  *		Ryan Leavengood, leavengood@gmail.com
844d1fa37SRyan Leavengood  */
944d1fa37SRyan Leavengood 
1044d1fa37SRyan Leavengood 
1144d1fa37SRyan Leavengood #include "CalibWin.h"
1244d1fa37SRyan Leavengood 
1344d1fa37SRyan Leavengood #include <View.h>
1444d1fa37SRyan Leavengood #include <CheckBox.h>
1544d1fa37SRyan Leavengood #include <StringView.h>
1644d1fa37SRyan Leavengood #include <ListView.h>
1744d1fa37SRyan Leavengood #include <Button.h>
1844d1fa37SRyan Leavengood #include <Box.h>
1944d1fa37SRyan Leavengood 
2044d1fa37SRyan Leavengood /*
2144d1fa37SRyan Leavengood 	All this code is here is just to not have an empty view at
2244d1fa37SRyan Leavengood 	Clicking the Calibrate function.
2344d1fa37SRyan Leavengood 
2444d1fa37SRyan Leavengood 	All controls in this view needs to be created and placed dynamically according
2544d1fa37SRyan Leavengood 	with the Joystick descriptors
2644d1fa37SRyan Leavengood */
2744d1fa37SRyan Leavengood 
CalibWin(BRect frame,const char * title,window_look look,window_feel feel,uint32 flags,uint32 workspace)2844d1fa37SRyan Leavengood CalibWin::CalibWin(BRect frame,const char *title, window_look look,
2944d1fa37SRyan Leavengood 	window_feel feel, uint32 flags, uint32 workspace)
3044d1fa37SRyan Leavengood 	: BWindow(frame,title,look,feel,flags,workspace)
3144d1fa37SRyan Leavengood {
3244d1fa37SRyan Leavengood 	// Allocate object
3344d1fa37SRyan Leavengood 	fButton12 = new BButton(BRect(213.00,86.00,268.00,105.00),"Button12","Button",NULL);
3444d1fa37SRyan Leavengood 	fButton11 = new BButton(BRect(148.00,88.00,206.00,110.00),"Button11","Button",NULL);
3544d1fa37SRyan Leavengood 	fButton10 = new BButton(BRect(205.00,168.00,260.00,190.00),"Button10","Button",NULL);
3644d1fa37SRyan Leavengood 	fButton9  = new BButton(BRect(213.00,137.00,263.00,163.00),"Button9","Button", NULL);
3744d1fa37SRyan Leavengood 	fButton8  = new BButton(BRect(144.00,173.00,189.00,194.00),"Button8","Button",NULL);
3844d1fa37SRyan Leavengood 	fButton7  = new BButton(BRect(145.00,145.00,193.00,168.00),"Button7","Button",NULL);
3944d1fa37SRyan Leavengood 	fButton6  = new BButton(BRect(217.00,109.00,261.00,131.00),"Button6","Button",NULL);
4044d1fa37SRyan Leavengood 	fButton5  = new BButton(BRect(147.00,116.00,194.00,139.00),"Button5","Button",NULL);
4144d1fa37SRyan Leavengood 	fButton4 = new BButton(BRect(189.00,263.00,271.00,288.00),"Button4","Button",NULL);
4244d1fa37SRyan Leavengood 	fButton3 = new BButton(BRect(17.00,254.00,100.00,284.00),"Button3","Button",NULL);
4344d1fa37SRyan Leavengood 
4444d1fa37SRyan Leavengood 	fStringView9 = new BStringView(BRect(8.00,175.00,116.00,190.00),"StringView9","Text");
4544d1fa37SRyan Leavengood 	fStringView8 = new BStringView(BRect(10.00,154.00,112.00,172.00),"StringView8","Text");
4644d1fa37SRyan Leavengood 	fStringView7 = new BStringView(BRect(9.00,132.00,116.00,148.00),"StringView7","Text");
4744d1fa37SRyan Leavengood 	fStringView6 = new BStringView(BRect(11.00,114.00,120.00,128.00),"StringView6","Text");
4844d1fa37SRyan Leavengood 	fStringView5 = new BStringView(BRect(11.00,93.00,121.00,108.00),"StringView5","Text");
4944d1fa37SRyan Leavengood 	fStringView4 = new BStringView(BRect(12.00,73.00,121.00,88.00),"StringView4","Text");
5044d1fa37SRyan Leavengood 	fStringView3 = new BStringView(BRect(26.00,17.00,258.00,45.00),"StringView3","Text3");
5144d1fa37SRyan Leavengood 
5244d1fa37SRyan Leavengood 	fBox = new BBox(BRect(12.00,7.00,280.00,67.00),"Box1",
5344d1fa37SRyan Leavengood 		B_FOLLOW_LEFT | B_FOLLOW_TOP,B_WILL_DRAW | B_NAVIGABLE, B_FANCY_BORDER);
5444d1fa37SRyan Leavengood 
5544d1fa37SRyan Leavengood 	fView = new BView(Bounds(),"View3", B_FOLLOW_NONE,B_WILL_DRAW);
5644d1fa37SRyan Leavengood 
57*f0650dc9Slooncraz 	fView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
5844d1fa37SRyan Leavengood 
5944d1fa37SRyan Leavengood 	// Adding object
6044d1fa37SRyan Leavengood   	fBox->AddChild(fStringView3);
6144d1fa37SRyan Leavengood 
6244d1fa37SRyan Leavengood 	fView->AddChild(fButton3);
6344d1fa37SRyan Leavengood 	fView->AddChild(fButton4);
6444d1fa37SRyan Leavengood 	fView->AddChild(fBox);
6544d1fa37SRyan Leavengood 
6644d1fa37SRyan Leavengood 	fView->AddChild(fStringView4);
6744d1fa37SRyan Leavengood 	fView->AddChild(fStringView5);
6844d1fa37SRyan Leavengood 	fView->AddChild(fStringView6);
6944d1fa37SRyan Leavengood 	fView->AddChild(fStringView7);
7044d1fa37SRyan Leavengood 	fView->AddChild(fStringView8);
7144d1fa37SRyan Leavengood 	fView->AddChild(fStringView9);
7244d1fa37SRyan Leavengood 
7344d1fa37SRyan Leavengood 	fView->AddChild(fButton5);
7444d1fa37SRyan Leavengood 	fView->AddChild(fButton6);
7544d1fa37SRyan Leavengood 	fView->AddChild(fButton7);
7644d1fa37SRyan Leavengood 	fView->AddChild(fButton8);
7744d1fa37SRyan Leavengood 	fView->AddChild(fButton9);
7844d1fa37SRyan Leavengood 	fView->AddChild(fButton10);
7944d1fa37SRyan Leavengood 	fView->AddChild(fButton11);
8044d1fa37SRyan Leavengood 	fView->AddChild(fButton12);
8144d1fa37SRyan Leavengood 
8244d1fa37SRyan Leavengood 	AddChild(fView);
8344d1fa37SRyan Leavengood }
8444d1fa37SRyan Leavengood 
8544d1fa37SRyan Leavengood 
MessageReceived(BMessage * message)8644d1fa37SRyan Leavengood void CalibWin::MessageReceived(BMessage *message)
8744d1fa37SRyan Leavengood {
8844d1fa37SRyan Leavengood 	switch(message->what)
8944d1fa37SRyan Leavengood 	{
9044d1fa37SRyan Leavengood 		default:
9144d1fa37SRyan Leavengood 			BWindow::MessageReceived(message);
9244d1fa37SRyan Leavengood 			break;
9344d1fa37SRyan Leavengood 	}
9444d1fa37SRyan Leavengood }
9544d1fa37SRyan Leavengood 
9644d1fa37SRyan Leavengood 
QuitRequested()9744d1fa37SRyan Leavengood bool CalibWin::QuitRequested()
9844d1fa37SRyan Leavengood {
9944d1fa37SRyan Leavengood 	return BWindow::QuitRequested();
10044d1fa37SRyan Leavengood }
10144d1fa37SRyan Leavengood 
102