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