BtnBmp New DATA aPromptClrs
BtnBmp New DATA aPromptClrs
This way, if I set only one BMP, I still have the effect of something changing in the button when an event happens (Button Enabled, Mouse Over, Button Pressed, Button Disabled...
I think METHOD SetColor( nClrText, nClrPane ) can be used for that effect....
I am planning to Update some time the beginning of next year, but I will like to have something done before that, I think the class can be modified rather easily by some one with CLASS programming experience, I will try to do my self, but I don't want to corrupt the class, If someone can help, I think it may be of benefit for everyone.... Thanks!!!
=====>
Bayron Landaverry
NextXbase.com
(215)2226600 Philadelphia,PA, USA
[email protected]
Guatemala
FWH25.12--Harbour 3.0.0--MSVC--UEstudio 10.10
Windows 11
FiveWin, One line of code and it's done...
Re: BtnBmp New DATA aPromptClrs
Code: Select all | Expand
254 ::SetColor( If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ), If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ) ), ::nClrPane )
357 ::SetColor( If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ), If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ) ), ::nClrPane )
500 ::SetColor( If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ), If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ) ), ::nClrPane )
1287 If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ), If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ) ), ::hDC,;
1311 If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ) , If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ) ), ::hDC,;
1318 nClr = If( IsWindowEnabled( ::hWnd ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ), If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ), if( ::lDisColor, CLR_HGRAY, ::nClrTextDis ) )
1172 nClr = If( IsWindowEnabled( ::hWnd ), if( !::lMOver .and. !Empty( ::cCaption ), If( ::lCalcColor = .t. , ::nClrText := CLR_BLACK , ::nClrText := CLR_WHITE ), If( ::lPressed .and. !Empty( ::cCaption ) , ::nClrText := CLR_HRED , If( ::lCalcColor = .t. , ::nClrText := CLR_YELLOW , ::nClrText := CLR_HGREEN ) ) ), if( ::lDisColor, CLR_HGRAY , ::nClrTextDis ) )::lCalcColor is a DATA I added to have a diferent color for the button where ::lCalcColor = .t.
It looks great....

I hope it will be SOFTCODED and included in a next Fivewin release before next year, something like
Code: Select all | Expand
@ 10, 10 BTNBMP oBtn OF oDialog FILENAME "Boton.bmp" PROMPT "Boton1" PROMPTCOLORS ColorActive, ColorMouseOver, ColorPressed, ColorDissabled FONT oFont1
THANKS FOR THAKING THIS UNTO CONSIDERATION...
=====>
Bayron Landaverry
NextXbase.com
(215)2226600 Philadelphia,PA, USA
[email protected]
Guatemala
FWH25.12--Harbour 3.0.0--MSVC--UEstudio 10.10
Windows 11
FiveWin, One line of code and it's done...
Re: BtnBmp New DATA aPromptClrs

New Datas:
nClrActive
nClrMouseOver
nClrPressed
nClrDisabled
I sent you the modified class by e-mail...
=====>
Bayron Landaverry
NextXbase.com
(215)2226600 Philadelphia,PA, USA
[email protected]
Guatemala
FWH25.12--Harbour 3.0.0--MSVC--UEstudio 10.10
Windows 11
FiveWin, One line of code and it's done...