[Kde-cygwin-cvs] CVS: qt-3/src/kernel qapplication_win.cpp,1.1.2.30.2.91,1.1.2.30.2.92 qwidget_win.c
Status: Inactive
Brought to you by:
habacker
From: Christian E. <che...@us...> - 2005-10-04 19:37:27
|
Update of /cvsroot/kde-cygwin/qt-3/src/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12473/src/kernel Modified Files: Tag: QT_WIN32_3_3_BRANCH qapplication_win.cpp qwidget_win.cpp Log Message: add message-handling for WM_NCLBUTTONDBLCLK Index: qapplication_win.cpp =================================================================== RCS file: /cvsroot/kde-cygwin/qt-3/src/kernel/Attic/qapplication_win.cpp,v retrieving revision 1.1.2.30.2.91 retrieving revision 1.1.2.30.2.92 diff -u -r1.1.2.30.2.91 -r1.1.2.30.2.92 --- qapplication_win.cpp 7 Aug 2005 16:11:39 -0000 1.1.2.30.2.91 +++ qapplication_win.cpp 4 Oct 2005 19:37:16 -0000 1.1.2.30.2.92 @@ -262,6 +262,10 @@ bool sendKeyEvent(MSG& msg, QEvent::Type type, int code, int ascii, int state, bool grab, const QString& text, bool autor=false); + bool sendSpontaneousEvent( QObject *receiver, QEvent *event ) + { + return QApplication::sendSpontaneousEvent( receiver, event ); + } }; @@ -1858,14 +1862,13 @@ != popup ) popup->close(); QWheelEvent e( w->mapFromGlobal( globalPos ), globalPos, delta, state, orient ); - if ( QApplication::sendSpontaneousEvent( w, &e ) - ) + if ( QApplication::sendSpontaneousEvent( w, &e ) ) return true; } // send the event to the widget that has the focus or its ancestors, if different - if ( w != qApp->focusWidget() - && ( w = qApp->focusWidget() ) ) { + if ( ( w != qApp->focusWidget() ) && + ( w = qApp->focusWidget() ) ) { QWidget * popup = qApp->activePopupWidget(); if ( popup && w->topLevelWidget() != popup ) popup->close(); @@ -2848,6 +2851,26 @@ } break; +#ifndef Q_OS_TEMP + case WM_NCLBUTTONDBLCLK: + if ( wParam == HTCAPTION ) { + bool window_state_changed = false; + unsigned int oldstate = widget->windowState(); + if ( widget->isMaximized() ) { + window_state_changed = true; + widget->setWindowState( widget->windowState() & ~Qt::WindowMaximized ); + } else if ( widget->isMaximized() ){ + window_state_changed = true; + widget->setWindowState( widget->windowState() | Qt::WindowMaximized ); + } + + if ( window_state_changed ) { + QEvent e( QEvent::WindowStateChange ); + widget->sendSpontaneousEvent( widget, &e ); + } + } + break; +#endif case WM_PAINT: if ( widget ) return ( widget->translatePaintEvent( msg ) ); Index: qwidget_win.cpp =================================================================== RCS file: /cvsroot/kde-cygwin/qt-3/src/kernel/Attic/qwidget_win.cpp,v retrieving revision 1.1.2.15.2.58 retrieving revision 1.1.2.15.2.59 diff -u -r1.1.2.15.2.58 -r1.1.2.15.2.59 --- qwidget_win.cpp 7 Aug 2005 16:11:42 -0000 1.1.2.15.2.58 +++ qwidget_win.cpp 4 Oct 2005 19:37:16 -0000 1.1.2.15.2.59 @@ -1248,7 +1248,7 @@ void QWidget::showWindow() { #ifdef DEBUG_QWIDGET - qDebug( "qwidget_win.cpp: showWindow, class %s", className() ); + qDebug( "QWidget::showWindow() for class %s", className() ); #endif if ( isDesktop() ) //desktop is always visible @@ -2103,7 +2103,8 @@ void QWidget::setWindowState( unsigned int newstate ) { bool needShow = FALSE; - uint oldstate = windowState(); + + unsigned int oldstate = windowState(); if ( isTopLevel() ) { QTLWExtra * top = topData(); |