mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 18:58:04 +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
|
||||
ClientWidth = 233
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDeactivate = FormDeactivate
|
||||
PopupMode = pmAuto
|
||||
LCLVersion = '0.9.29'
|
||||
LCLVersion = '0.9.31'
|
||||
object Calendar: TCalendar
|
||||
Left = 1
|
||||
Height = 153
|
||||
Height = 176
|
||||
Top = 1
|
||||
Width = 162
|
||||
Width = 177
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 1
|
||||
DateTime = 38823
|
||||
|
@ -38,6 +38,7 @@ type
|
||||
procedure CalendarDblClick(Sender: TObject);
|
||||
procedure CalendarKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
private
|
||||
FClosed: boolean;
|
||||
@ -75,11 +76,17 @@ end;
|
||||
|
||||
{ TCalendarPopupForm }
|
||||
|
||||
procedure TCalendarPopupForm.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
procedure TCalendarPopupForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FClosed := false;
|
||||
Application.AddOnDeactivateHandler(@FormDeactivate);
|
||||
end;
|
||||
|
||||
procedure TCalendarPopupForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
//DebugLn(['TCalendarPopupForm.FormClose ']);
|
||||
FClosed := true;
|
||||
Application.RemoveOnDeactivateHandler(@FormDeactivate);
|
||||
CloseAction := caFree;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user