New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Postby Antonio Linares » Sat Nov 12, 2011 3:12 pm

* New: Class TWindow Method Gradient( aGradColors )

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

Code: Select all  Expand view

     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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Postby Antonio Linares » Sat Nov 12, 2011 5:48 pm

Image

Code: Select all  Expand view

   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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Postby ukoenig » Sat Nov 12, 2011 9:25 pm

Does it work with TFolderex and Radios as well ( transparent ) ?
( easy to include the test in my Debugging-tool )

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: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: New DEFINE DIALOG oDlg GRADIENT aGradColors in FWH 11.11

Postby PeterHarmes » 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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests