Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXCalendarView.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                   B a s e   C a l e n d a r   W i d g e t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2006,2012 by Sander Jansen.   All Rights Reserved.              *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
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;                // Font
00052   FXDate   current;             // Current Date
00053   FXDate   selected;            // Selected Date
00054   FXDate   ds;                  // First Day in Calendar
00055   FXint    month;               // Which month is being viewed.
00056   FXint    firstday;            // Which day of the week we display in the first column
00057   FXint    ws;                  // First week number in Calendar
00058   FXColor  todayColor;          // Today Color
00059   FXColor  titleColor;          // Title Color
00060   FXColor  titleBackColor;      // Title Back Color
00061   FXColor  dayColor;            // Normal Day Color
00062   FXColor  otherDayColor;       // Normal Day Color Disabled
00063   FXColor  weekendColor;        // Weekend Color
00064   FXColor  otherWeekendColor;   // Weekend Color Disabled
00065   FXbool   has_selection;       // If any date is selected
00066   FXbool   state;               // 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 

Copyright © 1997-2011 Jeroen van der Zijp