From ec980b2999d40ea92e56ffa45c22883cc1aa764a Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 3 Aug 2010 17:16:29 +0000 Subject: [PATCH] 2010-08-03 10:11 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idedocks.prg * contrib/hbide/ideedit.prg % A hacked fix: to context menu actions inside editor, reported at FWH forum. % Fixed: switching over to non-MDI mode from MDI mode was raising RTE. --- harbour/ChangeLog | 7 ++++ harbour/contrib/hbide/idedocks.prg | 40 ++++++++++++++--------- harbour/contrib/hbide/ideedit.prg | 51 ++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 24 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e88982d294..eff4d15251 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-03 10:11 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/idedocks.prg + * contrib/hbide/ideedit.prg + % A hacked fix: to context menu actions inside editor, reported at FWH forum. + % Fixed: switching over to non-MDI mode from MDI mode was + raising RTE. + 2010-08-03 18:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ! Fixed error introduced in '2010-08-03 16:00 UTC+0200' diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 8199ca0846..712a19968f 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -220,11 +220,19 @@ METHOD IdeDocks:destroy() METHOD IdeDocks:getEditorPanelsInfo() LOCAL b_, a_:= {} FOR EACH b_ IN ::aViewsInfo - aadd( a_, b_[ 1 ] + "," + ; - iif( empty( b_[ 2 ] ), "", hbide_nArray2String( { b_[ 2 ]:x(), b_[ 2 ]:y(), b_[ 2 ]:width(), b_[ 2 ]:height() } ) ) + "," + ; - hb_ntos( b_[ 3 ] ) + "," + hb_ntos( b_[ 4 ] ) + "," + ; - hb_ntos( ::oStackedWidget:oWidget:viewMode() ) + "," + hb_ntos( ::nViewStyle ) + "," ; - ) + IF ::oIde:lCurEditsMdi + aadd( a_, b_[ 1 ] + "," + ; + iif( empty( b_[ 2 ] ), "", hbide_nArray2String( { b_[ 2 ]:x(), b_[ 2 ]:y(), b_[ 2 ]:width(), b_[ 2 ]:height() } ) ) + "," + ; + hb_ntos( b_[ 3 ] ) + "," + hb_ntos( b_[ 4 ] ) + "," + ; + hb_ntos( ::oStackedWidget:oWidget:viewMode() ) + "," + hb_ntos( ::nViewStyle ) + "," ; + ) + ELSE + aadd( a_, b_[ 1 ] + "," + ; + iif( empty( b_[ 2 ] ), "", hbide_nArray2String( { b_[ 2 ]:x(), b_[ 2 ]:y(), b_[ 2 ]:width(), b_[ 2 ]:height() } ) ) + "," + ; + hb_ntos( b_[ 3 ] ) + "," + hb_ntos( b_[ 4 ] ) + "," + ; + hb_ntos( b_[ 5 ] ) + "," + hb_ntos( b_[ 6 ] ) + "," ; + ) + ENDIF NEXT RETURN a_ @@ -322,16 +330,18 @@ METHOD IdeDocks:buildDialog() ENDIF ::setView( "Stats" ) /* Always call with name */ - IF x_[ 1,5 ] == QMdiArea_TabbedView - ::oStackedWidget:oWidget:setViewMode( QMdiArea_TabbedView ) - ENDIF - FOR EACH a_ IN x_ - ::oIde:aMdies[ a_:__enumIndex() ]:setWindowState( a_[ 4 ] ) - NEXT - IF x_[ 1,6 ] == 1 - ::oStackedWidget:oWidget:tileSubWindows() - ELSEIF x_[ 1,6 ] == 2 - ::oStackedWidget:oWidget:cascadeSubWindows() + IF ::oIde:lCurEditsMdi + IF x_[ 1,5 ] == QMdiArea_TabbedView + ::oStackedWidget:oWidget:setViewMode( QMdiArea_TabbedView ) + ENDIF + FOR EACH a_ IN x_ + ::oIde:aMdies[ a_:__enumIndex() ]:setWindowState( a_[ 4 ] ) + NEXT + IF x_[ 1,6 ] == 1 + ::oStackedWidget:oWidget:tileSubWindows() + ELSEIF x_[ 1,6 ] == 2 + ::oStackedWidget:oWidget:cascadeSubWindows() + ENDIF ENDIF ::oDlg:connectEvent( ::oDlg:oWidget, QEvent_WindowStateChange, {|e| ::execEvent( "QEvent_WindowStateChange", e ) } ) diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index c9d9bafd05..988d8b33a3 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -425,7 +425,7 @@ METHOD IdeEdit:connectEditSignals( oEdit ) /*----------------------------------------------------------------------*/ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) - LOCAL pAct, qAct, n, qEdit, oo, qCursor, cProto, nRows, nCols + LOCAL pAct, qAct, n, qEdit, oo, qCursor, cProto, nRows, nCols, cAct HB_SYMBOL_UNUSED( p1 ) @@ -447,12 +447,16 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) pAct := ::oEM:qContextMenu:exec_1( qEdit:mapToGlobal( p ) ) IF !hbqt_isEmptyQtPointer( pAct ) qAct := QAction():configure( pAct ) - DO CASE - CASE qAct:text() == "Split Horizontally" + cAct := strtran( qAct:text(), "&", "" ) +HB_TRACE( HB_TR_ALWAYS, cAct ) + SWITCH cAct + CASE "Split Horizontally" ::oEditor:split( 1, oEdit ) - CASE qAct:text() == "Split Vertically" + EXIT + CASE "Split Vertically" ::oEditor:split( 2, oEdit ) - CASE qAct:text() == "Close Split Window" + EXIT + CASE "Close Split Window" IF n > 0 /* 1 == Main Edit */ ::oUpDn:oUI:setParent( ::oEditor:oEdit:qEdit ) oo := ::oEditor:aEdits[ n ] @@ -462,13 +466,42 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) ::oEditor:qCoEdit := ::oEditor:oEdit ::oIde:manageFocusInEditor() ENDIF - CASE qAct:text() == "Save as Skeleton..." + EXIT + CASE "Save as Skeleton..." ::oSK:saveAs( ::getSelectedText() ) - CASE qAct:text() == "Apply Theme" + EXIT + CASE "Apply Theme" ::oEditor:applyTheme() - CASE qAct:text() == "Goto Function" + EXIT + CASE "Goto Function" ::gotoFunction() - ENDCASE + EXIT + CASE "Cut" + IF ::oIde:lCurEditsMdi + ::cut() + ENDIF + EXIT + CASE "Copy" + IF ::oIde:lCurEditsMdi + ::copy() + ENDIF + EXIT + CASE "Paste" + IF ::oIde:lCurEditsMdi + ::paste() + ENDIF + EXIT + CASE "Undo" + IF ::oIde:lCurEditsMdi + ::undo() + ENDIF + EXIT + CASE "Redo" + IF ::oIde:lCurEditsMdi + ::redo() + ENDIF + EXIT + ENDSWITCH ENDIF EXIT