Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2007-08-31 19:31:57 +0000
committerFelipe Heidrich2007-08-31 19:31:57 +0000
commitf2fdacc1748ba70c63b400772bf7b53217fb343f (patch)
tree0830b199d45c0c2924f8bf3291818d9ffdf80f8b
parenta7d5fd3d9c6e5068ddcdfcd54f78631d29228ff7 (diff)
downloadeclipse.platform.swt-f2fdacc1748ba70c63b400772bf7b53217fb343f.tar.gz
eclipse.platform.swt-f2fdacc1748ba70c63b400772bf7b53217fb343f.tar.xz
eclipse.platform.swt-f2fdacc1748ba70c63b400772bf7b53217fb343f.zip
Bug 199099 ExpandBar is not high contrast complient. Cannot manually fix this issue.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java29
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java2
2 files changed, 20 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
index e871c6bd45..336d9cf98c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
@@ -256,25 +256,34 @@ void drawWidget (GC gc, RECT clipRect) {
int uiState = (int)/*64*/OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);
drawFocus = (uiState & OS.UISF_HIDEFOCUS) == 0;
}
- int /*long*/ hCaptionFont = 0, oldFont = 0;
+ int /*long*/ hCurrentFont = 0, oldFont = 0;
if (hTheme == 0) {
- if (!OS.IsWinCE && hFont == 0) {
- NONCLIENTMETRICS info = OS.IsUnicode ? (NONCLIENTMETRICS) new NONCLIENTMETRICSW () : new NONCLIENTMETRICSA ();
- info.cbSize = NONCLIENTMETRICS.sizeof;
- if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, info, 0)) {
- LOGFONT logFont = OS.IsUnicode ? (LOGFONT) ((NONCLIENTMETRICSW)info).lfCaptionFont : ((NONCLIENTMETRICSA)info).lfCaptionFont;
- hCaptionFont = OS.CreateFontIndirect (logFont);
- oldFont = OS.SelectObject (gc.handle, hCaptionFont);
+ if (hFont != 0) {
+ hCurrentFont = hFont;
+ } else {
+ if (!OS.IsWinCE) {
+ NONCLIENTMETRICS info = OS.IsUnicode ? (NONCLIENTMETRICS) new NONCLIENTMETRICSW () : new NONCLIENTMETRICSA ();
+ info.cbSize = NONCLIENTMETRICS.sizeof;
+ if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, info, 0)) {
+ LOGFONT logFont = OS.IsUnicode ? (LOGFONT) ((NONCLIENTMETRICSW)info).lfCaptionFont : ((NONCLIENTMETRICSA)info).lfCaptionFont;
+ hCurrentFont = OS.CreateFontIndirect (logFont);
+ }
}
}
+ if (hCurrentFont != 0) {
+ oldFont = OS.SelectObject (gc.handle, hCurrentFont);
+ }
+ if (foreground != -1) {
+ OS.SetTextColor (gc.handle, foreground);
+ }
}
for (int i = 0; i < itemCount; i++) {
ExpandItem item = items[i];
item.drawItem (gc, hTheme, clipRect, item == focusItem && drawFocus);
}
- if (hCaptionFont != 0) {
+ if (hCurrentFont != 0) {
OS.SelectObject (gc.handle, oldFont);
- OS.DeleteObject (hCaptionFont);
+ if (hCurrentFont != hFont) OS.DeleteObject (hCurrentFont);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
index bf156e1862..eafb10ce08 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
@@ -122,7 +122,7 @@ private void drawChevron (int /*long*/ hDC, RECT rect) {
rect.top += 4;
rect.right -= 4;
rect.bottom -= 4;
- int /*long*/ hPen = OS.CreatePen (OS.PS_SOLID, 1, parent.foreground);
+ int /*long*/ hPen = OS.CreatePen (OS.PS_SOLID, 1, parent.getForegroundPixel ());
int /*long*/ oldPen = OS.SelectObject (hDC, hPen);
int [] polyline1, polyline2;
if (expanded) {

Back to the top