Possible to change the BtnBmp-textcolor on mousecaption ?

Possible to change the BtnBmp-textcolor on mousecaption ?

Postby ukoenig » Tue Feb 17, 2015 9:56 am

Hello,

the button-textcolor is defined with ==> oBtn:SetColor( 16777215, ) // white
but how to change / set the textcolor on FOCUS / mousecaption ?

Sample :
the basic button-gradient is dark with a light textcolor
the button-gradient on FOCUS is light, how to change the defined textcolor to dark to make it visible ?

Image

best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby Antonio Linares » Wed Feb 18, 2015 8:01 am

Uwe,

DATA nClrText can be a codeblock so from it we can check if the mouse is over and provide a different color.

The same applies to DATA nClrTextDis

Please try this:

oBtn:nClrText := { | lMouseOver | If( lMouseOver, CLR_HBLUE, CLR_WHITE ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby ukoenig » Wed Feb 18, 2015 10:22 am

Antonio,

thank You very much,
It is exactly what I need.

It is easy now, to find the best combination between the 6 colors. ( 4 gradient and 2 text )
I added a second textcolor-selection to the button-area.

Image

Copy / paste the gradient and textcolor of the button
added
oBtn:nClrText := { | lMouseOver | If( lMouseOver, nBTextCol2, nBTextCol1 ) }
to get the complete button-informations.

Image


best regards
Uwe :)
Last edited by ukoenig on Tue Feb 24, 2015 10:10 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby ukoenig » Mon Feb 23, 2015 8:53 pm

Antonio,
updating to 15.2 this solution doesn't work anymore.
In 15.1 it was OK.
I changed to nClrTextDis ; NO error but with NO result.
Maybe another solution, changing the textcolor on mouseover ?

OK in FWH 15.1
oBtn:nClrText := { | lMouseOver | If( lMouseOver, CLR_HBLUE, CLR_WHITE ) }

Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 02/23/15, 21:51:14
Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = B {|| ... }
[ 2] = N 2

Stack Calls
===========
Called from: .\source\classes\BTNBMP.PRG => WNDSAYTEXT( 1589 )
Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW:TWINDOW( 564 )
Called from: => TBTNBMP:SAYTEXT( 0 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:PAINTCAPTION( 1308 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:PAINT( 1340 )
Called from: .\source\classes\BTNBMP.PRG => (b)TBTNBMP:TBTNBMP( 126 )
Called from: => TBTNBMP:DISPLAY( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1699 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1434 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3464 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 )
Called from: .\BUTTONS.PRG => MAIN( 428 )

A small test :

Code: Select all  Expand view

#include "fivewin.ch"
 
FUNCTION MAIN()
LOCAL oDlg, oBtn1, oFont1
 
SETBALLOON( .T. )
 
DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-16 BOLD
 
DEFINE DIALOG oDlg SIZE 550, 400  TITLE "Test button"
 
 @ 145, 200 BTNBMP oBtn1 OF oDlg ;
SIZE 60, 35 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Exit " ;
ACTION oDlg:End() ;
FONT oFont1 ;
CENTER
oBtn1:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
    { { 0.5, 11513775, 16777215 }, ;
    { 0.5, 16777215, 11513775 } }, ;
    { { 0.5, 12615680, 16777215 }, ;
    {  0.5, 16777215, 12615680 } } ) }
oBtn1:lTransparent := .t.
oBtn1:cToolTip =  { "Exit" + CRLF + "Sample","EXIT", 1, CLR_BLACK, 14089979 }

// Errormessage !
// oBtn1:nClrText := { | lMouseOver | If( lMouseOver, 16777215, 255 ) }
 
ACTIVATE DIALOG oDlg CENTER
 
oFont1:End()
 
RETURN( NIL )
 



best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby nageswaragunupudi » Tue Feb 24, 2015 1:45 am

Regret the bug.

Please make this correction in the btnbmp.prg at line 1308:
Present code:
Code: Select all  Expand view

      ::SayText( ::cCaption, oRect:aRect, cAlign, ::oFont, nClr )
 

Please sustitute with:
Code: Select all  Expand view

      ::SayText( ::cCaption, oRect:aRect, cAlign, ::oFont, XEval( nClr , ::lMover ) )
 

Can you please make the change and test again?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10326
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby ukoenig » Tue Feb 24, 2015 7:35 am

Mr. Rao,

thank You very much.
It is working again.

best regards
Uwe :)
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby nageswaragunupudi » Tue Feb 24, 2015 8:34 am

Thanks for pointing out the problem promptly.
We shall include this for revised build.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10326
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Possible to change the BtnBmp-textcolor on mousecaption ?

Postby ukoenig » Tue Feb 24, 2015 10:07 am

The final result using FWH 15.2
Everything I need, is included now.

For the text I don't use says anymore, instead using 12 buttons shown in 2 columns
The buttons in column 2 including only the text but with accelerators and textcolor-change on focus
adjusted to LEFT. The acellerators are working fine and the images are changing related to a selected text-button.
A click on the buttons of column 2, is executing the same action like using the image-column.
That all offers more options, different from the normal radios.
Tooltips are included on each selection.
The border colors of column 1 ( images ) are changing on focus same like the textcolor in column 2.
Using a acellerator from column 2, the image of column 1 changes as well.

Image

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 132 guests

cron