CalLite: Fix behavior of right mouse click.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5373 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-11-22 08:53:34 +00:00
parent fcfce0aa75
commit f7c12d318b
2 changed files with 16 additions and 25 deletions

View File

@ -135,10 +135,10 @@ procedure TForm1.FormCreate(Sender: TObject);
var var
opt: TCalOption; opt: TCalOption;
begin begin
demoCal:= TCalendarLite.Create(Self); demoCal := TCalendarLite.Create(Self);
demoCal.Parent:= Self; demoCal.Parent := Self;
demoCal.Left:= 10; demoCal.Left := 10;
demoCal.Top:= PSettings.Height + 10; demoCal.Top := PSettings.Height + 10;
demoCal.Width := seWidth.Value; demoCal.Width := seWidth.Value;
demoCal.Height := seHeight.Value; demoCal.Height := seHeight.Value;
demoCal.OnGetHolidays := @GetHolidays; demoCal.OnGetHolidays := @GetHolidays;
@ -153,12 +153,12 @@ begin
if CbDrawCell.Checked then if CbDrawCell.Checked then
demoCal.OnDrawCell := @DrawCell else demoCal.OnDrawCell := @DrawCell else
demoCal.OnDrawCell := nil; demoCal.OnDrawCell := nil;
FNoHolidays:= False; FNoHolidays := False;
for opt in demoCal.Options do for opt in demoCal.Options do
if (opt in demoCal.Options) then cgOptions.Checked[integer(opt)] := True; if (opt in demoCal.Options) then cgOptions.Checked[integer(opt)] := True;
seHeight.Value := demoCal.Height; seHeight.Value := demoCal.Height;
seWidth.Value:= demoCal.Width; seWidth.Value := demoCal.Width;
rgStartingDOW.ItemIndex:= integer(demoCal.StartingDayOfWeek)-1; rgStartingDOW.ItemIndex := integer(demoCal.StartingDayOfWeek)-1;
copyCal:= TCalendarLite.Create(Self); copyCal:= TCalendarLite.Create(Self);
copyCal.Parent := Self; copyCal.Parent := Self;

View File

@ -284,7 +284,6 @@ type
protected protected
procedure ChangeDateTo(ADate: TDate; ASelMode: TCalSelMode); procedure ChangeDateTo(ADate: TDate; ASelMode: TCalSelMode);
procedure Click; override;
procedure DateChange; virtual; procedure DateChange; virtual;
procedure DblClick; override; procedure DblClick; override;
class function GetControlClassDefaultSize: TSize; override; class function GetControlClassDefaultSize: TSize; override;
@ -1288,7 +1287,7 @@ begin
FMonthNames := TStringList.Create; FMonthNames := TStringList.Create;
FDisplayTexts := TStringList.Create; FDisplayTexts := TStringList.Create;
FDisplayTexts.StrictDelimiter := True; FDisplayTexts.StrictDelimiter := True;
FDisplayTexts.Delimiter := '|'; FDisplayTexts.Delimiter := ',';
SetDefaultDisplayTexts; SetDefaultDisplayTexts;
FPopupMenu := TPopupMenu.Create(Self); FPopupMenu := TPopupMenu.Create(Self);
FCalDrawer := TCalDrawer.Create(Canvas); FCalDrawer := TCalDrawer.Create(Canvas);
@ -1399,15 +1398,6 @@ begin
Invalidate; Invalidate;
end; end;
procedure TCalendarLite.Click;
begin
inherited;
// Multi-select is handled by DblClickTimer
if not FMultiSelect then //and not FDblClickTimer.Enabled then
InternalClick;
end;
procedure TCalendarLite.DateChange; procedure TCalendarLite.DateChange;
begin begin
if Assigned(FOnDateChange) then if Assigned(FOnDateChange) then
@ -1531,12 +1521,13 @@ begin
if not Focused and not(csNoFocus in ControlStyle) then if not Focused and not(csNoFocus in ControlStyle) then
SetFocus; SetFocus;
if FMultiSelect then begin
FClickPoint := Point(X, Y); FClickPoint := Point(X, Y);
FClickShift := Shift; FClickShift := Shift;
FClickButton := Button; FClickButton := Button;
FDblClickTimer.Enabled := true; if FMultiSelect then
end; FDblClickTimer.Enabled := true
else
InternalClick;
end; end;
procedure TCalendarLite.MouseEnter; procedure TCalendarLite.MouseEnter;