Patch by Alex Wilson:

* Implemented archiving/unarchiving support.
* Coding style cleanup (some more by myself).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37543 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-07-17 00:15:31 +00:00
parent d1535a45df
commit 849e11ad8d
2 changed files with 27 additions and 7 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Haiku, Inc. All rights reserved.
* Copyright 2006-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _GRID_VIEW_H
@@ -13,11 +13,13 @@ class BGridView : public BView {
public:
BGridView(float horizontalSpacing = 0.0f,
float verticalSpacing = 0.0f);
BGridView(BMessage* from);
virtual ~BGridView();
virtual void SetLayout(BLayout* layout);
BGridLayout* GridLayout() const;
static BArchivable* Instantiate(BMessage* from);
};
+23 -5
View File
@@ -1,24 +1,33 @@
/*
* Copyright 2010, Haiku, Inc.
* Copyright 2006, Ingo Weinhold <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include <GridView.h>
// constructor
BGridView::BGridView(float horizontalSpacing, float verticalSpacing)
: BView(NULL, 0, new BGridLayout(horizontalSpacing, verticalSpacing))
:
BView(NULL, 0, new BGridLayout(horizontalSpacing, verticalSpacing))
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
// destructor
BGridView::BGridView(BMessage* from)
:
BView(from)
{
}
BGridView::~BGridView()
{
}
// SetLayout
void
BGridView::SetLayout(BLayout* layout)
{
@@ -29,9 +38,18 @@ BGridView::SetLayout(BLayout* layout)
BView::SetLayout(layout);
}
// GridLayout
BGridLayout*
BGridView::GridLayout() const
{
return dynamic_cast<BGridLayout*>(GetLayout());
}
BArchivable*
BGridView::Instantiate(BMessage* from)
{
if (validate_instantiation(from, "BGridView"))
return new BGridView(from);
return NULL;
}