lucasdebeltran wrote:Parece que desde Fivetech no se presta demasiada atención al interface gráfico
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------//
function Main()
local oBtn,oFont
local cVer := FWVERSION
local bGrad := { | lInvert | If( ! lInvert, ;
{ { 1, nRGB( 255, 255, 255 ), nRGB( 230, 234, 239 ) } }, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
} ) }
DEFINE FONT oFont NAME "MS SANS SERIF" SIZE 0,-12
DEFINE dialog oWnd TITLE "Rounded Buttons in " + cVer size 500, 300 PIXEL
@ 5, 10 BTNBMP oBtn OF oWnd ;
SIZE 60, 70 ;
PROMPT cVer 2007 ;
FONT oFont CENTER;
ACTION MsgInfo("Hello") ;
GRADIENT bGrad
@ 10, 75 BTNBMP oBtn OF oWnd ;
SIZE 60, 60 ;
PROMPT "&" + cVer 2007 ;
FONT oFont CENTER;
ACTION MsgInfo( "Yes" ) ;
GRADIENT bGrad
@ 70, 165 BTNBMP oBtn OF oWnd ;
SIZE 80, 60 ;
PROMPT cVer + CRLF + "FIVEWIN" 2007 ;
FONT oFont CENTER ;
ACTION MsgInfo("Hello") ;
GRADIENT bGrad
ACTIVATE DIALOG oWnd CENTER
return nil
if l2007
DEFAULT ::bClrGrad := { | lInvert | If( lInvert, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
}, ;
{ { 1/2, nRGB( 219, 230, 244 ), nRGB( 207-50, 221-25, 255 ) }, ;
{ 1/2, nRGB( 201-50, 217-25, 255 ), nRGB( 231, 242, 255 ) } ;
} ) }
endif
Daniel Garcia-Gil wrote:te dejo un ejemplo funcional de como hacer tu propio skin usando la clausula GRADIENT sin necesidad de cambiar la clase
CODE: SELECT ALL COLLAPSE VIEW
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------//
function Main()
local oBtn,oFont
local cVer := FWVERSION
local bGrad := { | lInvert | If( ! lInvert, ;
{ { 1, nRGB( 255, 255, 255 ), nRGB( 230, 234, 239 ) } }, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
} ) }
DEFINE FONT oFont NAME "MS SANS SERIF" SIZE 0,-12
DEFINE dialog oWnd TITLE "Rounded Buttons in " + cVer size 500, 300 PIXEL
@ 5, 10 BTNBMP oBtn OF oWnd ;
SIZE 60, 70 ;
PROMPT cVer 2007 ;
FONT oFont CENTER;
ACTION MsgInfo("Hello") ;
GRADIENT bGrad
@ 10, 75 BTNBMP oBtn OF oWnd ;
SIZE 60, 60 ;
PROMPT "&" + cVer 2007 ;
FONT oFont CENTER;
ACTION MsgInfo( "Yes" ) ;
GRADIENT bGrad
@ 70, 165 BTNBMP oBtn OF oWnd ;
SIZE 80, 60 ;
PROMPT cVer + CRLF + "FIVEWIN" 2007 ;
FONT oFont CENTER ;
ACTION MsgInfo("Hello") ;
GRADIENT bGrad
ACTIVATE DIALOG oWnd CENTER
return nil
Y resulta que ni FW 11.12 ni 12.01 son utilizables pues tienen bugs reportados ampliamente y no resueltos
/*procedimiento para reemplazar methodos o agregar nuevos a clases de fwh*/
PROCEDURE OverrideAndExtend()
EXTEND CLASS TFOLDER WITH METHOD RefreshPages
EXTEND CLASS TFOLDER WITH METHOD GoFirstControl
EXTEND CLASS TDIALOG WITH METHOD RefreshDialog
EXTEND CLASS TDIALOG WITH METHOD MySetFocus
EXTEND CLASS TDIALOG WITH METHOD MyCountControl
EXTEND CLASS TCONTROL WITH METHOD MyDisable
EXTEND CLASS TXBROWSE WITH METHOD MyConfig
EXTEND CLASS TXBROWSE WITH METHOD SetMyBmpSort
EXTEND CLASS TPRINTER WITH METHOD Cm2PixX
EXTEND CLASS TPRINTER WITH METHOD Cm2PixY
EXTEND CLASS TPRINTER WITH METHOD SayText
EXTEND CLASS TPRINTER WITH DATA nPxL
EXTEND CLASS TPRINTER WITH DATA nPxC
OVERRIDE METHOD GetDlgCode IN CLASS TButton WITH KGetDlgCode
RETURN
...
FUNCTION KGetDlgCode( nLastKey )
LOCAL Self := HB_QSelf()
::oWnd:nLastKey := nLastKey
DO CASE
CASE ::oWnd:oWnd != NIL .and. ( ::oWnd:oWnd:IsKindOf( "TFOLDER" ) .or. ::oWnd:oWnd:IsKindOf( "TFOLDEREX" ) )
RETURN DLGC_WANTALLKEYS
CASE nLastKey == VK_ESCAPE .and. ::oWnd:oWnd != NIL .and. ( ::oWnd:oWnd:IsKindOf( "TWINDOW" ) .and. ::oWnd:IsKindOf( "TDIALOG" ) )
RETURN DLGC_WANTALLKEYS
ENDCASE
RETURN NIL
/*-------------------------------------------------------------------------------------------------*/
/*funcion nueva para method de tget*/
FUNCTION MyDisable( aNameCtrl )
LOCAL Self := HB_QSelf()
IF ( ::ClassName() IN aNameCtrl )
::bWhen := NIL
::Disable()
ENDIF
RETURN NIL
FUNCTION SetMyBmpSort()
LOCAL Self := HB_QSelf()
LOCAL oBmp, hBmp
::aSortBmp := {}
DEFINE BITMAP oBmp NAME "BMS_ARROWDOWN"
hBmp := oBmp:hBitmap
AAdd( ::aSortBmp, { hBmp, 0, nBmpWidth( hBmp ), nBmpHeight( hBmp ), NIL, FALSE } )
DEFINE BITMAP oBmp NAME "BMS_ARROWUP"
hBmp := oBmp:hBitmap
AAdd( ::aSortBmp, { hBmp, 0, nBmpWidth( hBmp ), nBmpHeight( hBmp ), NIL, FALSE } )
RETURN NIL
...
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 63 guests