Module cSigCJMonthCalendar.pkg
1//==============================================================================
2// Project : SigCj - VDF Classes for Codejock
3// File : cSigCJMonthCalendar.pkg
4// Description : VDF Class for Codejock control
5//
6// Revision : $Rev: 599 $
7// $Date: 2009-10-14 05:39:01 -0400 (Wed, 14 Oct 2009) $
8// $Author: pak $ Martin Pincott
9//
10// Requirements : Visual DataFlex 12.1+
11// Codejock SuitePro - Version 12.0.0+
12//
13// Copyright : (c) 2008 VDF SIG UK
14// Visual DataFlex Special Interest Group UK.
15// http://www.vdfsig.co.uk/
16// dev@vdfsig.co.uk
17//
18// This file is part of SigCj.
19//
20// SigCj is free software: you can redistribute it and/or modify
21// it under the terms of the GNU Lesser General Public License
22// as published by the Free Software Foundation, either version
23// 2.1 of the License, or (at your option) any later version.
24//
25// SigCj is distributed in the hope that it will be useful, but
26// WITHOUT ANY WARRANTY; without even the implied warranty of
27// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28// GNU Lesser General Public License for more details.
29//
30// If you have the complete SigCj workspace then a copy of the
31// GNU Lesser General Public License is in the Docs folder. If
32// not, see <http://www.gnu.org/licenses/>.
33//
34//==============================================================================
35
36Use SigCjW_Controls.pkg
37Use cSigCJMethods_Mixin.pkg
38
39Enum_List
40 Define eMC_Tuesday for 1
41 Define eMC_Wednesday
42 Define eMC_Thursday
43 Define eMC_Friday
44 Define eMC_Saturday
45 Define eMC_Sunday
46 Define eMC_Monday
47End_Enum_List
48
49{DocStart = Class}
50//---------------------------------------------------
51//
52// Class : cSigCJMonthCalendar
53//
54// Superclass : cSigCjComMonthCalendar
55//
56// Package : cSigCJMonthCalendar.pkg
57//
58// Mixins : None
59//
60// Description : The MonthCalendar control enables you to create applications that let users
61// view and Set Date information via a calendar-like interface.
62//
63// Properties : pbAutoSize (Boolean)
64// piDay (Integer)
65// pbEnabled (Boolean)
66// pdMaxDate (Date)
67// piMaxSelCount (Integer)
68// pdMinDate (Date)
69// piMonth (Integer)
70// piMonthColumns (Integer)
71// piMonthRows (Integer)
72// pbMultiSelect (Boolean)
73// pdSelEnd (Date)
74// pdSelStart (Date)
75// pbShowToday (Boolean)
76// pbShowWeekNumbers (Boolean)
77// piStartOfWeek (Integer)
78// piYear (Integer)
79// pdValue (Date)
80//
81// Events : OnComSelChange (DateTime llStartDate DateTime llEndDate Boolean ByRef llCancel)
82// OnComMouseDown (Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly)
83// OnComMouseMove (Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly)
84// OnComMouseUp (Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly)
85// OnComDblClick
86// OnComClick
87// OnSetSize
88//
89// Methods :
90//
91// Notes :
92//
93// To Do :
94//
95//---------------------------------------------------
96{DocEnd}
97
98Class cSigCJMonthCalendar is a cSigCjComMonthCalendar
99 Import_Class_Protocol cSigCJMethods_Mixin
100
101 Procedure Construct_Object
102 Forward Send Construct_Object
103
104 // Define new Properties:
105 { DesignTime = False }
106 Property Boolean Private.pbAutoSize True
107 { DesignTime = False }
108 Property Integer Private.piDay
109 { DesignTime = False }
110 Property Boolean Private.pbEnabled True
111 { DesignTime = False }
112 Property Date Private.pdMaxDate "01/01/2050"
113 { DesignTime = False }
114 Property Integer Private.piMaxSelCount 7
115 { DesignTime = False }
116 Property Date Private.pdMinDate "01/01/1899"
117 { DesignTime = False }
118 Property Integer Private.piMonth
119 { DesignTime = False }
120 Property Integer Private.piMonthColumns 1
121 { DesignTime = False }
122 Property Integer Private.piMonthRows 1
123 { DesignTime = False }
124 Property Boolean Private.pbMultiSelect False
125 { DesignTime = False }
126 Property Date Private.pdSelEnd
127 { DesignTime = False }
128 Property Date Private.pdSelStart
129 { DesignTime = False }
130 Property Boolean Private.pbShowToday True
131 { DesignTime = False }
132 Property Boolean Private.pbShowWeekNumbers True
133 { DesignTime = False }
134 Property Integer Private.piStartOfWeek eMC_Monday
135 { DesignTime = False }
136 Property Date Private.pdValue
137 { DesignTime = False }
138 Property Integer Private.piYear
139
140 End_Procedure
141
142 // Create and augment procedures and functions
143
144 { Category="CodeJock" MethodType=Property }
145 { PropertyType=Boolean InitialValue=True }
146 Procedure Set pbAutoSize Boolean bState
147 Set SigCJProperty Set_Private.pbAutoSize Set_ComAutoSize to bState
148 End_Procedure
149
150 { Category="CodeJock" MethodType=Property }
151 Function pbAutoSize Returns Boolean
152 Function_Return (Private.pbAutoSize(Self))
153 End_Function
154
155 { Category="CodeJock" MethodType=Property }
156 Procedure Set piDay Integer iDay
157 Set SigCJProperty Set_Private.piDay Set_ComDay to iDay
158 End_Procedure
159
160 { Category="CodeJock" MethodType=Property }
161 Function piDay Returns Integer
162 Function_Return (Private.piDay(Self))
163 End_Function
164
165 { Category="CodeJock" MethodType=Property }
166 { PropertyType=Boolean InitialValue=True }
167 Procedure Set pbEnabled Boolean bState
168 Set SigCJProperty Set_Private.pbEnabled Set_ComEnabled to bState
169 End_Procedure
170
171 { Category="CodeJock" MethodType=Property }
172 Function pbEnabled Returns Boolean
173 Function_Return (Private.pbEnabled(Self))
174 End_Function
175
176 { Category="CodeJock" MethodType=Property }
177 { InitialValue = "01/01/2050" }
178 Procedure Set pdMaxDate Date dDate
179 Set SigCJProperty Set_Private.pdMaxDate Set_ComMaxDate to dDate
180 End_Procedure
181
182 { Category="CodeJock" MethodType=Property }
183 Function pdMaxDate Returns Date
184 Function_Return (Private.pdMaxDate(Self))
185 End_Function
186
187 { Category="CodeJock" MethodType=Property }
188 { InitialValue = 7 }
189 Procedure Set piMaxSelCount Integer iMaxSelCount
190 Set SigCJProperty Set_Private.piMaxSelCount Set_ComMaxSelCount to iMaxSelCount
191 End_Procedure
192
193 { Category="CodeJock" MethodType=Property }
194 Function piMaxSelCount Returns Integer
195 Function_Return (Private.piMaxSelCount(Self))
196 End_Function
197
198 { Category="CodeJock" MethodType=Property }
199 { InitialValue = "01/01/1899" }
200 Procedure Set pdMinDate Date dDate
201 Set SigCJProperty Set_Private.pdMinDate Set_ComMinDate to dDate
202 End_Procedure
203
204 { Category="CodeJock" MethodType=Property }
205 Function pdMinDate Returns Date
206 Function_Return (Private.pdMinDate(Self))
207 End_Function
208
209 { Category="CodeJock" MethodType=Property }
210 Procedure Set piMonth Integer iMonth
211 Set SigCJProperty Set_Private.piMonth Set_ComMonth to iMonth
212 End_Procedure
213
214 { Category="CodeJock" MethodType=Property }
215 Function piMonth Returns Integer
216 Function_Return (Private.piMonth(Self))
217 End_Function
218
219 { Category="CodeJock" MethodType=Property }
220 Procedure Set piMonthColumns Integer iMonthCols
221 Set SigCJProperty Set_Private.piMonthColumns Set_ComMonthColumns to iMonthCols
222 End_Procedure
223
224 { Category="CodeJock" MethodType=Property }
225 Function piMonthColumns Returns Integer
226 Function_Return (Private.piMonthColumns(Self))
227 End_Function
228
229 { Category="CodeJock" MethodType=Property }
230 Procedure Set piMonthRows Integer iMonthRows
231 Set SigCJProperty Set_Private.piMonthRows Set_ComMonthRows to iMonthRows
232 End_Procedure
233
234 { Category="CodeJock" MethodType=Property }
235 Function piMonthRows Returns Integer
236 Function_Return (Private.piMonthRows(Self))
237 End_Function
238
239 { Category="CodeJock" MethodType=Property }
240 { PropertyType=Boolean InitialValue=False }
241 Procedure Set pbMultiSelect Boolean bState
242 Set SigCJProperty Set_Private.pbMultiSelect Set_ComMultiSelect to bState
243 End_Procedure
244
245 { Category="CodeJock" MethodType=Property }
246 Function pbMultiSelect Returns Boolean
247 Function_Return (Private.pbMultiSelect(Self))
248 End_Function
249
250 { Category="CodeJock" MethodType=Property }
251 Procedure Set pdSelEnd Date dDate
252 Set SigCJProperty Set_Private.pdSelEnd Set_ComSelEnd to dDate
253 End_Procedure
254
255 { Category="CodeJock" MethodType=Property }
256 Function pdSelEnd Returns Date
257 Function_Return (Private.pdSelEnd(Self))
258 End_Function
259
260 { Category="CodeJock" MethodType=Property }
261 Procedure Set pdSelStart Date dDate
262 Set SigCJProperty Set_Private.pdSelStart Set_ComSelStart to dDate
263 End_Procedure
264
265 { Category="CodeJock" MethodType=Property }
266 Function pdSelStart Returns Date
267 Function_Return (Private.pdSelStart(Self))
268 End_Function
269
270 { Category="CodeJock" MethodType=Property }
271 { PropertyType=Boolean InitialValue=True }
272 Procedure Set pbShowToday Boolean bState
273 Set SigCJProperty Set_Private.pbShowToday Set_ComShowToday to bState
274 End_Procedure
275
276 { Category="CodeJock" MethodType=Property }
277 Function pbShowToday Returns Boolean
278 Function_Return (Private.pbShowToday(Self))
279 End_Function
280
281 { Category="CodeJock" MethodType=Property }
282 { PropertyType=Boolean InitialValue=True }
283 Procedure Set pbShowWeekNumbers Boolean bState
284 Set SigCJProperty Set_Private.pbShowWeekNumbers Set_ComShowWeekNumbers to bState
285 End_Procedure
286
287 { Category="CodeJock" MethodType=Property }
288 Function pbShowWeekNumbers Returns Boolean
289 Function_Return (Private.pbShowWeekNumbers(Self))
290 End_Function
291
292 { Category="CodeJock" MethodType=Property }
293 { EnumList = "eMC_Sunday, eMC_Monday, eMC_Tuesday, eMC_Wednesday, eMC_Thursday, eMC_Friday, eMC_Saturday" }
294 { InitialValue = eMC_Monday }
295 Procedure Set piStartOfWeek Integer iStart
296 Set SigCJProperty Set_Private.piStartOfWeek Set_ComStartOfWeek to iStart
297 End_Procedure
298
299 { Category="CodeJock" MethodType=Property }
300 Function piStartOfWeek Returns Integer
301 Function_Return (Private.piStartOfWeek(Self))
302 End_Function
303
304 { Category="CodeJock" MethodType=Property }
305 Procedure Set pdValue Date dDate
306 Set SigCJProperty Set_Private.pdValue Set_ComValue to dDate
307 End_Procedure
308
309 { Category="CodeJock" MethodType=Property }
310 Function pdValue Returns Date
311 Function_Return (Private.pdValue(Self))
312 End_Function
313
314 { Category="CodeJock" MethodType=Property }
315 Procedure Set piYear Integer iYear
316 Set SigCJProperty Set_Private.piYear Set_ComYear to iYear
317 End_Procedure
318
319 { Category="CodeJock" MethodType=Property }
320 Function piYear Returns Integer
321 Function_Return (Private.piYear(Self))
322 End_Function
323
324 {DocStart = Method}
325 //---------------------------------------------------
326 //
327 // Procedure : OnSetSize
328 //
329 // Scope : Public Event
330 //
331 // Paramaters : None
332 //
333 // Returns : None
334 //
335 // Purpose : Calendar Control may be being used in a dialog and you may wish to resize the dialog to match the
336 // size of the calendar
337 //
338 // Notes :
339 //
340 //---------------------------------------------------
341 {DocEnd}
342
343 { MethodType=Event }
344 Procedure OnSetSize Integer iHeight Integer iWidth
345 End_Procedure
346
347 Procedure OnCreate
348 Set pbAutoSize to (Private.pbAutoSize(Self))
349 Set piDay to (Private.piDay(Self))
350 Set pbEnabled to (Private.pbEnabled(Self))
351 Set pdMaxDate to (Private.pdMaxDate(Self))
352 Set piMaxSelCount to (Private.piMaxSelCount(Self))
353 Set pdMinDate to (Private.pdMinDate(Self))
354 Set piMonth to (Private.piMonth(Self))
355 Set piMonthColumns to (Private.piMonthColumns(Self))
356 Set piMonthRows to (Private.piMonthRows(Self))
357 Set pbMultiSelect to (Private.pbMultiSelect(Self))
358 Set pdSelEnd to (Private.pdSelEnd(Self))
359 Set pdSelStart to (Private.pdSelStart(Self))
360 Set pbShowToday to (Private.pbShowToday(Self))
361 Set pbShowWeekNumbers to (Private.pbShowWeekNumbers(Self))
362 Set piStartOfWeek to (Private.piStartOfWeek(Self))
363 Set piYear to (Private.piYear(Self))
364 Set pdValue to (Private.pdValue(Self))
365
366 Send OnSetSize (Hi(GuiSize(Self))) (Low(GuiSize(Self)))
367 End_Procedure
368End_Class
369
370//==============================================================================
371//End of Package - cSigCJMonthCalendar.pkg
372//==============================================================================
373