FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour User defined gradient colors FWH 8.07
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 06:50 AM

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

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

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 07:29 AM
Otto,

A XBrowse example:
#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
regards, saludos

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

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 07:40 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 07:42 AM

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
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

User defined gradient colors FWH 8.07

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

#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
}
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 08:01 AM

#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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 08:20 AM

#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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 08:21 AM

Dear Uwe,

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

regards, saludos

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

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 08:32 AM
regards, saludos

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

User defined gradient colors FWH 8.07

Posted: Sun Jul 27, 2008 08:37 AM

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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Visual-designer for xBrowse with new options

Posted: Fri Aug 01, 2008 05:16 PM

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:

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: 44162
Joined: Thu Oct 06, 2005 05:47 PM

User defined gradient colors FWH 8.07

Posted: Fri Aug 01, 2008 05:25 PM

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

Continue the discussion