mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 19:39:17 +02:00
LCL: fixed initial position of TCalendarPopupForm from Damien Gerard (bug #10599)
git-svn-id: trunk@14713 -
This commit is contained in:
parent
cb6d60d9cf
commit
d948a49ca9
@ -113,10 +113,20 @@ begin
|
|||||||
Close;
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCalendarPopupForm.Initialize(const PopupOrigin: TPoint; ADate: TDateTime);
|
procedure TCalendarPopupForm.Initialize(const PopupOrigin: TPoint;
|
||||||
|
ADate: TDateTime);
|
||||||
|
var ScrSize: TPoint;
|
||||||
begin
|
begin
|
||||||
Left := PopupOrigin.x;
|
ScrSize.X := Screen.Width;
|
||||||
Top := PopupOrigin.y;
|
ScrSize.Y := Screen.Height;
|
||||||
|
if PopupOrigin.X + Width > ScrSize.X then
|
||||||
|
Left := ScrSize.X - Width
|
||||||
|
else
|
||||||
|
Left := PopupOrigin.X;
|
||||||
|
if PopupOrigin.Y + Height > ScrSize.Y then
|
||||||
|
Top := ScrSize.Y - Height
|
||||||
|
else
|
||||||
|
Top := PopupOrigin.Y;
|
||||||
Calendar.DateTime := ADate;
|
Calendar.DateTime := ADate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user