Mercurial > projects > dwt-win
changeset 109:0a02d6d3466b
merge
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 11 Feb 2008 02:45:33 +0100 |
parents | 6f75fdfa1bcd (current diff) a378481be65f (diff) |
children | 9ad59dbf99d2 |
files | dwt/widgets/Control.d dwt/widgets/ExpandBar.d dwt/widgets/Widget.d |
diffstat | 3 files changed, 30 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/widgets/Control.d Mon Feb 11 02:44:32 2008 +0100 +++ b/dwt/widgets/Control.d Mon Feb 11 02:45:33 2008 +0100 @@ -1962,7 +1962,7 @@ void redraw (bool all) { // checkWidget (); if (!OS.IsWindowVisible (handle)) return; - if (OS.IsWinCE) { + static if (OS.IsWinCE) { OS.InvalidateRect (handle, null, true); } else { int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE; @@ -2006,7 +2006,7 @@ if (!OS.IsWindowVisible (handle)) return; RECT rect; OS.SetRect (&rect, x, y, x + width, y + height); - if (OS.IsWinCE) { + static if (OS.IsWinCE) { OS.InvalidateRect (handle, &rect, true); } else { int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE; @@ -2501,7 +2501,7 @@ } void setBackgroundImage (HBITMAP hBitmap) { - if (OS.IsWinCE) { + static if (OS.IsWinCE) { OS.InvalidateRect (handle, null, true); } else { int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE; @@ -2510,7 +2510,7 @@ } void setBackgroundPixel (int pixel) { - if (OS.IsWinCE) { + static if (OS.IsWinCE) { OS.InvalidateRect (handle, null, true); } else { int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE; @@ -2873,7 +2873,7 @@ * flag is specified. The fix is to set SWP_DRAWFRAME only when * not running on WinCE. */ - if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; + static if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; setBounds (x, y, 0, 0, flags); } @@ -2992,7 +2992,7 @@ OS.ShowWindow (topHandle_, OS.SW_HIDE); if (handle !is topHandle_) OS.ShowWindow (handle, OS.SW_HIDE); } else { - if (OS.IsWinCE) { + static if (OS.IsWinCE) { OS.InvalidateRect (topHandle_, null, true); if (handle !is topHandle_) OS.InvalidateRect (handle, null, true); } else { @@ -3578,7 +3578,7 @@ void update (bool all) { // checkWidget (); - if (OS.IsWinCE) { + static if (OS.IsWinCE) { OS.UpdateWindow (handle); } else { int flags = OS.RDW_UPDATENOW; @@ -3931,7 +3931,7 @@ } LRESULT WM_HELP (int wParam, int lParam) { - if (OS.IsWinCE) return null; + static if (OS.IsWinCE) return null; HELPINFO* lphi = cast(HELPINFO*)lParam; Decorations shell = menuShell (); if (!shell.isEnabled ()) return null;
--- a/dwt/widgets/ExpandBar.d Mon Feb 11 02:44:32 2008 +0100 +++ b/dwt/widgets/ExpandBar.d Mon Feb 11 02:45:33 2008 +0100 @@ -164,7 +164,7 @@ if (hFont !is null) { hCurrentFont = hFont; } else { - if (!OS.IsWinCE) { + static if (!OS.IsWinCE) { NONCLIENTMETRICS info; info.cbSize = NONCLIENTMETRICS.sizeof; if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { @@ -287,13 +287,15 @@ } HFONT hCaptionFont, oldFont; if (hTheme is null) { - if (!OS.IsWinCE && hFont is null) { - NONCLIENTMETRICS info; - info.cbSize = NONCLIENTMETRICS.sizeof; - if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { - LOGFONT* logFont = &info.lfCaptionFont; - hCaptionFont = OS.CreateFontIndirect (logFont); - oldFont = OS.SelectObject (gc.handle, hCaptionFont); + static if (!OS.IsWinCE ) { + if (hFont is null) { + NONCLIENTMETRICS info; + info.cbSize = NONCLIENTMETRICS.sizeof; + if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { + LOGFONT* logFont = &info.lfCaptionFont; + hCaptionFont = OS.CreateFontIndirect (logFont); + oldFont = OS.SelectObject (gc.handle, hCaptionFont); + } } } } @@ -497,7 +499,7 @@ override void setBackgroundPixel (int pixel) { super.setBackgroundPixel (pixel); - if (!OS.IsWinCE) { + static if (!OS.IsWinCE) { int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; OS.RedrawWindow (handle, null, null, flags); } @@ -511,7 +513,7 @@ override void setForegroundPixel (int pixel) { super.setForegroundPixel (pixel); - if (!OS.IsWinCE) { + static if (!OS.IsWinCE) { int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; OS.RedrawWindow (handle, null, null, flags); }
--- a/dwt/widgets/Widget.d Mon Feb 11 02:44:32 2008 +0100 +++ b/dwt/widgets/Widget.d Mon Feb 11 02:45:33 2008 +0100 @@ -385,7 +385,7 @@ } HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags){ - if (OS.IsWinCE) { + static if (OS.IsWinCE) { /* * Feature in Windows. On Windows CE, DeferWindowPos always causes * a WM_SIZE message, even when the new size is the same as the old @@ -1247,7 +1247,7 @@ } bool SetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags) { - if (OS.IsWinCE) { + static if (OS.IsWinCE) { /* * Feature in Windows. On Windows CE, SetWindowPos() always causes * a WM_SIZE message, even when the new size is the same as the old @@ -1341,7 +1341,7 @@ * NOTE: This only happens on WM2003. Previous WinCE versions did * not support WM_CONTEXTMENU. */ - if (OS.IsWinCE) return null; + static if (OS.IsWinCE) return null; /* * Feature in Windows. When the user presses WM_NCRBUTTONUP, @@ -1424,7 +1424,7 @@ * both virtual and ASCII are a special case. */ int mapKey = 0; - if (OS.IsWinCE) { + static if (OS.IsWinCE) { switch (wParam) { case OS.VK_BACK: mapKey = DWT.BS; break; case OS.VK_RETURN: mapKey = DWT.CR; break; @@ -1618,7 +1618,7 @@ Display display = this.display; /* Check for hardware keys */ - if (OS.IsWinCE) { + static if (OS.IsWinCE) { if (OS.VK_APP1 <= wParam && wParam <= OS.VK_APP6) { display.lastKey = display.lastAscii = 0; display.lastVirtual = display.lastNull = display.lastDead = false; @@ -1653,7 +1653,7 @@ * both virtual and ASCII are a special case. */ int mapKey = 0; - if (OS.IsWinCE) { + static if (OS.IsWinCE) { switch (wParam) { case OS.VK_BACK: mapKey = DWT.BS; break; case OS.VK_RETURN: mapKey = DWT.CR; break; @@ -1772,7 +1772,7 @@ bool dragging = false, mouseDown = true; int count = display.getClickCount (DWT.MouseDown, 1, hwnd, lParam); if (count is 1 && (state & DRAG_DETECT) !is 0 && hooks (DWT.DragDetect)) { - if (!OS.IsWinCE) { + static if (!OS.IsWinCE) { /* * Feature in Windows. It's possible that the drag * operation will not be started while the mouse is @@ -1970,7 +1970,7 @@ Display display = this.display; int pos = OS.GetMessagePos (); if (pos !is display.lastMouse || display.captureChanged) { - if (!OS.IsWinCE) { + static if (!OS.IsWinCE) { bool trackMouse = (state & TRACK_MOUSE) !is 0; bool mouseEnter = hooks (DWT.MouseEnter) || display.filters (DWT.MouseEnter); bool mouseExit = hooks (DWT.MouseExit) || display.filters (DWT.MouseExit); @@ -2050,7 +2050,7 @@ /* Issue a paint event */ int result = 0; - if (OS.IsWinCE) { + static if (OS.IsWinCE) { RECT rect; OS.GetUpdateRect (hwnd, &rect, false); result = callWindowProc (hwnd, OS.WM_PAINT, wParam, lParam); @@ -2313,7 +2313,7 @@ * both virtual and ASCII are a special case. */ int mapKey = 0; - if (OS.IsWinCE) { + static if (OS.IsWinCE) { switch (wParam) { case OS.VK_BACK: mapKey = DWT.BS; break; case OS.VK_RETURN: mapKey = DWT.CR; break;