Missed this in my previous Time commit, hence the build break, sorry!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ryan Leavengood 2011-06-05 06:09:55 +00:00
parent 4269010322
commit 2530274ddc
2 changed files with 52 additions and 0 deletions

View File

@ -36,6 +36,9 @@ class BCalendarView : public BView, public BInvoker {
BCalendarView(BRect frame, const char *name, week_start start,
uint32 resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
BCalendarView(const char* name,
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
virtual ~BCalendarView();
@ -88,6 +91,10 @@ class BCalendarView : public BView, public BInvoker {
virtual void ResizeToPreferred();
virtual void GetPreferredSize(float *width, float *height);
virtual BSize MaxSize();
virtual BSize MinSize();
virtual BSize PreferredSize();
int32 Day() const;
int32 Year() const;

View File

@ -11,6 +11,7 @@
#include <stdlib.h>
#include <LayoutUtils.h>
#include <Window.h>
@ -72,6 +73,24 @@ BCalendarView::BCalendarView(BRect frame, const char *name, week_start start,
}
BCalendarView::BCalendarView(const char* name, uint32 flags)
:
BView(name, flags),
BInvoker(),
fSelectionMessage(NULL),
fDay(0),
fYear(0),
fMonth(0),
fFocusChanged(false),
fSelectionChanged(false),
fWeekStart(B_WEEK_START_SUNDAY),
fDayNameHeaderVisible(true),
fWeekNumberHeaderVisible(true)
{
_InitObject();
}
BCalendarView::~BCalendarView()
{
SetSelectionMessage(NULL);
@ -559,6 +578,32 @@ BCalendarView::GetPreferredSize(float *width, float *height)
}
BSize
BCalendarView::MaxSize()
{
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
}
BSize
BCalendarView::MinSize()
{
float width, height;
_GetPreferredSize(&width, &height);
return BLayoutUtils::ComposeSize(ExplicitMinSize(),
BSize(width, height));
}
BSize
BCalendarView::PreferredSize()
{
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(),
MinSize());
}
int32
BCalendarView::Day() const
{