CalLite: Undo previous commit. Not good.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7605 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-08-15 21:24:27 +00:00
parent 58ee5bae50
commit 4d6f43d583
3 changed files with 5 additions and 32 deletions

View File

@ -71,20 +71,6 @@ object Form1: TForm1
State = cbChecked State = cbChecked
TabOrder = 1 TabOrder = 1
end 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 end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 278 Left = 278

View File

@ -15,13 +15,11 @@ type
TForm1 = class(TForm) TForm1 = class(TForm)
CalendarLite1: TCalendarLite; CalendarLite1: TCalendarLite;
CbMultiselect: TCheckBox; CbMultiselect: TCheckBox;
CbPersistentSelectedDates: TCheckBox;
ListBox1: TListBox; ListBox1: TListBox;
Panel1: TPanel; Panel1: TPanel;
Splitter1: TSplitter; Splitter1: TSplitter;
procedure CalendarLite1DateChange(Sender: TObject); procedure CalendarLite1DateChange(Sender: TObject);
procedure CbMultiselectChange(Sender: TObject); procedure CbMultiselectChange(Sender: TObject);
procedure CbPersistentSelectedDatesChange(Sender: TObject);
private private
public public
@ -58,13 +56,5 @@ begin
CalendarLite1.MultiSelect := cbMultiSelect.Checked; CalendarLite1.MultiSelect := cbMultiSelect.Checked;
end; end;
procedure TForm1.CbPersistentSelectedDatesChange(Sender: TObject);
begin
if CbPersistentSelectedDates.Checked then
CalendarLite1.Options := CalendarLite1.Options + [coPersistentSelectedDates]
else
CalendarLite1.Options := CalendarLite1.Options - [coPersistentSelectedDates];
end;
end. end.

View File

@ -88,8 +88,7 @@ type
TCalOption = (coBoldDayNames, coBoldHolidays, coBoldToday, coBoldTopRow, TCalOption = (coBoldDayNames, coBoldHolidays, coBoldToday, coBoldTopRow,
coBoldWeekend, coDayLine, coShowBorder, coShowHolidays, coBoldWeekend, coDayLine, coShowBorder, coShowHolidays,
coShowTodayFrame, coShowTodayName, coShowTodayRow, coShowTodayFrame, coShowTodayName, coShowTodayRow,
coShowWeekend, coShowDayNames, coShowTopRow, coUseTopRowColors, coShowWeekend, coShowDayNames, coShowTopRow, coUseTopRowColors
coPersistentSelectedDates
); );
TCalOptions = set of TCalOption; TCalOptions = set of TCalOption;
@ -1504,8 +1503,7 @@ begin
case ASelMode of case ASelMode of
smFirstSingle: smFirstSingle:
begin begin
if not (coPersistentSelectedDates in FOptions) then FSelDates.Clear;
FSelDates.Clear;
FSelDates.AddDate(ADate); FSelDates.AddDate(ADate);
FPrevDate := ADate; FPrevDate := ADate;
end; end;
@ -1520,7 +1518,7 @@ begin
begin begin
if (DayOfWeek(ADate) in [ord(dowSunday), ord(dowSaturday)]) then if (DayOfWeek(ADate) in [ord(dowSunday), ord(dowSaturday)]) then
exit; exit;
if (ASelMode = smFirstWeek) and not (coPersistentSelectedDates in FOptions) then if ASelMode = smFirstWeek then
FSelDates.Clear; FSelDates.Clear;
// Collect all weekdays // Collect all weekdays
if ASelMode = smNextWeekRange then begin if ASelMode = smNextWeekRange then begin
@ -1548,7 +1546,7 @@ begin
smFirstRange, smNextRange: smFirstRange, smNextRange:
begin begin
if (ASelMode = smFirstRange) and not (coPersistentSelectedDates in FOptions) then if (ASelMode = smFirstRange) then
FSelDates.Clear; FSelDates.Clear;
if FPrevDate < ADate then begin if FPrevDate < ADate then begin
d1 := FPrevDate + ord(ASelMode = smNextRange); d1 := FPrevDate + ord(ASelMode = smNextRange);
@ -1973,8 +1971,7 @@ begin
oldMonth := MonthOf(FDate); oldMonth := MonthOf(FDate);
FDate := AValue; FDate := AValue;
FPrevDate := AValue; FPrevDate := AValue;
if not (coPersistentSelectedDates in FOptions) then FSelDates.Clear;
FSelDates.Clear;
DateChange; DateChange;
if MonthOf(FDate) <> oldMonth then if MonthOf(FDate) <> oldMonth then
MonthChange; MonthChange;