xref: /haiku/src/apps/powerstatus/PowerStatusWindow.cpp (revision 981f1b1135291a4fca290fbdf69910dc2f24abdd)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  */
8 
9 
10 #include "PowerStatusWindow.h"
11 #include "PowerStatusView.h"
12 
13 #include <Application.h>
14 
15 
16 PowerStatusWindow::PowerStatusWindow()
17 	: BWindow(BRect(100, 150, 147, 197), "PowerStatus", B_TITLED_WINDOW,
18 		B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
19 {
20 	BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
21 	topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
22 	AddChild(topView);
23 
24 	topView->AddChild(new PowerStatusReplicant(Bounds(), B_FOLLOW_ALL));
25 }
26 
27 
28 PowerStatusWindow::~PowerStatusWindow()
29 {
30 }
31 
32 
33 bool
34 PowerStatusWindow::QuitRequested()
35 {
36 	be_app->PostMessage(B_QUIT_REQUESTED);
37 	return true;
38 }
39