-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSolarCalendarPackage.pas
6644 lines (5559 loc) · 179 KB
/
SolarCalendarPackage.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Solar Calendar Package
*
* The Initial Developer of the Original Code is
* Mohammad Khorsandi
*
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* Solar Calendar Package v3.7.2 *}
{*********************************************************}
{*********************************************************}
{* Developer : Mohammad Khorsandi *}
{* eMail : ? *}
{*********************************************************}
{* Bug Fixes, Improvements History *}
{* ******************************** *}
{* June 2007, Khordad 1386 *}
{* - Improvement: New property BackgroundColor in TCustomSolarCalendar class for change background color *}
{* - Bug fix: TCustomSolarCalendar.DateKind did not change layout button value *}
{* November 2007, Azar 1386 *}
{* - Bug fix: if Readonly was set with true the window of the calendar should not be open *}
{* - Improvement: New Anchors property *}
{* - Improvement: handling invalid date *}
{* May 2008, Khordad 1387 *}
{* - Bug fix: The numbers of the day of Esfand in leap year *}
{* - Version is now 1.4.2 *}
{* June, September 2008, Khordad, Tir, Mehr 1387 *}
{* - Improvement: New DateKind property for specifying Layout in TSolarDatePicker *}
{* - Improvement: New PersianInvalidDateMessage and EnglishInvalidDateMessage properties for customizing invalid date messages *}
{* - Improvement: New public Year, Month and Day properties for getting separately Year, Month and Day values *}
{* - Improvement: New OnClick events for prior year button, next year button, layout button of main classes *}
{* - Improvement: Hint for Prior, Next and layout buttons *}
{* - Improvement: Press Esc key to close popup window *}
{* - Bug fix: The numbers of the day of February in leap year *}
{* - Bug fix: Fix out of position bug on popup calendar window in Delphi 2005, 2006 and 2007 *}
{* - Improvement: weekend day color changed to Maroon color *}
{* - Bug fix: Fix out of range the value of FCurrYear, FCurrMonth, FCurrDay variables *}
{* - Improvement: New ShowToDay property for showing today object or not *}
{* - Improvement: New MonthName and DayName properties for getting month name and day name *}
{* - Bug fix: Checking input date in TCustomSolarCalendar *}
{* - Bug fix: Fix OnExit bug *}
{* - Improvement: Filling empty cells for showing prior and next month days *}
{* - Improvement: Click on cells of prior and next days for going to prior or next month *}
{* - Improvement: Click on Today label for changing date to today *}
{* - Version is now 1.19.7 *}
{* October 2008 - January 2009, Mehr, Day 1387 *}
{* - Improvement: Check input date on exit event with set CheckInputOnExit to
true in TSolarDatePicker class *}
{* - Improvement: Add edit box and UpDown controls on year label to easy change year *}
{* - Improvement: Change FToDay font color when mouse cursor point to it *}
{* - Improvement: Add moNone item to TMonthObject *}
{* - Improvement: Add ShowCellInColor for showing cell in different colors or white color *}
{* - Improvement: Show hint on selected cell *}
{* - Bug fix: Fix unable to choose cells of last row bug *}
{* - Improvement: Add Glyph property for choosing specific image for TSolarDatePicker button *}
{* - Improvement: use CTRL+Enter in TSolarDatePicker for switch between
solar and gregorian datekind and vice versa *}
{* - Improvement: open calendar windows by Ctrl+Down keys in TSolarDatePicker *}
{* - Improvement: add DefaultShowDate for showing today as default in TSolarDatePicker *}
{* - Version is now 1.28.8 *}
{* - January, February 2009 - Day, Bahman 1387 *}
{* - Improvement: add IncYear method to both main classes *}
{* - Improvement: add IncMonth method to both main classes * }
{* - Improvement: add IncDay method to both main classes *}
{* - Improvement: add DecYear method to both main classes *}
{* - Improvement: add DecMonth method to both main classes *}
{* - Improvement: add DecDay method to both main classes *}
{* - Improvement: add GotoYear method to both main classes *}
{* - Improvement: add GotoMonth method to both main classes *}
{* - Improvement: add GotoDay method to both main classes *}
{* - Improvement: add ConvertDate method *}
{* - Improvement: add ConvertYear method *}
{* - Improvement: add ConvertMonth method *}
{* - Improvement: add DaysBetween method *}
{* - Version is now 1.41.8 *}
{* - March 2009 - Farvardin 1388 *}
{* - Improvement: add Drop method to TSolarDatePicker class *}
{* - Improvement: add Close method to TSolarDatePicker class *}
{* - Improvement: optimized ShowPopup method codes }
{* - Version is now 1.43.8 *}
{* - April 2009 - Farvardin 1388 *}
{* - Improvement: add AutoCheck property for check user input *}
{* - Bug fix: The numbers of the day of Esfand in leap year *}
{* - Bug fix: The numbers of the day of February in leap year *}
{* - Version is now 2.0.2 *}
{* - May 2009 - Ordibehesht 1388 *}
{* - Bug fix: debug IncDay and DecDay functions *}
{* - Bug fix: debug IncMonth and DecMonth functions *}
{* - Improvement: add AutoDeleteDelimiter property to TSolarDatePicker *}
{* - Bug fix: debug FTopPanel size on Delphi 2009 *}
{* - Bug fix: Set AutoHotkeys to maManual for PopupMenu on Delphi 2009 *}
{* - Bug fix: use CharInSet instead of IN on Delphi 2009 *}
{* - Bug fix: debug unable to select a TSolarDatePicker cell on Delphi 2009 *}
{* - Bug fix: ConvertDate in TSolarDatePicker*}
{* - Version is now 2.1.9 *}
{* - July 2009 - Tir 1388 *}
{* - Improvement: add LIncYear method to both main classes *}
{* - Improvement: add LIncMonth method to both main classes * }
{* - Improvement: add LIncDay method to both main classes *}
{* - Improvement: add LDecYear method to both main classes *}
{* - Improvement: add LDecMonth method to both main classes *}
{* - Improvement: add LDecDay method to both main classes *}
{* - Bug fix: debug user interface on leap year *}
{* - Improvement: add GetRawDate method to both main classes *}
{* - Improvement: add GetDateWithDiv method for getting date with specific divider *}
{* - Improvement: add GetWeekRemainDays method for getting remain days of current week *}
{* - Improvement: add GetWeekRemainDays method with parameter for getting remain days of specific date *}
{* - Improvement: add DayOfWeek method for getting the day of the week for current date *}
{* - Improvement: add DayOfWeek method with parameters for getting the day of the week for a specific date *}
{* - Improvement: add GetMonthRemainDay method for getting remain days of current month *}
{* - Improvement: add GetMonthRemainDay method with parameters for getting remain days of specific date *}
{* - Improvement: add GetYearRemainDays method for getting remain days of this year *}
{* - Improvement: add GetYearRemainDays method with parameters for getting remain days of specific year *}
{* - Improvement: add YearScript method for getting year script *}
{* - Improvement: add MonthScript method for getting month script *}
{* - Improvement: add DayScript method for getting day script *}
{* - Improvement: add YMDScript method for getting year/month/day script *}
{* - Improvement: add WeekOfTheYear method for getting the week of the current year *}
{* - Improvement: add WeekOfTheYear method with parameters for getting the week of the specific year *}
{* - Improvement: removed unused space on CustomSolarCalendar(WinControl) and
the result is a fine and small component *}
{* - Bug fix: debug gregorian month popup menu *}
{* - Improvement: add EnabledDays property*}
{* - Improvement: add MaskEnabled property*}
{* - Version is now 2.26.11 *}
{* - August 2010 - Shahrivar 1389 *}
{* - Version is now 2.27.20 *}
{* - June 2012 - Tir 1391 *}
{* - XE *}
{* - XE2 *}
{* - DataSet *}
{* - Interface *}
{* - Bug fix *}
{* - Version is now 3.0 *}
{* - Version is now 3.1 *}
{* - November 2015 - Aabaan 1394 *}
{* - Version is now 3.4.12 *}
{* - XE3 - XE10 support *}
{* - Add month buttons *}
{* - Add FormatSettings *}
{* - Add Ctrl + Left/Right arrow key to Next/Prior month *}
{* - Add Shift + Left/Right arrow key to Next/Prior year *}
{* - Add gray bitmap for disabled control *}
{* - Bug fix : When for delete a char use Backspace key *}
{* - Bug fix : When user manually entered date dataset can not save it *}
{* - December 2016 - Dey 1395 *}
{* - Version is now 3.4.27 *}
{* - Bug fix : Exception raised when click on prior month *}
{* - Bug fix : Clear TSolarDatePicker.Text when DataField is null or empty *}
{* - bug fix: Fix YearEdit.Left position *}
{* - bug fix: Clear Text when DataField or DataSource is null *}
{* - bug fix: Make changes to comply with Delphi 7 *}
{* - bug fix: After the date is entered manually in TSolarDatePicker, the YMDScript output is wrong *}
{* - bug fix: When no value(no date in text) in TSolarDatePicker, the YMDScript output is wrong *}
{* - bug fix: When no value(no date in text) in TSolarDatePicker, BackSpace causes an error *}
{* - bug fix: When press Delete or BackSpace key in year editbox then cursor shifted to the another control *}
{* - bug fix: In TSolarMonthCalendar when YearEdit set focued then press Enter focus go on unknown control(Now DayGrid focued) *}
{* - bug fix: A Key value was not passed correctly to the event SolarDatePicker.KeyPress *}
{* - Improvement: Add AutoSaveModified property to post automatically modified field in table *}
{* - Improvement: Add DataFieldType property to convert automatically Gregorian date(DateTime) field to string and convert string to Gregorian. *}
{* - Improvement: Add csWhiteBlack to ColorStyle *}
{* - Improvement: Add Events for NextMonth and PrevMonth buttons click (OnNextMonth and OnPrevMonth) *}
{* - March 2017 - Esfand 1395 *}
{* - Version is now 3.4.27 *}
{* - Bug fix : Leap year *}
{* - Improvement: Select one of three date part when focused by keyboard key *}
{* - Improvement: Select one of three date part when focused by left mouse key *}
{* - February 2018 - Esfand 1396 *}
{* - version 3.5.2 *}
{* - Improvement : Add CTRL+D to show today in textbox *}
{* - March 2021 - Farvardin 1400 *}
{* - version 3.6 *}
{* - Bug fix : Fixed a problem with compatibility date formats *}
{* - Bug fix : Fixed source code file format *}
{* - Bug fix : Fix SolarMonthCalendar.Month value *}
{* - October 2023 - Mehr 1402 *}
{* - version 3.6.4 *}
{* - Bug fix : Fixed OnEnter event bug *}
{* - Bug fix : Fixed range check error on Delphi 11 *}
{* - Bug fix : Fixed UI bug (NextYear button on Header) *}
{* - Bug fix : Fixed ConvertDate method result *}
{* - March 2024 - Esfand 1402 *}
{* - version 3.6.8 *}
{* - Bug fix : fix TPublicUtils.IsLeapYear *}
{* - Bug fix : change Next/Prior buttons functions *}
{* - Bug fix : update DataField when DataField set and after pressing the keys CTRL+D *}
{* - Bug fix : update DataField when DataField set and after entering the information and leaving the editbox *}
{* - March 2024 - Farvardeen 1403 *}
{* - version 3.7 *}
{* - Bug fix : fix TPublicUtils.GregorinanToSolar function result *}
{* - Bug fix : fix current day hint on change layout event *}
{* - Add AutoCompleteOnMonthAndDay property : If the Month or Day section is a single character, a zero character is added to the left side of that section *}
{* - January 2025 - Dey 1403 *}
{* - version 3.7.2 *}
{* - Bug fix : Fixed the bug of increasing the Day part by pressing the up arrow key(TSolarDatePicker) *}
{* - Bug fix : Access Violation When the calendar button is pressed on Windows 64 bit *}
{* - February 2025 - Bahman 1403 *}
{* - version 3.7.x *}
{* - Bug fix : delete slash character when press backspace *}
unit SolarCalendarPackage;
//{$D-} { disable debug information }
//{$S+} { stack overflow checking }
{$R-}
{$R Calendar_Images.res}
interface
uses
Windows, Buttons, Classes, Controls, Forms, Graphics, Messages, StdCtrls,
Dialogs, SysUtils, ExtCtrls, Menus, DB, GraphUtil, DBCtrls;
type
TColorStyle = (csCustom, csPinkPink, csBlueBlue, csWhiteGray, csWhiteOrange, csWhiteRed, csWhiteWhite, csWhiteBlack);
TButtonStyle = (bsRound, bsRectangular);
TButtonType = (btLeftYear, btRightYear, btLayout, btLeftMonth, btRightMonth);
TDateKind = (dkSolar, dkGregorian);
TMonthPosition = (mpBottomRight, mpBottomCenter, mpRightYear, mpLeftYear);
TMonthObject = (moPopupMenu, moComboBox, moNone);
TGlyphType = (gtBlackArrowDown, gtCalendar, gtBlueArrowDown, gtGreenArrowDown);
TDivider = (dSlash, dBackSlash, dLine, dUnderScore, dDot, dComma);
TControlPosition = (cpLeftTop, cpLeftBottom, cpRightTop, cpRightBottom);
TFormat = (fLong, fShort);
TMonthType = (mtNumeral, mtAlphabet);
TMonthCaption = (mcSaturday = 0, mcSunday = 1, mcMonday = 2, mcTuesday = 3,
mcWednesday = 4, mcThursday = 5, mcFriday = 6);
TMonthCaptionSet = set of TMonthCaption;
TDatePartType = (dptNone, dptYear, dptMonth, dptDay);
TDataFieldType = (dftSolar, dftGregorian);
TSolarSideBarPosition = (sbpLeft, sbpRight);
TCell = record
Col: integer;
Row: integer;
end;
TDateFormatInfo = record
YearPart: string;
YearPartLen: integer;
end;
const
{***** Error Block *****}
ERR_INVALIDDATEFA = '.تاريخ وارد شده معتبر نمیباشد، لطفاً تاريخ صحيح را وارد نمائيد';
ERR_INVALIDDATEEN = 'Invalid date, Enter correct date please.';
{***** Error Block *****}
{***** Hint Block *****}
ST_ENNEXTYEARHINT = 'Next Year';
ST_ENPRIORYEARHINT = 'Prior Year';
ST_ENNEXTMONTHHINT = 'Next Month';
ST_ENPRIORMONTHHINT = 'Prior Month';
ST_FALAYOUTHINT = 'Persian';
ST_FANEXTYEARHINT = 'سال بعد';
ST_FAPRIORYEARHINT = 'سال قبل';
ST_FANEXTMONTHHINT = 'ماه بعد';
ST_FAPRIORMONTHHINT = 'ماه قبل';
ST_ENLAYOUTHINT = 'میلادی';
ST_FACURRENTYEAREDIT = 'سال جاری - كلیك كنید';
{***** Hint Block *****}
{***** Color Constants Block *****}
CL_ODDROWCOLOR = $00E1FFF9; //InfoBk
CL_EVENROWCOLOR = $00FFEBDF; //Blue
CL_DISABLECELLCOLOR = clWhite;//$00F0F0FF;
CL_BACKGROUNDCOLOR = clWhite; //$00BFBFBF;
CL_CAPTIONCOLOR = $004B4B4B;//clActiveCaption;//clNavy;
CL_SELECTEDCELLFONTCOLOR = 255;
CL_VACATIONDAYCOLOR = clMaroon;
CL_CELLFONTCOLOR = 0;
CL_WHITECOLOR = clwhite;
{***** Color Constants Block *****}
ST_PERSIANTODAY = '%s : امروز';
ST_ENGLISHTODAY = 'Today : %s';
ST_PERSIANYEAR = '%s سال';
ST_ENGLISHYEAR = 'Year %s';
ST_ABOUTSTR = 'Created by : Mohamad Khorsandi';
ST_VERSIONINFO = '3.7';
LayoutSet: array[TDateKind, 1..1] of String = (('C'), ('ش'));
DaySet: array[TDateKind, 1..7] of string = (
('جمعه', 'شنبه', 'يکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه'),
('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'));
ShortDaySet: array[TDateKind, 1..7] of string = (
('جمعه', 'شنبه', 'یک', 'دو', 'سه', 'چهار', 'پنج'),
('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'));
MonthSet: array[TDateKind, 1..12] of string = (
('فروردين ماه', 'ارديبهشت ماه', 'خرداد ماه', 'تير ماه', 'مرداد ماه',
'شهريور ماه', 'مهر ماه', 'آبان ماه', 'آذر ماه', 'دي ماه', 'بهمن ماه', 'اسفند ماه'),
('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',
'September', 'October', 'November', 'December')
);
ShortMonthSet: array[TDateKind, 1..12] of string = (
('فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد',
'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'),
('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',
'September', 'October', 'November', 'December')
);
LeapMonth: array[TDateKind] of Byte = (12 {Esfand}, 2 {February});
DaysOfMonths: array[TDateKind, 1..12] of Byte = (
( 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 )
{ Far, Ord, Kho, Tir, Mor, Sha, Meh, Aba, Aza, Day, Bah,^Esf },
( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )
{ Jan,^Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec });
DaysToMonth: array[TDateKind, 1..13] of Word = (
( 0, 31, 62, 93, 124, 155, 186, 216, 246, 276, 306, 336, 365 )
{ Far, Ord, Kho, Tir, Mor, Sha, Meh, Aba, Aza, Day, Bah,^Esf, *** },
( 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 )
{ Jan,^Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, *** });
type
TCustomSolarCalendar = class;
TSolarGrid = class;
TSolarTopPanel = class;
TYearEdit = class(TEdit)
private
FpPanel: TSolarTopPanel;
procedure SetIntYear(Value: Integer);
function GetIntYear: Integer;
protected
yMax: LongInt;
yMin: LongInt;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: Char); override;
public
constructor Create(AOwner: TComponent); override;
published
property yInt: Integer read GetIntYear write SetIntYear;
end;
TSolarButton = class(TGraphicControl)
protected
FpPanel: TSolarTopPanel;
FEnter: Boolean;
FType: TButtonType;
procedure Paint; override;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer); override;
public
constructor Create(AOwner: TComponent); override;
property Canvas;
end;
TSolarTopPanel = class(TCustomControl)
private
FYearEdit: TYearEdit;
FYear: TLabel;
FpCalendar: TCustomSolarCalendar;
btnNextYear: TSolarButton;
btnLayoutSwitch: TSolarButton;
btnPriorYear: TSolarButton;
btnPriorMonth: TSolarButton;
btnNextMonth: TSolarButton;
protected
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer); override;
procedure SetParent(AParent: TWinControl); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Paint; override;
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
procedure Panel_Set_Object_Mode;
Procedure ClickNextBtn(Sender: TObject);
Procedure ClickPriorBtn(Sender: TObject);
Procedure ClickNextMonthBtn(Sender: TObject);
Procedure ClickPriorMonthBtn(Sender: TObject);
procedure CaptionOnClick(Sender: TObject);
procedure ClickLayout(Sender: TObject);
// procedure YearUpDownChange(Sender: TObject; var AllowChange: Boolean; NewValue: Smallint; Direction: TUpDownDirection);
Procedure SetYearButton(Prm_Value: Boolean);
procedure SetMonthButton(Prm_Value: Boolean);
procedure SetHeaderButtonsHint();
end;
TSolarCell = class
private
Fcl_Text: string;
procedure cl_SetText(const Value: string);
public
cl_pBody: TSolarGrid;
cl_Col: Byte;
cl_Row: Byte;
cl_Left: LongInt;
cl_Top: LongInt;
cl_Width: LongInt;
cl_Height: LongInt;
property cl_Text: string read Fcl_Text write cl_SetText;
end;
TSolarGrid = class(TCustomControl) //TStringGrid
private
FSGr_Col: integer;
FSGr_Row: integer;
FSGr_ColCount: Byte;
FSGr_RowCount: Byte;
procedure SGr_SetColCount(const Value: Byte);
procedure SGr_SetRowCount(const Value: Byte);
procedure SGr_SetCol(const Value: integer);
procedure SGr_SetRow(const Value: integer);
procedure SGr_DrawItem(ACol, ARow: integer);
procedure SGr_FreeAll;
procedure SGr_CreateAll;
procedure SGr_Pos(X, Y: Integer; var ACol, ARow: Integer);
protected
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
procedure SGr_Paint;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer); override;
procedure SetParent(AParent: TWinControl); override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure CNKeydown(var Message: TMessage); message CN_KEYDOWN;
procedure Paint; override;
public
SGr_DefaultColWidth: LongInt;
SGr_DefaultRowHeight: LongInt;
SGr_Cells: array of array of TSolarCell;
FpCalendar: TCustomSolarCalendar;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property SGr_ColCount: Byte read FSGr_ColCount write SGr_SetColCount;
property SGr_RowCount: Byte read FSGr_RowCount write SGr_SetRowCount;
property SGr_Col: integer read FSGr_Col write SGr_SetCol;
property SGr_Row: integer read FSGr_Row write SGr_SetRow;
end;
TCustomButtonEdit = class(TCustomEdit)
private
FButton: TBitBtn;
FAbout: String;
FVisibleLayoutSwitch: Boolean;
procedure ButtonClick(Sender: TObject);
procedure SetAbout(const Value: String);
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure DoButtonClick; virtual; abstract;
function GetEnabled: Boolean; reintroduce;
procedure SetEnabled(PEnable: Boolean); reintroduce; virtual;
procedure WMSize(var Message: TWMSize); message WM_SIZE;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Anchors;
property About: String read FAbout write SetAbout;
property BiDiMode;
property AutoSelect;
property BorderStyle;
property Color;
property Ctl3d;
property DragCursor;
property DragMode;
property Font;
property HideSelection;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property Text;
property Visible;
property Enabled: Boolean Read GetEnabled Write SetEnabled;
property VisibleLayoutSwitch: Boolean read FVisibleLayoutSwitch write FVisibleLayoutSwitch default True;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TCustomSolarCalendar = class(TCustomControl)
private
FToDay: TLabel;
FSat: TLabel;
FSun: TLabel;
FMon: TLabel;
FTus: TLabel;
FThu: TLabel;
FWed: TLabel;
FFri: TLabel;
FTopPanel: TSolarTopPanel;//TPanel;
FGrid: TSolarGrid;
FMenu: TPopupMenu;
FMonth: TLabel;
FMiladi: String;
FSolar: String;
FMonthObject: TMonthObject;
FEnabledYearButton: Boolean;
FTextHint: String;
FDateKind: TDateKind;
FPrevMenuItem: Integer;
FCurrYear: Word;
FCurrMonth: Word;
FCurrDay: Word;
FDisableCellColor: TColor;
FOddRowColor: TColor;
FEvenRowColor: TColor;
FMonthPosition: TMonthPosition;
FCellFontColor: TColor;
FSelectedCellFontColor: TColor;
FMonthCombo: TComboBox;
LastCol: Byte;
LastRow: Byte;
FInDate: String;
FAbout: String;
FFirstCell: integer;
FLastCell: TCell;
FShowToDay: Boolean;
FTempYear: integer;
FCanvas: TControlCanvas;
FVisibleLayoutSwitch: Boolean;
FEnabledDays: TMonthCaptionSet;
FColorCaptionStart: TColor;
FColorCaptionStop: TColor;
FColorBodyStart: TColor;
FColorBodyStop: TColor;
FColorTodayLine: TColor;
FColorSelectBrush: TColor;
FColorDisableMonth: TColor;
FColorVacationDay: TColor;
FColorNormalDay: TColor;
FRoundButton: LongInt;
FRoundSelect: LongInt;
FColorStyle: TColorStyle;
FButtonStyle: TButtonStyle;
FDataLink: TFieldDataLink;
FEnabledMonthButton: Boolean;
FDataFieldType: TDataFieldType;
FChangePersianFridayCaption: boolean;
FOutDate: String;
function GetCanvas: TCanvas;
procedure ToDayClick(Sender: TObject);
Procedure CalendarSetObjectMode;
Procedure MonthChanging();
Procedure GridSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); virtual;
Procedure MenuItemClick(Sender: TObject);
Procedure MonthSetting();
Procedure SetOnCellClick(Value: TNotifyEvent);
Procedure SetDate(out SDate, MDate: String; PKind: Byte);
procedure SetDateKind(const Value: TDateKind);
procedure SetDisableCellColor(const Value: TColor);
procedure SetOddRowColor(const Value: TColor);
procedure SetEvenRowColor(const Value: TColor);
procedure SetMonthPosition(const Value: TMonthPosition);
procedure SetCellFontColor(const Value: TColor);
procedure SetSelectedCellFontColor(const Value: TColor);
procedure SetMonthObject(const Value: TMonthObject);
procedure MonthComboClick(Sender: TObject);
procedure SetComboBox();
procedure SetInDate(const Value: String);
Procedure WMSize(var Message: TWMSize); Message WM_SIZE;
procedure SetToDay;
procedure SetAbout(const Value: String);
function GetPrevMonthDays: integer;
procedure FillPrevMonthDayCells;
procedure FillNextMonthDayCells;
procedure SetShowToDay(const Value: Boolean);
function GetMonthName: string;
function GetDayName: string;
function CheckInputDate(Year, Month, Day: word): boolean;
procedure SetPriorYear;
procedure SetNextYear;
procedure SetNextMonth;
procedure SetPriorMonth;
procedure YearOnClick(Sender: TObject);
procedure YearEditContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
procedure SetYear(Value: integer);
procedure SetYearEditVisibility(value: boolean);
procedure ToDayMouseEnter(Sender: TObject);
procedure ToDayMouseLeave(Sender: TObject);
procedure ClearGridCurrMonthCells;
procedure ClearGridNextMonthCells;
procedure ClearGridPrevMonthCells;
function InThisRange(ACol, ARow: integer): boolean;
procedure SetVisibleLayoutSwitch(const Value: Boolean);
procedure ActiveOnDayClick(Active: boolean);
procedure SetColorCaptionStop(const Value: TColor);
procedure SetColorCaptionStart(const Value: TColor);
procedure SetColorBodyStop(const Value: TColor);
procedure SetColorBodyStart(const Value: TColor);
procedure SetColorSelectBrush(const Value: TColor);
procedure SetColorTodayLine(const Value: TColor);
procedure SetColorDisableMonth(const Value: TColor);
procedure SetColorVacationDay(const Value: TColor);
procedure SetColorNormalDay(const Value: TColor);
procedure SetYearButton(const Value: Boolean);
procedure SetColorStyle(const Value: TColorStyle);
procedure SetButtonStyle(const Value: TButtonStyle);
function GetDataField: String;
function GetDataSource: TDataSource;
procedure SetDataField(const Value: String);
procedure SetDataSource(const Value: TDataSource);
procedure DataChange(Sender: TObject);
procedure SetMonthButton(const Value: Boolean);
procedure SetOutDate(const Value: String);
procedure SetGridCellHint(ADay: integer);
protected
FOnLayoutClick: TNotifyEvent;
FOnNextClick: TNotifyEvent;
FOnPrevClick: TNotifyEvent;
FOnNextMonthClick: TNotifyEvent;
FOnPrevMonthClick: TNotifyEvent;
FOnDayClick: TNotifyEvent;
procedure PaintWindow(DC: HDC); override;
procedure Paint; override;
procedure DoEnter; override;
public
Constructor Create(AOwner: TComponent); Override;
Destructor Destroy; override;
function GetToDay: string;
procedure SetParent(AParent: TWinControl); override;
function ConvertDate: string;
function ConvertMonth: byte;
function ConvertYear: integer;
function DaysBetween(ANow, AThen: string): integer;
function DecDay(ANumberOfDay: integer = 1): string;
function DecMonth(ANumberOfMonth: integer = 1): string;
function DecYear(ANumberOfYear: integer = 1): string;
function GotoDay(ADay: integer): string;
function GotoMonth(AMonth: integer): string;
function GotoYear(AYear: integer): string;
function IncDay(ANumberOfDay: integer = 1): string;
function IncMonth(ANumberOfMonth: integer = 1): string;
function IncYear(ANumberOfYear: integer = 1): string;
function LDecDay(ANumberOfDay: integer = 1): string;
function LDecMonth(ANumberOfMonth: integer = 1): string;
function LDecYear(ANumberOfYear: integer = 1): string;
function LIncDay(ANumberOfDay: integer = 1): string;
function LIncMonth(ANumberOfMonth: integer = 1): string;
function LIncYear(ANumberOfYear: integer = 1): string;
function GetRawDate: string;
function GetDateWithDiv(Divider: string): string;
function GetWeekRemainDays: integer; overload;
function GetWeekRemainDays(Date: string; DateKind: TDateKind): integer; overload;
function GetYearRemainDays: integer; overload;
function GetYearRemainDays(Date: string; DateKind: TDateKind): integer; overload;
function GetMonthRemainDay: integer; overload;
function GetMonthRemainDay(Date: string; DateKind: TDateKind): integer; overload;
function DayOfWeek: integer; overload;
function DayOfWeek(Date: string; DateKind: TDateKind): integer; overload;
function YearScript(Year: integer = 0; Format: TFormat = fLong): string;
function MonthScript(Month: integer = 0): string;
function DayScript(Day: integer = 0): string;
function YMDScript(MonthType: TMonthType = mtAlphabet; Divider: string = ' '): string; overload;
function WeekOfTheYear: integer; overload;
function WeekOfTheYear(ADate: string; ADateKind: TDateKind): integer; overload;
property Canvas: TCanvas read GetCanvas;
Property InDate: String Read FInDate Write SetInDate;
property MonthName: string Read GetMonthName;
property DayName: string Read GetDayName;
property OutDate: String read FOutDate write SetOutDate;
published
property About: String read FAbout write SetAbout;
Property Visible;
Property EnableYearButtons: Boolean Read FEnabledYearButton Write SetYearButton default True;
Property EnableYearMonth: Boolean Read FEnabledMonthButton Write SetMonthButton;
Property MonthObject: TMonthObject Read FMonthObject Write SetMonthObject;
Property MiladiDate: String Read FMiladi Write FMiladi;
Property HintText: String Read FTextHint Write FTextHint;
Property SolarDate: String Read FSolar Write FSolar;
Property DateKind: TDateKind Read FDateKind Write SetDateKind;
Property DisableCellColor: TColor Read FDisableCellColor Write SetDisableCellColor;
Property OddRowColor: TColor Read FOddRowColor Write SetOddRowColor default CL_ODDROWCOLOR;
Property EvenRowColor: TColor Read FEvenRowColor Write SetEvenRowColor default CL_EVENROWCOLOR;
Property MonthPosition: TMonthPosition Read FMonthPosition Write SetMonthPosition;
Property CellFontColor: TColor Read FCellFontColor Write SetCellFontColor;
Property SelectedCellFontColor: TColor Read FSelectedCellFontColor write SetSelectedCellFontColor;
Property ShowToDay: Boolean Read FShowToDay Write SetShowToDay;
property VisibleLayoutSwitch: Boolean read FVisibleLayoutSwitch write SetVisibleLayoutSwitch;
property EnabledDays: TMonthCaptionSet read FEnabledDays write FEnabledDays;
property ColorCaptionStart: TColor read FColorCaptionStart write SetColorCaptionStart;
property ColorCaptionStop: TColor read FColorCaptionStop write SetColorCaptionStop;
property ColorBodyStart: TColor read FColorBodyStart write SetColorBodyStart;
property ColorBodyStop: TColor read FColorBodyStop write SetColorBodyStop;
property ColorTodayLine: TColor read FColorTodayLine write SetColorTodayLine;
property ColorSelectBrush: TColor read FColorSelectBrush write SetColorSelectBrush;
property ColorDisableMonth: TColor read FColorDisableMonth write SetColorDisableMonth;
property ColorVacationDay: TColor read FColorVacationDay write SetColorVacationDay;
property ColorNormalDay: TColor read FColorNormalDay write SetColorNormalDay;
property ColorStyle: TColorStyle read FColorStyle write SetColorStyle;
property ButtonStyle: TButtonStyle read FButtonStyle write SetButtonStyle;
Property OnDayClick: TNotifyEvent read FOnDayClick Write SetOnCellClick;
property OnNextClick: TNotifyEvent read FOnNextClick write FOnNextClick;
property OnPrevClick: TNotifyEvent read FOnPrevClick write FOnPrevClick;
property OnNextMonthClick: TNotifyEvent read FOnNextMonthClick write FOnNextMonthClick;
property OnPrevMonthClick: TNotifyEvent read FOnPrevMonthClick write FOnPrevMonthClick;
property OnLayoutClick: TNotifyEvent read FOnLayoutClick write FOnLayoutClick;
property DataSource: TDataSource Read GetDataSource Write SetDataSource;
property DataField: String Read GetDataField Write SetDataField;
property DataFieldType: TDataFieldType read FDataFieldType write FDataFieldType;
property ChangePersianFridayCaption: boolean read FChangePersianFridayCaption write FChangePersianFridayCaption;
end;
TSolarDatePicker = Class(TCustomButtonEdit)
Private
FDataLink: TFieldDataLink;
FDataFieldType: TDataFieldType;
FCurrYear: Word;
FCurrMonth: Word;
FCurrDay: Word;
FCustomSolarCalendar: TCustomSolarCalendar;
FOnButtonClick: TNotifyEvent;
FCheckInputOnExit: Boolean;
FPersianInvalidDateMessage: string;
FEnglishInvalidDateMessage: string;
FDateKind: TDateKind;
FOnLayoutClick: TNotifyEvent;
FOnNextClick: TNotifyEvent;
FOnPrevClick: TNotifyEvent;
FDivider: TDivider;
FDividerStr: string[1];
FShowToDay: Boolean;
FMonthObject: TMonthObject;
FGlyph: TGlyphType;
FShowDefaultDate: boolean;
FAutoCheck: boolean;
FAutoDeleteDelimiter: boolean;
FEnabledDays: TMonthCaptionSet;
FMaskEnabled: Boolean;
FButtonStyle: TButtonStyle;
FColorDisableMonth: TColor;
FColorStyle: TColorStyle;
FColorNormalDay: TColor;
FColorBodyStop: TColor;
FColorBodyStart: TColor;
FColorTodayLine: TColor;
FColorCaptionStop: TColor;
FColorCaptionStart: TColor;
FColorVacationDay: TColor;
FColorSelectBrush: TColor;
FOnNextMonthClick: TNotifyEvent;
FOnPrevMonthClick: TNotifyEvent;
FSelectPartOnFocus: TDatePartType;
FShowCalendarWhenReadOnly: boolean;
FAutoCompleteOnMonthAndDay: boolean;
function GetDataField: String;
function GetDataSource: TDataSource;
procedure SetDataField(const Value: String);
procedure SetDataSource(const Value: TDataSource);
procedure DataChange(Sender: TObject);
Procedure CellDblClick4Close(Sender: TObject);
procedure ShowPopup(xPos: integer = -1; yPos: integer = -1);
procedure ShowInvalidDateMsg;
function GetDay: integer;
function GetMonth: integer;
function GetYear: integer;
function GetDayName: string;
function GetMonthName: string;
procedure SetDivider(const Value: TDivider);
procedure SetGlyph(const Value: TGlyphType);
procedure SetShowDefaultDate(const Value: boolean);
procedure InsertChar(MainString, Key: string; CaretPos: integer);
function AddYearPart: string;
function AddMonthPart: string;
function AddDayPart: string;
function GetDayPart: string;
function GetMonthPart: string;
function GetYearPart: string;
function DecDayPart: string;
function DecMonthPart: string;
function DecYearPart: string;
procedure SelectYearPart();
procedure SelectMonthPart();
procedure SelectDayPart();
procedure SetAutoCheck(const Value: boolean);
procedure GridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure SetMonth(const Value: integer);
procedure SetDay(const Value: integer);
procedure SetYear(const Value: integer);
function ValidateDataSet: boolean;
procedure SetColorStyle(const Value: TColorStyle);
procedure DoSelectPartOnFocus(ADatePartType: TDatePartType);
procedure SetDataFieldValue;
Protected
procedure DoButtonClick; override;
procedure CMExit(var Message: TCMExit); message CM_EXIT;
procedure CMEnter(var Message: TCMGotFocus); message CM_ENTER;
procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: Char); override;
procedure SetEnabled(PEnable: Boolean); override;
procedure Change; override;
Public
Constructor Create(AOwner: TComponent); override;
Destructor Destroy; override;
function ConvertDate: string;
function ConvertMonth: byte;
function ConvertYear: integer;
function DaysBetween(ANow, AThen: string): integer;
function DecDay(ANumberOfDay: integer = 1): string;
function DecMonth(ANumberOfMonth: integer = 1): string;
function DecYear(ANumberOfYear: integer = 1): string;
function GotoDay(ADay: integer): string;
function GotoMonth(AMonth: integer): string;
function GotoYear(AYear: integer): string;
function IncDay(ANumberOfDay: integer = 1): string;
function IncMonth(ANumberOfMonth: integer = 1): string;
function IncYear(ANumberOfYear: integer = 1): string;
function GetRawDate: string;
function GetDateWithDiv(Divider: string): string;
function GetWeekRemainDays: integer; overload;
function DayOfWeek: integer; overload;
function DayOfWeek(Date: string; DateKind: TDateKind): integer; overload;
function GetMonthRemainDay: integer; overload;
function GetMonthRemainDay(Date: string; DateKind: TDateKind): integer; overload;
function GetYearRemainDays: integer; overload;
function GetWeekRemainDays(Date: string; DateKind: TDateKind): integer; overload;
function GetYearRemainDays(Date: string; DateKind: TDateKind): integer; overload;
function YearScript(Year: integer = 0; Format: TFormat = fLong): string; overload;
function MonthScript(Month: integer = 0): string;
function DayScript(Day: integer): string;
function YMDScript(MonthType: TMonthType = mtAlphabet; Divider: string = ' '): string; overload;
function WeekOfTheYear: integer; overload;
function WeekOfTheYear(ADate: string; ADateKind: TDateKind): integer; overload;
function Len: integer;
procedure Drop;
procedure Close;
property Year: integer read GetYear write SetYear;
property Month: integer read GetMonth write SetMonth;
property Day: integer read GetDay write SetDay;
property MonthName: string Read GetMonthName;
property DayName: string Read GetDayName;
property SolarCalendar: TCustomSolarCalendar read FCustomSolarCalendar write FCustomSolarCalendar;
published
property ShowCalendarWhenReadOnly: boolean read FShowCalendarWhenReadOnly write FShowCalendarWhenReadOnly;
Property DateKind: TDateKind Read FDateKind Write FDateKind;
property PersianInvalidDateMessage: string read FPersianInvalidDateMessage write FPersianInvalidDateMessage;
property EnglishInvalidDateMessage: string read FEnglishInvalidDateMessage write FEnglishInvalidDateMessage;
property CheckInputOnExit: Boolean read FCheckInputOnExit write FCheckInputOnExit;
Property Divider: TDivider read FDivider write SetDivider;
Property ShowToDay: Boolean Read FShowToDay Write FShowToDay;
Property MonthObject: TMonthObject read FMonthObject write FMonthObject;
property Glyph: TGlyphType read FGlyph write SetGlyph;
property ShowDefaultDate: boolean read FShowDefaultDate write SetShowDefaultDate;
property AutoCheck: boolean read FAutoCheck write SetAutoCheck;
property AutoDeleteDelimiter: boolean read FAutoDeleteDelimiter write FAutoDeleteDelimiter;
property EnabledDays: TMonthCaptionSet read FEnabledDays write FEnabledDays;
property MaskEnabled: Boolean read FMaskEnabled write FMaskEnabled;
property ColorCaptionStart: TColor read FColorCaptionStart write FColorCaptionStart;
property ColorCaptionStop: TColor read FColorCaptionStop write FColorCaptionStop;
property ColorBodyStart: TColor read FColorBodyStart write FColorBodyStart;
property ColorBodyStop: TColor read FColorBodyStop write FColorBodyStop;
property ColorTodayLine: TColor read FColorTodayLine write FColorTodayLine;
property ColorSelectBrush: TColor read FColorSelectBrush write FColorSelectBrush;
property ColorDisableMonth: TColor read FColorDisableMonth write FColorDisableMonth;
property ColorVacationDay: TColor read FColorVacationDay write FColorVacationDay;
property ColorNormalDay: TColor read FColorNormalDay write FColorNormalDay;
property ColorStyle: TColorStyle read FColorStyle write SetColorStyle;
property ButtonStyle: TButtonStyle read FButtonStyle write FButtonStyle;
property DataSource: TDataSource Read GetDataSource Write SetDataSource;
property DataField: String Read GetDataField Write SetDataField;
property DataFieldType: TDataFieldType read FDataFieldType write FDataFieldType;
property SelectPartOnFocus: TDatePartType read FSelectPartOnFocus write FSelectPartOnFocus;
property AutoCompleteOnMonthAndDay: boolean read FAutoCompleteOnMonthAndDay write FAutoCompleteOnMonthAndDay;
property OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick;
property OnNextClick: TNotifyEvent read FOnNextClick write FOnNextClick;
property OnPrevClick: TNotifyEvent read FOnPrevClick write FOnPrevClick;
property OnNextMonthClick: TNotifyEvent read FOnNextMonthClick write FOnNextMonthClick;
property OnPrevMonthClick: TNotifyEvent read FOnPrevMonthClick write FOnPrevMonthClick;
property OnLayoutClick: TNotifyEvent read FOnLayoutClick write FOnLayoutClick;
End;
TSolarMonthCalendar = Class(TCustomSolarCalendar)
Private
function GetYear: integer;
function GetDay: integer;