Changeset 34027
- Timestamp:
- 06/18/09 15:54:57 (4 years ago)
- Location:
- lang/objective-cplusplus/i3/trunk/src/gui-windows
- Files:
-
- 2 modified
-
InputWindowPlatform.cpp (modified) (9 diffs)
-
InputWindowPlatform.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.cpp
r34022 r34027 10 10 using namespace mil; 11 11 12 int touch_x = 0; 13 int touch_y = 0; 14 bool cap = false; 15 12 16 struct ExecuteEvent 13 17 { … … 18 22 void Delegate::execute(ExecuteEvent& e) 19 23 { 20 24 /* 21 25 TCHAR cwd_buf[MAX_PATH] = {}; 22 26 TCHAR* cwd = cwd_buf; … … 53 57 alert(_T("failure")); 54 58 } 55 59 */ 56 60 } 57 61 … … 110 114 { 111 115 memset((void*)&layout, 0, sizeof(layout)); 116 memset((void*)&ce, 0, sizeof(ce)); 112 117 layout.icon_edit_space = 1; 113 118 icon = LoadIcon(i3::hInstance, _T("IDI_ICON1")); … … 124 129 void InputWindowPlatform<InputWindow>::OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) 125 130 { 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 148 template <> 149 void 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 126 164 SetMsgHandled(false); 127 165 } … … 130 168 void InputWindowPlatform<InputWindow>::OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags) 131 169 { 170 #ifdef _WIN32_WCE 171 { 172 ReleaseCapture(); 173 ce.is_capturing = 0; 174 } 175 #endif 132 176 SetFocus(hEdit); 133 177 SetMsgHandled(false); … … 153 197 template <> 154 198 void 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)162 199 { 163 200 SetMsgHandled(false); … … 309 346 const int DEFAULT_WINDOW_HEIGHT = 200; 310 347 311 riched20_dll = LoadLibrary(_T("riched20.dll"));312 //riched20_dll = LoadLibrary(_T("riched32.dll"));313 314 348 TCHAR ClassName[] = _T("i3 InputWindow"); // <- rule required 315 349 int nCmdShow = SW_SHOW; … … 334 368 } 335 369 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; 340 371 341 372 HWND w = CreateWindowEx( -
lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.h
r33899 r34027 52 52 int icon_edit_space; 53 53 } layout; 54 struct { 55 #ifdef _WIN32_WCE 56 int is_capturing; 57 int capture_x; 58 int capture_y; 59 #endif 60 } ce; 54 61 HICON icon; 55 62 };
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)