00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef FXCALENDARVIEW_H
00024 #define FXCALENDARVIEW_H
00025
00026 #ifndef FXWINDOW_H
00027 #include "FXWindow.h"
00028 #endif
00029
00030 namespace FX {
00031
00032
00033
00034 enum {
00035 CALENDAR_BROWSESELECT = 0x00000000,
00036 CALENDAR_SINGLESELECT = 0x00100000,
00037 CALENDAR_WEEKNUMBERS = 0x00200000,
00038 CALENDAR_STATIC = 0x00400000,
00039 CALENDAR_HIDEOTHER = 0x00800000,
00040 };
00041
00042
00043 class FXFont;
00044
00045
00046
00047
00048
00049
00050 class FXAPI FXCalendarView : public FXWindow {
00051 FXDECLARE(FXCalendarView)
00052 protected:
00053 FXFont *font;
00054 FXDate current;
00055 FXDate selected;
00056 FXDate ds;
00057 FXint month;
00058 FXint firstday;
00059 FXint ws;
00060 FXColor todayColor;
00061 FXColor titleColor;
00062 FXColor titleBackColor;
00063 FXColor dayColor;
00064 FXColor otherDayColor;
00065 FXColor weekendColor;
00066 FXColor otherWeekendColor;
00067 FXbool has_selection;
00068 FXbool state;
00069 protected:
00070 FXCalendarView();
00071 void moveFocus(FXDate);
00072 void markdirty(FXDate);
00073 void updateview(FXbool notify=true);
00074 private:
00075 FXCalendarView(const FXCalendarView&);
00076 FXCalendarView &operator=(const FXCalendarView&);
00077 public:
00078 long onPaint(FXObject*,FXSelector,void*);
00079 long onLeftBtnPress(FXObject*,FXSelector,void*);
00080 long onLeftBtnRelease(FXObject*,FXSelector,void*);
00081 long onKeyPress(FXObject*,FXSelector,void*);
00082 long onKeyRelease(FXObject*,FXSelector,void*);
00083 long onFocusIn(FXObject*,FXSelector,void*);
00084 long onFocusOut(FXObject*,FXSelector,void*);
00085 long onClicked(FXObject*,FXSelector,void*);
00086 long onDoubleClicked(FXObject*,FXSelector,void*);
00087 long onTripleClicked(FXObject*,FXSelector,void*);
00088 long onCommand(FXObject*,FXSelector,void*);
00089 long onCmdSetValue(FXObject*,FXSelector,void*);
00090 long onCmdSetIntValue(FXObject*,FXSelector,void*);
00091 long onCmdGetIntValue(FXObject*,FXSelector,void*);
00092 public:
00093
00094
00095 FXCalendarView(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=CALENDAR_BROWSESELECT,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00096
00097
00098 virtual void create();
00099
00100
00101 virtual FXbool canFocus() const;
00102
00103
00104 virtual void setFocus();
00105
00106
00107 virtual void killFocus();
00108
00109
00110 virtual void enable();
00111
00112
00113 virtual void disable();
00114
00115
00116 virtual FXint getDefaultWidth();
00117
00118
00119 virtual FXint getDefaultHeight();
00120
00121
00122 FXbool getDateAt(FXint x,FXint y,FXDate& date) const;
00123
00124
00125 void setCurrentDate(FXDate date,FXbool notify=false);
00126
00127
00128 FXDate getCurrentDate() const { return current; }
00129
00130
00131 void setCurrentMonth(FXint month,FXbool notify=false);
00132
00133
00134
00135 FXint getCurrentMonth() const { return month; }
00136
00137
00138 void selectDate(FXDate date,FXbool notify=false);
00139
00140
00141 void killSelection(FXbool notify=false);
00142
00143
00144 FXbool getSelectedDate(FXDate& date) const;
00145
00146
00147 void setFirstDay(FXint d);
00148
00149
00150 FXint getFirstDay() const { return firstday; }
00151
00152
00153 void setCalendarStyle(FXuint);
00154
00155
00156 FXuint getCalendarStyle() const;
00157
00158
00159 void setTitleColor(FXColor c);
00160
00161
00162 FXColor getTitleColor() const { return titleColor; }
00163
00164
00165 void setTitleBackColor(FXColor c);
00166
00167
00168 FXColor getTitleBackColor() const { return titleBackColor; }
00169
00170
00171 void setDayColor(FXColor c);
00172
00173
00174 FXColor getDayColor() const { return dayColor; }
00175
00176
00177 void setOtherDayColor(FXColor c);
00178
00179
00180 FXColor getOtherDayColor() const { return otherDayColor; }
00181
00182
00183 void setTodayColor(FXColor c);
00184
00185
00186 FXColor getTodayColor() const { return todayColor; }
00187
00188
00189 void setWeekendColor(FXColor c);
00190
00191
00192 FXColor getWeekendColor() const { return weekendColor; }
00193
00194
00195 void setOtherWeekendColor(FXColor c);
00196
00197
00198 FXColor getOtherWeekendColor() const { return otherWeekendColor; }
00199
00200
00201 virtual ~FXCalendarView();
00202 };
00203
00204 }
00205
00206 #endif
00207