xref: /haiku/src/kits/interface/GridView.cpp (revision ca8ed5ea660fb6275799a3b7f138b201c41a667b)
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 <GridView.h>
10 
11 
12 BGridView::BGridView(float horizontalSpacing, float verticalSpacing)
13 	:
14 	BView(NULL, 0, new BGridLayout(horizontalSpacing, verticalSpacing))
15 {
16 	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
17 }
18 
19 
20 BGridView::BGridView(const char* name, float horizontalSpacing,
21 	float verticalSpacing)
22 	:
23 	BView(name, 0, new BGridLayout(horizontalSpacing, verticalSpacing))
24 {
25 	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
26 }
27 
28 
29 BGridView::BGridView(BMessage* from)
30 	:
31 	BView(from)
32 {
33 }
34 
35 
36 BGridView::~BGridView()
37 {
38 }
39 
40 
41 void
42 BGridView::SetLayout(BLayout* layout)
43 {
44 	// only BGridLayouts are allowed
45 	if (!dynamic_cast<BGridLayout*>(layout))
46 		return;
47 
48 	BView::SetLayout(layout);
49 }
50 
51 
52 BGridLayout*
53 BGridView::GridLayout() const
54 {
55 	return dynamic_cast<BGridLayout*>(GetLayout());
56 }
57 
58 
59 BArchivable*
60 BGridView::Instantiate(BMessage* from)
61 {
62 	if (validate_instantiation(from, "BGridView"))
63 		return new BGridView(from);
64 	return NULL;
65 }
66 
67 
68 status_t
69 BGridView::Perform(perform_code code, void* _data)
70 {
71 	return BView::Perform(code, _data);
72 }
73 
74 
75 void BGridView::_ReservedGridView1() {}
76 void BGridView::_ReservedGridView2() {}
77 void BGridView::_ReservedGridView3() {}
78 void BGridView::_ReservedGridView4() {}
79 void BGridView::_ReservedGridView5() {}
80 void BGridView::_ReservedGridView6() {}
81 void BGridView::_ReservedGridView7() {}
82 void BGridView::_ReservedGridView8() {}
83 void BGridView::_ReservedGridView9() {}
84 void BGridView::_ReservedGridView10() {}
85