From d6a8d70a2990bedeb34e9872ed1b51f488403e34 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 18 May 2011 19:54:14 +0000 Subject: [PATCH] 2011-05-18 12:51 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idedocks.prg * contrib/hbxbp/xbpdialog.prg * contrib/hbxbp/xbpwindow.prg ! Fixed: a logical glitch causing X button on hbIDE behaving not as intended. --- harbour/ChangeLog | 9 ++++++++- harbour/contrib/hbide/idedocks.prg | 3 ++- harbour/contrib/hbxbp/xbpdialog.prg | 30 ++++++++++++++++------------- harbour/contrib/hbxbp/xbpwindow.prg | 3 --- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e465169b05..21cef11327 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-18 12:51 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/idedocks.prg + * contrib/hbxbp/xbpdialog.prg + * contrib/hbxbp/xbpwindow.prg + ! Fixed: a logical glitch causing X button on hbIDE behaving + not as intended. + 2011-05-18 20:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbwin/axcore.c ! added missing AddRef() for OLE object returbed by __AXREGISTERHANDLER() @@ -39,7 +46,7 @@ * contrib/xhb/hbdll.ch ! several fixes to make it work in Harbour and MT apps -2011-05-18 17:53 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) +2011-05-17 17:53 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idedocks.prg * contrib/hbide/ideedit.prg * contrib/hbide/ideeditor.prg diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 91402a3e08..d334222dd6 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -329,7 +329,8 @@ METHOD IdeDocks:buildDialog() ::oDlg:oWidget:setStyleSheet( GetStyleSheet( "QMainWindow", ::nAnimantionMode ) ) - ::oDlg:close := {|| hbide_setClose( hbide_getYesNo( "hbIDE is about to be closed!", "Are you sure?" ) ) } + ::oDlg:close := {|| hbide_setClose( hbide_getYesNo( "hbIDE is about to be closed!", "Are you sure?" ) ), ; + PostAppEvent( xbeP_Close, , , ::oDlg ) } ::oDlg:setDockOptions( QMainWindow_AllowTabbedDocks + QMainWindow_ForceTabbedDocks ) ::oDlg:setTabPosition( Qt_BottomDockWidgetArea, QTabWidget_South ) ::oDlg:setCorner( Qt_BottomLeftCorner, Qt_LeftDockWidgetArea ) diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index a015ab4a6e..a3d2cda56e 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -294,19 +294,22 @@ METHOD XbpDialog:destroy() METHOD XbpDialog:execEvent( nEvent, pEvent ) - DO CASE + SWITCH nEvent - CASE nEvent == QEvent_WindowActivate + CASE QEvent_WindowActivate SetAppEvent( xbeP_SetDisplayFocus, NIL, NIL, Self ) + EXIT - CASE nEvent == QEvent_WindowDeactivate + CASE QEvent_WindowDeactivate SetAppEvent( xbeP_KillDisplayFocus, NIL, NIL, Self ) + EXIT - CASE nEvent == QEvent_Close + CASE QEvent_Close pEvent:ignore() - SetAppEvent( xbeP_Close, NIL, NIL, Self ) + ::close() + EXIT - ENDCASE + ENDSWITCH RETURN .F. @@ -378,24 +381,25 @@ METHOD XbpDialog:showModal() METHOD XbpDialog:setFrameState( nState ) LOCAL lSuccess := .T. LOCAL nCurState := ::getFrameState() + LOCAL oWidget := iif( hb_isObject( ::oMdi ), ::oMdi, ::oWidget ) DO CASE CASE nState == XBPDLG_FRAMESTAT_MINIMIZED IF nCurState != XBPDLG_FRAMESTAT_MINIMIZED - ::oWidget:setWindowState( Qt_WindowMinimized ) + oWidget:setWindowState( Qt_WindowMinimized ) ENDIF CASE nState == XBPDLG_FRAMESTAT_MAXIMIZED IF nCurState == XBPDLG_FRAMESTAT_MINIMIZED - ::oWidget:show() - ::oWidget:setWindowState( Qt_WindowMaximized ) + oWidget:show() + oWidget:setWindowState( Qt_WindowMaximized ) ELSEIF nCurState == XBPDLG_FRAMESTAT_NORMALIZED - ::oWidget:setWindowState( Qt_WindowMaximized ) + oWidget:setWindowState( Qt_WindowMaximized ) ENDIF CASE nState == XBPDLG_FRAMESTAT_NORMALIZED IF nCurState != XBPDLG_FRAMESTAT_MINIMIZED - ::oWidget:show() + oWidget:show() ENDIF - ::oWidget:setWindowState( Qt_WindowNoState ) + oWidget:setWindowState( Qt_WindowNoState ) ENDCASE RETURN lSuccess @@ -403,7 +407,7 @@ METHOD XbpDialog:setFrameState( nState ) /*----------------------------------------------------------------------*/ METHOD XbpDialog:getFrameState() - LOCAL nState := ::oWidget:windowState() + LOCAL nState := iif( hb_isObject( ::oMdi ), ::oMdi, ::oWidget ):windowState() IF ( hb_bitAnd( nState, Qt_WindowMinimized ) == Qt_WindowMinimized ) RETURN XBPDLG_FRAMESTAT_MINIMIZED diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index e507f742bd..b6d9b915a7 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -672,9 +672,6 @@ METHOD XbpWindow:handleEvent( nEvent, mp1, mp2 ) SWITCH ( nEvent ) - CASE xbeP_Close - ::close() - EXIT CASE xbeP_Keyboard ::keyboard( mp1 ) EXIT