2009-07-01 23:39 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* harbour/contrib/hbxbp/xbpstatic.prg
    + Implemented more static styles.
  * harbour/contrib/hbxbp/tests/demoxbp.prg
    ! Demonstrated newly implemented static styles.

    NOTE: Remaining styles are :
          XBPSTATIC_TYPE_ICON
          XBPSTATIC_TYPE_SYSICON
          XBPSTATIC_TYPE_BITMAP
             As these styles are mainly resource based, we need to 
             think of a system where existing applns could use its 
             resource files.
                If anyone has any clue about how system defined icons 
                can be manipulated in QT please speak out. A quick search
                has not led me to any significant clue.
This commit is contained in:
Pritpal Bedi
2009-07-02 06:47:28 +00:00
parent fa50b1ccc3
commit 922db43726
3 changed files with 135 additions and 64 deletions

View File

@@ -17,6 +17,23 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-07-01 23:39 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbxbp/xbpstatic.prg
+ Implemented more static styles.
* harbour/contrib/hbxbp/tests/demoxbp.prg
! Demonstrated newly implemented static styles.
NOTE: Remaining styles are :
XBPSTATIC_TYPE_ICON
XBPSTATIC_TYPE_SYSICON
XBPSTATIC_TYPE_BITMAP
As these styles are mainly resource based, we need to
think of a system where existing applns could use its
resource files.
If anyone has any clue about how system defined icons
can be manipulated in QT please speak out. A quick search
has not led me to any significant clue.
2009-07-02 02:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/maindllp.c
! fixed unapdated hb_parvds() redirection

View File

@@ -340,17 +340,18 @@ FUNCTION Build_PushButton( oDA )
oXbp := XbpPushButton():new( oDA )
oXbp:caption := "A"
oXbp:create( , , {30,370}, {100,40} )
oXbp:create( , , {30,370}, {90,40} )
oXbp:activate:= {|| MsgBox( "Pushbutton A" ) }
/* Harbour supports presentation colors */
oXbp:setColorBG( GraMakeRGBColor( {133,240,90} ) )
//oXbp:setColorBG( GraMakeRGBColor( {133,240,90} ) )
oXbp:setColorBG( GraMakeRGBColor( {0,0,255} ) )
oXbp := XbpPushButton():new( oDA )
oXbp:caption := "new.png"
oXbp:create( , , {140,370}, {100,40} )
oXbp:create( , , {140,370}, {90,40} )
oXbp:activate:= {|| MsgBox( "Pushbutton B" ) }
/* Harbour supports presentation colors */
oXbp:setColorBG( GraMakeRGBColor( {0,255,255} ) )
oXbp:setColorBG( GraMakeRGBColor( {255,255,0} ) )
RETURN nil
@@ -441,7 +442,7 @@ FUNCTION Build_RadioButton( oStatic )
FUNCTION Build_TabPages( oDlg )
LOCAL oTab1, oTab2, oTab3, oTab4
LOCAL nHeight := 380
LOCAL nHeight := 390
// First tab page is maximized
@@ -792,11 +793,12 @@ PROCEDURE FieldStruct( oItem, aField )
FUNCTION Build_Statics( oWnd )
LOCAL oGrp,oLbl, oLin, oBox
oGrp := XbpStatic():new( oWnd, , {250,10}, {240,200} )
oGrp := XbpStatic():new( oWnd, , {250,10}, {240,400} )
oGrp:type := XBPSTATIC_TYPE_GROUPBOX
oGrp:caption := " Harbour-QT-Statics "
oGrp:create()
oGrp:setColorFG( GraMakeRGBColor( { 0,255,255 } ) )
oGrp:setColorFG( GraMakeRGBColor( { 0,255,255 } ) )
oGrp:setColorBG( GraMakeRGBColor( { 134,128,220 } ) )
oLbl := XbpStatic():new( oGrp, , {10,20}, {220,30} )
oLbl:type := XBPSTATIC_TYPE_TEXT
@@ -807,31 +809,78 @@ FUNCTION Build_Statics( oWnd )
oLbl:setColorFG( GraMakeRGBColor( { 255,0,0 } ) )
// OK
oLin := XbpStatic():new( oGrp, , {50,60}, {180,10} )
oLin:type := XBPSTATIC_TYPE_RAISEDLINE
oLin:create()
// OK
oLin := XbpStatic():new( oGrp, , {50,80}, {180,10} )
oLin:type := XBPSTATIC_TYPE_RECESSEDLINE
oLin:create()
// OK
oLin := XbpStatic():new( oGrp, , {10,60}, {10,100} )
oLin:type := XBPSTATIC_TYPE_RAISEDLINE
oLin:create()
// OK
oLin := XbpStatic():new( oGrp, , {25,60}, {10,100} )
oLin:type := XBPSTATIC_TYPE_RECESSEDLINE
oLin:create()
// OK
oBox := XbpStatic():new( oGrp, , {50,110}, {50,50} )
oBox:type := XBPSTATIC_TYPE_RAISEDBOX
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {120,110}, {50,50} )
oBox:type := XBPSTATIC_TYPE_RECESSEDBOX
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {50,170}, {50,50} )
oBox:type := XBPSTATIC_TYPE_RAISEDRECT
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {120,170}, {50,50} )
oBox:type := XBPSTATIC_TYPE_RECESSEDRECT
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {50,230}, {50,50} )
oBox:type := XBPSTATIC_TYPE_FGNDFRAME
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {120,230}, {50,50} )
oBox:type := XBPSTATIC_TYPE_BGNDFRAME
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {50,290}, {50,50} )
oBox:type := XBPSTATIC_TYPE_FGNDRECT
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {120,290}, {50,50} )
oBox:type := XBPSTATIC_TYPE_BGNDRECT
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {50,350}, {50,40} )
oBox:type := XBPSTATIC_TYPE_HALFTONERECT
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
// OK
oBox := XbpStatic():new( oGrp, , {120,350}, {50,40} )
oBox:type := XBPSTATIC_TYPE_HALFTONEFRAME
oBox:options := XBPSTATIC_FRAMETHICK
oBox:create()
oBox := XbpStatic():new( oGrp, , {180,350}, {40,40} )
oBox:type := XBPSTATIC_TYPE_SYSICON
oBox:caption := XBPSTATIC_SYSICON_ICONQUESTION
oBox:create()
RETURN nil
/*----------------------------------------------------------------------*/

