FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Posted: Sat Nov 12, 2011 03:12 PM
* New: Class TWindow Method Gradient( aGradColors )

* New: DEFINE DIALOG oDlg GRADIENT <aGradColors>, in example:

Code (fw): Select all Collapse
     DEFINE DIALOG oDlg TITLE "Test" ;
        GRADIENT { { 0.25, nRGB( 219, 230, 244 ), nRGB( 207, 221, 239 ) },;
                   { 0.75, nRGB( 201, 217, 237 ), nRGB( 231, 242, 255 ) } }

     ACTIVATE DIALOG oDlg CENTERED


No need to use function GradBrush() ever more :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Posted: Sat Nov 12, 2011 05:48 PM


Code (fw): Select all Collapse
   local oDlg, cHost := Space( 20 ), cUser := Space( 20 ), cPassword := Space( 20 )
   local oBtn, bClrGrad := { | lPressed | If( ! lPressed,;
                           { { 1, nRGB( 253, 254, 255 ), nRGB( 179, 217, 255 ) } },;
                           { { 1, nRGB( 179, 217, 255 ), nRGB( 253, 254, 255 ) } } ) }

   DEFINE DIALOG oDlg TITLE "Login" ;
      GRADIENT { { 1, nRGB( 199, 216, 237 ), nRGB( 237, 242, 248 ) } }
   
   @ 0.5, 3 SAY "Host:" 
   
   @ 0.5, 7 GET cHost
   
   @ 1.5, 3 SAY "User:" 

   @ 1.7, 7 GET cUser
   
   @ 2.5, 3 SAY "Password:" 

   @ 2.9, 7 GET cPassword
   
   @ 55, 30 BTNBMP oBtn PROMPT "Ok" FILENAME "..\bitmaps\32x32\yes2.bmp" SIZE 50, 15 ;
      LEFT NOBORDER ACTION oDlg:End()

   oBtn:bClrGrad = bClrGrad

   @ 55, 85 BTNBMP oBtn PROMPT "Cancel" FILENAME "..\bitmaps\32x32\cancel.bmp" SIZE 50, 15 ;
      LEFT NOBORDER ACTION oDlg:End()

   oBtn:bClrGrad = bClrGrad
   
   ACTIVATE DIALOG oDlg CENTERED
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Posted: Sat Nov 12, 2011 09:25 PM
Does it work with TFolderex and Radios as well ( transparent ) ?
( easy to include the test in my Debugging-tool )



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.
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Posted: Mon Nov 14, 2011 10:36 AM

Excellent news!

Can you also specify if you want horizontal or vertical gradients?

As Uwe said, hope it works with Folders (tFolder & tFolderex), Radios & Checkboxes.

Currently, I set all of the labels/checkboxes/radios as transparent, will I still need to do this or will it do this automatically if a gradient is used?

Also, currently, we give the users the ability to turn on or off the gradient, could we acieve this by passing an empty array as the gradient parameter or will we have to define it in a different way (oDlg:aGradient := {1, 1234567890, 0987654321})

Best regards,

Pete

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Posted: Mon Nov 14, 2011 12:27 PM

Uwe,

We have implemented a Method Gradient( aGradColors ) in Class TWindow that does all the work, so any inherited Class from TWindow can use it. So in case that a Class is not using, it will be able to use it :-)

This method uses function GradBrush() logic, so if the radios and folder work fine with GradBrush() then they will work fine with this new method too.

Pete,

When clause GRADIENT is used, TRANSPARENT is set automatically. I guess that we could use horizontal by default and optionally accept vertical mode too.

Maybe we need to implement a global setting to use the same gradient in all dialogs, on and off, etc... We need your feedback :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Posted: Mon Nov 14, 2011 12:46 PM

Antonio,

That would be great, I could read in my config file that contains, Gradient Yes/No, Direction (H/V), Starting position of gradient, Colours used, then write these to FWH global settings.

Global settings are a very good idea :D

Best regards,

Pete

Continue the discussion