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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXCalendar.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       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 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

Copyright © 1997-2011 Jeroen van der Zijp