Changeset 107:a378481be65f

Show
Ignore:
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
  • dwt/widgets/Control.d

    r82 r107  
    19631963//  checkWidget (); 
    19641964    if (!OS.IsWindowVisible (handle)) return; 
    1965     if (OS.IsWinCE) { 
     1965    static if (OS.IsWinCE) { 
    19661966        OS.InvalidateRect (handle, null, true); 
    19671967    } else { 
     
    20072007    RECT rect; 
    20082008    OS.SetRect (&rect, x, y, x + width, y + height); 
    2009     if (OS.IsWinCE) { 
     2009    static if (OS.IsWinCE) { 
    20102010        OS.InvalidateRect (handle, &rect, true); 
    20112011    } else { 
     
    25022502 
    25032503void setBackgroundImage (HBITMAP hBitmap) { 
    2504     if (OS.IsWinCE) { 
     2504    static if (OS.IsWinCE) { 
    25052505        OS.InvalidateRect (handle, null, true); 
    25062506    } else { 
     
    25112511 
    25122512void setBackgroundPixel (int pixel) { 
    2513     if (OS.IsWinCE) { 
     2513    static if (OS.IsWinCE) { 
    25142514        OS.InvalidateRect (handle, null, true); 
    25152515    } else { 
     
    28742874    * not running on WinCE. 
    28752875    */ 
    2876     if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; 
     2876    static if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; 
    28772877    setBounds (x, y, 0, 0, flags); 
    28782878} 
     
    29932993                if (handle !is topHandle_) OS.ShowWindow (handle, OS.SW_HIDE); 
    29942994            } else { 
    2995                 if (OS.IsWinCE) { 
     2995                static if (OS.IsWinCE) { 
    29962996                    OS.InvalidateRect (topHandle_, null, true); 
    29972997                    if (handle !is topHandle_) OS.InvalidateRect (handle, null, true); 
     
    35793579void update (bool all) { 
    35803580//  checkWidget (); 
    3581     if (OS.IsWinCE) { 
     3581    static if (OS.IsWinCE) { 
    35823582        OS.UpdateWindow (handle); 
    35833583    } else { 
     
    39323932 
    39333933LRESULT WM_HELP (int wParam, int lParam) { 
    3934     if (OS.IsWinCE) return LRESULT.NULL; 
     3934    static if (OS.IsWinCE) return LRESULT.NULL; 
    39353935    HELPINFO* lphi = cast(HELPINFO*)lParam; 
    39363936    Decorations shell = menuShell (); 
  • dwt/widgets/ExpandBar.d

    r82 r107  
    161161                    hCurrentFont = hFont; 
    162162                } else { 
    163                     if (!OS.IsWinCE) { 
     163                    static if (!OS.IsWinCE) { 
    164164                        NONCLIENTMETRICS info; 
    165165                        info.cbSize = NONCLIENTMETRICS.sizeof; 
     
    284284    HFONT hCaptionFont, oldFont; 
    285285    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                } 
    293295            } 
    294296        } 
     
    494496override void setBackgroundPixel (int pixel) { 
    495497    super.setBackgroundPixel (pixel); 
    496     if (!OS.IsWinCE) { 
     498    static if (!OS.IsWinCE) { 
    497499        int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; 
    498500        OS.RedrawWindow (handle, null, null, flags); 
     
    508510override void setForegroundPixel (int pixel) { 
    509511    super.setForegroundPixel (pixel); 
    510     if (!OS.IsWinCE) { 
     512    static if (!OS.IsWinCE) { 
    511513        int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; 
    512514        OS.RedrawWindow (handle, null, null, flags); 
  • dwt/widgets/Widget.d

    r104 r107  
    391391 
    392392HDWP 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) { 
    394394        /* 
    395395        * Feature in Windows.  On Windows CE, DeferWindowPos always causes 
     
    12531253 
    12541254bool SetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags) { 
    1255     if (OS.IsWinCE) { 
     1255    static if (OS.IsWinCE) { 
    12561256        /* 
    12571257        * Feature in Windows.  On Windows CE, SetWindowPos() always causes 
     
    13471347    * not support WM_CONTEXTMENU. 
    13481348    */ 
    1349     if (OS.IsWinCE) return LRESULT.NULL; 
     1349    static if (OS.IsWinCE) return LRESULT.NULL; 
    13501350 
    13511351    /* 
     
    14301430    */ 
    14311431    int mapKey = 0; 
    1432     if (OS.IsWinCE) { 
     1432    static if (OS.IsWinCE) { 
    14331433        switch (wParam) { 
    14341434            case OS.VK_BACK: mapKey = DWT.BS; break; 
     
    16241624 
    16251625    /* Check for hardware keys */ 
    1626     if (OS.IsWinCE) { 
     1626    static if (OS.IsWinCE) { 
    16271627        if (OS.VK_APP1 <= wParam && wParam <= OS.VK_APP6) { 
    16281628            display.lastKey = display.lastAscii = 0; 
     
    16591659    */ 
    16601660    int mapKey = 0; 
    1661     if (OS.IsWinCE) { 
     1661    static if (OS.IsWinCE) { 
    16621662        switch (wParam) { 
    16631663            case OS.VK_BACK: mapKey = DWT.BS; break; 
     
    17801780    int count = display.getClickCount (DWT.MouseDown, 1, hwnd, lParam); 
    17811781    if (count is 1 && (state & DRAG_DETECT) !is 0 && hooks (DWT.DragDetect)) { 
    1782         if (!OS.IsWinCE) { 
     1782        static if (!OS.IsWinCE) { 
    17831783            /* 
    17841784            * Feature in Windows.  It's possible that the drag 
     
    19801980    int pos = OS.GetMessagePos (); 
    19811981    if (pos !is display.lastMouse || display.captureChanged) { 
    1982         if (!OS.IsWinCE) { 
     1982        static if (!OS.IsWinCE) { 
    19831983            bool trackMouse = (state & TRACK_MOUSE) !is 0; 
    19841984            bool mouseEnter = hooks (DWT.MouseEnter) || display.filters (DWT.MouseEnter); 
     
    20602060    /* Issue a paint event */ 
    20612061    LRESULT result = LRESULT.NULL; 
    2062     if (OS.IsWinCE) { 
     2062    static if (OS.IsWinCE) { 
    20632063        RECT rect; 
    20642064        OS.GetUpdateRect (hwnd, &rect, false); 
     
    23312331    */ 
    23322332    int mapKey = 0; 
    2333     if (OS.IsWinCE) { 
     2333    static if (OS.IsWinCE) { 
    23342334        switch (wParam) { 
    23352335            case OS.VK_BACK: mapKey = DWT.BS; break;