Code: Select all | Expand
// C:\FWH\SAMPLES\SILVDIAG.PRG - VERSION: 1.2 by Kapiaba.
#Include "FiveWin.ch"
STATIC oChkSil
// colorize btnbmp with diagonal
FUNCTION test()
LOCAL oBtn, hBmp := LinesBmp(), oFont, cVersion := "Version: 1.2"
LOCAL oDlg, oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6, oBtn7, ;
lMenu := .T., cTitle, oSalida
LOCAL nLarg := 095 // Largura
LOCAL nAlt := 095 // altura
SET _3DLOOK ON
SkinButtons()
cTitle := "Colorize BTNBMP con DIAGONAL - " + cVersion
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14
DEFINE DIALOG oDlg SIZE 400, 450 TITLE cTitle TRANSPARENT FONT oFont
oDlg:lHelpIcon := .F.
@ 10, 10 BTNBMP oBtn1 SIZE 50, 50 PIXEL OF oDlg FLAT GDIP NOROUND ;
RESOURCE "PREV", "", LinesBmp( oBtn1, nLarg, nAlt ), "" ;
ACTION NIL WHEN lMenu
oBtn1:nClrBorder := RGB( 195, 195, 185 )
// nLarg := nLarg +...
nAlt := nAlt + 75
@ 70, 10 BTNBMP oBtn2 SIZE 50, 90 PIXEL OF oDlg FLAT GDIP NOROUND ;
RESOURCE "NEXT", "", LinesBmp( oBtn2, nLarg, nAlt ), "" ;
ACTION NIL WHEN lMenu
oBtn2:nClrBorder := RGB( 195, 195, 185 )
// nLarg := nLarg +...
nAlt := nAlt - 75
@ 10, 70 BTNBMP oBtn3 SIZE 50, 50 PIXEL OF oDlg FLAT GDIP NOROUND ;
RESOURCE "PREV", "", LinesBmp( oBtn3, nLarg, nAlt ), "" ;
ACTION NIL WHEN lMenu
oBtn3:nClrBorder := RGB( 195, 195, 185 )
// nLarg := nLarg +...
nAlt := nAlt + 75
@ 70, 70 BTNBMP oBtn4 SIZE 50, 90 PIXEL OF oDlg FLAT GDIP NOROUND ;
RESOURCE "NEXT", "", LinesBmp( oBtn4, nLarg, nAlt ), "" ;
ACTION NIL WHEN lMenu
oBtn4:nClrBorder := RGB( 195, 195, 185 )
// nLarg := nLarg +...
nAlt := nAlt - 75
@ 10, 130 BTNBMP oBtn5 SIZE 50, 50 PIXEL OF oDlg FLAT GDIP NOROUND ;
RESOURCE "PREV", "", LinesBmp( oBtn5, nLarg, nAlt ), "" ;
ACTION NIL WHEN lMenu
oBtn5:nClrBorder := RGB( 195, 195, 185 )
// nLarg := nLarg +-...
nAlt := nAlt + 75
@ 70, 130 BTNBMP oBtn4 SIZE 50, 90 PIXEL OF oDlg FLAT GDIP NOROUND ;
RESOURCE "NEXT", "", LinesBmp( oBtn4, nLarg, nAlt ), "" ;
ACTION NIL WHEN lMenu
oBtn4:nClrBorder := RGB( 195, 195, 185 )
@ 160, 80 CHECKBOX oChkSil VAR lMenu PROMPT "Enabled" SIZE 80, 14 PIXEL ;
OF oDlg UPDATE // Cambiar color en el ON INIT.
@ 165, 10 SAY "I Love FiveWin" OF oDlg SIZE 100, 12 PIXEL FONT oFont ;
COLORS METRO_PINK, CLR_WHITE TRANSPARENT UPDATE
@ 185, 10 SAY "kapiabafwh@gmail.com" OF oDlg SIZE 120, 12 PIXEL ;
FONT oFont COLORS METRO_VIOLET, CLR_WHITE TRANSPARENT UPDATE
@ 205, 010 BUTTON oSalida PROMPT "&Exit" SIZE 30, 12 PIXEL OF oDlg ;
ACTION( oDlg:End() ) CANCEL
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT CTRLS_COLORS( oDlg ) // Color in CheckBox
oFont:End()
RETURN NIL
FUNCTION LinesBmp( oControl, nDiag1, nDiag2 )
LOCAL hBmp, oBrush
DEFINE BRUSH oBrush STYLE BDIAGONAL COLOR nRGB( 000, 100, 255 ) // nRGB( 255, 000, 035 )
hBmp := FW_MakeYourBitmap( nDiag1, nDiag2, < | hDC, w, h |
FillRect( hDC, { 0, 0, h, w }, oBrush:hBrush )
RETURN NIL
> )
RELEASE BRUSH oBrush
RETURN( hBmp )
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )
LOCAL lc_aCtrls := {}, lc_iFor := 0
LOCAL lc_aItemsRadio := {}
lc_aCtrls := f_oDlgContainer:aControls
FOR lc_iFor := 1 TO Len( lc_aCtrls )
IF ValType( lc_aCtrls[lc_iFor] ) == "O"
IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"
aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems, ;
{|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
_oRadId:SetColor( CLR_CYAN, CLR_WHITE ) } } )
ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"
SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )
lc_aCtrls[lc_iFor]:SetColor( METRO_ORANGE, CLR_WHITE )
ENDIF
ENDIF
NEXT
RETURN NIL
/* // SILVDIAG.RC
ico ICON ".\.\..\ICONS\fivewin.ico"
#ifndef __64__
1 24 "WinXP\WindowsXP.Manifest"
#endif
#ifdef __64__
1 24 "WinXP\WindowsXP.Manifest64"
#endif
new BITMAP .\..\bitmaps\32x32\new.bmp
open BITMAP .\..\bitmaps\32x32\open.bmp
copy BITMAP .\..\bitmaps\32x32\copy.bmp
prev BITMAP .\..\bitmaps\32x32\previous.bmp
next BITMAP .\..\bitmaps\32x32\next.bmp
exit BITMAP .\..\bitmaps\32x32\exit.bmp
*/
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.