Beginnings of a test app that shows all Interface Kit controls in various

configurations so that one can work better on the look.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28966 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-01-20 09:27:41 +00:00
parent 9b7603b992
commit a4ef4a4915
3 changed files with 85 additions and 0 deletions
+1
View File
@@ -150,6 +150,7 @@ SubInclude HAIKU_TOP src tests kits interface bfont ;
SubInclude HAIKU_TOP src tests kits interface bshelf ;
SubInclude HAIKU_TOP src tests kits interface flatten_picture ;
SubInclude HAIKU_TOP src tests kits interface layout ;
SubInclude HAIKU_TOP src tests kits interface look ;
SubInclude HAIKU_TOP src tests kits interface picture ;
SubInclude HAIKU_TOP src tests kits interface pictureprint ;
+6
View File
@@ -0,0 +1,6 @@
SubDir HAIKU_TOP src tests kits interface look ;
SimpleTest LookTest :
Look.cpp
: be
;
+78
View File
@@ -0,0 +1,78 @@
/*
* Copyright 2009, Stephan Aßmus <[email protected]>. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include <Application.h>
#include <Box.h>
#include <Button.h>
#include <ChannelSlider.h>
#include <CheckBox.h>
#include <ColorControl.h>
#include <GridLayoutBuilder.h>
#include <GroupLayoutBuilder.h>
#include <ListView.h>
#include <MenuBar.h>
#include <MenuItem.h>
#include <OptionControl.h>
#include <OutlineListView.h>
#include <RadioButton.h>
#include <ScrollBar.h>
#include <ScrollView.h>
#include <Slider.h>
#include <StatusBar.h>
#include <StringView.h>
#include <TabView.h>
#include <TextControl.h>
#include <TextView.h>
#include <Window.h>
template <class ControlType>
void
add_controls(BGridLayout* layout, int32& row)
{
ControlType* control1 = new ControlType("Enabled", NULL);
ControlType* control2 = new ControlType("Disabled", NULL);
control2->SetEnabled(false);
ControlType* control3 = new ControlType("On", NULL);
control3->SetValue(B_CONTROL_ON);
layout->AddView(control1, 0, row);
layout->AddView(control2, 1, row);
layout->AddView(control3, 2, row);
row++;
}
int
main(int argc, char** argv)
{
BApplication app("application/x-vnd.haiku-look");
BWindow* window = new BWindow(BRect(50, 50, 100, 100),
"Look at these pretty controls!", B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS
| B_QUIT_ON_WINDOW_CLOSE);
window->SetLayout(new BGroupLayout(B_HORIZONTAL));
// create some controls
BGridView* view = new BGridView(5.0f, 5.0f);
BGridLayout* layout = view->GridLayout();
layout->SetInsets(5, 5, 5, 5);
view->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
int32 row = 0;
add_controls<BButton>(layout, row);
add_controls<BCheckBox>(layout, row);
add_controls<BRadioButton>(layout, row);
window->AddChild(view);
window->Show();
app.Run();
return 0;
}