2009-11-18 15:26 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbxbp/xbpgeneric.prg
    ! Change the way HBXBP_DEBUG() shows up the values. In my scheme of things 
      the whole HBQT's debug system is revolving around this way.

  * contrib/hbide/hbide.prg
    + More basic visual components to host different project elements.
      Keep on playing with it. I am gathering all pitfalls.
This commit is contained in:
Pritpal Bedi
2009-11-18 23:28:08 +00:00
parent 52da6a02a5
commit 77f0a7af87
3 changed files with 101 additions and 60 deletions

View File

@@ -17,6 +17,15 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-11-18 15:26 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbxbp/xbpgeneric.prg
! Change the way HBXBP_DEBUG() shows up the values. In my scheme of things
the whole HBQT's debug system is revolving around this way.
* contrib/hbide/hbide.prg
+ More basic visual components to host different project elements.
Keep on playing with it. I am gathering all pitfalls.
2009-11-18 22:41 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Added dependency tree to flat dependency list converter.

View File

@@ -120,12 +120,7 @@ PROCEDURE JustACall()
CLASS HbIde
DATA oDlg
DATA mp1, mp2, oXbp, nEvent
DATA oDa
DATA oSBar
DATA oMenu
DATA oTBar
DATA aTabs INIT {}
DATA cProjFile
@@ -133,8 +128,19 @@ CLASS HbIde
DATA nCurTab INIT 0
DATA nPrevTab INIT 0
/* HBQT Objects */
DATA qLayout
DATA qSplitter
/* XBP Objects */
DATA oDlg
DATA oDa
DATA oSBar
DATA oMenu
DATA oTBar
DATA oFont
DATA oProjTree
DATA oProjRoot
METHOD new( cProjectOrSource )
METHOD create( cProjectOrSource )
@@ -192,15 +198,34 @@ METHOD HbIde:create( cProjectOrSource )
::oDa := ::oDlg:drawingArea
::oDa:oTabWidget := XbpTabWidget():new( ::oDa, , ::oDa:aPos, ::oDa:aSize, , .t. ):create()
::oDa:oTabWidget := XbpTabWidget():new():create( ::oDa, , ::oDa:aPos, ::oDa:aSize, , .t. )
::oDa:oTabWidget:oWidget:setTabsClosable( .t. )
::qLayout := QBoxLayout():new()
::qLayout:setDirection( 0 )
::qSplitter := QSplitter():new( QT_PTROF( ::oDa:oWidget ) )
::oProjTree := XbpTreeView():new()
::oProjTree:hasLines := .T.
::oProjTree:hasButtons := .T.
::oProjTree:create( ::oDa, , { 0,0 }, { 10,10 }, , .t. )
::oProjRoot := ::oProjTree:rootItem:addItem( "Untitled" )
IF !empty( ::cProjFile )
::oProjRoot:addItem( ::cProjFile )
ENDIF
::oProjTree:setColorBG( GraMakeRGBColor( { 223,240,255 } ) )
::oProjTree:oWidget:setMaximumWidth( 200 )
::qLayout := QGridLayout():new()
::qLayout:setContentsMargins( 0,0,0,0 )
::qLayout:addWidget( QT_PTROFXBP( ::oDa:oTabWidget ) )
::qLayout:setHorizontalSpacing( 0 )
::qLayout:setVerticalSpacing( 0 )
#if 0
::qLayout:addWidget_1( QT_PTROFXBP( ::oProjTree ), 0, 0, 1, 1 )
::qLayout:addWidget_1( QT_PTROFXBP( ::oDa:oTabWidget ), 0, 1, 1, 1 )
#else
::qLayout:addWidget_1( QT_PTROF( ::qSplitter ), 0, 0, 1, 1 )
::qSplitter:addWidget( QT_PTROFXBP( ::oProjTree ) )
::qSplitter:addWidget( QT_PTROFXBP( ::oDa:oTabWidget ) )
#endif
::oDa:oWidget:setLayout( QT_PTROF( ::qLayout ) )
#if 0
@@ -209,8 +234,9 @@ METHOD HbIde:create( cProjectOrSource )
/* Place on the center of desktop */
::oDlg:setPos( { ( aSize[ 1 ] - ::oDlg:currentSize()[ 1 ] ) / 2, ;
( aSize[ 2 ] - ::oDlg:currentSize()[ 2 ] ) / 2 } )
#endif
#else
::oDlg:setPos( { 100, 60 } )
#endif
/* Editor's Font */
::oFont := XbpFont():new()
@@ -226,7 +252,8 @@ METHOD HbIde:create( cProjectOrSource )
/* Install Toolbar */
::buildToolBar()
::editSource()
/* This is only for demonstration. Final version will follow another mechanism */
::editSource( ::cProjFile )
::oDlg:Show()
@@ -237,6 +264,8 @@ METHOD HbIde:create( cProjectOrSource )
EXIT
ENDIF
HBXBP_DEBUG( ::nEvent, ::mp1, ::mp2 )
IF ( ::nEvent == xbeP_Close ) .OR. ( ::nEvent == xbeP_Keyboard .and. ::mp1 == xbeK_ESC )
IF ::nEvent == xbeP_Close
::closeAllSources()
@@ -259,19 +288,6 @@ METHOD HbIde:create( cProjectOrSource )
/*----------------------------------------------------------------------*/
METHOD HbIde:buildDialog()
::oDlg := XbpDialog():new( , , {10,10}, {900,500}, , .f. )
::oDlg:icon := s_resPath + "vr.png" //"hbide.ico"
::oDlg:title := "Harbour-Qt IDE"
::oDlg:create()
RETURN Self
/*----------------------------------------------------------------------*/
METHOD HbIde:buildTabPage( oWnd, cSource )
LOCAL aPos := { 5,5 }
LOCAL aSize := { 890, 420 }
@@ -422,23 +438,6 @@ METHOD HbIde:selectSource( cMode )
/*----------------------------------------------------------------------*/
METHOD HbIde:buildMenu()
LOCAL oMenuBar, oSubMenu
oMenuBar := SetAppWindow():MenuBar()
oSubMenu := XbpMenu():new( oMenuBar ):create()
oSubMenu:title := "~File"
oSubMenu:addItem( { "Open", {|| ::manageMenu( 1 ) } } )
oSubMenu:addItem( { "Save", {|| ::manageMenu( 2 ) } } )
oSubMenu:addItem( { NIL, NIL, XBPMENUBAR_MIS_SEPARATOR, NIL } )
oSubMenu:addItem( { "Exit", {|| ::manageMenu( 3 ) } } )
oMenuBar:addItem( { oSubMenu, NIL } )
Return Self
/*----------------------------------------------------------------------*/
METHOD HbIde:manageMenu( nMode )
DO CASE
@@ -450,6 +449,28 @@ METHOD HbIde:manageMenu( nMode )
/*----------------------------------------------------------------------*/
METHOD HbIde:manageToolbar( oButton )
LOCAL cFile
DO CASE
CASE oButton:key == "3"
IF !empty( cFile := ::selectSource( "open" ) )
::oProjRoot:addItem( cFile )
::editSource( cFile )
ENDIF
CASE oButton:key == "4"
::saveSource( ::nCurTab )
CASE oButton:key == "5"
::closeSource( ::nCurTab, .t. )
ENDCASE
RETURN nil
/*----------------------------------------------------------------------*/
METHOD HbIde:buildToolBar()
::oTBar := XbpToolBar():new( ::oDA )
@@ -459,6 +480,8 @@ METHOD HbIde:buildToolBar()
::oTBar:imageWidth := 20
::oTBar:imageHeight := 20
::oTBar:oWidget:setMaximumHeight( 30 )
::oTBar:addItem( "Exit" , s_resPath + "exit.png" , , , , , "1" )
::oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR )
::oTBar:addItem( "Properties" , s_resPath + "properties.png" , , , , , "2" )
@@ -505,24 +528,20 @@ METHOD HbIde:buildToolBar()
/*----------------------------------------------------------------------*/
METHOD HbIde:manageToolbar( oButton )
LOCAL cFile
METHOD HbIde:buildMenu()
LOCAL oMenuBar, oSubMenu
DO CASE
CASE oButton:key == "3"
IF !empty( cFile := ::selectSource( "open" ) )
::editSource( cFile )
ENDIF
oMenuBar := SetAppWindow():MenuBar()
CASE oButton:key == "4"
::saveSource( ::nCurTab )
oSubMenu := XbpMenu():new( oMenuBar ):create()
oSubMenu:title := "~File"
oSubMenu:addItem( { "Open", {|| ::manageMenu( 1 ) } } )
oSubMenu:addItem( { "Save", {|| ::manageMenu( 2 ) } } )
oSubMenu:addItem( { NIL, NIL, XBPMENUBAR_MIS_SEPARATOR, NIL } )
oSubMenu:addItem( { "Exit", {|| ::manageMenu( 3 ) } } )
oMenuBar:addItem( { oSubMenu, NIL } )
CASE oButton:key == "5"
::closeSource( ::nCurTab, .t. )
ENDCASE
RETURN nil
Return Self
/*----------------------------------------------------------------------*/
@@ -540,4 +559,16 @@ METHOD HbIde:buildStatusBar()
/*----------------------------------------------------------------------*/

