Page 1 of 1

Dual-Monitor Mode (i18n)

PostPosted: December 16th, 2011, 10:03 am
by keeny
Hi

I had some troubles with dual-monitor usage of TIntlDatePicker. The Popup always opened on the border of my first screen.

This happens because:

Code: Select all
procedure TCustomIntlDatePicker.PopupDropDown;
var
  TopLeft: TPoint;
  X, Y, W, H: Integer;
begin
  if Enabled and CanModify and not CalendarPopup.Visible then
  begin
    CalendarPopup.HandleNeeded;
    TopLeft := Parent.ClientToScreen(Point(Left, Top));
    CalendarPopup.GetPreferredControlSize(W, H);
    if W < Width then
      W := Width;
    if UseRightToLeftAlignment then
      X := TopLeft.X + Width - W
    else
      X := TopLeft.X;
    if X < 0 then
      X := 0
    else if X + W > Screen.Width then
      X := Screen.Width - W;
    Y := TopLeft.Y + Height;
    if Y + H > Screen.Height then
      Y := TopLeft.Y - H;
    CalendarPopup.Date := Date;
    Checked := True;
    CalendarPopup.SetBounds(X, Y, W, H);
    CalendarPopup.Show(X, Y);
    InvalidateDropDown;
    InvalidateDate;
  end;
end;


... now I changed Screen.Width / Height to DesktopWidth/DektopHeight and it worked!

I hope this helps other users too... (will this be in the next update?)

greets
Daniel

Re: Dual-Monitor Mode (i18n)

PostPosted: December 18th, 2011, 3:44 pm
by Kambiz
Hi,

Thanks for the fix!
Of course, it will be in the next update.