callite: Add support to select dates by code.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6543 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-07-04 21:58:27 +00:00
parent af5a127379
commit 36a928c055

View File

@ -314,6 +314,8 @@ type
function GetDayName(ADayOfWeek: TDayOfWeek): String; function GetDayName(ADayOfWeek: TDayOfWeek): String;
function GetMonthName(AMonth: Integer): String; function GetMonthName(AMonth: Integer): String;
procedure AddSelectedDate(ADate: TDate);
procedure ClearSelectedDates;
function IsSelected(ADate: TDate): Boolean; function IsSelected(ADate: TDate): Boolean;
function SelectedDates: TCalDateArray; function SelectedDates: TCalDateArray;
@ -368,7 +370,8 @@ type
property DayNames: String read GetDayNames write SetDayNames; property DayNames: String read GetDayNames write SetDayNames;
property DisplayTexts: String read GetDisplaytexts write SetDisplayTexts; property DisplayTexts: String read GetDisplaytexts write SetDisplayTexts;
property MonthNames: String read GetMonthnames write SetMonthNames; property MonthNames: String read GetMonthnames write SetMonthNames;
property MultiSelect: Boolean read FMultiSelect write SetMultiSelect; property MultiSelect: Boolean read FMultiSelect write SetMultiSelect
default false;
property Options: TCalOptions read FOptions write SetOptions property Options: TCalOptions read FOptions write SetOptions
default [coShowTodayFrame, coBoldHolidays, coShowWeekend, coShowHolidays, coShowTodayRow]; default [coShowTodayFrame, coBoldHolidays, coShowWeekend, coShowHolidays, coShowTodayRow];
property StartingDayOfWeek: TDayOfWeek read FStartingDayOfWeek property StartingDayOfWeek: TDayOfWeek read FStartingDayOfWeek
@ -1324,6 +1327,12 @@ begin
inherited Destroy; inherited Destroy;
end; end;
procedure TCalendarLite.AddSelectedDate(ADate: TDate);
begin
FSelDates.AddDate(ADate);
Invalidate;
end;
procedure TCalendarLite.ChangeDateTo(ADate: TDate; ASelMode: TCalSelMode); procedure TCalendarLite.ChangeDateTo(ADate: TDate; ASelMode: TCalSelMode);
var var
d, d1, d2: TDate; d, d1, d2: TDate;
@ -1406,6 +1415,12 @@ begin
Invalidate; Invalidate;
end; end;
procedure TCalendarLite.ClearSelectedDates;
begin
FSelDates.Clear;
Invalidate;
end;
procedure TCalendarLite.DateChange; procedure TCalendarLite.DateChange;
begin begin
if Assigned(FOnDateChange) then if Assigned(FOnDateChange) then