Woopsi 1.3
Nintendo DS Gui Framework
Public Member Functions | Protected Member Functions | Protected Attributes
WoopsiUI::Calendar Class Reference

#include <libwoopsi/include/calendar.h>

Inheritance diagram for WoopsiUI::Calendar:
WoopsiUI::Gadget WoopsiUI::GadgetEventHandler

List of all members.

Public Member Functions

 Calendar (s16 x, s16 y, u16 width, u16 height, u8 day, u8 month, u16 year, GadgetStyle *style=NULL)
virtual void handleReleaseEvent (const GadgetEventArgs &e)
virtual void setDate (u8 day, u8 month, u16 year)
const u8 getDay () const
const u8 getMonth () const
const u16 getYear () const
virtual void getPreferredDimensions (Rect &rect) const

Protected Member Functions

virtual void drawContents (GraphicsPort *port)
virtual void drawBorder (GraphicsPort *port)
void onResize (u16 width, u16 height)
virtual ~Calendar ()
virtual void buildGUI ()
virtual void populateGUI ()
 Calendar (const Calendar &calendar)
void calculateColumnWidths (s32 spaceWidth, u8 *columnWidths)
void calculateColumnHeights (s32 spaceHeight, u8 *columnHeights)

Protected Attributes

Date_date
Date_visibleDate
StickyButton_selectedDayButton
Button_leftArrow
Button_rightArrow
Label_monthLabel

Detailed Description

Class providing a calendar/date picker. Raises an EVENT_ACTION event when a new date is clicked.


Constructor & Destructor Documentation

WoopsiUI::Calendar::Calendar ( s16  x,
s16  y,
u16  width,
u16  height,
u8  day,
u8  month,
u16  year,
GadgetStyle style = NULL 
)

Constructor.

Parameters:
xThe x co-ordinate of the calendar.
yThe y co-ordinate of the calendar.
widthThe width of the calendar.
heightThe height of the calendar.
dayThe default day to display.
monthThe default month to display.
yearThe default year to display.
styleThe style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.
virtual WoopsiUI::Calendar::~Calendar ( ) [protected, virtual]

Destructor.

WoopsiUI::Calendar::Calendar ( const Calendar calendar) [inline, protected]

Copy constructor is protected to prevent usage.


Member Function Documentation

virtual void WoopsiUI::Calendar::buildGUI ( ) [protected, virtual]

Creates all gadgets but leaves them textless.

void WoopsiUI::Calendar::calculateColumnHeights ( s32  spaceHeight,
u8 *  columnHeights 
) [protected]

Calculate the heights of the columns in the calendar.

Parameters:
spaceHeightWidth of the space to fill.
columnHeightsArray large enough to contain the heights of the columns.
void WoopsiUI::Calendar::calculateColumnWidths ( s32  spaceWidth,
u8 *  columnWidths 
) [protected]

Calculate the widths of the columns in the calendar.

Parameters:
spaceWidthWidth of the space to fill.
columnWidthsArray large enough to contain the widths of the columns.
virtual void WoopsiUI::Calendar::drawBorder ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::Calendar::drawContents ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

const u8 WoopsiUI::Calendar::getDay ( ) const

Get the day displayed in the calendar.

Returns:
The day.
const u8 WoopsiUI::Calendar::getMonth ( ) const

Get the month displayed in the calendar.

Returns:
The month.
virtual void WoopsiUI::Calendar::getPreferredDimensions ( Rect rect) const [virtual]

Insert the dimensions that this gadget wants to have into the rect passed in as a parameter. All co-ordinates are relative to the gadget's parent.

Parameters:
rectReference to a rect to populate with data.

Reimplemented from WoopsiUI::Gadget.

const u16 WoopsiUI::Calendar::getYear ( ) const

Get the year displayed in the calendar.

Returns:
The year.
virtual void WoopsiUI::Calendar::handleReleaseEvent ( const GadgetEventArgs e) [virtual]

Handles events raised by its sub-gadgets.

Parameters:
eEvent data to process.

Reimplemented from WoopsiUI::GadgetEventHandler.

void WoopsiUI::Calendar::onResize ( u16  width,
u16  height 
) [protected, virtual]

Resize the calendar to the new dimensions.

Parameters:
widthThe new width.
heightThe new height.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::Calendar::populateGUI ( ) [protected, virtual]

Populates the previously-created gadget layout with correct text based on current date objects.

virtual void WoopsiUI::Calendar::setDate ( u8  day,
u8  month,
u16  year 
) [virtual]

Set the date displayed in the calendar.

Parameters:
dayThe new day.
monthThe new month.
yearThe new year.

Member Data Documentation

Calendar working date

Pointer to the left arrow

Pointer to the month label

Pointer to the right arrow

Pointer to the selected day button

Date displayed in the UI


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Enumerator