xref: /haiku/src/kits/interface/GridView.cpp (revision bab64f65bb775dc23060e276f1f1c4498ab7af6c)
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 
BGridView(float horizontalSpacing,float verticalSpacing)12 BGridView::BGridView(float horizontalSpacing, float verticalSpacing)
13 	:
14 	BView(NULL, 0, new BGridLayout(horizontalSpacing, verticalSpacing))
15 {
16 	AdoptSystemColors();
17 }
18 
19 
BGridView(const char * name,float horizontalSpacing,float verticalSpacing)20 BGridView::BGridView(const char* name, float horizontalSpacing,
21 	float verticalSpacing)
22 	:
23 	BView(name, 0, new BGridLayout(horizontalSpacing, verticalSpacing))
24 {
25 	AdoptSystemColors();
26 }
27 
28 
BGridView(BMessage * from)29 BGridView::BGridView(BMessage* from)
30 	:
31 	BView(from)
32 {
33 }
34 
35 
~BGridView()36 BGridView::~BGridView()
37 {
38 }
39 
40 
41 void
SetLayout(BLayout * layout)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*
GridLayout() const53 BGridView::GridLayout() const
54 {
55 	return dynamic_cast<BGridLayout*>(GetLayout());
56 }
57 
58 
59 BArchivable*
Instantiate(BMessage * from)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
Perform(perform_code code,void * _data)69 BGridView::Perform(perform_code code, void* _data)
70 {
71 	return BView::Perform(code, _data);
72 }
73 
74 
_ReservedGridView1()75 void BGridView::_ReservedGridView1() {}
_ReservedGridView2()76 void BGridView::_ReservedGridView2() {}
_ReservedGridView3()77 void BGridView::_ReservedGridView3() {}
_ReservedGridView4()78 void BGridView::_ReservedGridView4() {}
_ReservedGridView5()79 void BGridView::_ReservedGridView5() {}
_ReservedGridView6()80 void BGridView::_ReservedGridView6() {}
_ReservedGridView7()81 void BGridView::_ReservedGridView7() {}
_ReservedGridView8()82 void BGridView::_ReservedGridView8() {}
_ReservedGridView9()83 void BGridView::_ReservedGridView9() {}
_ReservedGridView10()84 void BGridView::_ReservedGridView10() {}
85