diff options
author | Felipe Heidrich <fheidric> | 2006-01-11 19:00:38 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2006-01-11 19:00:38 +0000 |
commit | 42537dfe8f5c0d03bf0ea929d00cb3460fcbd579 (patch) | |
tree | 5ca0ee93698ae32470f7eece484d7344bf482563 | |
parent | 7a44a1c8a9f99a6bee35bb415241439ba04ffed8 (diff) | |
download | eclipse.platform.swt-42537dfe8f5c0d03bf0ea929d00cb3460fcbd579.tar.gz eclipse.platform.swt-42537dfe8f5c0d03bf0ea929d00cb3460fcbd579.tar.xz eclipse.platform.swt-42537dfe8f5c0d03bf0ea929d00cb3460fcbd579.zip |
120907 - Border for Forms API controls screenshots
7 files changed, 46 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java index 0f2e6786b9..663ff1e485 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java @@ -50,7 +50,6 @@ public class Button extends Control { static final int ICON_WIDTH = 128, ICON_HEIGHT = 128; static final int ButtonProc; static final TCHAR ButtonClass = new TCHAR (0,"BUTTON", true); - static final char [] SCROLLBAR = new char [] {'S', 'C', 'R', 'O', 'L', 'L', 'B', 'A', 'R', 0}; static { int hBitmap = OS.LoadBitmap (0, OS.OBM_CHECKBOXES); if (hBitmap == 0) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java index a3a374422d..5b582309c6 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java @@ -52,8 +52,7 @@ public class Composite extends Scrollable { WINDOWPOS [] lpwp; Control [] tabList; int layoutCount, backgroundMode; - static final char [] EDIT = new char [] {'E', 'D', 'I', 'T', 0}; - + /** * Prevents uninitialized instances from being created outside the package. */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index 9c3dfe198d..c006865ce6 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -3271,6 +3271,7 @@ int windowProc (int hwnd, int msg, int wParam, int lParam) { case OS.WM_PALETTECHANGED: result = WM_PALETTECHANGED (wParam, lParam); break; case OS.WM_PARENTNOTIFY: result = WM_PARENTNOTIFY (wParam, lParam); break; case OS.WM_PASTE: result = WM_PASTE (wParam, lParam); break; + case OS.WM_PRINT: result = WM_PRINT (wParam, lParam); break; case OS.WM_PRINTCLIENT: result = WM_PRINTCLIENT (wParam, lParam); break; case OS.WM_QUERYENDSESSION: result = WM_QUERYENDSESSION (wParam, lParam); break; case OS.WM_QUERYNEWPALETTE: result = WM_QUERYNEWPALETTE (wParam, lParam); break; @@ -3780,6 +3781,10 @@ LRESULT WM_PASTE (int wParam, int lParam) { return null; } +LRESULT WM_PRINT (int wParam, int lParam) { + return wmPrint (handle, wParam, lParam); +} + LRESULT WM_PRINTCLIENT (int wParam, int lParam) { return null; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java index a64227ca69..1fb2b720e8 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java @@ -46,7 +46,6 @@ public class TabFolder extends Composite { ImageList imageList; static final int TabFolderProc; static final TCHAR TabFolderClass = new TCHAR (0, OS.WC_TABCONTROL, true); - static final char [] TAB = new char [] {'T', 'A', 'B', 0}; /* * These are the undocumented control id's for the children of diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java index 09459454d4..43dd69854d 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java @@ -59,7 +59,6 @@ public class Table extends Composite { static final int HEADER_EXTRA = 3; static final int TableProc; static final TCHAR TableClass = new TCHAR (0, OS.WC_LISTVIEW, true); - static final char [] BUTTON = new char [] {'B', 'U', 'T', 'T', 'O', 'N', 0}; static { WNDCLASS lpWndClass = new WNDCLASS (); OS.GetClassInfo (0, TableClass, lpWndClass); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index 120d9dc001..c7cb54ad69 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -62,7 +62,6 @@ public class Tree extends Composite { static final TCHAR TreeClass = new TCHAR (0, OS.WC_TREEVIEW, true); static final int HeaderProc; static final TCHAR HeaderClass = new TCHAR (0, OS.WC_HEADER, true); - static final char [] BUTTON = new char [] {'B', 'U', 'T', 'T', 'O', 'N', 0}; static { WNDCLASS lpWndClass = new WNDCLASS (); OS.GetClassInfo (0, TreeClass, lpWndClass); @@ -3446,6 +3445,11 @@ int windowProc (int hwnd, int msg, int wParam, int lParam) { if (result != null) return result.value; break; } + case OS.WM_PRINT: { + LRESULT result = wmPrint (hwnd, wParam, lParam); + if (result != null) return result.value; + break; + } case OS.WM_COMMAND: case OS.WM_NOTIFY: case OS.WM_SYSCOLORCHANGE: { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java index 6f0afe067f..3a6594418f 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java @@ -79,6 +79,12 @@ public abstract class Widget { static final int DEFAULT_WIDTH = 64; static final int DEFAULT_HEIGHT = 64; + /* Windows XP Theme Classes */ + static final char [] BUTTON = new char [] {'B', 'U', 'T', 'T', 'O', 'N', 0}; + static final char [] EDIT = new char [] {'E', 'D', 'I', 'T', 0}; + static final char [] SCROLLBAR = new char [] {'S', 'C', 'R', 'O', 'L', 'L', 'B', 'A', 'R', 0}; + static final char [] TAB = new char [] {'T', 'A', 'B', 0}; + /* Check and initialize the Common Controls DLL */ static final int MAJOR = 5, MINOR = 80; static { @@ -2036,6 +2042,35 @@ LRESULT wmPaint (int hwnd, int wParam, int lParam) { return new LRESULT (result); } +LRESULT wmPrint (int hwnd, int wParam, int lParam) { + /* + * Bug in Windows. When WM_PRINT is used to print the contents + * of a control that has WS_EX_CLIENTEDGE, the old 3D border is + * drawn instead of the theme border. The fix is to call the + * default window proc and then draw the theme border on top. + */ + if ((lParam & OS.PRF_NONCLIENT) != 0) { + if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) { + int bits = OS.GetWindowLong (hwnd, OS.GWL_EXSTYLE); + if ((bits & OS.WS_EX_CLIENTEDGE) != 0) { + int code = callWindowProc (hwnd, OS.WM_PRINT, wParam, lParam); + RECT rect = new RECT (); + OS.GetWindowRect (hwnd, rect); + rect.right -= rect.left; + rect.bottom -= rect.top; + rect.left = rect.top = 0; + int border = OS.GetSystemMetrics (OS.SM_CXEDGE); + OS.ExcludeClipRect (wParam, border, border, rect.right - border, rect.bottom - border); + int hTheme = OS.OpenThemeData (hwnd, EDIT); + OS.DrawThemeBackground (hTheme, wParam, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null); + OS.CloseThemeData (hwnd); + return new LRESULT (code); + } + } + } + return null; +} + LRESULT wmRButtonDblClk (int hwnd, int wParam, int lParam) { /* * Feature in Windows. Windows sends the following |