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
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

View File

@ -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.

View File

@ -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;