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