Changeset 107:a378481be65f
- Timestamp:
- 02/10/08 19:54:57
(1 year ago)
- Author:
- John Reimer <terminal.node@gmail.com
- branch:
- default
- Message:
Adding "static if" where necessary
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r82 |
r107 |
|
| 1963 | 1963 | // checkWidget (); |
|---|
| 1964 | 1964 | if (!OS.IsWindowVisible (handle)) return; |
|---|
| 1965 | | if (OS.IsWinCE) { |
|---|
| | 1965 | static if (OS.IsWinCE) { |
|---|
| 1966 | 1966 | OS.InvalidateRect (handle, null, true); |
|---|
| 1967 | 1967 | } else { |
|---|
| … | … | |
| 2007 | 2007 | RECT rect; |
|---|
| 2008 | 2008 | OS.SetRect (&rect, x, y, x + width, y + height); |
|---|
| 2009 | | if (OS.IsWinCE) { |
|---|
| | 2009 | static if (OS.IsWinCE) { |
|---|
| 2010 | 2010 | OS.InvalidateRect (handle, &rect, true); |
|---|
| 2011 | 2011 | } else { |
|---|
| … | … | |
| 2502 | 2502 | |
|---|
| 2503 | 2503 | void setBackgroundImage (HBITMAP hBitmap) { |
|---|
| 2504 | | if (OS.IsWinCE) { |
|---|
| | 2504 | static if (OS.IsWinCE) { |
|---|
| 2505 | 2505 | OS.InvalidateRect (handle, null, true); |
|---|
| 2506 | 2506 | } else { |
|---|
| … | … | |
| 2511 | 2511 | |
|---|
| 2512 | 2512 | void setBackgroundPixel (int pixel) { |
|---|
| 2513 | | if (OS.IsWinCE) { |
|---|
| | 2513 | static if (OS.IsWinCE) { |
|---|
| 2514 | 2514 | OS.InvalidateRect (handle, null, true); |
|---|
| 2515 | 2515 | } else { |
|---|
| … | … | |
| 2874 | 2874 | * not running on WinCE. |
|---|
| 2875 | 2875 | */ |
|---|
| 2876 | | if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; |
|---|
| | 2876 | static if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; |
|---|
| 2877 | 2877 | setBounds (x, y, 0, 0, flags); |
|---|
| 2878 | 2878 | } |
|---|
| … | … | |
| 2993 | 2993 | if (handle !is topHandle_) OS.ShowWindow (handle, OS.SW_HIDE); |
|---|
| 2994 | 2994 | } else { |
|---|
| 2995 | | if (OS.IsWinCE) { |
|---|
| | 2995 | static if (OS.IsWinCE) { |
|---|
| 2996 | 2996 | OS.InvalidateRect (topHandle_, null, true); |
|---|
| 2997 | 2997 | if (handle !is topHandle_) OS.InvalidateRect (handle, null, true); |
|---|
| … | … | |
| 3579 | 3579 | void update (bool all) { |
|---|
| 3580 | 3580 | // checkWidget (); |
|---|
| 3581 | | if (OS.IsWinCE) { |
|---|
| | 3581 | static if (OS.IsWinCE) { |
|---|
| 3582 | 3582 | OS.UpdateWindow (handle); |
|---|
| 3583 | 3583 | } else { |
|---|
| … | … | |
| 3932 | 3932 | |
|---|
| 3933 | 3933 | LRESULT WM_HELP (int wParam, int lParam) { |
|---|
| 3934 | | if (OS.IsWinCE) return LRESULT.NULL; |
|---|
| | 3934 | static if (OS.IsWinCE) return LRESULT.NULL; |
|---|
| 3935 | 3935 | HELPINFO* lphi = cast(HELPINFO*)lParam; |
|---|
| 3936 | 3936 | Decorations shell = menuShell (); |
|---|
| r82 |
r107 |
|
| 161 | 161 | hCurrentFont = hFont; |
|---|
| 162 | 162 | } else { |
|---|
| 163 | | if (!OS.IsWinCE) { |
|---|
| | 163 | static if (!OS.IsWinCE) { |
|---|
| 164 | 164 | NONCLIENTMETRICS info; |
|---|
| 165 | 165 | info.cbSize = NONCLIENTMETRICS.sizeof; |
|---|
| … | … | |
| 284 | 284 | HFONT hCaptionFont, oldFont; |
|---|
| 285 | 285 | if (hTheme is null) { |
|---|
| 286 | | if (!OS.IsWinCE && hFont is null) { |
|---|
| 287 | | NONCLIENTMETRICS info; |
|---|
| 288 | | info.cbSize = NONCLIENTMETRICS.sizeof; |
|---|
| 289 | | if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { |
|---|
| 290 | | LOGFONT* logFont = &info.lfCaptionFont; |
|---|
| 291 | | hCaptionFont = OS.CreateFontIndirect (logFont); |
|---|
| 292 | | oldFont = OS.SelectObject (gc.handle, hCaptionFont); |
|---|
| | 286 | static if (!OS.IsWinCE ) { |
|---|
| | 287 | if (hFont is null) { |
|---|
| | 288 | NONCLIENTMETRICS info; |
|---|
| | 289 | info.cbSize = NONCLIENTMETRICS.sizeof; |
|---|
| | 290 | if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { |
|---|
| | 291 | LOGFONT* logFont = &info.lfCaptionFont; |
|---|
| | 292 | hCaptionFont = OS.CreateFontIndirect (logFont); |
|---|
| | 293 | oldFont = OS.SelectObject (gc.handle, hCaptionFont); |
|---|
| | 294 | } |
|---|
| 293 | 295 | } |
|---|
| 294 | 296 | } |
|---|
| … | … | |
| 494 | 496 | override void setBackgroundPixel (int pixel) { |
|---|
| 495 | 497 | super.setBackgroundPixel (pixel); |
|---|
| 496 | | if (!OS.IsWinCE) { |
|---|
| | 498 | static if (!OS.IsWinCE) { |
|---|
| 497 | 499 | int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; |
|---|
| 498 | 500 | OS.RedrawWindow (handle, null, null, flags); |
|---|
| … | … | |
| 508 | 510 | override void setForegroundPixel (int pixel) { |
|---|
| 509 | 511 | super.setForegroundPixel (pixel); |
|---|
| 510 | | if (!OS.IsWinCE) { |
|---|
| | 512 | static if (!OS.IsWinCE) { |
|---|
| 511 | 513 | int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; |
|---|
| 512 | 514 | OS.RedrawWindow (handle, null, null, flags); |
|---|
| r104 |
r107 |
|
| 391 | 391 | |
|---|
| 392 | 392 | HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags){ |
|---|
| 393 | | if (OS.IsWinCE) { |
|---|
| | 393 | static if (OS.IsWinCE) { |
|---|
| 394 | 394 | /* |
|---|
| 395 | 395 | * Feature in Windows. On Windows CE, DeferWindowPos always causes |
|---|
| … | … | |
| 1253 | 1253 | |
|---|
| 1254 | 1254 | bool SetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags) { |
|---|
| 1255 | | if (OS.IsWinCE) { |
|---|
| | 1255 | static if (OS.IsWinCE) { |
|---|
| 1256 | 1256 | /* |
|---|
| 1257 | 1257 | * Feature in Windows. On Windows CE, SetWindowPos() always causes |
|---|
| … | … | |
| 1347 | 1347 | * not support WM_CONTEXTMENU. |
|---|
| 1348 | 1348 | */ |
|---|
| 1349 | | if (OS.IsWinCE) return LRESULT.NULL; |
|---|
| | 1349 | static if (OS.IsWinCE) return LRESULT.NULL; |
|---|
| 1350 | 1350 | |
|---|
| 1351 | 1351 | /* |
|---|
| … | … | |
| 1430 | 1430 | */ |
|---|
| 1431 | 1431 | int mapKey = 0; |
|---|
| 1432 | | if (OS.IsWinCE) { |
|---|
| | 1432 | static if (OS.IsWinCE) { |
|---|
| 1433 | 1433 | switch (wParam) { |
|---|
| 1434 | 1434 | case OS.VK_BACK: mapKey = DWT.BS; break; |
|---|
| … | … | |
| 1624 | 1624 | |
|---|
| 1625 | 1625 | /* Check for hardware keys */ |
|---|
| 1626 | | if (OS.IsWinCE) { |
|---|
| | 1626 | static if (OS.IsWinCE) { |
|---|
| 1627 | 1627 | if (OS.VK_APP1 <= wParam && wParam <= OS.VK_APP6) { |
|---|
| 1628 | 1628 | display.lastKey = display.lastAscii = 0; |
|---|
| … | … | |
| 1659 | 1659 | */ |
|---|
| 1660 | 1660 | int mapKey = 0; |
|---|
| 1661 | | if (OS.IsWinCE) { |
|---|
| | 1661 | static if (OS.IsWinCE) { |
|---|
| 1662 | 1662 | switch (wParam) { |
|---|
| 1663 | 1663 | case OS.VK_BACK: mapKey = DWT.BS; break; |
|---|
| … | … | |
| 1780 | 1780 | int count = display.getClickCount (DWT.MouseDown, 1, hwnd, lParam); |
|---|
| 1781 | 1781 | if (count is 1 && (state & DRAG_DETECT) !is 0 && hooks (DWT.DragDetect)) { |
|---|
| 1782 | | if (!OS.IsWinCE) { |
|---|
| | 1782 | static if (!OS.IsWinCE) { |
|---|
| 1783 | 1783 | /* |
|---|
| 1784 | 1784 | * Feature in Windows. It's possible that the drag |
|---|
| … | … | |
| 1980 | 1980 | int pos = OS.GetMessagePos (); |
|---|
| 1981 | 1981 | if (pos !is display.lastMouse || display.captureChanged) { |
|---|
| 1982 | | if (!OS.IsWinCE) { |
|---|
| | 1982 | static if (!OS.IsWinCE) { |
|---|
| 1983 | 1983 | bool trackMouse = (state & TRACK_MOUSE) !is 0; |
|---|
| 1984 | 1984 | bool mouseEnter = hooks (DWT.MouseEnter) || display.filters (DWT.MouseEnter); |
|---|
| … | … | |
| 2060 | 2060 | /* Issue a paint event */ |
|---|
| 2061 | 2061 | LRESULT result = LRESULT.NULL; |
|---|
| 2062 | | if (OS.IsWinCE) { |
|---|
| | 2062 | static if (OS.IsWinCE) { |
|---|
| 2063 | 2063 | RECT rect; |
|---|
| 2064 | 2064 | OS.GetUpdateRect (hwnd, &rect, false); |
|---|
| … | … | |
| 2331 | 2331 | */ |
|---|
| 2332 | 2332 | int mapKey = 0; |
|---|
| 2333 | | if (OS.IsWinCE) { |
|---|
| | 2333 | static if (OS.IsWinCE) { |
|---|
| 2334 | 2334 | switch (wParam) { |
|---|
| 2335 | 2335 | case OS.VK_BACK: mapKey = DWT.BS; break; |
|---|