00001 #ifndef _CALENDAR_H_ 00002 #define _CALENDAR_H_ 00003 00004 #include <nds.h> 00005 #include "gadget.h" 00006 #include "gadgeteventhandler.h" 00007 00008 #define CALENDAR_ROWS 6 00009 #define CALENDAR_COLS 7 00010 00011 namespace WoopsiUI { 00012 00013 class Button; 00014 class Label; 00015 class Date; 00016 00021 class Calendar : public Gadget, public GadgetEventHandler { 00022 public: 00023 00036 Calendar(s16 x, s16 y, u16 width, u16 height, u8 day, u8 month, u16 year, u32 flags, FontBase* font = NULL); 00037 00042 virtual void handleReleaseEvent(const GadgetEventArgs& e); 00043 00049 virtual void draw(Rect clipRect); 00050 00057 virtual void setDate(u8 day, u8 month, u16 year); 00058 00063 const u8 getDay() const; 00064 00069 const u8 getMonth() const; 00070 00075 const u16 getYear() const; 00076 00083 bool resize(u16 width, u16 height); 00084 00085 protected: 00086 Date* _date; 00087 Date* _visibleDate; 00088 Button* _selectedDayButton; 00089 Button* _leftArrow; 00090 Button* _rightArrow; 00091 Label* _monthLabel; 00096 virtual ~Calendar(); 00097 00101 virtual void buildGUI(); 00102 00107 virtual void populateGUI(); 00108 00112 inline Calendar(const Calendar& calendar) : Gadget(calendar) { }; 00113 }; 00114 } 00115 00116 #endif