xref: /haiku/src/apps/packageinstaller/PackageWindow.cpp (revision a5bf12376daeded4049521eb17a6cc41192250d9)
1 /*
2  * Copyright (c) 2007-2010, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Author:
6  *		Łukasz 'Sil2100' Zemczak <sil2100@vexillium.org>
7  */
8 
9 
10 #include "PackageWindow.h"
11 
12 #include <Application.h>
13 #include <Catalog.h>
14 #include <GroupLayout.h>
15 #include <Locale.h>
16 
17 
18 #undef B_TRANSLATE_CONTEXT
19 #define B_TRANSLATE_CONTEXT "PackageWindow"
20 
21 
22 PackageWindow::PackageWindow(const entry_ref *ref)
23 	:
24 	BWindow(BRect(100, 100, 600, 300), B_TRANSLATE("PackageInstaller"),
25 		B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
26 {
27 	//SetLayout(new BGroupLayout(B_HORIZONTAL));
28 
29 	fBackground = new PackageView(Bounds(), ref);
30 	AddChild(fBackground);
31 
32 	ResizeTo(Bounds().Width(), fBackground->Bounds().Height());
33 }
34 
35 
36 PackageWindow::~PackageWindow()
37 {
38 	RemoveChild(fBackground);
39 
40 	delete fBackground;
41 }
42 
43 
44 void
45 PackageWindow::Quit()
46 {
47 	be_app->PostMessage(P_WINDOW_QUIT);
48 	BWindow::Quit();
49 }
50 
51