mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 13:59:31 +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;
|
||||
end;
|
||||
|
||||
procedure TCalendarPopupForm.Initialize(const PopupOrigin: TPoint; ADate: TDateTime);
|
||||
procedure TCalendarPopupForm.Initialize(const PopupOrigin: TPoint;
|
||||
ADate: TDateTime);
|
||||
var ScrSize: TPoint;
|
||||
begin
|
||||
Left := PopupOrigin.x;
|
||||
Top := PopupOrigin.y;
|
||||
ScrSize.X := Screen.Width;
|
||||
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;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user