METHOD HbIde:buildDialog()
::oDlg := XbpDialog():new( , , {10,10}, {900,500}, , .f. )
::oDlg:icon := s_resPath + "vr.png" //"hbide.ico"
::oDlg:title := "Harbour-Qt IDE"
::oDlg:create()
RETURN Self
/*----------------------------------------------------------------------*/

View File

@@ -372,7 +372,8 @@ FUNCTION ConvertAFact( cMode, nFrom, xValue )
PROCEDURE _HBXBP_DEBUG( ... )
LOCAL cString := ""
AEval( hb_AParams(), {| x | cString += ValType( x ) + ":" + iif( ISARRAY( x ), "[" + hb_ntos( Len( x ) ) + "]", hb_ValToStr( x ) ) + " " } )
//AEval( hb_AParams(), {| x | cString += ValType( x ) + ":" + iif( ISARRAY( x ), "[" + hb_ntos( Len( x ) ) + "]", hb_ValToStr( x ) ) + " " } )
AEval( hb_AParams(), {| x | cString += iif( ISARRAY( x ), "[" + hb_ntos( Len( x ) ) + "]", hb_ValToStr( x ) ) + " " } )
#if defined( __PLATFORM__WINDOWS ) .AND. defined( __HB_WINDEBUG__ )
wapi_OutputDebugString( cString )