FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MDI Window w Gradient
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
MDI Window w Gradient
Posted: Tue Mar 10, 2015 09:28 PM
Hi everyone;

I wonder if the main MDI window can be shown with a gradient?

Code (fw): Select all Collapse
   DEFINE WINDOW oWnd ICON oIcon ;MDI ;
      MENU BuildMenu() ;
      TITLE "My Title" 
...

   ACTIVATE WINDOW oWnd MAXIMIZED ;


But with a gradient.

Reinaldo.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: MDI Window w Gradient
Posted: Tue Mar 10, 2015 11:58 PM
Reinaldo,

NO problem
tomorrow I will include a downloadlink



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: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 08:05 AM
For a standard window:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oWnd
   local aGradient := { { 1 , nRGB( 248, 186, 107 ), nRGB( 255, 253, 222 ) } }  

   DEFINE WINDOW oWnd
   
   oWnd:Gradient( aGradient )

   ACTIVATE WINDOW oWnd ;
      ON RESIZE oWnd:Gradient( aGradient )  

return nil


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 08:11 AM
For a MDI frame:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function main()

   local oWnd
   local aGradient := { { 1 , nRGB( 248, 186, 107 ), nRGB( 255, 253, 222 ) } }  

   DEFINE WINDOW oWnd MDI
   
   oWnd:oWndClient:Gradient( aGradient )

   ACTIVATE WINDOW oWnd ;
      ON RESIZE oWnd:oWndClient:Gradient( aGradient )   

return nil


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 08:16 AM
MDI frame and childs with gradient:

As I am not using here any code to create the childs, you will need to call oWndChild:Gradient( aGradient ) too on MDICHILD creation:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oWnd
   local aGradient := { { 1 , nRGB( 248, 186, 107 ), nRGB( 255, 253, 222 ) } }  

   DEFINE WINDOW oWnd MDI
   
   oWnd:oWndClient:Gradient( aGradient )

   ACTIVATE WINDOW oWnd ;
      ON RESIZE ( oWnd:oWndClient:Gradient( aGradient ),;
                  AEval( oWnd:oWndClient:aWnd, { | o | o:Gradient( aGradient ) } ) )

return nil


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 10:44 AM
Found it, posted 2010 !!!



You can test any color, gradient, bmp-brush and image.
I will do some revisions of the PAINTER, for better looking and using some new options.

viewtopic.php?f=3&t=20544&p=108970&hilit=mdipaint#p108970

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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 03:26 PM
Please consider another way too:

Code (fw): Select all Collapse
function main()

   local oWnd, oBrush
   local aGradient := { { 0.5, CLR_BLUE, CLR_HBLUE }, { 0.5, CLR_HBLUE, CLR_BLUE } }

   DEFINE BRUSH oBrush GRADIENT aGradient // optional clauses HORIZONTAL/VERTICAL
   DEFINE WINDOW oWnd MDI BRUSH oBrush

   ACTIVATE WINDOW oWnd ON RIGHT CLICK mdichild()
   RELEASE BRUSH oBrush

return nil

function mdichild

  local oWnd

  DEFINE WINDOW oWnd MDICHILD OF WndMain() BRUSH WndMain():oBrush
  ACTIVATE WINDOW oWnd

return nil

Resizing of the Gradient is automatic when the window is resized and you do not need to write any code to handle resizing
Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 09:13 PM

Rao,

Very nice solution and simpler than mine, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: MDI Window w Gradient
Posted: Wed Mar 11, 2015 09:29 PM

Rao/Antonio;

Yes; I agree. Thank you both.

Reinaldo.

Continue the discussion