diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e4763a6209..ca7aa15db2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,33 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-08 16:58 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbxbp/xbpbitmap.prg + + Implemented XbpBitmap() class - mostly working. + + * harbour/contrib/hbxbp/xbpfiledialog.prg + ! Shifted constants to hbqt.ch + + * harbour/contrib/hbxbp/xbpfontdialog.prg + + Implemented XbpFontDialog() and XbpFont() class with interaction. + + * harbour/contrib/hbxbp/xbpstatic.prg + + Implemented :type == XBPSTATIC_TYPE_BITMAP. + + * harbour/contrib/hbxbp/xbpwindow.prg + + Implemented :setFont( oXbpFont ). + ! Enhanced "Attribute" factor of :compoundName to accept bold and italic together. + Integrated with :setFont() + + * harbour/contrib/hbxbp/tests/demoxbp.prg + + Demonstrated XbpFontDialog() and XbpFont() implementation. + 1. Click on tab-page. + 2. Click on toolbar icon. + 3. Adjust and select a font. + 4. See the result in MLE text editor. + + + Demonstrated XbpBitmap() functionality as in Xbase++, code shows up with both compilers. + 2009-07-08 16:50 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/hbqt.ch diff --git a/harbour/contrib/hbxbp/tests/demoxbp.prg b/harbour/contrib/hbxbp/tests/demoxbp.prg index 7fe1c67ad3..33c41686a3 100644 --- a/harbour/contrib/hbxbp/tests/demoxbp.prg +++ b/harbour/contrib/hbxbp/tests/demoxbp.prg @@ -68,6 +68,8 @@ #define TAB_4 4 #define TAB_5 5 +STATIC oMLE /* Change Font elsewhere */ + /*----------------------------------------------------------------------*/ PROCEDURE Main() @@ -138,7 +140,7 @@ PROCEDURE BuildADialog() Build_SLEs( oDa ) /* Install Multi-Line Edit */ - Build_MLE( aTabs[ 2 ] ) + oMLE := Build_MLE( aTabs[ 2 ] ) /* Install ScrollBar */ Build_ScrollBar( aTabs[ 5 ] ) @@ -158,8 +160,7 @@ PROCEDURE BuildADialog() /* Build HTML Viewer */ oHtm := Build_HTMLViewer( aTabs[ TAB_1 ] ) - /* Gather Font INformation */ - Build_Font( oDlg ) + /* Present the dialog on the screen */ oDlg:Show() @@ -191,10 +192,11 @@ PROCEDURE AppSys() /*----------------------------------------------------------------------*/ #ifdef __XPP__ -FUNCTION Hb_OutDebug( cStr );RETURN nil -FUNCTION Hb_Symbol_Unused();RETURN nil -FUNCTION Hb_NtoS( n );RETURN ltrim( str( n ) ) -FUNCTION Hb_ThreadStart();RETURN nil +FUNCTION Hb_OutDebug( cStr ) ; RETURN nil +FUNCTION Hb_Symbol_Unused() ; RETURN nil +FUNCTION Hb_NtoS( n ) ; RETURN ltrim( str( n ) ) +FUNCTION Hb_ThreadStart() ; RETURN nil +FUNCTION hb_DirBase() ; RETURN CurDir() #endif /*----------------------------------------------------------------------*/ @@ -640,7 +642,6 @@ FUNCTION Build_SLEs( oWnd ) /*----------------------------------------------------------------------*/ FUNCTION Build_MLE( oWnd ) - LOCAL oMLE LOCAL cText := "This is Xbase++ compatible implementation of XbpMLE()" // Create MLE, specify position using :create() and @@ -656,9 +657,9 @@ FUNCTION Build_MLE( oWnd ) oMLE:setColorBG( GraMakeRGBColor( { 190,190,0 } ) ) oMLE:setColorFG( GraMakeRGBColor( { 0,0,0 } ) ) - oMLE:setFontCompoundName( "14.Courier New bold normal" ) + oMLE:setFontCompoundName( "14.Courier bold" ) - RETURN nil + RETURN oMLE /*----------------------------------------------------------------------*/ @@ -844,7 +845,7 @@ PROCEDURE FieldStruct( oItem, aField ) /*----------------------------------------------------------------------*/ FUNCTION Build_Statics( oWnd ) - LOCAL oGrp,oLbl, oLin, oBox + LOCAL oGrp,oLbl, oLin, oBox, oBmp, oBmp1 LOCAL nC1 := 10, nC2 := 45, nC3 := 110, nC4 := 175 LOCAL nW := 50, nH := 50, nG := 10 LOCAL nT := 60 @@ -937,21 +938,27 @@ FUNCTION Build_Statics( oWnd ) oBox:options := XBPSTATIC_FRAMETHICK oBox:create() - #ifdef __HARBOUR__ oBox := XbpStatic():new( oGrp, , {nC4,nT}, {nW,nH+nH+nG} ) oBox:type := XBPSTATIC_TYPE_BITMAP oBox:options := XBPSTATIC_BITMAP_SCALED - oBox:caption := 'paste.png' + oBmp := XbpBitmap():new():create() + oBmp:loadFile( 'paste.png' ) + oBox:caption := oBmp oBox:create() oBox:setColorBG( GraMakeRGBColor( { 0,100,100 } ) ) oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*2}, {nW,nH} ) oBox:type := XBPSTATIC_TYPE_BITMAP oBox:options := XBPSTATIC_BITMAP_TILED + #ifdef __HARBOUR__ oBox:caption := 'cut.png' + #else + oBmp1 := XbpBitmap():new():create() + oBmp1:loadFile( 'paste.png' ) + oBox:caption := oBmp1 + #endif oBox:create() oBox:setColorBG( GraMakeRGBColor( { 100,0,100 } ) ) - #endif #ifdef __HARBOUR__ /* Differes from Xbase++ by Disk File | Resource Name, ID */ @@ -1046,17 +1053,6 @@ FUNCTION Build_FileDialog( oWnd, cMode ) /*----------------------------------------------------------------------*/ -FUNCTION Build_FontDialog( oWnd ) - LOCAL oDlg - - oDlg := XbpFontDialog():new( oWnd, , , , { 20,20 } ) - oDlg:create() - oDlg:display( 0 ) - - RETURN nil - -/*----------------------------------------------------------------------*/ - FUNCTION Build_Bitmap( oWnd ) LOCAL oBmp, aFltr, cFile, cExt, nFrmt, oDlg LOCAL cExtns := { "png","gif","jpg","jpeg","bmp","tiff" } @@ -1114,15 +1110,22 @@ FUNCTION Build_Bitmap( oWnd ) /*----------------------------------------------------------------------*/ -FUNCTION Build_Font( oWnd ) - LOCAL oFont +FUNCTION Build_FontDialog( oWnd ) + LOCAL oDlg - oFont := XbpFont():new() + oDlg := XbpFontDialog():new( oWnd, , , , { 20,20 } ) + oDlg:activateOk := {|oFont| DisplayFontInfo( oFont ) } + oDlg:create() - oFont:nominalPointSize := 16 - oFont:create( "Times New Roman" ) - -hb_outDebug( IF( oFont:bold(), "BOLD", "NORMAL" ) ) + oDlg:display( 0 ) + + RETURN nil + +/*----------------------------------------------------------------------*/ + +FUNCTION DisplayFontInfo( oFont ) + + oMLE:setFont( oFont ) RETURN nil diff --git a/harbour/contrib/hbxbp/xbpbitmap.prg b/harbour/contrib/hbxbp/xbpbitmap.prg index 8c07c50669..a1977aa60f 100644 --- a/harbour/contrib/hbxbp/xbpbitmap.prg +++ b/harbour/contrib/hbxbp/xbpbitmap.prg @@ -79,12 +79,11 @@ CLASS XbpBitmap ACCESS bits INLINE ::oWidget:depth() DATA bufferOffset INIT 0 - DATA planes INIT 0 + ACCESS planes INLINE 0 DATA transparentColor INIT GRA_CLR_INVALID ACCESS xSize INLINE ::oWidget:width() ACCESS ySize INLINE ::oWidget:height() - DATA oWidget DATA oPS DATA cImageFileName @@ -154,7 +153,6 @@ METHOD XbpBitmap:load( cDLLName, cID ) METHOD XbpBitmap:loadFile( cImageFileName ) LOCAL lSuccess - HB_SYMBOL_UNUSED( cImageFileName ) // BMP, GIF, JPEG, PNG ::cImageFileName := cImageFileName diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index 197baffb9d..95f9e57bd1 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -65,47 +65,6 @@ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ -#define QFileDialog_AcceptOpen 0 -#define QFileDialog_AcceptSave 1 - -// enum #define QFileDialog_DialogLabel -// -#define QFileDialog_LookIn 0 -#define QFileDialog_FileName 1 -#define QFileDialog_FileType 2 -#define QFileDialog_Accept 3 -#define QFileDialog_Reject 4 - -// enum #define QFileDialog_FileMode -// This enum is used to indicate what the user may select in the file dialog; -// i.e. what the dialog will return if the user clicks OK. -// -#define QFileDialog_AnyFile 0 // The name of a file, whether it exists or not. -#define QFileDialog_ExistingFile 1 // The name of a single existing file. -#define QFileDialog_Directory 2 // The name of a directory. Both files and directories are displayed. -#define QFileDialog_ExistingFiles 3 // The names of zero or more existing files. - -// The Options type is a typedef for QFlags