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
0004462 [JEDI VCL] 00 JVCL Components minor always 2008-09-17 08:48 2008-10-25 08:41
Reporter asertac View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.35
Summary 0004462: With a form on a secondary monitor, JvDBLookupCombo drops down to the wrong monitor
Description In the procedure TJvDBLookupCombo.DropDown, there is code to place logically the dropped down list box. The code fills a TRect structure with the current monitors work area. But instead of testing the work areas coordinates against the listbox's coordinates, the code, erronously, tests the workarea's width and height. This causes, the listbox to drop down to the first monitor for a form in the second monitor. Also causes to drop the listbox above the lookup combo when it should not.
Additional Information Here is a suggested fix;
.
.
    Monitor := FindMonitor(MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST));
    Rect := GetWorkAreaRect(Monitor);
    SR.Top := Rect.Top;
    SR.Left := Rect.Left;
    SR.Width := Rect.Right - Rect.Left;
    SR.Height := Rect.Bottom - Rect.Top;

    P := Parent.ClientToScreen(Point(Left, Top));
    Y := P.Y + Height;
//-> modified code
// if Y + FDataList.Height > SR.Height then
// Y := P.Y - FDataList.Height;
    if Y + FDataList.Height > Rect.Bottom then
      Y := P.Y - FDataList.Height;
//--
    case FDropDownAlign of
      daRight:
        Dec(P.X, FDataList.Width - Width);
      daCenter:
        Dec(P.X, (FDataList.Width - Width) div 2);
    end;
//-> modified code
// if P.X + FDataList.Width > SR.Width then
// P.X := SR.Width - FDataList.Width;
    if P.X + FDataList.Width > Rect.Right then
      P.X := Rect.Right - FDataList.Width;
    if P.X < Rect.Left then
      P.X := Rect.Left;
//--
.
.
Tags No tags attached.
Attached Files zip file icon 4462-3.zip [^] (43,195 bytes) 2008-10-05 06:22

- Relationships

-  Notes
(0014723)
obones (administrator)
2008-09-29 06:43

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

Done.
(0014906)
AHUser (developer)
2008-10-25 08:41

Fixed in SVN.

- Issue History
Date Modified Username Field Change
2008-09-17 08:48 asertac New Issue
2008-09-29 06:43 obones Note Added: 0014723
2008-09-29 06:43 obones Status new => feedback
2008-10-05 06:22 asertac File Added: 4462-3.zip
2008-10-05 06:23 asertac Note Added: 0014745
2008-10-25 08:41 AHUser Status feedback => resolved
2008-10-25 08:41 AHUser Fixed in Version => Daily / SVN
2008-10-25 08:41 AHUser Resolution open => fixed
2008-10-25 08:41 AHUser Assigned To => AHUser
2008-10-25 08:41 AHUser Note Added: 0014906


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