Changeset 97 for trunk/src/kernel/qapplication_pm.cpp
- Timestamp:
- Jul 6, 2006, 11:25:56 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qapplication_pm.cpp
r78 r97 657 657 // there is no need to unregister private window classes -- it is done 658 658 // automatically upon process termination. 659 // QAsciiDictIterator<int> it(*winclassNames);660 // const char *k;661 // while ( (k = it.currentKey()) ) {662 // }663 659 delete winclassNames; 664 660 winclassNames = 0; … … 913 909 extern uint qGlobalPostedEventsCount(); 914 910 911 #ifndef QT_NO_DRAGANDDROP 912 extern MRESULT qt_dispatchDragAndDrop( QWidget *, const QMSG & ); // qdnd_pm.cpp 913 #endif 914 915 915 /*! 916 916 The message procedure calls this function for every message … … 945 945 } 946 946 } 947 948 947 949 948 // … … 1169 1168 result = widget->translateWheelEvent( qmsg ); 1170 1169 rc = (MRESULT) result; 1170 #endif 1171 #ifndef QT_NO_DRAGANDDROP 1172 } else if ( msg >= WM_DRAGFIRST && msg <= WM_DRAGLAST ) { 1173 RETURN( qt_dispatchDragAndDrop( widget, qmsg ) ); 1171 1174 #endif 1172 1175 } else { … … 1589 1592 break; 1590 1593 1591 /// @todo (dmik) later1594 /// @todo (dmik) remove? 1592 1595 // case WM_IME_STARTCOMPOSITION: 1593 1596 // result = QInputContext::startComposition(); … … 2182 2185 static int qt_extraKeyState = 0; 2183 2186 2184 // State holder for mouse buttons 2185 static int qt_buttonState = 0; 2187 static int mouseButtonState() 2188 { 2189 int state = 0; 2190 2191 if ( WinGetKeyState( HWND_DESKTOP, VK_BUTTON1 ) & 0x8000 ) 2192 state |= Qt::LeftButton; 2193 if ( WinGetKeyState( HWND_DESKTOP, VK_BUTTON2 ) & 0x8000 ) 2194 state |= Qt::RightButton; 2195 if ( WinGetKeyState( HWND_DESKTOP, VK_BUTTON3 ) & 0x8000 ) 2196 state |= Qt::MidButton; 2197 2198 return state; 2199 } 2186 2200 2187 2201 // … … 2195 2209 autoCaptureWnd = h; 2196 2210 2197 if ( ! qt_buttonState) {2211 if ( !mouseButtonState() ) { 2198 2212 // all buttons released, we don't actually capture the mouse 2199 2213 // (see QWidget::translateMouseEvent()) … … 2242 2256 static int translateButtonState( USHORT s, int type, int button ) 2243 2257 { 2244 if ( type == QEvent::MouseButtonPress ) 2245 qt_buttonState |= ( button & Qt::MouseButtonMask ); 2246 if ( type == QEvent::MouseButtonRelease ) 2247 qt_buttonState &= ~( button & Qt::MouseButtonMask ); 2248 2249 int bst = qt_buttonState; 2258 int bst = mouseButtonState(); 2259 2250 2260 if ( type == QEvent::ContextMenu ) { 2251 2261 if ( WinGetKeyState( HWND_DESKTOP, VK_SHIFT ) & 0x8000 ) … … 2279 2289 } 2280 2290 2281 //@@TODO (dmik): later 2282 //// In DnD, the mouse release event never appears, so the 2283 //// mouse button state machine must be manually reset 2284 ///*! \internal */ 2285 //void QApplication::winMouseButtonUp() 2286 //{ 2287 // qt_button_down = 0; 2288 // releaseAutoCapture(); 2289 //} 2291 /*! \internal 2292 In DnD, the mouse release event never appears, so the 2293 mouse button state machine must be manually reset 2294 */ 2295 void qt_pmMouseButtonUp() 2296 { 2297 // release any stored mouse capture 2298 qt_button_down = 0; 2299 autoCaptureReleased = TRUE; 2300 releaseAutoCapture(); 2301 } 2290 2302 2291 2303 bool QETWidget::translateMouseEvent( const QMSG &qmsg ) … … 2358 2370 type = (QEvent::Type)mouseTbl[++i]; // event type 2359 2371 button = mouseTbl[++i]; // which button 2360 // @@TODO (dmik):later (extra buttons)2372 /// @todo (dmik) later (extra buttons) 2361 2373 // if ( button > Qt::MidButton ) { 2362 2374 // switch( GET_XBUTTON_WPARAM( msg.wParam ) ) { … … 2424 2436 #endif 2425 2437 if ( curWin != winId() ) { // new current window 2426 //@@TODO (dmik): add CS_HITTEST to our window classes and handle WM_HITTEST, 2438 /// @todo (dmik) 2439 // add CS_HITTEST to our window classes and handle WM_HITTEST, 2427 2440 // otherwise disabled windows will not get mouse events? 2428 2441 qt_dispatchEnterLeave( this, QWidget::find(curWin) );
Note:
See TracChangeset
for help on using the changeset viewer.