Skip to content

Commit

Permalink
Ticket#39: Adapt GetSystemMetrics call to be DPI dependent
Browse files Browse the repository at this point in the history
Using GetSystemMetrics method in Combo, Table and list to make them DPI
dependent

vi-eclipse/Eclipse-Platform#39
  • Loading branch information
ShahzaibIbrahim committed May 2, 2024
1 parent 3384021 commit b73e167
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ public void clearSelection () {
width += pcbi.itemLeft + (pcbi.buttonRight - pcbi.buttonLeft);
height = (pcbi.buttonBottom - pcbi.buttonTop) + pcbi.buttonTop * 2;
} else {
int border = OS.GetSystemMetrics (OS.SM_CXEDGE);
width += OS.GetSystemMetrics (OS.SM_CXVSCROLL) + border * 2;
int border = getSystemMetrics (OS.SM_CXEDGE);
width += getSystemMetrics (OS.SM_CXVSCROLL) + border * 2;
int textHeight = (int)OS.SendMessage (handle, OS.CB_GETITEMHEIGHT, -1, 0);
if ((style & SWT.DROP_DOWN) != 0) {
height = textHeight + 6;
Expand All @@ -665,7 +665,7 @@ public void clearSelection () {
}
}
if ((style & SWT.SIMPLE) != 0 && (style & SWT.H_SCROLL) != 0) {
height += OS.GetSystemMetrics (OS.SM_CYHSCROLL);
height += getSystemMetrics (OS.SM_CYHSCROLL);
}
return new Point (width, height);
}
Expand Down Expand Up @@ -2188,7 +2188,7 @@ void setScrollWidth (int scrollWidth) {
OS.SendMessage (handle, OS.CB_SETDROPPEDWIDTH, 0, 0);
OS.SendMessage (handle, OS.CB_SETHORIZONTALEXTENT, scrollWidth, 0);
} else {
scrollWidth += OS.GetSystemMetrics (OS.SM_CYHSCROLL);
scrollWidth += getSystemMetrics (OS.SM_CYHSCROLL);
OS.SendMessage (handle, OS.CB_SETDROPPEDWIDTH, scrollWidth, 0);
OS.SendMessage (handle, OS.CB_SETHORIZONTALEXTENT, 0, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ static int checkStyle (int style) {
width += border * 2 + INSET;
height += border * 2;
if ((style & SWT.V_SCROLL) != 0) {
width += OS.GetSystemMetrics (OS.SM_CXVSCROLL);
width += getSystemMetrics (OS.SM_CXVSCROLL);
}
if ((style & SWT.H_SCROLL) != 0) {
height += OS.GetSystemMetrics (OS.SM_CYHSCROLL);
height += getSystemMetrics (OS.SM_CYHSCROLL);
}
return new Point (width, height);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1479,10 +1479,10 @@ public void clearAll () {
int border = getBorderWidthInPixels ();
width += border * 2; height += border * 2;
if ((style & SWT.V_SCROLL) != 0) {
width += OS.GetSystemMetrics (OS.SM_CXVSCROLL);
height += getSystemMetrics (OS.SM_CYHSCROLL);
}
if ((style & SWT.H_SCROLL) != 0) {
height += OS.GetSystemMetrics (OS.SM_CYHSCROLL);
height += getSystemMetrics (OS.SM_CYHSCROLL);
}
return new Point (width, height);
}
Expand Down

0 comments on commit b73e167

Please sign in to comment.