View File

@@ -106,10 +106,12 @@ METHOD XbpStatic:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
/*----------------------------------------------------------------------*/
METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
LOCAL lThick := hb_bitAnd( ::options, XBPSTATIC_FRAMETHICK ) == XBPSTATIC_FRAMETHICK
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
DO CASE
// OK
CASE ::type == XBPSTATIC_TYPE_TEXT
::oWidget := QLabel():new( ::pParent )
@@ -134,44 +136,68 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
IF ( hb_bitAnd( ::options, XBPSTATIC_TEXT_WORDBREAK ) == XBPSTATIC_TEXT_WORDBREAK )
::oWidget:setWordWrap( .T. )
ENDIF
// OK
CASE ::type == XBPSTATIC_TYPE_GROUPBOX
::oWidget := QGroupBox():new( ::pParent )
CASE ::type == XBPSTATIC_TYPE_FGNDFRAME // rectangle in foreground color, not filled
::oWidget := QFrame():new( ::pParent )
CASE ::type == XBPSTATIC_TYPE_BGNDFRAME
::oWidget := QFrame():new( ::pParent )
CASE ::type == XBPSTATIC_TYPE_HALFTONEFRAME
::oWidget := QFrame():new( ::pParent )
CASE ::type == XBPSTATIC_TYPE_FGNDRECT
::oWidget := QFrame():new( ::pParent )
CASE ::type == XBPSTATIC_TYPE_BGNDRECT
::oWidget := QFrame():new( ::pParent )
CASE ::type == XBPSTATIC_TYPE_RAISEDRECT
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Raised )
CASE ::type == XBPSTATIC_TYPE_RECESSEDRECT
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Sunken )
CASE ::type == XBPSTATIC_TYPE_HALFTONERECT
::oWidget := QFrame():new( ::pParent )
// OK
CASE ::type == XBPSTATIC_TYPE_RAISEDBOX
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Raised )
::setColorBG( GraMakeRGBColor( { 198, 198, 198 } ) )
IF lThick
::oWidget:setLineWidth( 2 )
ENDIF
// OK
CASE ::type == XBPSTATIC_TYPE_RECESSEDBOX
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Sunken )
::setColorBG( GraMakeRGBColor( { 198, 198, 198 } ) )
IF lThick
::oWidget:setLineWidth( 2 )
ENDIF
// OK
CASE ::type == XBPSTATIC_TYPE_RAISEDRECT
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Raised )
IF lThick
::oWidget:setLineWidth( 2 )
ENDIF
// OK
CASE ::type == XBPSTATIC_TYPE_RECESSEDRECT
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Sunken )
IF lThick
::oWidget:setLineWidth( 2 )
ENDIF
// OK
CASE ::type == XBPSTATIC_TYPE_FGNDFRAME // rectangle in foreground color, not filled
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Panel + QFrame_Plain )
::setColorFG( GraMakeRGBColor( { 0, 0, 0 } ) )
// OK
CASE ::type == XBPSTATIC_TYPE_BGNDFRAME
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Box + QFrame_Plain )
::setColorFG( GraMakeRGBColor( { 127, 127, 127 } ) )
// OK
CASE ::type == XBPSTATIC_TYPE_FGNDRECT
::oWidget := QFrame():new( ::pParent )
::setColorBG( GraMakeRGBColor( { 0, 0, 0 } ) )
// OK
CASE ::type == XBPSTATIC_TYPE_BGNDRECT
::oWidget := QFrame():new( ::pParent )
::setColorBG( GraMakeRGBColor( { 127, 127, 127 } ) )
// OK
CASE ::type == XBPSTATIC_TYPE_HALFTONERECT
::oWidget := QFrame():new( ::pParent )
::setColorBG( GraMakeRGBColor( { 255, 255, 255 } ) )
// OK
CASE ::type == XBPSTATIC_TYPE_HALFTONEFRAME
::oWidget := QFrame():new( ::pParent )
::oWidget:setFrameStyle( QFrame_Box + QFrame_Plain )
::setColorFG( GraMakeRGBColor( { 255, 255, 255 } ) )
// OK
CASE ::type == XBPSTATIC_TYPE_RAISEDLINE
::oWidget := QFrame():new( ::pParent )
IF ::aPos[ 1 ] + ::aSize[ 1 ] >= ::aPos[ 2 ] + ::aSize[ 2 ]
@@ -179,7 +205,7 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
ELSE
::oWidget:setFrameStyle( QFrame_VLine + QFrame_Raised )
ENDIF
// OK
CASE ::type == XBPSTATIC_TYPE_RECESSEDLINE
::oWidget := QFrame():new( ::pParent )
IF ::aPos[ 1 ] + ::aSize[ 1 ] >= ::aPos[ 2 ] + ::aSize[ 2 ]
@@ -200,27 +226,6 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
ENDCASE
#if 0
/* Options */
IF ( ascan( { XBPSTATIC_TYPE_FGNDFRAME, XBPSTATIC_TYPE_BGNDFRAME, XBPSTATIC_TYPE_HALFTONEFRAME }, ::type ) > 0 )
IF ( hb_bitAnd( ::options, XBPSTATIC_FRAMETHIN ) == XBPSTATIC_FRAMETHIN )
::style += WS_BORDER
ELSEIF ( hb_bitAnd( ::options, XBPSTATIC_FRAMETHICK ) == XBPSTATIC_FRAMETHICK )
::style += WS_DLGFRAME
ENDIF
ENDIF
IF ::type == XBPSTATIC_TYPE_TEXT
IF ::options == XBPSTATIC_FRAMETHIN
::style += WS_BORDER
ELSEIF ::options == XBPSTATIC_FRAMETHICK
::style += WS_DLGFRAME
ENDIF
ENDIF
#endif
::setPosAndSize()
IF ::visible