diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a78fd9f2ba..abeb56ef5f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-07 09:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/generator/hbqtgen.prg + ! Some refinements and formatting. + + * harbour/contrib/hbxbp/xbpstatic.prg + + Implemented :type == XBPSTATIC_TYPE_SYSICON + With this XbpStatic() class is 100% Xbase++ compliant plus + Harbour has more goodies to play with, i.e., more sysicons to + display ( about 60+ ) instead of only 4 provided in Xbase++. + Plus Harbour has implemented to define mouse cursor from any image format. + + * harbour/contrib/hbxbp/tests/demoxbp.prg + ! Demonstrated all XbpStatic() implementation. + 2009-07-07 07:46 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/generator/hbqtgen.prg ! METHOD New( ... ) diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 99049bbbd7..9b3f0196bf 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -1251,8 +1251,8 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut ) aadd( txt_, '' ) aadd( txt_, ' ENDCLASS' ) aadd( txt_, '' ) - aadd( txt_, '/*----------------------------------------------------------------------*/' ) - aadd( txt_, '' ) + aadd( txt_, '/*----------------------------------------------------------------------*/' ) + aadd( txt_, '' ) n := ascan( cls_, {|e_| lower( e_[ 1 ] ) == 'type' } ) IF n > 0 @@ -1269,7 +1269,7 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut ) aadd( txt_, '' ) aadd( txt_, ' RETURN Self' ) aadd( txt_, '' ) - aadd( txt_, '/*----------------------------------------------------------------------*/' ) + aadd( txt_, '/*----------------------------------------------------------------------*/' ) aadd( txt_, '' ) OTHERWISE @@ -1281,8 +1281,8 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut ) aadd( txt_, '' ) aadd( txt_, ' RETURN Self' ) aadd( txt_, '' ) - aadd( txt_, '/*----------------------------------------------------------------------*/' ) - aadd( txt_, '' ) + aadd( txt_, '/*----------------------------------------------------------------------*/' ) + aadd( txt_, '' ) ENDCASE @@ -1410,7 +1410,6 @@ STATIC FUNCTION BuildDocument( cWidget, doc_, cPathDoc, docum_ ) aadd( aHF_, { cText, cRet } ) ENDIF NEXT - //aeval( doc_, {|e| aadd( txt_, ' ' + e ) } ) aadd( txt_, ' ' ) aadd( txt_, "/*----------------------------------------------------------------------*/" ) @@ -1470,7 +1469,7 @@ FUNCTION Build_HTML( cWidget, aHM_, aHF_, cPathOut, docum_ ) cPara := 'pr' + hb_ntos( ++nCounter ) - s += '' + s += '' s += '
'
       s += CRLF
       s += CRLF
@@ -1560,40 +1559,40 @@ FUNCTION Build_HtmlTable( aHTML, cTitle, SetColorTable )
 
 FUNCTION Build_HtmlHeader( aHTML )
 
-   aadd( aHtml, '                                                             ' )
-   aadd( aHtml, '  ' )
-   aadd( aHtml, '         ' )
-   aadd( aHtml, '  ' )
-   aadd( aHtml, '                                                                   ' )
-   aadd( aHtml, '                                                           ' )
-   aadd( aHtml, '                                                                   ' )
-   aadd( aHtml, '                                                            ' )
+   aadd( aHtml, '                                                              ' )
+   aadd( aHtml, '  ' )
+   aadd( aHtml, '          ' )
+   aadd( aHtml, '   ' )
+   aadd( aHtml, '                                                                    ' )
+   aadd( aHtml, '                                                            ' )
+   aadd( aHtml, '                                                                    ' )
+   aadd( aHtml, '                                                             ' )
 
    RETURN Nil
 
diff --git a/harbour/contrib/hbxbp/tests/demoxbp.prg b/harbour/contrib/hbxbp/tests/demoxbp.prg
index edc3f4d891..7fe1c67ad3 100644
--- a/harbour/contrib/hbxbp/tests/demoxbp.prg
+++ b/harbour/contrib/hbxbp/tests/demoxbp.prg
@@ -945,7 +945,7 @@ FUNCTION Build_Statics( oWnd )
    oBox:create()
    oBox:setColorBG( GraMakeRGBColor( { 0,100,100 } ) )
 
-   oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*2}, {nW,nH+nH+nG} )
+   oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*2}, {nW,nH} )
    oBox:type := XBPSTATIC_TYPE_BITMAP
    oBox:options := XBPSTATIC_BITMAP_TILED
    oBox:caption := 'cut.png'
@@ -954,23 +954,19 @@ FUNCTION Build_Statics( oWnd )
    #endif
 
 
