diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2bcf5c5047..82672f2f88 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,27 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-16 18:31 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + + contrib/hbide/resources/cutb16.png + + contrib/hbide/resources/dbl2sglquote.png + + contrib/hbide/resources/decreaseindent.png + + contrib/hbide/resources/down16.png + + contrib/hbide/resources/increaseindent.png + + contrib/hbide/resources/sgl2dblquote.png + + contrib/hbide/resources/up16.png + + * contrib/hbide/idedocks.prg + + Implemented left-side toolbar containing available panels + distinguished by suble color change. Click on one will + bring forward the relevant tabs-panel. Tooltip describes + which panel it is. + + Implemented left-side another toolbar underneath above one + giving access to line and block actions. + + ;NOTE: Please test and forward suggessions. + ;REQUEST: Can someone provide relevant .png's to these actions ? + I am really poor in drafting something meaningful. + 2010-02-17 03:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/legacycd.c ! Fixed GETPROCADDRESS() for WinCE after recent changes. diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index bccfd11dbb..dd98b3f4a7 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -75,6 +75,8 @@ CLASS IdeDocks INHERIT IdeObject DATA nPass INIT 0 + DATA aPanels INIT {} + DATA aBtnLines INIT {} METHOD new( oIde ) METHOD create( oIde ) @@ -104,6 +106,8 @@ CLASS IdeDocks INHERIT IdeObject METHOD getMarkWidget( nIndex ) METHOD dispEnvironment( cEnviron ) METHOD execSkeleton( nMode, p ) + METHOD addPanelButton( cPanel ) + METHOD disblePanelButton( qTBtn ) ENDCLASS @@ -129,6 +133,7 @@ METHOD IdeDocks:create( oIde ) METHOD IdeDocks:destroy() LOCAL oUI := ::oIde:oSkeltnUI + LOCAL qTBtn ::disconnect( oUI:q_buttonNew , "clicked()" ) ::disconnect( oUI:q_buttonRename, "clicked()" ) @@ -142,47 +147,35 @@ METHOD IdeDocks:destroy() /* Initiate more destructors */ + FOR EACH qTBtn IN ::aPanels + ::disconnect( qTBtn, "clicked()" ) + qTBtn := NIL + NEXT + + RETURN Self /*----------------------------------------------------------------------*/ -METHOD IdeDocks:setView( cView ) - LOCAL n +METHOD IdeDocks:buildDockWidgets() - SWITCH cView + ::buildToolBarPanels() - CASE "New..." - cView := hbide_fetchAString( ::qViewsCombo, cView, "Name the View", "New View" ) - IF cView != "New..." - IF ascan( ::aINI[ INI_VIEWS ], {|e| e == cView } ) > 0 - MsgBox( "View: " + cView + ", already exists" ) - ELSE - aadd( ::aINI[ INI_VIEWS ], cView ) - ::qViewsCombo:addItem( cView ) - ::buildViewWidget() - ::oStackedWidget:oWidget:setCurrentIndex( len( ::aINI[ INI_VIEWS ] ) ) - ::oIde:cWrkView := cView - ENDIF - ENDIF - EXIT + ::buildProjectTree() + ::buildEditorTree() + ::buildFuncList() + ::buildCompileResults() + ::buildLinkResults() + ::buildOutputResults() + ::buildHelpWidget() + ::buildSkeletonWidget() - CASE "Main" - ::oIde:nCurView := 0 - ::oIde:qTabWidget := ::aViews[ ::nCurView + 1 ]:oTabWidget:oWidget - ::oIde:oTabParent := ::aViews[ ::nCurView + 1 ] - ::oStackedWidget:oWidget:setCurrentIndex( 0 ) - ::oIde:cWrkView := "Main" - EXIT +* ::buildFindInFiles() - OTHERWISE - IF ( n := ascan( ::aINI[ INI_VIEWS ], cView ) ) > 0 - ::oStackedWidget:oWidget:setCurrentIndex( n ) /* Note: n is always base of zero as main == 1 */ - ::oIde:cWrkView := cView - ENDIF - EXIT - ENDSWITCH + ::oDlg:oWidget:tabifyDockWidget( ::oDockB:oWidget , ::oDockB1:oWidget ) + ::oDlg:oWidget:tabifyDockWidget( ::oDockB1:oWidget, ::oDockB2:oWidget ) - RETURN NIL + RETURN Self /*----------------------------------------------------------------------*/ @@ -323,42 +316,127 @@ METHOD IdeDocks:buildViewWidget() /*----------------------------------------------------------------------*/ -METHOD IdeDocks:buildDockWidgets() +METHOD IdeDocks:setView( cView ) + LOCAL n - ::buildToolBarPanels() + SWITCH cView - ::buildProjectTree() - ::buildEditorTree() - ::buildFuncList() - ::buildCompileResults() - ::buildLinkResults() - ::buildOutputResults() - ::buildHelpWidget() - ::buildSkeletonWidget() + CASE "New..." + cView := hbide_fetchAString( ::qViewsCombo, cView, "Name the View", "New View" ) + IF cView != "New..." + IF ascan( ::aINI[ INI_VIEWS ], {|e| e == cView } ) > 0 + MsgBox( "View: " + cView + ", already exists" ) + ELSE + aadd( ::aINI[ INI_VIEWS ], cView ) + ::qViewsCombo:addItem( cView ) + ::buildViewWidget() + ::oStackedWidget:oWidget:setCurrentIndex( len( ::aINI[ INI_VIEWS ] ) ) + ::oIde:cWrkView := cView + ENDIF + ENDIF + EXIT -* ::buildFindInFiles() + CASE "Main" + ::oIde:nCurView := 0 + ::oIde:qTabWidget := ::aViews[ ::nCurView + 1 ]:oTabWidget:oWidget + ::oIde:oTabParent := ::aViews[ ::nCurView + 1 ] + ::oStackedWidget:oWidget:setCurrentIndex( 0 ) + ::oIde:cWrkView := "Main" + EXIT - ::oDlg:oWidget:tabifyDockWidget( ::oDockB:oWidget , ::oDockB1:oWidget ) - ::oDlg:oWidget:tabifyDockWidget( ::oDockB1:oWidget, ::oDockB2:oWidget ) + OTHERWISE + IF ( n := ascan( ::aINI[ INI_VIEWS ], cView ) ) > 0 + ::oStackedWidget:oWidget:setCurrentIndex( n ) /* Note: n is always base of zero as main == 1 */ + ::oIde:cWrkView := cView + ENDIF + EXIT + ENDSWITCH + + RETURN NIL + +/*----------------------------------------------------------------------*/ + +METHOD IdeDocks:disblePanelButton( qTBtn ) + LOCAL q + + FOR EACH q IN ::aPanels + q:setEnabled( !( q == qTBtn ) ) + NEXT + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeDocks:addPanelButton( cPanel ) + LOCAL qTBtn, aColors, nIndex + #if 0 /* Royal Blue */ + aColors := { ; + "#000073" , ; + "#000080" , ; + "#19198D" , ; + "#333399" , ; + "#4D4DA6" , ; + "#6666B3" , ; + "#8080C0" , ; + "#9999CC" , ; + "#B2B2D9" , ; + "#CCCCE6" , ; + "#E6E6F2" ; + } + #endif + #if 0 /* Turquish */ + aColors := { ; + "#009999" , ; + "#19A3A3" , ; + "#33ADAD" , ; + "#4DB8B8" , ; + "#66C2C2" , ; + "#80CCCC" , ; + "#99D6D6" , ; + "#B2E0E0" , ; + "#CCEBEB" , ; + "#E6F5F5" ; + } + #endif + + aColors := { ; + "#996633" , ; + "#A37547" , ; + "#AD855C" , ; + "#B89470" , ; + "#C2A385" , ; + "#CCB299" , ; + "#D6C2AD" , ; + "#E0D1C2" , ; + "#EBE0D6" , ; + "#F5F0EB" ; + } + + + IF cPanel == "Main" + nIndex := 0 + ELSE + nIndex := len( ::aPanels ) - 1 + ENDIF + + qTBtn := QToolButton():new() + qTBtn:setMaximumHeight( 12 ) + qTBtn:setMaximumWidth( 18 ) + qTBtn:setTooltip( "Panel: " + cPanel ) + qTBtn:setStyleSheet( "background-color: " + aColors[ nIndex + 1 ] + " ;" ) + + ::connect( qTBtn, "clicked()", {|| ::disblePanelButton( qTBtn ), ::setView( cPanel ) } ) + ::qTBarPanels:addWidget( qTBtn ) + + aadd( ::aPanels, qTBtn ) RETURN Self /*----------------------------------------------------------------------*/ METHOD IdeDocks:buildToolBarPanels() - LOCAL qAct, i, s, qSize, qA - #if 0 - LOCAL aColors := { "rgb( 0,0,212 )" , "rgb( 0,0,255 )" , "rgb( 40,40,255 )", ; - "rgb( 80,80,255 )", "rgb( 120,120,255 )", "rgb( 160,160,255 )" } - #else - //LOCAL aColors := { "rgb(128,64,64)","rgb(128,0,0)","rgb(255,128,64)","rgb(128,128,64)","rgb(255,128,128)","rgb(225,128,0)" } - LOCAL aColors := { "rgb(255,128,64)","rgb(225,225,0)" ,"rgb(0,128,128)",; - "rgb(190,115,65)","rgb(80,175,120)","rgb(17,122,238)" } - #endif + LOCAL s, qSize, qTBtn, a_, aBtns - STATIC aPanels := {} - - qSize := QSize():new( 16,16 ) + qSize := QSize():new( 20,20 ) ::oIde:qTBarPanels := QToolBar():new() ::qTBarPanels:setObjectName( "ToolBar_Panels" ) @@ -367,31 +445,60 @@ METHOD IdeDocks:buildToolBarPanels() ::qTBarPanels:setIconSize( qSize ) ::qTBarPanels:setMovable( .f. ) ::qTBarPanels:setFloatable( .f. ) + ::qTBarPanels:setStyleSheet( "QToolBar { spacing: 1px; color: white; margin-top: 2px; }" ) ::oDlg:oWidget:addToolBar( Qt_LeftToolBarArea, ::qTBarPanels ) - qAct := QToolButton():new( ::qTBarPanels ) - qAct:setMaximumHeight( 12 ) - qAct:setMaximumWidth( 20 ) - qAct:setTooltip( "Panel: Main" ) - //qAct:setStyleSheet( "background-color: rgb( 0,0,175 );" ) - qAct:setStyleSheet( "background-color: rgb( 132,66,0 );" ) - aadd( aPanels, qAct ) - qA := QAction():from( ::qTBarPanels:addWidget( qAct ) ) - qA:setCheckable( .t. ) - i := 0 + ::addPanelButton( "Main" ) FOR EACH s IN ::aINI[ INI_VIEWS ] -* ::qTBarPanels:addSeparator() - qAct := QToolButton():new( ::qTBarPanels ) - qAct:setMaximumHeight( 12 ) - qAct:setMaximumWidth( 20 ) - qAct:setTooltip( "Panel: " + s ) - qAct:setStyleSheet( "background-color: " + aColors[ ++i ] + ";" ) - IF i >= len( aColors ) - i := 0 - ENDIF - aadd( aPanels, qAct ) - ::qTBarPanels:addWidget( qAct ) + ::addPanelButton( s ) + NEXT + + /* Toolbar Line Actions */ + ::oDlg:oWidget:addToolBarBreak( Qt_LeftToolBarArea ) + + ::oIde:qTBarLines := QToolBar():new() + ::qTBarLines:setObjectName( "ToolBar_Lines" ) + ::qTBarLines:setAllowedAreas( Qt_LeftToolBarArea ) + ::qTBarLines:setOrientation( Qt_Vertical ) + ::qTBarLines:setIconSize( qSize ) + ::qTBarLines:setMovable( .f. ) + ::qTBarLines:setFloatable( .f. ) + + ::oDlg:oWidget:addToolBar( Qt_LeftToolBarArea, ::qTBarLines ) + + aBtns := {} + aadd( aBtns, { "up16" , "Move Current Line Up" , {|| ::oEM:moveLine( -1 ) } } ) + aadd( aBtns, { "down16" , "Move Current Line Down", {|| ::oEM:moveLine( 1 ) } } ) + aadd( aBtns, { "cutb16" , "Delete Current Line" , {|| ::oEM:deleteLine() } } ) + aadd( aBtns, { "copy" , "Duplicate Current Line", {|| ::oEM:duplicateLine() } } ) + FOR EACH a_ IN aBtns + qTBtn := QToolButton():new() + qTBtn:setTooltip( a_[ 2 ] ) + qTBtn:setIcon( ::resPath + a_[ 1 ] + ".png" ) + qTBtn:setMaximumWidth( 20 ) + qTBtn:setMaximumHeight( 20 ) + ::connect( qTBtn, "clicked()", a_[ 3 ] ) + ::qTBarLines:addWidget( qTBtn ) + aadd( ::aBtnLines, qTBtn ) + NEXT + + + aBtns := {} + aadd( aBtns, { "commentout" , "Block Comment" , {|| ::oEM:blockComment() } } ) + aadd( aBtns, { "increaseindent", "Indent Right" , {|| ::oEM:indent( 1 ) } } ) + aadd( aBtns, { "decreaseindent", "Indent Left" , {|| ::oEM:indent( -1 ) } } ) + aadd( aBtns, { "sgl2dblquote" , "Single to Double Quotes", {|| ::oEM:convertDQuotes() } } ) + aadd( aBtns, { "dbl2sglquote" , "Double to Single Quotes", {|| ::oEM:convertQuotes() } } ) + FOR EACH a_ IN aBtns + qTBtn := QToolButton():new() + qTBtn:setTooltip( a_[ 2 ] ) + qTBtn:setIcon( ::resPath + a_[ 1 ] + ".png" ) + qTBtn:setMaximumWidth( 20 ) + qTBtn:setMaximumHeight( 20 ) + ::connect( qTBtn, "clicked()", a_[ 3 ] ) + ::qTBarLines:addWidget( qTBtn ) + aadd( ::aBtnLines, qTBtn ) NEXT RETURN Self diff --git a/harbour/contrib/hbide/resources/cutb16.png b/harbour/contrib/hbide/resources/cutb16.png new file mode 100644 index 0000000000..4467d55136 Binary files /dev/null and b/harbour/contrib/hbide/resources/cutb16.png differ diff --git a/harbour/contrib/hbide/resources/dbl2sglquote.png b/harbour/contrib/hbide/resources/dbl2sglquote.png new file mode 100644 index 0000000000..f37eb95af5 Binary files /dev/null and b/harbour/contrib/hbide/resources/dbl2sglquote.png differ diff --git a/harbour/contrib/hbide/resources/decreaseindent.png b/harbour/contrib/hbide/resources/decreaseindent.png new file mode 100644 index 0000000000..0c76129b7b Binary files /dev/null and b/harbour/contrib/hbide/resources/decreaseindent.png differ diff --git a/harbour/contrib/hbide/resources/down16.png b/harbour/contrib/hbide/resources/down16.png new file mode 100644 index 0000000000..c63e82684b Binary files /dev/null and b/harbour/contrib/hbide/resources/down16.png differ diff --git a/harbour/contrib/hbide/resources/increaseindent.png b/harbour/contrib/hbide/resources/increaseindent.png new file mode 100644 index 0000000000..26aa95647f Binary files /dev/null and b/harbour/contrib/hbide/resources/increaseindent.png differ diff --git a/harbour/contrib/hbide/resources/sgl2dblquote.png b/harbour/contrib/hbide/resources/sgl2dblquote.png new file mode 100644 index 0000000000..f3bb1fde63 Binary files /dev/null and b/harbour/contrib/hbide/resources/sgl2dblquote.png differ diff --git a/harbour/contrib/hbide/resources/up16.png b/harbour/contrib/hbide/resources/up16.png new file mode 100644 index 0000000000..9ef0cb9679 Binary files /dev/null and b/harbour/contrib/hbide/resources/up16.png differ