xref: /haiku/src/kits/interface/GroupView.cpp (revision 5e96d7d537fbec23bad4ae9b4c8e7b02e769f0c6)
1 /*
2  * Copyright 2010, Haiku, Inc.
3  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 
7 
8 #include <GroupView.h>
9 
10 
11 BGroupView::BGroupView(orientation orientation, float spacing)
12 	:
13 	BView(NULL, 0, new BGroupLayout(orientation, spacing))
14 {
15 	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
16 }
17 
18 
19 BGroupView::BGroupView(const char* name, orientation orientation,
20 		float spacing)
21 	:
22 	BView(name, 0, new BGroupLayout(orientation, spacing))
23 {
24 	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
25 }
26 
27 
28 BGroupView::BGroupView(BMessage* from)
29 	:
30 	BView(from)
31 {
32 }
33 
34 
35 BGroupView::~BGroupView()
36 {
37 }
38 
39 
40 void
41 BGroupView::SetLayout(BLayout* layout)
42 {
43 	// only BGroupLayouts are allowed
44 	if (!dynamic_cast<BGroupLayout*>(layout))
45 		return;
46 
47 	BView::SetLayout(layout);
48 }
49 
50 
51 BArchivable*
52 BGroupView::Instantiate(BMessage* from)
53 {
54 	if (validate_instantiation(from, "BGroupView"))
55 		return new BGroupView(from);
56 	return NULL;
57 }
58 
59 
60 BGroupLayout*
61 BGroupView::GroupLayout() const
62 {
63 	return dynamic_cast<BGroupLayout*>(GetLayout());
64 }
65 
66 
67 status_t
68 BGroupView::Perform(perform_code code, void* _data)
69 {
70 	return BView::Perform(code, _data);
71 }
72 
73 
74 void BGroupView::_ReservedGroupView1() {}
75 void BGroupView::_ReservedGroupView2() {}
76 void BGroupView::_ReservedGroupView3() {}
77 void BGroupView::_ReservedGroupView4() {}
78 void BGroupView::_ReservedGroupView5() {}
79 void BGroupView::_ReservedGroupView6() {}
80 void BGroupView::_ReservedGroupView7() {}
81 void BGroupView::_ReservedGroupView8() {}
82 void BGroupView::_ReservedGroupView9() {}
83 void BGroupView::_ReservedGroupView10() {}
84 
85