-   #if 0  /* Does not work - despite best efforts :-((( */
-   oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*4}, {nW,nH} )
-   oBox:type := XBPSTATIC_TYPE_SYSICON
-   oBox:caption := XBPSTATIC_SYSICON_ICONINFORMATION
-   oBox:create()
-   #endif
-
-   #if 1
    #ifdef __HARBOUR__ /* Differes from Xbase++ by Disk File | Resource Name, ID */
-   oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*4}, {nW,nH} )
+   oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*3}, {nW,nH} )
    oBox:type := XBPSTATIC_TYPE_ICON
    oBox:caption := "vr.png"
    oBox:create()
-   oBox:setColorBG( GraMakeRGBColor( { 255,255,0 } ) )
-   #endif
+   oBox:setColorBG( GraMakeRGBColor( { 255,255,187 } ) )
    #endif
 
+   oBox := XbpStatic():new( oGrp, , {nC4,nT+(nH+nG)*4}, {nW,nH} )
+   oBox:type := XBPSTATIC_TYPE_SYSICON
+   oBox:caption := XBPSTATIC_SYSICON_ICONINFORMATION //XBPSTATIC_SYSICON_ICONQUESTION //
+   oBox:create()
+
    #define CRLF chr(13)+chr(10)
 
    oLbl := XbpStatic():new( oWnd, , {30,60}, {200,240} )
diff --git a/harbour/contrib/hbxbp/xbpstatic.prg b/harbour/contrib/hbxbp/xbpstatic.prg
index 553896dac1..ee08951bc9 100644
--- a/harbour/contrib/hbxbp/xbpstatic.prg
+++ b/harbour/contrib/hbxbp/xbpstatic.prg
@@ -272,7 +272,7 @@ METHOD XbpStatic:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
 /*----------------------------------------------------------------------*/
 
 METHOD XbpStatic:setCaption( xCaption, cDll )
-   LOCAL oStyle, pPixmap, oIcon, oSize//, oPixmap
+   LOCAL oStyle, pPixmap, oIcon, oPixmap
 
    HB_SYMBOL_UNUSED( cDll )
 
@@ -298,30 +298,38 @@ METHOD XbpStatic:setCaption( xCaption, cDll )
          ::oWidget:setPixmap( QPixmap():new( ::caption ):scaled( ::aSize[ 1 ], ::aSize[ 2 ] ) )
 
       CASE ::type == XBPSTATIC_TYPE_SYSICON
+         oPixmap     := QPixmap()
          oIcon       := QIcon()
          oStyle      := QStyle()
          oStyle:pPtr := QApplication():style()
 
          DO CASE
          CASE ::caption == XBPSTATIC_SYSICON_ICONINFORMATION
-            oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxInformation, 0, 0 )
-hb_outDebug( "2 "+ valtype( oIcon:pPtr ) )
-            //pPixmap := oIcon:pixmap( ::aSize[ 1 ], ::aSize[ 2 ] )
-            oSize := QSize():new()
-            oSize:setWidth( 16 )
-            oSize:setHeight( 16 )
-            pPixmap := oIcon:pixmap( QT_PTROF( oSize ), QIcon_Normal, QIcon_On )
-hb_outDebug( "5" )
+            oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxInformation )
+
          CASE ::caption == XBPSTATIC_SYSICON_ICONQUESTION
-            pPixmap := oStyle:standardPixmap( QStyle_SP_MessageBoxQuestion )
+            oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxQuestion )
+
          CASE ::caption == XBPSTATIC_SYSICON_ICONERROR
-            pPixmap := oStyle:standardPixmap( QStyle_SP_MessageBoxCritical )
+            oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxCritical )
+
          CASE ::caption == XBPSTATIC_SYSICON_ICONWARNING
-            pPixmap := oStyle:standardPixmap( QStyle_SP_MessageBoxWarning )
+            oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxWarning )
+
+         OTHERWISE
+            /* It is a Harbour Extension - you have 60+ icons to display
+             * Check hbqt.ch : #define QStyle_SP_* constants
+             */
+            oIcon:pPtr := oStyle:standardIcon( ::caption )
+
          ENDCASE
 
+         /* Harbour can also implement if icon be displayed scaled or proportionate
+          */
+         oPixmap:pPtr := oIcon:pixmap_1( ::aSize[ 1 ], ::aSize[ 2 ] )
+         pPixmap      := oPixmap:scaled( ::aSize[ 1 ], ::aSize[ 2 ] )
+
          ::oWidget:setPixmap( pPixmap )
-hb_outDebug( "6" )
       ENDCASE
    ENDIF