Gradient advice needed

Gradient advice needed

Postby Richard Chidiak » Fri Apr 30, 2010 8:48 am

Hello

One of my applications (Pos system) draws user defined buttons , mainly 2 or 3 lines of text with selected colors for each button

I an using tsbutton for that , no problem

I want to give a better look with gradient effect to the buttons and unfortunately i can not get them to work. I have seen Uwe's buttons designed and they look very nice. I downloaded the tools and tried to do the same without reult so far. Can anyone help ?

I tried the 3 classes, Tbtnbmp, Tbuttonbmp, and Tbutton ? my buttons are redefined from resources

Please note that my application uses skinbuttons , is this compatible ?

Thanks for your time,

Here is the code

Code: Select all  Expand view


// DOLDC is the user selected colour

DBLUE  := INT(NRGBBLUE(DOLDC)  * 0.9)   // retreive the blue from user's selected colour
DGREEN := INT(NRGBGREEN(DOLDC) * 0.9)
DRED   := INT(NRGBRED(DOLDC)   * 0.9)

DNEWC  := nRgb(DRED,DGREEN, DBLUE)

TOBJ[I]:bClrGrad := { | lInvert | If( lInvert, ;
      { { 0.67, DOLDC, DNEWC }, { 0.67, DNEWC, DOLDC } }, ;
      { { 0.50, 128,DNEWC }, { 0.50,DNEWC, 128 }  } ) }

 
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Gradient advice needed

Postby nageswaragunupudi » Fri Apr 30, 2010 9:30 am

>>
Please note that my application uses skinbuttons , is this compatible ?

>>
If you are using skinbuttons, you can either use the default gradient provided by FWin, or you can define your own gradients. The gradients that are defined with skinbuttons function apply to the entire application to all BtnBmps, Buttons, and ButtonBmps uniformly.

In addition, you can define individual gradients to individual btnbmps.
Regards

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

Re: Gradient advice needed

Postby Richard Chidiak » Fri Apr 30, 2010 10:37 am

Mr Rao

Thank you for the explanation, this is what i understood from previous topics i read

Nevertheless the gradient setting for individual buttons is not working as per my sample , this is my problem.

Using FWH 10.1
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Gradient advice needed

Postby nageswaragunupudi » Fri Apr 30, 2010 11:15 am

>>
Nevertheless the gradient setting for individual buttons is not working as per my sample , this is my problem
>>
Gradient settings for individual buttons work with only BTNBMPs and that too if 2007 style is on.

Please make sure you are using 2007 clause while defining the BTNBMP.
Regards

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

Re: Gradient advice needed

Postby Richard Chidiak » Fri Apr 30, 2010 11:27 am

Thank you , this is the missing information i was looking for

I have it working now,

Thanks again
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Gradient advice needed

Postby ukoenig » Fri Apr 30, 2010 12:11 pm

Richard,
changing Buttons ( BtnBMP ) at Runtime using Vars :

Code: Select all  Expand view

REDEFINE BTNBMP oBtn1 ID 110 OF oDlg70 BORDER ;
FILENAME cBmpFile ;
ACTION MsgAlert( "Button-Click", "Button 1" ) ;
PROMPT cPrompt ;
FONT oTextFont
IF BT_FORM = 2 // Form
   oBtn1:lEllipse = .T.
ENDIF
IF BT_STYLE = 1 // 2007-Style
   oBtn1:l2007 := .T.
ENDIF
IF BT_STYLE = 2 // Gradient
   oBtn1:l2007 := .T.
   oBtn1:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
   { { BT_MOVE, BTN_COLOR1, BTN_COLOR2 }, ;
      { BT_MOVE, BTN_COLOR2, BTN_COLOR1 } },;
   { { BT_MOVE, BTF_COLOR1, BTF_COLOR2 }, ;
     { BT_MOVE, BTF_COLOR2, BTF_COLOR1 } } ) }
ENDIF
IF BT_STYLE = 3 // Style-Setting
   oBtn1:lTransparent := .T.
ENDIF
IF BT_BORDER = 2 // Border-Setting
   oBtn1:lBORDER := .F.
ENDIF
oBtn1:nLayout := B_POSITION // Text-Position
oBtn1:SetColor( BT_COLOR ) // Text-Color
oBtn1:cToolTip =  { "TBtnBMP" + CRLF + cBtn1, "Size", 1, CLR_BLACK, 14089979 }

// Changing Buttonsize from Resource :
ACTIVATE DIALOG oDlg70 CENTERED ;
ON INIT ( IIF( BTN_RESIZE = .T., ; // Resize wanted
                    oBtn1:SetSize( BTN_WIDTH, BTN_HEIGHT, .T. ), NIL ) )
 


Best Regards
Uwe :lol:
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: Gradient advice needed

Postby Richard Chidiak » Fri Apr 30, 2010 12:29 pm

Uwe

Thank you
:)
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Silvio.Falconi and 97 guests