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

FXCalendar.h
1 /********************************************************************************
2 * *
3 * C a l e n d a r W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2006,2024 by Sander Jansen. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXCALENDAR_H
22 #define FXCALENDAR_H
23 
24 #ifndef FXPACKER_H
25 #include "FXPacker.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXLabel;
32 class FXPopup;
33 class FXOptionMenu;
34 class FXHorizontalFrame;
35 class FXCalendarView;
36 
37 
42 class FXAPI FXCalendar : public FXPacker {
43 FXDECLARE(FXCalendar)
44 protected:
45  FXCalendarView *view;
46  FXHorizontalFrame *frame;
47  FXLabel *year;
48  FXOptionMenu *month;
49  FXPopup *monthpopup;
50  FXOption *months[12];
51  FXArrowButton *arrows[4];
52 protected:
53  FXCalendar();
54 private:
55  FXCalendar(const FXCalendar&);
56  FXCalendar &operator=(const FXCalendar&);
57 public:
58  enum{
59  ID_CALENDAR=FXPacker::ID_LAST,
60  ID_NEXTYEAR,
61  ID_PREVYEAR,
62  ID_NEXTMONTH,
63  ID_PREVMONTH,
64  ID_MONTH_START,
65  ID_MONTH_END=ID_MONTH_START+12,
66  ID_MONTH
67  };
68 public:
69  long onCmdDate(FXObject*,FXSelector,void*);
70  long onCmdMonth(FXObject*,FXSelector,void*);
71  long onCmdNextYear(FXObject*,FXSelector,void*);
72  long onCmdPrevYear(FXObject*,FXSelector,void*);
73  long onCmdNextMonth(FXObject*,FXSelector,void*);
74  long onCmdPrevMonth(FXObject*,FXSelector,void*);
75  long onCmdSelectMonth(FXObject*,FXSelector,void*);
76  long onFwdToView(FXObject*,FXSelector,void*);
77  long onFwdToTarget(FXObject*,FXSelector,void*);
78 public:
79 
81  FXCalendar(FXComposite *p,FXObject* tgt=nullptr,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
82 
84  void create();
85 
87  virtual void enable();
88 
90  virtual void disable();
91 
93  void setCurrentDate(FXDate date,FXbool notify=false);
94 
96  FXDate getCurrentDate() const;
97 
99  void setCurrentMonth(FXint mo,FXbool notify=false);
100 
105  FXint getCurrentMonth() const;
106 
108  FXCalendarView* calendarView() const { return view; }
109 
111  void setFirstDay(FXint d);
112 
114  FXint getFirstDay() const;
115 
117  void setFrameStyle(FXuint);
118 
120  void setCalendarStyle(FXuint);
121 
123  FXuint getCalendarStyle() const;
124 
126  void setBackColor(FXColor c);
127 
129  FXColor getBackColor() const;
130 
132  void setTitleColor(FXColor c);
133 
135  FXColor getTitleColor() const;
136 
138  void setTitleBackColor(FXColor c);
139 
141  FXColor getTitleBackColor() const;
142 
144  void setDayColor(FXColor c);
145 
147  FXColor getDayColor() const;
148 
150  void setOtherDayColor(FXColor c);
151 
153  FXColor getOtherDayColor() const;
154 
156  void setTodayColor(FXColor c);
157 
159  FXColor getTodayColor() const;
160 
162  void setWeekendColor(FXColor c);
163 
165  FXColor getWeekendColor() const;
166 
168  void setOtherWeekendColor(FXColor c);
169 
171  FXColor getOtherWeekendColor() const;
172 
174  void setHeaderFont(FXFont *fnt);
175 
177  FXFont* getHeaderFont() const;
178 
180  void setCalendarFont(FXFont *fnt);
181 
183  FXFont* getCalendarFont() const;
184 
186  virtual ~FXCalendar();
187  };
188 
189 }
190 
191 #endif
A label widget can be used to place a text and/or icon for explanation purposes.
Definition: FXLabel.h:64
Popup window is used as a container for transitional controls such as menu panes and other ephemeral ...
Definition: FXPopup.h:51
Base composite.
Definition: FXComposite.h:32
Gregorian date class, which is useful for calendrical calculations.
Definition: FXDate.h:31
Horizontal frame layout manager widget is used to automatically place child-windows horizontally from...
Definition: FXHorizontalFrame.h:36
Option Menu Button.
Definition: FXOptionMenu.h:42
Definition: FX4Splitter.h:28
Packer is a layout manager which automatically places child windows inside its area against the left...
Definition: FXPacker.h:48
Option Menu.
Definition: FXOptionMenu.h:101
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXCalendarView * calendarView() const
Return calendar view control.
Definition: FXCalendar.h:108
The Calendar Widget.
Definition: FXCalendar.h:42
Font class.
Definition: FXFont.h:137
The Basic Calendar Widget.
Definition: FXCalendarView.h:48
Button with an arrow; the arrow can point in any direction.
Definition: FXArrowButton.h:55

Copyright © 1997-2022 Jeroen van der Zijp