00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXCALENDAR_H
00022 #define FXCALENDAR_H
00023
00024 #ifndef FXPACKER_H
00025 #include "FXPacker.h"
00026 #endif
00027
00028
00029 namespace FX {
00030
00031
00032 class FXLabel;
00033 class FXPopup;
00034 class FXOptionMenu;
00035 class FXHorizontalFrame;
00036 class FXCalendarView;
00037
00038
00043 class FXAPI FXCalendar : public FXPacker {
00044 FXDECLARE(FXCalendar)
00045 protected:
00046 FXCalendarView *view;
00047 FXHorizontalFrame *frame;
00048 FXLabel *year;
00049 FXOptionMenu *month;
00050 FXPopup *monthpopup;
00051 FXOption *months[12];
00052 FXArrowButton *arrows[4];
00053 protected:
00054 FXCalendar();
00055 private:
00056 FXCalendar(const FXCalendar&);
00057 FXCalendar &operator=(const FXCalendar&);
00058 public:
00059 enum{
00060 ID_CALENDAR=FXPacker::ID_LAST,
00061 ID_NEXTYEAR,
00062 ID_PREVYEAR,
00063 ID_NEXTMONTH,
00064 ID_PREVMONTH,
00065 ID_MONTH_START,
00066 ID_MONTH_END=ID_MONTH_START+12,
00067 ID_MONTH
00068 };
00069 public:
00070 long onCmdDate(FXObject*,FXSelector,void*);
00071 long onCmdMonth(FXObject*,FXSelector,void*);
00072 long onCmdNextYear(FXObject*,FXSelector,void*);
00073 long onCmdPrevYear(FXObject*,FXSelector,void*);
00074 long onCmdNextMonth(FXObject*,FXSelector,void*);
00075 long onCmdPrevMonth(FXObject*,FXSelector,void*);
00076 long onCmdSelectMonth(FXObject*,FXSelector,void*);
00077 long onFwdToView(FXObject*,FXSelector,void*);
00078 long onFwdToTarget(FXObject*,FXSelector,void*);
00079 public:
00080
00082 FXCalendar(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00083
00085 void create();
00086
00088 virtual void enable();
00089
00091 virtual void disable();
00092
00094 void setCurrentDate(FXDate date,FXbool notify=false);
00095
00097 FXDate getCurrentDate() const;
00098
00100 void setCurrentMonth(FXint mo,FXbool notify=false);
00101
00106 FXint getCurrentMonth() const;
00107
00109 FXCalendarView* calendarView() const { return view; }
00110
00112 void setFirstDay(FXint d);
00113
00115 FXint getFirstDay() const;
00116
00118 void setFrameStyle(FXuint);
00119
00121 void setCalendarStyle(FXuint);
00122
00124 FXuint getCalendarStyle() const;
00125
00127 void setBackColor(FXColor c);
00128
00130 FXColor getBackColor() const;
00131
00133 void setTitleColor(FXColor c);
00134
00136 FXColor getTitleColor() const;
00137
00139 void setTitleBackColor(FXColor c);
00140
00142 FXColor getTitleBackColor() const;
00143
00145 void setDayColor(FXColor c);
00146
00148 FXColor getDayColor() const;
00149
00151 void setOtherDayColor(FXColor c);
00152
00154 FXColor getOtherDayColor() const;
00155
00157 void setTodayColor(FXColor c);
00158
00160 FXColor getTodayColor() const;
00161
00163 void setWeekendColor(FXColor c);
00164
00166 FXColor getWeekendColor() const;
00167
00169 void setOtherWeekendColor(FXColor c);
00170
00172 FXColor getOtherWeekendColor() const;
00173
00175 void setHeaderFont(FXFont *fnt);
00176
00178 FXFont* getHeaderFont() const;
00179
00181 void setCalendarFont(FXFont *fnt);
00182
00184 FXFont* getCalendarFont() const;
00185
00187 virtual ~FXCalendar();
00188 };
00189
00190 }
00191
00192 #endif