View Issue Details

IDProjectCategoryView StatusLast Update
0004462JEDI VCL00 JVCL Componentspublic2008-10-25 08:41
ReporterasertacAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.35 
Target VersionFixed in Version3.36 
Summary0004462: With a form on a secondary monitor, JvDBLookupCombo drops down to the wrong monitor
DescriptionIn 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 InformationHere 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;
//--
.
.
TagsNo tags attached.

Activities

obones

2008-09-29 06:43

administrator   ~0014723

Please post the zipped sources of a sample application showing this.

2008-10-05 06:22

 

4462-3.zip (43,195 bytes)

asertac

2008-10-05 06:23

reporter   ~0014745

Done.

AHUser

2008-10-25 08:41

developer   ~0014906

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