Page 1 of 1

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 6:50 am
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

Posted: Sun Jul 27, 2008 7:29 am
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

Posted: Sun Jul 27, 2008 7:40 am
by Antonio Linares

Posted: Sun Jul 27, 2008 7:42 am
by nageswaragunupudi
It would look even better if oBrw:nRecSelColor is assigned a suitable green color to match with the headers and footers

Posted: Sun Jul 27, 2008 7:59 am
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
}


Posted: Sun Jul 27, 2008 8:01 am
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

Posted: Sun Jul 27, 2008 8:20 am
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

Posted: Sun Jul 27, 2008 8:21 am
by Antonio Linares
Dear Uwe,

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

Posted: Sun Jul 27, 2008 8:32 am
by Antonio Linares
Image

Posted: Sun Jul 27, 2008 8:37 am
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.

Visual-designer for xBrowse with new options

Posted: Fri Aug 01, 2008 5:16 pm
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:

Posted: Fri Aug 01, 2008 5:25 pm
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 :-)