mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 21:41:01 +02:00
Fix KeyDown in calendar in Windows (to close only when CalendarView is cvMonth)
git-svn-id: trunk@51733 -
This commit is contained in:
parent
18fd7670b3
commit
238a361f68
@ -46,7 +46,8 @@ uses
|
|||||||
clocale, // needed to initialize default locale settings on Linux.
|
clocale, // needed to initialize default locale settings on Linux.
|
||||||
{$endif}
|
{$endif}
|
||||||
Classes, SysUtils, Controls, LCLType, Graphics, Math, StdCtrls, Buttons,
|
Classes, SysUtils, Controls, LCLType, Graphics, Math, StdCtrls, Buttons,
|
||||||
ExtCtrls, Forms, ComCtrls, Types, LMessages, LazUTF8, CalControlWrapper;
|
ExtCtrls, Forms, ComCtrls, Types, LMessages, Calendar, LazUTF8,
|
||||||
|
CalControlWrapper;
|
||||||
|
|
||||||
const
|
const
|
||||||
{ We will deal with the NullDate value the special way. It will be especially
|
{ We will deal with the NullDate value the special way. It will be especially
|
||||||
@ -542,6 +543,7 @@ type
|
|||||||
procedure CalendarResize(Sender: TObject);
|
procedure CalendarResize(Sender: TObject);
|
||||||
procedure CalendarMouseUp(Sender: TObject; Button: TMouseButton;
|
procedure CalendarMouseUp(Sender: TObject; Button: TMouseButton;
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
|
||||||
procedure VisibleOfParentChanged(Sender: TObject);
|
procedure VisibleOfParentChanged(Sender: TObject);
|
||||||
|
|
||||||
protected
|
protected
|
||||||
@ -666,14 +668,16 @@ end;
|
|||||||
procedure TDTCalendarForm.CalendarKeyDown(Sender: TObject; var Key: Word;
|
procedure TDTCalendarForm.CalendarKeyDown(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
case Key of
|
if (not(Cal.GetCalendarControl is TCustomCalendar))
|
||||||
VK_ESCAPE:
|
or (TCustomCalendar(Cal.GetCalendarControl).GetCalendarView = cvMonth) then
|
||||||
CloseCalendarForm;
|
case Key of
|
||||||
|
VK_ESCAPE:
|
||||||
|
CloseCalendarForm;
|
||||||
|
|
||||||
VK_RETURN, VK_SPACE:
|
VK_RETURN, VK_SPACE:
|
||||||
CloseCalendarForm(True);
|
CloseCalendarForm(True);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDTCalendarForm.CalendarResize(Sender: TObject);
|
procedure TDTCalendarForm.CalendarResize(Sender: TObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user