mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 02:16:48 +02:00
LCL: Close calendar popup also when the application loses focus. Issue #20171
git-svn-id: trunk@33131 -
This commit is contained in:
parent
680ef77895
commit
79353aa2a5
@ -10,14 +10,15 @@ object CalendarPopupForm: TCalendarPopupForm
|
|||||||
ClientHeight = 192
|
ClientHeight = 192
|
||||||
ClientWidth = 233
|
ClientWidth = 233
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
OnDeactivate = FormDeactivate
|
OnDeactivate = FormDeactivate
|
||||||
PopupMode = pmAuto
|
PopupMode = pmAuto
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '0.9.31'
|
||||||
object Calendar: TCalendar
|
object Calendar: TCalendar
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 153
|
Height = 176
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 162
|
Width = 177
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 1
|
BorderSpacing.Around = 1
|
||||||
DateTime = 38823
|
DateTime = 38823
|
||||||
|
@ -38,6 +38,7 @@ type
|
|||||||
procedure CalendarDblClick(Sender: TObject);
|
procedure CalendarDblClick(Sender: TObject);
|
||||||
procedure CalendarKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure CalendarKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDeactivate(Sender: TObject);
|
procedure FormDeactivate(Sender: TObject);
|
||||||
private
|
private
|
||||||
FClosed: boolean;
|
FClosed: boolean;
|
||||||
@ -75,11 +76,17 @@ end;
|
|||||||
|
|
||||||
{ TCalendarPopupForm }
|
{ TCalendarPopupForm }
|
||||||
|
|
||||||
procedure TCalendarPopupForm.FormClose(Sender: TObject;
|
procedure TCalendarPopupForm.FormCreate(Sender: TObject);
|
||||||
var CloseAction: TCloseAction);
|
begin
|
||||||
|
FClosed := false;
|
||||||
|
Application.AddOnDeactivateHandler(@FormDeactivate);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCalendarPopupForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
begin
|
begin
|
||||||
//DebugLn(['TCalendarPopupForm.FormClose ']);
|
//DebugLn(['TCalendarPopupForm.FormClose ']);
|
||||||
FClosed := true;
|
FClosed := true;
|
||||||
|
Application.RemoveOnDeactivateHandler(@FormDeactivate);
|
||||||
CloseAction := caFree;
|
CloseAction := caFree;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user