* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32466 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005, Haiku Inc.
|
* Copyright 2005-2009, Haiku Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -15,16 +15,34 @@
|
|||||||
|
|
||||||
|
|
||||||
class View : public BView {
|
class View : public BView {
|
||||||
public:
|
public:
|
||||||
View(BRect rect);
|
View(BRect rect);
|
||||||
virtual ~View();
|
virtual ~View();
|
||||||
|
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Window : public BWindow {
|
||||||
|
public:
|
||||||
|
Window();
|
||||||
|
virtual ~Window();
|
||||||
|
|
||||||
|
virtual bool QuitRequested();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Application : public BApplication {
|
||||||
|
public:
|
||||||
|
Application();
|
||||||
|
|
||||||
|
virtual void ReadyToRun();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
View::View(BRect rect)
|
View::View(BRect rect)
|
||||||
: BView(rect, "view state", B_FOLLOW_ALL, B_WILL_DRAW)
|
:
|
||||||
|
BView(rect, "view state", B_FOLLOW_ALL, B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,20 +94,12 @@ View::Draw(BRect updateRect)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
class Window : public BWindow {
|
|
||||||
public:
|
|
||||||
Window();
|
|
||||||
virtual ~Window();
|
|
||||||
|
|
||||||
virtual bool QuitRequested();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Window::Window()
|
Window::Window()
|
||||||
: BWindow(BRect(100, 100, 400, 400), "ViewState-Test",
|
:
|
||||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS)
|
BWindow(BRect(100, 100, 400, 400), "ViewState-Test", B_TITLED_WINDOW,
|
||||||
|
B_ASYNCHRONOUS_CONTROLS)
|
||||||
{
|
{
|
||||||
BView *view = new View(BRect(10, 10, 290, 290));
|
BView* view = new View(BRect(10, 10, 290, 290));
|
||||||
AddChild(view);
|
AddChild(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,24 +119,17 @@ Window::QuitRequested()
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
class Application : public BApplication {
|
|
||||||
public:
|
|
||||||
Application();
|
|
||||||
|
|
||||||
virtual void ReadyToRun(void);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Application::Application()
|
Application::Application()
|
||||||
: BApplication("application/x-vnd.haiku-view_state")
|
:
|
||||||
|
BApplication("application/x-vnd.haiku-view_state")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Application::ReadyToRun(void)
|
Application::ReadyToRun()
|
||||||
{
|
{
|
||||||
Window *window = new Window();
|
Window* window = new Window();
|
||||||
window->Show();
|
window->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,11 +137,11 @@ Application::ReadyToRun(void)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Application app;// app;
|
Application app;
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user