Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004463 [JEDI VCL] 00 JVCL Components minor always 2008-09-17 09:17 2008-10-26 06:15
Reporter asertac View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.35
Summary 0004463: JvDateEdit's calendar dialog pops in weird places with a form not on the primary monitor.
Description The function "SelectDate" in "JvPickDate.pas" does not have code to handle multi monitor setups. This causes the JvSelectDateDlg to pop in weird places instead of around JvDateEdit control, if the form containing the control is not on the primary monitor.
Additional Information Here is a suggested fix;

function SelectDate(Sender: TWinControl; var Date: TDateTime; const DlgCaption: TCaption;
  AStartOfWeek: TDayOfWeekName; AWeekends: TDaysOfWeek;
  AWeekendColor: TColor; BtnHints: TStrings;
  MinDate: TDateTime; MaxDate: TDateTime): Boolean;
var
  D: TJvSelectDateDlg;
  I: Integer;
  P: TPoint; // Polaris
//--> new variables
  MonHandle: HMonitor;
  MonInfo: TMonitorInfo;
  ScrLeft, ScrRight, ScrBottom: Integer;
//--
begin
  Result := False;
  D := CreateDateDialog(DlgCaption, MinDate, MaxDate);
  try
    // Polaris for Popup position
    if Assigned(Sender) then
      with D do
      begin
        Position := poDesigned;
        P := (Sender.ClientOrigin);
//--> new code
        DefaultMonitor := dmDesktop;

        ScrLeft := 0;
        ScrRight := Screen.Width;
        ScrBottom := Screen.Height;
        MonHandle := MonitorFromPoint(P, MONITOR_DEFAULTTONEAREST);
        MonInfo.cbSize := SizeOf(TMonitorInfo);
        if GetMonitorInfo(MonHandle, @MonInfo) then begin
          ScrLeft := MonInfo.rcWork.Left;
          ScrRight := MonInfo.rcWork.Right;
          ScrBottom := MonInfo.rcWork.Bottom;
        end;
//--
        Top := P.Y + Sender.Height - 1;
//--> modified code
// if (Top + Height) > Screen.Height then
// Top := P.Y - Height + 1;
// if Top < 0 then
// Top := P.Y + Sender.Height - 1;
        if (Top + Height) > ScrBottom then
          Top := P.Y - Height + 1;
//--
        Left := (P.X + Sender.Width) - Width;
//--> modified code
// if (Left + Width) > Screen.Width then
// Left := Screen.Width - Width;
// if Left < 0 then
// Left := Max(P.X, 0);
        if (Left + Width) > ScrRight then
          Left := ScrRight - Width;
        if Left < ScrLeft then
          Left := Max(P.X, ScrLeft);
//--
      end;
.
.
.
Tags No tags attached.
Attached Files zip file icon 4462-3.zip [^] (43,195 bytes) 2008-10-05 06:25

- Relationships

-  Notes
(0014609)
asertac (reporter)
2008-09-17 09:28

forgot to add,

uses
.., multimon;
(0014724)
obones (administrator)
2008-09-29 06:45

Please post the zipped sources of a sample application showing this.
(0014746)
asertac (reporter)
2008-10-05 06:25

Done.
(0014914)
AHUser (developer)
2008-10-26 06:14

Fixed in SVN.

- Issue History
Date Modified Username Field Change
2008-09-17 09:17 asertac New Issue
2008-09-17 09:28 asertac Note Added: 0014609
2008-09-29 06:45 obones Note Added: 0014724
2008-09-29 06:45 obones Status new => feedback
2008-10-05 06:25 asertac File Added: 4462-3.zip
2008-10-05 06:25 asertac Note Added: 0014746
2008-10-26 06:14 AHUser Status feedback => resolved
2008-10-26 06:14 AHUser Fixed in Version => Daily / SVN
2008-10-26 06:14 AHUser Resolution open => fixed
2008-10-26 06:14 AHUser Assigned To => AHUser
2008-10-26 06:14 AHUser Note Added: 0014914


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker