diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 52cbf8f04d..edad5a327b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-16 09:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/hbide.prg + * contrib/hbide/ideactions.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/idefindreplace.prg + * contrib/hbide/ideobject.prg + * contrib/hbide/ideprojmanager.prg + * contrib/hbide/idestylesheets.prg + + Started left-hand toolbar(s) to present visual interactions for + a number of hidden actions. A work-in-progress. + + * contrib/hbqt/THbQtUI.prg + ! Fixed object destruction sequence per latest changes in HbQtUI() class. + 2010-02-16 16:29 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/wce_smsc.c ! Fixed to skip content for msvc 2003 in C mode. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index a440ec0a31..f11175023d 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -164,6 +164,9 @@ CLASS HbIde DATA qBrushWrkProject DATA qProcess DATA qHelpBrw + DATA qTBarSlctns + DATA qTBarLines + DATA qTBarPanels ACCESS oCurEditor INLINE ::oEM:getEditorCurrent() ACCESS qCurEdit INLINE ::oEM:getEditCurrent() @@ -424,10 +427,12 @@ METHOD HbIde:create( cProjIni ) IF !empty( ::qCurEdit ) ::oFR:show() ENDIF + CASE ::mp1 == xbeK_CTRL_N IF !empty( ::qCurEdit ) ::oFR:find() ENDIF + CASE ::mp1 == xbeK_CTRL_R IF !empty( ::qCurEdit ) ::oFR:replace() @@ -456,8 +461,8 @@ METHOD HbIde:create( cProjIni ) hbide_dbg( "After ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) hbide_dbg( "======================================================" ) - ::qCursor:pPtr := NIL - ::oFont := NIL + ::qCursor := NIL + ::oFont := NIL hbide_dbg( "EXITING after destroy ....", memory( 1001 ), hbqt_getMemUsed() ) diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 7114581bd5..a71d5629c3 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -368,6 +368,8 @@ METHOD IdeActions:buildToolBar() oTBar:addItem( , , , , , nSep ) oTBar:oWidget:setAllowedAreas( Qt_TopToolBarArea ) + oTBar:oWidget:setMovable( .f. ) + oTBar:oWidget:setFloatable( .f. ) /* ComboBox to Manage Views */ ::oIde:qViewsCombo := QComboBox():new() diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 0a69431be0..bccfd11dbb 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -81,6 +81,7 @@ CLASS IdeDocks INHERIT IdeObject METHOD destroy() METHOD execEvent( nMode, p ) METHOD setView( cView ) + METHOD buildToolBarPanels() METHOD buildHelpWidget() METHOD buildSkeletonWidget() METHOD buildDialog() @@ -324,16 +325,19 @@ METHOD IdeDocks:buildViewWidget() METHOD IdeDocks:buildDockWidgets() + ::buildToolBarPanels() + ::buildProjectTree() ::buildEditorTree() ::buildFuncList() ::buildCompileResults() ::buildLinkResults() ::buildOutputResults() - * ::buildFindInFiles() ::buildHelpWidget() ::buildSkeletonWidget() +* ::buildFindInFiles() + ::oDlg:oWidget:tabifyDockWidget( ::oDockB:oWidget , ::oDockB1:oWidget ) ::oDlg:oWidget:tabifyDockWidget( ::oDockB1:oWidget, ::oDockB2:oWidget ) @@ -341,6 +345,59 @@ METHOD IdeDocks:buildDockWidgets() /*----------------------------------------------------------------------*/ +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 + + STATIC aPanels := {} + + qSize := QSize():new( 16,16 ) + + ::oIde:qTBarPanels := QToolBar():new() + ::qTBarPanels:setObjectName( "ToolBar_Panels" ) + ::qTBarPanels:setAllowedAreas( Qt_LeftToolBarArea ) + ::qTBarPanels:setOrientation( Qt_Vertical ) + ::qTBarPanels:setIconSize( qSize ) + ::qTBarPanels:setMovable( .f. ) + ::qTBarPanels:setFloatable( .f. ) + + ::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 + 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 ) + NEXT + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeDocks:buildProjectTree() LOCAL i @@ -360,7 +417,7 @@ METHOD IdeDocks:buildProjectTree() ::oProjTree:setStyleSheet( GetStyleSheet( "QTreeWidgetHB" ) ) - //::oProjTree:itemMarked := {|oItem| ::manageItemSelected( 0, oItem ), ::oCurProjItem := oItem } + * ::oProjTree:itemMarked := {|oItem| ::manageItemSelected( 0, oItem ), ::oCurProjItem := oItem } ::oProjTree:itemMarked := {|oItem| ::oIde:oCurProjItem := oItem, ::oIde:manageFocusInEditor() } ::oProjTree:itemSelected := {|oItem| ::oIde:manageItemSelected( oItem ) } ::oProjTree:hbContextMenu := {|mp1, mp2, oXbp| ::oIde:manageProjectContext( mp1, mp2, oXbp ) } @@ -484,6 +541,7 @@ METHOD IdeDocks:buildHelpWidget() ::oHelp:oWidget:setAllowedAreas( Qt_RightDockWidgetArea ) ::oHelp:oWidget:setWindowTitle( "hbIDE Help" ) ::oHelp:oWidget:setFocusPolicy( Qt_NoFocus ) + ::oHelp:oWidget:setStyleSheet( getStyleSheet( "QDockWidget" ) ) ::oIde:qHelpBrw := QTextBrowser():new( ::oHelp:oWidget ) ::qHelpBrw:show() @@ -790,6 +848,7 @@ METHOD IdeDocks:buildSkeletonWidget() ::oSkeltn:oWidget:setAllowedAreas( Qt_RightDockWidgetArea ) ::oSkeltn:oWidget:setWindowTitle( "Code Skeletons" ) ::oSkeltn:oWidget:setFocusPolicy( Qt_NoFocus ) + ::oSkeltn:oWidget:setStyleSheet( getStyleSheet( "QDockWidget" ) ) ::oIde:oSkeltnUI := HbQtUI():new( ::oIde:resPath + "skeletons.uic", ::oSkeltn:oWidget ):build() diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index d80a371a44..19d6c9c670 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -462,7 +462,7 @@ METHOD IdeFindInFiles:create( oIde, lShowOnCreate ) ::oUI:q_editResults:setReadOnly( .t. ) //::oUI:q_editResults:setFontFamily( "Courier New" ) //::oUI:q_editResults:setFontPointSize( 10 ) - ::oUI:q_editResults:setFont( ::oFont:oWidget ) + //::oUI:q_editResults:setFont( ::oIde:oFont:oWidget ) ::oUI:q_editResults:setContextMenuPolicy( Qt_CustomContextMenu ) ::oUI:q_labelStatus:setText( "Ready" ) diff --git a/harbour/contrib/hbide/ideobject.prg b/harbour/contrib/hbide/ideobject.prg index ef037d62ec..e71bd6adc5 100644 --- a/harbour/contrib/hbide/ideobject.prg +++ b/harbour/contrib/hbide/ideobject.prg @@ -113,6 +113,10 @@ CLASS IdeObject ACCESS qViewsCombo INLINE ::oIde:qViewsCombo ACCESS qHelpBrw INLINE ::oIde:qHelpBrw + ACCESS qTBarSlctns INLINE ::oIde:qTBarSlctns + ACCESS qTBarLines INLINE ::oIde:qTBarLines + ACCESS qTBarPanels INLINE ::oIde:qTBarPanels + ACCESS cWrkProject INLINE ::oIde:cWrkProject ACCESS cWrkTheme INLINE ::oIde:cWrkTheme ACCESS cWrkCodec INLINE ::oIde:cWrkCodec diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index cf94595d93..5bc0f3cc4c 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -586,7 +586,7 @@ METHOD IdeProjManager:fetchProperties() ::oUI:q_buttonSortZA :setIcon( ::resPath + "tolower.png" ) // tolower.png => ztoa.png ::oUI:q_buttonSortOrg:setIcon( ::resPath + "invertcase.png" ) // tolower.png => ztoa.png - ::oUI:signal( "buttonCn" , "clicked()", {|| ::lSaveOK := .f., ::oUI:oWidget:close() } ) + ::oUI:signal( "buttonCn" , "clicked()", {|| ::lSaveOK := .f., ::oUI:done( 0 ) } ) //oWidget:close() } ) ::oUI:signal( "buttonSave" , "clicked()", {|| ::lSaveOK := .t., ::save( .F. ) } ) ::oUI:signal( "buttonSaveExit" , "clicked()", {|| ::lSaveOK := .t., ::save( .T. ) } ) // @@ -644,10 +644,10 @@ METHOD IdeProjManager:fetchProperties() // ::oUI:exec() // - ::aIni[ INI_HBIDE, PropsDialogGeometry ] := hbide_posAndSize( ::oUI:oWidget ) +// ::aIni[ INI_HBIDE, PropsDialogGeometry ] := hbide_posAndSize( ::oUI:oWidget ) + ::aIni[ INI_HBIDE, PropsDialogGeometry ] := hbide_posAndSize( ::oUI ) ::oUI:destroy() - ::oUI := NIL ::manageFocusInEditor() @@ -742,7 +742,7 @@ METHOD IdeProjManager:save( lCanClose ) ENDIF IF lCanClose .AND. lOk - ::oUI:oWidget:close() + ::oUI:done( 1 ) ENDIF RETURN lOk diff --git a/harbour/contrib/hbide/idestylesheets.prg b/harbour/contrib/hbide/idestylesheets.prg index a354abe351..5a37c68dee 100644 --- a/harbour/contrib/hbide/idestylesheets.prg +++ b/harbour/contrib/hbide/idestylesheets.prg @@ -304,6 +304,17 @@ FUNCTION GetStyleSheet( cWidget ) aadd( txt_, ' stop:0 white, stop:1 lightblue); ' ) aadd( txt_, ' } ' ) + CASE cWidget == "QDockWidget" + + aadd( txt_, 'QDockWidget { ' ) + aadd( txt_, ' border: 1px solid lightgray; ' ) + aadd( txt_, ' } ' ) + //aadd( txt_, 'QDockWidget::title { ' ) + //aadd( txt_, ' text-align: left; /* align the text to the left */ ' ) + //aadd( txt_, ' background: darkgray; ' ) + //aadd( txt_, ' padding-left: 5px; ' ) + //aadd( txt_, ' } ' ) + ENDCASE aeval( txt_, {|e| s += trim( e ) + chr( 13 ) + chr( 10 ) } ) diff --git a/harbour/contrib/hbqt/THbQtUI.prg b/harbour/contrib/hbqt/THbQtUI.prg index eeeed20883..eefdb30df6 100644 --- a/harbour/contrib/hbqt/THbQtUI.prg +++ b/harbour/contrib/hbqt/THbQtUI.prg @@ -139,7 +139,7 @@ METHOD HbQtUI:create( cFile, qParent ) /*----------------------------------------------------------------------*/ METHOD HbQtUI:destroy() - LOCAL a_, qObj + LOCAL a_ ::oWidget:hide() @@ -150,15 +150,35 @@ METHOD HbQtUI:destroy() Qt_Events_disConnect( ::pEvents, a_[ 1 ], a_[ 2 ] ) NEXT + #if 0 FOR EACH qObj IN ::qObj DESCEND - qObj := NIL + IF qObj:__enumIndex() > 1 +hbide_dbg( "HbQtUI:destroy()", 1, a_[ 1 ], a_[ 2 ] ) + qObj := NIL + ENDIF + NEXT + #endif + + FOR EACH a_ IN ::widgets DESCEND + IF a_:__enumIndex() > 1 + IF type( a_[ 3 ] ) == "UI" +#if 0 + .AND. ; + !( "Layout" $ a_[ 1 ] ) .AND. ; + ! a_[ 2 ] == "tabGeneral" .AND. ; + ! a_[ 1 ] $ "QSizePolicy,QTabWidget" +#endif +hbide_dbg( "HbQtUI:destroy()", 1, a_[ 1 ], a_[ 2 ] ) + ::qObj[ a_[ 2 ] ] := NIL + ENDIF + ENDIF NEXT ::oWidget:close() - ::oWidget := NIL - ::aEvents := NIL - ::aSignals := NIL + ::oWidget := NIL + ::aEvents := NIL + ::aSignals := NIL RETURN NIL @@ -274,6 +294,8 @@ METHOD HbQtUI:loadUI( cUiFull, qParent ) qUiLoader := NIL ENDIF + ::oWidget := oWidget + RETURN oWidget /*----------------------------------------------------------------------*/