Interface Kit: Add BCardView

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
This commit is contained in:
Markus Himmel 2015-12-26 22:12:29 +01:00 committed by Augustin Cavalier
parent c09a549146
commit 5f2db70ffb
3 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,47 @@
/*
* Copyright 2015, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _CARD_VIEW_H
#define _CARD_VIEW_H
#include <View.h>
class BCardLayout;
class BCardView : public BView {
public:
BCardView();
BCardView(const char* name);
BCardView(BMessage* from);
virtual ~BCardView();
virtual void SetLayout(BLayout* layout);
BCardLayout* CardLayout() const;
static BArchivable* Instantiate(BMessage* from);
virtual status_t Perform(perform_code d, void* arg);
private:
// FBC padding - prevent breaking compatibility when methods are added
virtual void _ReservedCardView1();
virtual void _ReservedCardView2();
virtual void _ReservedCardView3();
virtual void _ReservedCardView4();
virtual void _ReservedCardView5();
virtual void _ReservedCardView6();
virtual void _ReservedCardView7();
virtual void _ReservedCardView8();
virtual void _ReservedCardView9();
virtual void _ReservedCardView10();
// forbitten methods
BCardView(const BCardView&);
void operator =(const BCardView&);
uint32 _reserved[10];
};
#endif // _CARD_VIEW_H

View File

@ -0,0 +1,81 @@
/*
* Copyright 2015, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*/
#include <CardLayout.h>
#include <CardView.h>
BCardView::BCardView()
:
BView(NULL, 0, new BCardLayout())
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
BCardView::BCardView(const char* name)
:
BView(name, 0, new BCardLayout())
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
BCardView::BCardView(BMessage* from)
:
BView(from)
{
}
BCardView::~BCardView()
{
}
void
BCardView::SetLayout(BLayout* layout)
{
if (dynamic_cast<BCardLayout*>(layout) == NULL)
return;
BView::SetLayout(layout);
}
BCardLayout*
BCardView::CardLayout() const
{
return static_cast<BCardLayout*>(GetLayout());
}
BArchivable*
BCardView::Instantiate(BMessage* from)
{
if (validate_instantiation(from, "BCardView"))
return new BCardView(from);
return NULL;
}
status_t
BCardView::Perform(perform_code d, void* arg)
{
return BView::Perform(d, arg);
}
void BCardView::_ReservedCardView1() {}
void BCardView::_ReservedCardView2() {}
void BCardView::_ReservedCardView3() {}
void BCardView::_ReservedCardView4() {}
void BCardView::_ReservedCardView5() {}
void BCardView::_ReservedCardView6() {}
void BCardView::_ReservedCardView7() {}
void BCardView::_ReservedCardView8() {}
void BCardView::_ReservedCardView9() {}
void BCardView::_ReservedCardView10() {}

View File

@ -51,6 +51,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
Box.cpp
Button.cpp
CardLayout.cpp
CardView.cpp
ChannelControl.cpp
ChannelSlider.cpp
CheckBox.cpp