BtnBmp New DATA aPromptClrs

BtnBmp New DATA aPromptClrs

Postby Bayron » 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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: BtnBmp New DATA aPromptClrs

Postby Bayron » Tue Sep 06, 2011 6:54 pm

I was able to obtain what I wanted, harcoding the following lines:

Code: Select all  Expand view
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....
Image

I hope it will be SOFTCODED and included in a next Fivewin release before next year, something like

Code: Select all  Expand view
@ 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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: BtnBmp New DATA aPromptClrs

Postby Bayron » Sat Jun 23, 2012 3:37 am

Just in case it can be included in FiveWin, I made changes to btnbmp.prg FWH12.04
Image

New Datas:

nClrActive
nClrMouseOver
nClrPressed
nClrDisabled


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

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

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA


Return to To do - WishList / Por hacer - Peticiones

Who is online

Users browsing this forum: No registered users and 1 guest