mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 01:06:02 +02:00
DateTimePicker: cleanup code from ifdef regarding very old Lazarus version
git-svn-id: trunk@44434 -
This commit is contained in:
parent
1895283edd
commit
9459918ec8
@ -47,7 +47,6 @@ uses
|
|||||||
{$endif}
|
{$endif}
|
||||||
Classes, SysUtils, Controls, LCLType, Graphics, Math, StdCtrls, Buttons,
|
Classes, SysUtils, Controls, LCLType, Graphics, Math, StdCtrls, Buttons,
|
||||||
ExtCtrls, Forms, ComCtrls, Types, LMessages, LCLProc, CalControlWrapper
|
ExtCtrls, Forms, ComCtrls, Types, LMessages, LCLProc, CalControlWrapper
|
||||||
{$ifdef LCLGtk2}, LCLVersion{$endif}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -3341,22 +3340,7 @@ begin
|
|||||||
AutoResizeButton;
|
AutoResizeButton;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef LCLGtk2}
|
|
||||||
// On Gtk2, it seems that if a non-modal form is shown on top
|
|
||||||
// of a modal one, it can't get user interaction. So it is useless then.
|
|
||||||
// Therefore, if our parent is shown modally, we must show the calendar
|
|
||||||
// on a modal form too.
|
|
||||||
{$if lcl_fullversion < 00093100}
|
|
||||||
// This seems to be fixed, so this is not needed in recent Lazarus versions.
|
|
||||||
{$define show_modally_on_modal_form}
|
|
||||||
{$endif}
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
procedure TCustomDateTimePicker.DropDownCalendarForm;
|
procedure TCustomDateTimePicker.DropDownCalendarForm;
|
||||||
{$ifdef show_modally_on_modal_form}
|
|
||||||
var
|
|
||||||
F: TCustomForm;
|
|
||||||
{$endif}
|
|
||||||
begin
|
begin
|
||||||
SetFocusIfPossible;
|
SetFocusIfPossible;
|
||||||
|
|
||||||
@ -3364,14 +3348,7 @@ begin
|
|||||||
if not (FReadOnly or Assigned(FCalendarForm)
|
if not (FReadOnly or Assigned(FCalendarForm)
|
||||||
or (csDesigning in ComponentState)) then begin
|
or (csDesigning in ComponentState)) then begin
|
||||||
FCalendarForm := TDTCalendarForm.CreateNewDTCalendarForm(nil, Self);
|
FCalendarForm := TDTCalendarForm.CreateNewDTCalendarForm(nil, Self);
|
||||||
|
FCalendarForm.Show;
|
||||||
{$ifdef show_modally_on_modal_form}
|
|
||||||
F := GetParentForm(Self);
|
|
||||||
if Assigned(F) and (fsModal in F.FormState) then
|
|
||||||
FCalendarForm.ShowModal
|
|
||||||
else
|
|
||||||
{$endif}
|
|
||||||
FCalendarForm.Show;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end else begin
|
end else begin
|
||||||
|
Loading…
Reference in New Issue
Block a user