User defined gradient colors FWH 8.07

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

User defined gradient colors FWH 8.07

Post by Otto »

Hello Antonio,

I saw that bClrGrad is in those classes:
BAR, BTNBMP, WINDOW, XBROWSE

Could you please post some more examples how to use with BTNBMP and xBrowse.
And if there are more possibilities to use 'User defined gradient colors' also these.

Thanks in advance
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

A XBrowse example:

Code: Select all

#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oWnd, oBrw

   USE customer

   DEFINE WINDOW oWnd
   
   @ 0,0 XBROWSE oBrw OF oWnd AUTOCOLS FOOTERS

   oBrw:bClrGrad = { | lInvert | If( ! lInvert,;
                             { { 0.5, nRGB( 63, 177, 66 ), nRGB( 197, 235, 198 ) },;
                             { 0.5, nRGB( 197, 235, 198 ), nRGB( 20, 186, 182 ) } },; 
                             { { 0.5, nRGB( 197, 235, 198 ), nRGB( 20, 186, 182 ) },;  
                             { 0.5, nRGB( 63, 177, 66 ), nRGB( 197, 235, 198 ) } } ) }

   oBrw:CreateFromCode()
   oWnd:oClient = oBrw
   
   ACTIVATE WINDOW oWnd

return nil
Please notice that I use gray color as my window background color
Image
regards, saludos

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

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

It would look even better if oBrw:nRecSelColor is assigned a suitable green color to match with the headers and footers
Regards

G. N. Rao.
Hyderabad, India
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Antonio, could you please have a look at this code.
I can't see the gradient colors. Where do I have the mistake?
Regards,
Otto

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg, oBtn

   DEFINE DIALOG oDlg RESOURCE "Test"

   REDEFINE BTNBMP oBtn PROMPT "A Test" ID 100 OF oDlg ACTION msginfo("test")

    oBtn:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 0.50, nRGB( 178, 187, 202 ), nRGB( 137, 155, 179 ) },;
                                       { 0.50, nRGB( 129, 149, 174 ), nRGB( 114, 132, 156 ) } },;
                                     { { 0.50, nRGB( 139, 166, 193 ), nRGB(  69, 119, 170 ) },;
                                       { 0.50, nRGB(  52, 104, 152 ), nRGB(  50, 107, 162 ) } } ) }
   oBtn:nClrText = nRGB( 255, 255, 255 )


   ACTIVATE DIALOG oDlg CENTERED

return nil



RC-FILE
----------------------------------------------------
test DIALOG 76, 71, 194, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Colors on Buttons"
FONT 8, "MS Sans Serif"
{
 CONTROL "A Test", 100, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 70, 62, 50, 22
}

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Image

Code: Select all

#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oWnd, oBrw

   USE customer

   DEFINE WINDOW oWnd
   
   @ 0,0 XBROWSE oBrw OF oWnd AUTOCOLS FOOTERS ;
      COLORS CLR_WHITE, CLR_BLUE CELL LINES

   oBrw:nRecSelColor = nRGB( 146, 213, 148 )
   oBrw:bClrSelFocus = { || { nRGB( 255, 255, 255 ), nRGB( 146, 213, 148 ) } }
   oBrw:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 0.5, nRGB( 63, 177, 66 ), nRGB( 197, 235, 198 ) },;
                                       { 0.5, nRGB( 197, 235, 198 ), nRGB( 20, 186, 182 ) } },; 
                                     { { 0.5, nRGB( 197, 235, 198 ), nRGB( 20, 186, 182 ) },;  
                                       { 0.5, nRGB( 63, 177, 66 ), nRGB( 197, 235, 198 ) } } ) }

   oBrw:CreateFromCode()
   oWnd:oClient = oBrw
   
   ACTIVATE WINDOW oWnd

return nil
regards, saludos

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

Post by Antonio Linares »

Image

Code: Select all

#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oWnd, oBrw, oBrush

   USE customer

   DEFINE BRUSH oBrush FILE "sky3.bmp"

   DEFINE WINDOW oWnd
   
   @ 0,0 XBROWSE oBrw OF oWnd AUTOCOLS FOOTERS ;
      COLORS CLR_BLUE, CLR_WHITE CELL LINES ALIAS "customer"

   oBrw:nRecSelColor = nRGB( 146, 213, 148 )
   oBrw:bClrSelFocus = { || { nRGB( 255, 255, 255 ), nRGB( 146, 213, 148 ) } }
   oBrw:SetBackGround( oBrush )
   oBrw:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 0.5, nRGB( 63, 177, 66 ), nRGB( 197, 235, 198 ) },;
                                       { 0.5, nRGB( 197, 235, 198 ), nRGB( 20, 186, 182 ) } },; 
                                     { { 0.5, nRGB( 197, 235, 198 ), nRGB( 20, 186, 182 ) },;  
                                       { 0.5, nRGB( 63, 177, 66 ), nRGB( 197, 235, 198 ) } } ) }

   oBrw:CreateFromCode()
   oWnd:oClient = oBrw
   
   ACTIVATE WINDOW oWnd

return nil
regards, saludos

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

Post by Antonio Linares »

Dear Uwe,

You could now create a nice visual designer for the XBrowse :-)
regards, saludos

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

Post by Antonio Linares »

Image
regards, saludos

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

Post by Antonio Linares »

Otto,

Single BtnBmp buttons are not using bClrGrad yet. They will do it in next FWH build.

For now, they only use it when placed on buttonbars.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Visual-designer for xBrowse with new options

Post by ukoenig »

Hello,

to modify the Visual-designer with all the new
options : Gradient ..... , is on my to do-list.
As well i'm busy to create a new MAKE-tool.

Is it better, to carry on with xBrowse at first ?

Best regards
Uwe :lol:
Last edited by ukoenig on Fri Aug 01, 2008 6:20 pm, 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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dear Uwe,

Its up to you, though there are many FWH users migrating from other browses to xbrowse these days and surely they will appreciate a visual assistant from you, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply