Show
Ignore:
Timestamp:
06/18/09 15:54:57 (4 years ago)
Author:
saturday06
Message:

owata.....orz

Location:
lang/objective-cplusplus/i3/trunk/src/gui-windows
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.cpp

    r34022 r34027  
    1010using namespace mil; 
    1111 
     12int touch_x = 0; 
     13int touch_y = 0; 
     14bool cap = false; 
     15 
    1216struct ExecuteEvent 
    1317{ 
     
    1822void Delegate::execute(ExecuteEvent& e) 
    1923{ 
    20      
     24    /* 
    2125    TCHAR cwd_buf[MAX_PATH] = {}; 
    2226    TCHAR* cwd = cwd_buf; 
     
    5357        alert(_T("failure")); 
    5458    } 
    55      
     59    */ 
    5660} 
    5761 
     
    110114{ 
    111115    memset((void*)&layout, 0, sizeof(layout)); 
     116    memset((void*)&ce, 0, sizeof(ce)); 
    112117    layout.icon_edit_space = 1; 
    113118    icon = LoadIcon(i3::hInstance, _T("IDI_ICON1")); 
     
    124129void InputWindowPlatform<InputWindow>::OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) 
    125130{ 
     131#ifdef _WIN32_WCE 
     132    { 
     133        SetCapture(hwnd); 
     134        RECT rect; 
     135        GetWindowRect(hwnd, &rect); 
     136        ce.is_capturing = 1; 
     137        POINT point; 
     138        point.x = x; 
     139        point.y = y; 
     140        ClientToScreen(hwnd, &point); 
     141        ce.capture_x = point.x - rect.left; 
     142        ce.capture_y = point.y - rect.top; 
     143    } 
     144#endif 
     145    SetMsgHandled(false); 
     146} 
     147 
     148template <> 
     149void InputWindowPlatform<InputWindow>::OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags) 
     150{ 
     151#ifdef _WIN32_WCE 
     152    if (ce.is_capturing) { 
     153        POINT point; 
     154        point.x = x; 
     155        point.y = y; 
     156        ClientToScreen(hwnd, &point); 
     157        SetWindowPos(hwnd, 0,  
     158            point.x - ce.capture_x,  point.y - ce.capture_y, 
     159                        0, 0,  
     160                        SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOSIZE); 
     161        SetMsgHandled(true); 
     162    } 
     163#endif 
    126164    SetMsgHandled(false); 
    127165} 
     
    130168void InputWindowPlatform<InputWindow>::OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags) 
    131169{ 
     170#ifdef _WIN32_WCE 
     171    { 
     172        ReleaseCapture(); 
     173        ce.is_capturing = 0; 
     174    } 
     175#endif 
    132176    SetFocus(hEdit); 
    133177    SetMsgHandled(false); 
     
    153197template <> 
    154198void InputWindowPlatform<InputWindow>::OnActivateApp(HWND hwnd, BOOL fActivate, DWORD dwThreadId) 
    155 { 
    156     SetMsgHandled(false); 
    157 } 
    158  
    159  
    160 template <> 
    161 void InputWindowPlatform<InputWindow>::OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags) 
    162199{ 
    163200    SetMsgHandled(false); 
     
    309346    const int DEFAULT_WINDOW_HEIGHT = 200; 
    310347 
    311     riched20_dll = LoadLibrary(_T("riched20.dll")); 
    312     //riched20_dll = LoadLibrary(_T("riched32.dll")); 
    313  
    314348    TCHAR ClassName[] = _T("i3 InputWindow"); //  <- rule required 
    315349    int nCmdShow = SW_SHOW; 
     
    334368    } 
    335369 
    336     DWORD dwDefaultStyle = WS_THICKFRAME | WS_POPUP; 
    337 #ifdef _WIN32_WCE 
    338     dwDefaultStyle |= WS_CAPTION; 
    339 #endif 
     370    DWORD dwDefaultStyle = /*WS_THICKFRAME*/ WS_BORDER | WS_POPUP; 
    340371 
    341372    HWND w = CreateWindowEx( 
  • lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.h

    r33899 r34027  
    5252        int icon_edit_space; 
    5353    } layout; 
     54    struct { 
     55#ifdef _WIN32_WCE 
     56        int is_capturing; 
     57        int capture_x; 
     58        int capture_y; 
     59#endif 
     60    } ce; 
    5461    HICON icon; 
    5562};