FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index To do - WishList / Por hacer - Peticiones BtnBmp New DATA aPromptClrs
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
BtnBmp New DATA aPromptClrs
Posted: Mon Sep 05, 2011 10:49 PM

Basically I want to have a Color of Text Set for events, similar to what cBmpFile1, cBmpFile2, cBmpFile3 and cBmpFile4 do, but even if only one Bmp file is set.
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
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: BtnBmp New DATA aPromptClrs
Posted: Tue Sep 06, 2011 06:54 PM
I was able to obtain what I wanted, harcoding the following lines:

Code (fw): Select all Collapse
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 (fw): Select all Collapse
@ 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
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: BtnBmp New DATA aPromptClrs
Posted: Sat Jun 23, 2012 03:37 AM
Just in case it can be included in FiveWin, I made changes to btnbmp.prg FWH12.04


New Datas:

nClrActive
nClrMouseOver
nClrPressed
nClrDisabled


I sent you the modified class by e-mail...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Continue the discussion