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