From 4d6f43d5830767e0eb035c7e0983a22e467b087e Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 15 Aug 2020 21:24:27 +0000 Subject: [PATCH] CalLite: Undo previous commit. Not good. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7605 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/callite/demo3/selectiondemo.lfm | 14 -------------- components/callite/demo3/selectiondemo.pas | 10 ---------- components/callite/source/calendarlite.pas | 13 +++++-------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/components/callite/demo3/selectiondemo.lfm b/components/callite/demo3/selectiondemo.lfm index 7c608020c..af324c980 100644 --- a/components/callite/demo3/selectiondemo.lfm +++ b/components/callite/demo3/selectiondemo.lfm @@ -71,20 +71,6 @@ object Form1: TForm1 State = cbChecked TabOrder = 1 end - object CbPersistentSelectedDates: TCheckBox - AnchorSideLeft.Control = CbMultiselect - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = CbMultiselect - AnchorSideTop.Side = asrCenter - Left = 110 - Height = 19 - Top = 225 - Width = 148 - BorderSpacing.Left = 6 - Caption = 'Persistent selected dates' - OnChange = CbPersistentSelectedDatesChange - TabOrder = 2 - end end object Splitter1: TSplitter Left = 278 diff --git a/components/callite/demo3/selectiondemo.pas b/components/callite/demo3/selectiondemo.pas index 8ff51b97b..785a55cfc 100644 --- a/components/callite/demo3/selectiondemo.pas +++ b/components/callite/demo3/selectiondemo.pas @@ -15,13 +15,11 @@ type TForm1 = class(TForm) CalendarLite1: TCalendarLite; CbMultiselect: TCheckBox; - CbPersistentSelectedDates: TCheckBox; ListBox1: TListBox; Panel1: TPanel; Splitter1: TSplitter; procedure CalendarLite1DateChange(Sender: TObject); procedure CbMultiselectChange(Sender: TObject); - procedure CbPersistentSelectedDatesChange(Sender: TObject); private public @@ -58,13 +56,5 @@ begin CalendarLite1.MultiSelect := cbMultiSelect.Checked; end; -procedure TForm1.CbPersistentSelectedDatesChange(Sender: TObject); -begin - if CbPersistentSelectedDates.Checked then - CalendarLite1.Options := CalendarLite1.Options + [coPersistentSelectedDates] - else - CalendarLite1.Options := CalendarLite1.Options - [coPersistentSelectedDates]; -end; - end. diff --git a/components/callite/source/calendarlite.pas b/components/callite/source/calendarlite.pas index a1db0f433..c2a14aea5 100644 --- a/components/callite/source/calendarlite.pas +++ b/components/callite/source/calendarlite.pas @@ -88,8 +88,7 @@ type TCalOption = (coBoldDayNames, coBoldHolidays, coBoldToday, coBoldTopRow, coBoldWeekend, coDayLine, coShowBorder, coShowHolidays, coShowTodayFrame, coShowTodayName, coShowTodayRow, - coShowWeekend, coShowDayNames, coShowTopRow, coUseTopRowColors, - coPersistentSelectedDates + coShowWeekend, coShowDayNames, coShowTopRow, coUseTopRowColors ); TCalOptions = set of TCalOption; @@ -1504,8 +1503,7 @@ begin case ASelMode of smFirstSingle: begin - if not (coPersistentSelectedDates in FOptions) then - FSelDates.Clear; + FSelDates.Clear; FSelDates.AddDate(ADate); FPrevDate := ADate; end; @@ -1520,7 +1518,7 @@ begin begin if (DayOfWeek(ADate) in [ord(dowSunday), ord(dowSaturday)]) then exit; - if (ASelMode = smFirstWeek) and not (coPersistentSelectedDates in FOptions) then + if ASelMode = smFirstWeek then FSelDates.Clear; // Collect all weekdays if ASelMode = smNextWeekRange then begin @@ -1548,7 +1546,7 @@ begin smFirstRange, smNextRange: begin - if (ASelMode = smFirstRange) and not (coPersistentSelectedDates in FOptions) then + if (ASelMode = smFirstRange) then FSelDates.Clear; if FPrevDate < ADate then begin d1 := FPrevDate + ord(ASelMode = smNextRange); @@ -1973,8 +1971,7 @@ begin oldMonth := MonthOf(FDate); FDate := AValue; FPrevDate := AValue; - if not (coPersistentSelectedDates in FOptions) then - FSelDates.Clear; + FSelDates.Clear; DateChange; if MonthOf(FDate) <> oldMonth then MonthChange;