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.
This commit is contained in:
Pritpal Bedi
2009-07-07 16:26:47 +00:00
parent c954c7fa61
commit 62ec105515
4 changed files with 83 additions and 66 deletions

View File

@@ -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( ... )

View File

@@ -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 += '<TD class="only" >'
s += '<TD class="only" ' + 'colspan=' + hb_ntos( nCols ) + '>'
s += '<PRE id="' + cPara + '">'
s += CRLF
s += CRLF
@@ -1560,40 +1559,40 @@ FUNCTION Build_HtmlTable( aHTML, cTitle, SetColorTable )
FUNCTION Build_HtmlHeader( aHTML )
aadd( aHtml, '<head> ' )
aadd( aHtml, ' <meta name="Author" CONTENT=Pritpal Bedi [pritpal@vouchcac.com]">' )
aadd( aHtml, ' <meta http-equiv="content-style-type" content="text/css" > ' )
aadd( aHtml, ' <meta http-equiv="content-script-type" content="text/javascript">' )
aadd( aHtml, ' ' )
aadd( aHtml, ' <style type="text/css"> ' )
aadd( aHtml, ' th ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' colspan : 1; ' )
aadd( aHtml, ' text-align : center; ' )
aadd( aHtml, ' vertical-align : baseline; ' )
aadd( aHtml, ' horizontal-align : left; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' td ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' vertical-align : top; ' )
aadd( aHtml, ' horizontal-align : left; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' td.only ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' cursor : hand; ' )
aadd( aHtml, ' vertical-align : top; ' )
aadd( aHtml, ' horizontal-align : left; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' pre ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' font-family : Courier New; ' )
aadd( aHtml, ' font-size : .7em; ' )
aadd( aHtml, ' color : black; ' )
aadd( aHtml, ' cursor : text; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' </style> ' )
aadd( aHtml, ' ' )
aadd( aHtml, '</head> ' )
aadd( aHtml, '<head> ' )
aadd( aHtml, ' <meta name="Author" CONTENT="Pritpal Bedi [pritpal@vouchcac.com]">' )
aadd( aHtml, ' <meta http-equiv="content-style-type" content="text/css" > ' )
aadd( aHtml, ' <meta http-equiv="content-script-type" content="text/javascript"> ' )
aadd( aHtml, ' ' )
aadd( aHtml, ' <style type="text/css"> ' )
aadd( aHtml, ' th ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' colspan : 1; ' )
aadd( aHtml, ' text-align : center; ' )
aadd( aHtml, ' vertical-align : baseline; ' )
aadd( aHtml, ' horizontal-align : left; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' td ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' vertical-align : top; ' )
aadd( aHtml, ' horizontal-align : left; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' td.only ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' cursor : hand; ' )
aadd( aHtml, ' vertical-align : top; ' )
aadd( aHtml, ' horizontal-align : left; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' pre ' )
aadd( aHtml, ' { ' )
aadd( aHtml, ' font-family : Courier New; ' )
aadd( aHtml, ' font-size : .7em; ' )
aadd( aHtml, ' color : black; ' )
aadd( aHtml, ' cursor : text; ' )
aadd( aHtml, ' } ' )
aadd( aHtml, ' </style> ' )
aadd( aHtml, ' ' )
aadd( aHtml, '</head> ' )
RETURN Nil

View File

@@ -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} )

View File

@@ -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