diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0dd8345d69..81d2498df2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,35 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-02 18:17 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + + contrib/hbide/updown_v.ui + + Added: widget to expose Top> buttons + for selected text. + + * contrib/hbide/hbide.hbp + * contrib/hbide/idebrowse.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/idefindreplace.prg + * contrib/hbide/idemisc.prg + % Swapped: editing MDI area's top-toolbar actions with + left-toolbar. Now the visual elements are synchrinized + with how we are used to view these actions. + + + Implemented: in MDI editors mode, actions to navigate + selection for etc exposed via left toolbar. + These actions are shown enabled only if there is active + selection text is visible, either by double clicking on a + word or by virtue of Find/Replace dialog. It fixes the + visual irritating artifact discussed recently. + + + Implemented: MDI editing panels are now remembered for + their last state for the next run. It effectively means + that if a panel(s) are left maximized, minimized, cascaded, + tiled, under tabbed view or subwindowed view, next run + correctly position all of them. This is on top of your + own layout which you would have saved earlier, which can ever + be brought back by clicking on "View as arranged" icon. + 2010-08-02 20:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/utils/hbqtgen.prg + Will now generate hbqt*_extern.ch with REQUEST for all diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index bad29b9d38..eaa6c4e9ea 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -76,5 +76,6 @@ updown.ui dbstruct.ui fetchdate.ui tables.ui +updown_v.ui hbide.qrc diff --git a/harbour/contrib/hbide/idebrowse.prg b/harbour/contrib/hbide/idebrowse.prg index 1538991afa..37a766c7fc 100644 --- a/harbour/contrib/hbide/idebrowse.prg +++ b/harbour/contrib/hbide/idebrowse.prg @@ -901,25 +901,25 @@ METHOD IdeBrowseManager:buildToolbar() ::qToolbar:addWidget( sp0 ) ::buildRddsCombo() ::buildConxnCombo() - ::buildToolButton( ::qToolbar, { "Open a table" , "open" , "clicked()", {|| ::execEvent( "buttonOpen_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Open a table" , "open" , {|| ::execEvent( "buttonOpen_clicked" ) }, .f. } ) ::qToolbar:addWidget( sp1 ) - ::buildToolButton( ::qToolbar, { "Toggle tabbed view" , "view_tabbed" , "clicked()", {|| ::execEvent( "buttonViewTabbed_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Toggle tabbed view" , "view_tabbed" , {|| ::execEvent( "buttonViewTabbed_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbar, {} ) - ::buildToolButton( ::qToolbar, { "View as arranged" , "view_organized", "clicked()", {|| ::execEvent( "buttonViewOrganized_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbar, { "View as cascaded" , "view_cascaded" , "clicked()", {|| ::execEvent( "buttonViewCascaded_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbar, { "View as tiled" , "view_tiled" , "clicked()", {|| ::execEvent( "buttonViewTiled_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "View as arranged" , "view_organized", {|| ::execEvent( "buttonViewOrganized_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "View as cascaded" , "view_cascaded" , {|| ::execEvent( "buttonViewCascaded_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "View as tiled" , "view_tiled" , {|| ::execEvent( "buttonViewTiled_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbar, {} ) - ::buildToolButton( ::qToolbar, { "Save layout" , "save" , "clicked()", {|| ::execEvent( "buttonSaveLayout_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Save layout" , "save" , {|| ::execEvent( "buttonSaveLayout_clicked" ) }, .f. } ) ::qToolbar:addWidget( sp2 ) - ::buildToolButton( ::qToolbar, { "Show/hide form view", "formview" , "clicked()", {|| ::execEvent( "buttonShowForm_clicked" ) }, .t. } ) + ::buildToolButton( ::qToolbar, { "Show/hide form view", "formview" , {|| ::execEvent( "buttonShowForm_clicked" ) }, .t. } ) ::buildToolButton( ::qToolbar, {} ) - ::buildToolButton( ::qToolbar, { "Table Structure" , "dbstruct" , "clicked()", {|| ::execEvent( "buttonDbStruct_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Table Structure" , "dbstruct" , {|| ::execEvent( "buttonDbStruct_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbar, {} ) ::buildIndexButton() - ::buildToolButton( ::qToolbar, { "Search in table" , "find" , "clicked()", {|| ::execEvent( "buttonFind_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbar, { "Goto record" , "gotoline" , "clicked()", {|| ::execEvent( "buttonGoto_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Search in table" , "find" , {|| ::execEvent( "buttonFind_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Goto record" , "gotoline" , {|| ::execEvent( "buttonGoto_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbar, {} ) - ::buildToolButton( ::qToolbar, { "Close current table", "dc_delete" , "clicked()", {|| ::execEvent( "buttonClose_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbar, { "Close current table", "dc_delete" , {|| ::execEvent( "buttonClose_clicked" ) }, .f. } ) ::qToolbar:addWidget( sp3 ) ::buildTablesButton() @@ -940,18 +940,18 @@ METHOD IdeBrowseManager:buildLeftToolbar() ::qToolbarL:setMaximumWidth( 24 ) ::qToolbarL:setStyleSheet( GetStyleSheet( "QToolBar", ::nAnimantionMode ) ) - ::buildToolButton( ::qToolbarL, { "Append a record" , "database_add" , "clicked()", {|| ::execEvent( "buttonAppendRecord_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbarL, { "Delete a record" , "database_remove" , "clicked()", {|| ::execEvent( "buttonDelRecord_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbarL, { "Lock/Unlock Record" , "database_lock" , "clicked()", {|| ::execEvent( "buttonLockRecord_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Append a record" , "database_add" , {|| ::execEvent( "buttonAppendRecord_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Delete a record" , "database_remove" , {|| ::execEvent( "buttonDelRecord_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Lock/Unlock Record" , "database_lock" , {|| ::execEvent( "buttonLockRecord_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbarL, {} ) - ::buildToolButton( ::qToolbarL, { "Goto Top" , "database_up" , "clicked()", {|| ::execEvent( "buttonGoTop_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbarL, { "Goto Bottom" , "database_down" , "clicked()", {|| ::execEvent( "buttonGoBottom_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbarL, { "Scroll to First Column", "database_previous", "clicked()", {|| ::execEvent( "buttonScrollToFirst_clicked" ) }, .f. } ) - ::buildToolButton( ::qToolbarL, { "Scroll to Last Column" , "database_next" , "clicked()", {|| ::execEvent( "buttonScrollToLast_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Goto Top" , "database_up" , {|| ::execEvent( "buttonGoTop_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Goto Bottom" , "database_down" , {|| ::execEvent( "buttonGoBottom_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Scroll to First Column", "database_previous", {|| ::execEvent( "buttonScrollToFirst_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Scroll to Last Column" , "database_next" , {|| ::execEvent( "buttonScrollToLast_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbarL, {} ) - ::buildToolButton( ::qToolbarL, { "Search in Table" , "database_search" , "clicked()", {|| ::execEvent( "buttonSearchInTable_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Search in Table" , "database_search" , {|| ::execEvent( "buttonSearchInTable_clicked" ) }, .f. } ) ::buildToolButton( ::qToolbarL, {} ) - ::buildToolButton( ::qToolbarL, { "Zap Table" , "database_process" , "clicked()", {|| ::execEvent( "buttonZaptable_clicked" ) }, .f. } ) + ::buildToolButton( ::qToolbarL, { "Zap Table" , "database_process" , {|| ::execEvent( "buttonZaptable_clicked" ) }, .f. } ) RETURN Self @@ -967,10 +967,10 @@ METHOD IdeBrowseManager:buildToolButton( qToolbar, aBtn ) qBtn:setTooltip( aBtn[ 1 ] ) qBtn:setAutoRaise( .t. ) qBtn:setIcon( hbide_image( aBtn[ 2 ] ) ) - IF aBtn[ 5 ] + IF aBtn[ 4 ] qBtn:setCheckable( .t. ) ENDIF - ::connect( qBtn, aBtn[ 3 ], aBtn[ 4 ] ) + ::connect( qBtn, "clicked()", aBtn[ 3 ] ) qToolBar:addWidget( qBtn ) aadd( ::aToolBtns, qBtn ) ENDIF @@ -1041,7 +1041,6 @@ METHOD IdeBrowseManager:buildTablesButton() ::qTablesButton:setIcon( hbide_image( "database" ) ) ::qTablesButton:setPopupMode( QToolButton_MenuButtonPopup ) ::qTablesButton:setMenu( ::qTablesMenu ) - //::qTablesButton:setMaximumWidth( 0 ) ::connect( ::qTablesButton, "clicked()", {|| ::execEvent( "buttonTables_clicked" ) } ) diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 531b9d6c22..8199ca0846 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -220,14 +220,18 @@ 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() } ) ) ) + 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 ) + "," ; + ) NEXT RETURN a_ /*------------------------------------------------------------------------*/ METHOD IdeDocks:buildDialog() - LOCAL s, aSize, a_, lTiled := .t. + LOCAL s, aSize, a_, lTiled := .t., x_ ::oIde:oDlg := XbpDialog():new() ::oDlg:icon := hbide_image( "hbide" ) @@ -284,29 +288,52 @@ METHOD IdeDocks:buildDialog() /* Normalize Views */ FOR EACH s IN ::oINI:aViews a_:= hb_aTokens( s, "," ) - asize( a_, 2 ) + asize( a_, 6 ) IF ! empty( a_[ 2 ] ) a_[ 2 ] := hbide_array2Rect( hbide_string2nArray( a_[ 2 ] ) ) lTiled := .f. ENDIF + DEFAULT a_[ 3 ] TO "0" + DEFAULT a_[ 4 ] TO "0" + DEFAULT a_[ 5 ] TO "0" + DEFAULT a_[ 6 ] TO "0" + a_[ 3 ] := val( a_[ 3 ] ) + a_[ 4 ] := val( a_[ 4 ] ) + a_[ 5 ] := val( a_[ 5 ] ) + a_[ 6 ] := val( a_[ 6 ] ) aadd( ::aViewsInfo, a_ ) NEXT IF ascan( ::aViewsInfo, {|e_| e_[ 1 ] == "Main" } ) == 0 - hb_ains( ::aViewsInfo, 1, { "Main", NIL }, .t. ) + hb_ains( ::aViewsInfo, 1, { "Main", NIL, 0, 0, 0, 0 }, .t. ) ENDIF IF ascan( ::aViewsInfo, {|e_| e_[ 1 ] == "Stats" } ) == 0 - hb_ains( ::aViewsInfo, 1, { "Stats", NIL }, .t. ) + hb_ains( ::aViewsInfo, 1, { "Stats", NIL, 0, 0, 0, 0 }, .t. ) ENDIF /* View Panels */ + x_:= aclone( ::aViewsInfo ) FOR EACH a_ IN ::aViewsInfo ::buildViewWidget( a_[ 1 ] ) NEXT - IF ::oIde:lCurEditsMdi .AND. lTiled - ::oStackedWidget:oWidget:tileSubWindows() + IF ::oIde:lCurEditsMdi + IF lTiled + ::oStackedWidget:oWidget:tileSubWindows() + ENDIF 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() + ENDIF + ::oDlg:connectEvent( ::oDlg:oWidget, QEvent_WindowStateChange, {|e| ::execEvent( "QEvent_WindowStateChange", e ) } ) ::oDlg:connectEvent( ::oDlg:oWidget, QEvent_Hide , {|e| ::execEvent( "QEvent_Hide" , e ) } ) @@ -558,6 +585,15 @@ HB_TRACE( HB_TR_ALWAYS, "projectTree_dropEvent" ) ENDIF EXIT + CASE "mdiSubWindow_windowStateChanged" + IF ! empty( ::oIde:aMdies ) + IF ( n := ascan( ::oIde:aMdies, {|o| o == p } ) ) > 0 + ::aViewsInfo[ n, 3 ] := p1[ 1 ] + ::aViewsInfo[ n, 4 ] := p1[ 2 ] + ENDIF + ENDIF + EXIT + ENDSWITCH RETURN Self @@ -711,7 +747,7 @@ METHOD IdeDocks:setView( cView ) IF ascan( ::aViewsInfo, {|e_| e_[ 1 ] == cView } ) > 0 MsgBox( "View: " + cView + ", already exists" ) ELSE - aadd( ::aViewsInfo, { cView, NIL } ) + aadd( ::aViewsInfo, { cView, NIL, 0, 0, 0, 0 } ) ::oTM:addPanelsMenu( cView ) ::buildViewWidget( cView ) IF ! ::oIde:lCurEditsMdi @@ -769,34 +805,54 @@ METHOD IdeDocks:buildMdiToolbarLeft() qTBar := ::qMdiToolbarL aBtn := {} - aadd( aBtn, ::buildToolButton( qTBar, { "Undo" , "undo" , {|| ::oEM:undo() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Redo" , "redo" , {|| ::oEM:redo() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, {} ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Cut" , "cut" , {|| ::oEM:cut() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Copy" , "copy" , {|| ::oEM:copy() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Paste" , "paste" , {|| ::oEM:paste() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Select all" , "selectall" , {|| ::oEM:seletAll() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Selection mode" , "stream" , {|| ::oEM:toggleSelectionMode() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, {} ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Find / Replace" , "find" , {|| ::oEM:find() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Mark" , "placeremovemark" , {|| ::oEM:setMark() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Goto Line" , "gotoline" , {|| ::oEM:goTo() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, {} ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Move Current Line Up" , "movelineup" , {|| ::oEM:moveLine( -1 ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Move Current Line Down" , "movelinedown" , {|| ::oEM:moveLine( 1 ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Delete Current Line" , "deleteline" , {|| ::oEM:deleteLine() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Duplicate Current Line" , "duplicateline" , {|| ::oEM:duplicateLine() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, {} ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "To Upper" , "toupper" , {|| ::oEM:convertSelection( "ToUpper" ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "To Lower" , "tolower" , {|| ::oEM:convertSelection( "ToLower" ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Invert Case" , "invertcase" , {|| ::oEM:convertSelection( "Invert" ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Block Comment" , "blockcomment" , {|| ::oEM:blockComment() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Stream Comment" , "streamcomment" , {|| ::oEM:streamComment() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Indent Right" , "blockindentr" , {|| ::oEM:indent( 1 ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Indent Left" , "blockindentl" , {|| ::oEM:indent( -1 ) }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Single to Double Quotes" , "sgl2dblquote" , {|| ::oEM:convertDQuotes() }, .f. } ) ) - aadd( aBtn, ::buildToolButton( qTBar, { "Double to Single Quotes" , "dbl2sglquote" , {|| ::oEM:convertQuotes() }, .f. } ) ) - +#if 1 + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle tabbed view" , "view_tabbed" , {|| ::execEvent( "buttonViewTabbed_clicked" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "View as arranged" , "view_organized" , {|| ::execEvent( "buttonViewOrganized_clicked" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "View as cascaded" , "view_cascaded" , {|| ::execEvent( "buttonViewCascaded_clicked" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "View as tiled" , "view_tiled" , {|| ::execEvent( "buttonViewTiled_clicked" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Save layout" , "save" , {|| ::execEvent( "buttonSaveLayout_clicked" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Line Numbers" , "togglelinenumber", {|| ::oEM:toggleLineNumbers() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Horizontal Ruler" , "horzruler" , {|| ::oEM:toggleHorzRuler() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Current Line Hilight", "curlinehilight" , {|| ::oEM:toggleCurrentLineHighlightMode() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Code Completion" , "help1" , {|| ::oEM:toggleCodeCompetion() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Completion Tips" , "infotips" , {|| ::oEM:toggleCompetionTips() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Zoom In" , "zoomin" , {|| ::oEM:zoom( +1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Zoom Out" , "zoomout" , {|| ::oEM:zoom( -1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) +#else + aadd( aBtn, ::buildToolButton( qTBar, { "Undo" , "undo" , {|| ::oEM:undo() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Redo" , "redo" , {|| ::oEM:redo() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Cut" , "cut" , {|| ::oEM:cut() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Copy" , "copy" , {|| ::oEM:copy() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Paste" , "paste" , {|| ::oEM:paste() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Select all" , "selectall" , {|| ::oEM:seletAll() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Selection mode" , "stream" , {|| ::oEM:toggleSelectionMode() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Find / Replace" , "find" , {|| ::oEM:find() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Mark" , "placeremovemark" , {|| ::oEM:setMark() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Goto Line" , "gotoline" , {|| ::oEM:goTo() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Move Current Line Up" , "movelineup" , {|| ::oEM:moveLine( -1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Move Current Line Down" , "movelinedown" , {|| ::oEM:moveLine( 1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Delete Current Line" , "deleteline" , {|| ::oEM:deleteLine() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Duplicate Current Line" , "duplicateline" , {|| ::oEM:duplicateLine() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "To Upper" , "toupper" , {|| ::oEM:convertSelection( "ToUpper" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "To Lower" , "tolower" , {|| ::oEM:convertSelection( "ToLower" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Invert Case" , "invertcase" , {|| ::oEM:convertSelection( "Invert" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Block Comment" , "blockcomment" , {|| ::oEM:blockComment() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Stream Comment" , "streamcomment" , {|| ::oEM:streamComment() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Indent Right" , "blockindentr" , {|| ::oEM:indent( 1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Indent Left" , "blockindentl" , {|| ::oEM:indent( -1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Single to Double Quotes" , "sgl2dblquote" , {|| ::oEM:convertDQuotes() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Double to Single Quotes" , "dbl2sglquote" , {|| ::oEM:convertQuotes() }, .f. } ) ) +#endif ::aBtnLines := aBtn RETURN Self @@ -826,6 +882,41 @@ METHOD IdeDocks:buildMdiToolbar() ::qMdiToolbar:addWidget( ::oIde:oTM:buildPanelsButton() ) ::qMdiToolbar:addWidget( sp0 ) +#if 1 + aadd( aBtn, ::buildToolButton( qTBar, { "Undo" , "undo" , {|| ::oEM:undo() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Redo" , "redo" , {|| ::oEM:redo() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Cut" , "cut" , {|| ::oEM:cut() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Copy" , "copy" , {|| ::oEM:copy() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Paste" , "paste" , {|| ::oEM:paste() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Select all" , "selectall" , {|| ::oEM:seletAll() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Selection mode" , "stream" , {|| ::oEM:toggleSelectionMode() }, .f. } ) ) + ::qMdiToolbar:addWidget( sp1 ) +// aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Find / Replace" , "find" , {|| ::oEM:find() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Toggle Mark" , "placeremovemark" , {|| ::oEM:setMark() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Goto Line" , "gotoline" , {|| ::oEM:goTo() }, .f. } ) ) +// aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + ::qMdiToolbar:addWidget( sp2 ) + aadd( aBtn, ::buildToolButton( qTBar, { "Move Current Line Up" , "movelineup" , {|| ::oEM:moveLine( -1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Move Current Line Down" , "movelinedown" , {|| ::oEM:moveLine( 1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Delete Current Line" , "deleteline" , {|| ::oEM:deleteLine() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Duplicate Current Line" , "duplicateline" , {|| ::oEM:duplicateLine() }, .f. } ) ) + ::qMdiToolbar:addWidget( sp3 ) +// aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "To Upper" , "toupper" , {|| ::oEM:convertSelection( "ToUpper" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "To Lower" , "tolower" , {|| ::oEM:convertSelection( "ToLower" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Invert Case" , "invertcase" , {|| ::oEM:convertSelection( "Invert" ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Block Comment" , "blockcomment" , {|| ::oEM:blockComment() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Stream Comment" , "streamcomment" , {|| ::oEM:streamComment() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Indent Right" , "blockindentr" , {|| ::oEM:indent( 1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Indent Left" , "blockindentl" , {|| ::oEM:indent( -1 ) }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, {} ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Single to Double Quotes" , "sgl2dblquote" , {|| ::oEM:convertDQuotes() }, .f. } ) ) + aadd( aBtn, ::buildToolButton( qTBar, { "Double to Single Quotes" , "dbl2sglquote" , {|| ::oEM:convertQuotes() }, .f. } ) ) +#else aadd( aBtn, ::buildToolButton( qTBar, { "Toggle tabbed view" , "view_tabbed" , {|| ::execEvent( "buttonViewTabbed_clicked" ) }, .f. } ) ) aadd( aBtn, ::buildToolButton( qTBar, {} ) ) aadd( aBtn, ::buildToolButton( qTBar, { "View as arranged" , "view_organized" , {|| ::execEvent( "buttonViewOrganized_clicked" ) }, .f. } ) ) @@ -844,6 +935,7 @@ METHOD IdeDocks:buildMdiToolbar() aadd( aBtn, ::buildToolButton( qTBar, { "Zoom In" , "zoomin" , {|| ::oEM:zoom( +1 ) }, .f. } ) ) aadd( aBtn, ::buildToolButton( qTBar, {} ) ) aadd( aBtn, ::buildToolButton( qTBar, { "Zoom Out" , "zoomout" , {|| ::oEM:zoom( -1 ) }, .f. } ) ) +#endif ::aMdiToolBtns := aBtn @@ -960,6 +1052,8 @@ METHOD IdeDocks:buildViewWidget( cView ) qMdi:setWidget( oFrame:oWidget ) qMdi:show() ::oStackedWidget:oWidget:addSubWindow( qMdi ) + ::connect( qMdi, "windowStateChanged(Qt::WindowStates,Qt::WindowStates)", ; + {|p,p1| ::execEvent( "mdiSubWindow_windowStateChanged", qMdi, { p, p1 } ) } ) ::setView( cView ) ELSE @@ -1020,6 +1114,12 @@ METHOD IdeDocks:buildUpDownWidget() ::oIde:oUpDn := IdeUpDown():new( ::oIde ):create() ::oUpDn:oUI:hide() + IF ::oIde:lCurEditsMdi + ::oUpDn:oUI:setParent( ::qMdiToolbarL ) + ::oUpDn:oUI:show() + ::qMdiToolbarL:addWidget( ::oUpDn:oUI:oWidget ) + ::oUpDn:oUI:hide() + ENDIF RETURN Self diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index 9b6d194f06..bba5c1a493 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -115,13 +115,21 @@ METHOD IdeUpDown:show() LOCAL oEdit IF !empty( oEdit := ::oEM:getEditObjectCurrent() ) - ::position() - - oEdit:qEdit:hbGetSelectionInfo() - IF oEdit:aSelectionInfo[ 1 ] > -1 - ::oUI:show() + IF ::oIde:lCurEditsMdi + oEdit:qEdit:hbGetSelectionInfo() + IF oEdit:aSelectionInfo[ 1 ] > -1 + ::oUI:setEnabled( .t. ) + ELSE + ::oUI:setEnabled( .f. ) + ENDIF ELSE - ::oUI:hide() + ::position() + oEdit:qEdit:hbGetSelectionInfo() + IF oEdit:aSelectionInfo[ 1 ] > -1 + ::oUI:show() + ELSE + ::oUI:hide() + ENDIF ENDIF ENDIF @@ -135,12 +143,14 @@ METHOD IdeUpDown:create( oIde ) ::oIde := oIde - ::oUI := hbide_getUI( "updown", ::oIde:oDlg:oWidget ) + IF ::oIde:lCurEditsMdi + ::oUI := hbide_getUI( "updown_v" ) + ELSE + ::oUI := hbide_getUI( "updown", ::oIde:oDlg:oWidget ) + ENDIF ::oUI:setWindowFlags( hb_bitOr( Qt_Tool, Qt_FramelessWindowHint ) ) ::oUI:setFocusPolicy( Qt_NoFocus ) - //::oUI:setMaximumWidth( 75 ) - //::oUI:setMaximumHeight( 25 ) ::oUI:q_buttonPrev:setIcon( hbide_image( "go-prev" ) ) ::oUI:q_buttonPrev:setToolTip( "Find Previous" ) diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index 2e1678db9d..515cdcf001 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -2021,6 +2021,9 @@ FUNCTION hbide_getUI( cUI, qParent ) CASE "updown" oUI := iif( nModeUI == UI_MODE_FUNC, hbqtui_UpDown( qParent ), NIL ) EXIT + CASE "updown_v" + oUI := iif( nModeUI == UI_MODE_FUNC, hbqtui_UpDown_v( qParent ), NIL ) + EXIT CASE "searchreplace" oUI := iif( nModeUI == UI_MODE_FUNC, hbqtui_SearchReplace( qParent ), NIL ) EXIT diff --git a/harbour/contrib/hbide/updown_v.ui b/harbour/contrib/hbide/updown_v.ui new file mode 100644 index 0000000000..80236e96ca --- /dev/null +++ b/harbour/contrib/hbide/updown_v.ui @@ -0,0 +1,86 @@ + + + Form + + + + 0 + 0 + 78 + 116 + + + + Form + + + + 3 + + + 0 + + + 2 + + + 0 + + + 2 + + + + + ... + + + true + + + + + + + ... + + + true + + + + + + + ... + + + true + + + + + + + ... + + + true + + + + + + + ... + + + true + + + + + + + +