Ignore:
Timestamp:
Jul 6, 2006, 11:25:56 PM (19 years ago)
Author:
dmik
Message:

kernel: Created the initial implementation of the Drag'n'Drop support for OS/2 (not fully functiona yet: updating widget contents under the drag pointer will cause screen corruption, setting the drag object's pixmap is not possible). See ticket:22 for more info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qapplication_pm.cpp

    r78 r97  
    657657    // there is no need to unregister private window classes -- it is done
    658658    // automatically upon process termination.
    659 //    QAsciiDictIterator<int> it(*winclassNames);
    660 //    const char *k;
    661 //    while ( (k = it.currentKey()) ) {
    662 //    }
    663659    delete winclassNames;
    664660    winclassNames = 0;
     
    913909extern uint qGlobalPostedEventsCount();
    914910
     911#ifndef QT_NO_DRAGANDDROP
     912extern MRESULT qt_dispatchDragAndDrop( QWidget *, const QMSG & ); // qdnd_pm.cpp
     913#endif
     914
    915915/*!
    916916    The message procedure calls this function for every message
     
    945945    }
    946946}
    947 
    948947
    949948//
     
    11691168        result = widget->translateWheelEvent( qmsg );
    11701169        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 ) );
    11711174#endif
    11721175    } else {
     
    15891592            break;
    15901593
    1591 /// @todo (dmik) later
     1594/// @todo (dmik) remove?
    15921595//      case WM_IME_STARTCOMPOSITION:
    15931596//          result = QInputContext::startComposition();
     
    21822185static int qt_extraKeyState = 0;
    21832186
    2184 // State holder for mouse buttons
    2185 static int qt_buttonState = 0;
     2187static 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}
    21862200
    21872201//
     
    21952209    autoCaptureWnd = h;
    21962210
    2197     if ( !qt_buttonState ) {
     2211    if ( !mouseButtonState() ) {
    21982212        // all buttons released, we don't actually capture the mouse
    21992213        // (see QWidget::translateMouseEvent())
     
    22422256static int translateButtonState( USHORT s, int type, int button )
    22432257{
    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
    22502260    if ( type == QEvent::ContextMenu ) {
    22512261        if ( WinGetKeyState( HWND_DESKTOP, VK_SHIFT ) & 0x8000 )
     
    22792289}
    22802290
    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*/
     2295void qt_pmMouseButtonUp()
     2296{
     2297    // release any stored mouse capture
     2298    qt_button_down = 0;
     2299    autoCaptureReleased = TRUE;
     2300    releaseAutoCapture();
     2301}
    22902302
    22912303bool QETWidget::translateMouseEvent( const QMSG &qmsg )
     
    23582370    type   = (QEvent::Type)mouseTbl[++i];       // event type
    23592371    button = mouseTbl[++i];                     // which button
    2360 //@@TODO (dmik): later (extra buttons)
     2372/// @todo (dmik) later (extra buttons)
    23612373//    if ( button > Qt::MidButton ) {
    23622374//      switch( GET_XBUTTON_WPARAM( msg.wParam ) ) {
     
    24242436#endif
    24252437        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,
    24272440//  otherwise disabled windows will not get mouse events?
    24282441            qt_dispatchEnterLeave( this, QWidget::find(curWin) );
Note: See TracChangeset for help on using the changeset viewer.