Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 Tags
Subject: RE: Grid graph
Thread ID: 395806 Message ID: 395915 # Views: 52 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Tuesday, January 21, 2014 10:44:06 AM         
   


> >
> > You can use Shape objects, and put them in a Grid.Column, or in Container that you put beneath the Grid as your picture looks.
> >
> > The Shape.Width would indicate something like percentage, so that you could use one of the Column.Dynamic properties if it's inside the Grid, see also the sample code pasted below.
> >
> > If it's outside the Grid, Shape.Width could get determined in a place like Grid.AfterRowColChange(), which would be easy, and the Container(s) that hosts the Shape would probably need to adjust position according to resizing Forms as well as resized as well as moved Grid.Columns which can be done using BindEvent()
> >
> >
> >
> > hth
> > -Stefan
> >
> >
> >
> > LOCAL oForm as Form
> > oForm = CREATEOBJECT('TestForm')
> > oForm.Show(1)
> > RETURN
> > 
> > DEFINE CLASS TestForm as Form
> > 	AutoCenter = .T.
> > 	DataSession = 2
> > 	Width = 450
> > 
> > 	PROCEDURE Load
> > 		CREATE CURSOR temp (test I)
> > 		RAND(-1)
> > 		INSERT INTO temp VALUES ( 50 )
> > 		LOCAL i
> > 		FOR i = 1 TO 20
> > 			INSERT INTO temp VALUES ( INT(RAND()*100) )
> > 		ENDFOR
> > 		GO TOP IN temp
> > 	ENDPROC
> > 
> > 	ADD OBJECT grdTest as Grid WITH ;
> > 		ColumnCount = 2, Width = 450, Height = 250
> > 	PROCEDURE grdTest.Init
> > 		WITH This.Column2 as Column
> > 			.NewObject('cntShape','GridShape')
> > 			.cntShape.Visible = .T.
> > 			.CurrentControl = 'cntShape'
> > 			.DynamicFontBold = 'This.Column2.cntShape.DynamicWidth(temp.test)'
> > 			.Sparse = .F.
> > 			.Width = 300
> > 		ENDWITH
> > 	ENDPROC
> > ENDDEFINE
> > 
> > DEFINE CLASS GridShape as Container
> > 	PROCEDURE DynamicWidth(tnPercent)
> > 		This.shpOne.Width = This.Parent.Width / 100 * m.tnPercent
> > 		RETURN .T.
> > 	ENDPROC
> > 
> > 	ADD OBJECT shpOne as Shape WITH ;
> > 		BackColor = RGB(255,0,0), ;
> > 		Width = 0
> > ENDDEFINE
> > 

>
> I really love this one, thanks!
>
> My respects



That's an honor for me :-)

There are brilliant alternatives in the thread that starts here
https://www.foxite.com/archives/how-to-create-variable-rectangle-in-grid-0000308166.htm




Best Regards
-Stefan

ENTIRE THREAD

Grid graph Posted by randy requina @ 1/20/2014 7:32:40 AM
RE: Grid graph Posted by David Mustakim @ 1/20/2014 7:38:40 AM
RE: Grid graph Posted by randy requina @ 1/20/2014 7:51:13 AM
RE: Grid graph Posted by Stefan Wuebbe @ 1/20/2014 7:53:30 AM
RE: Grid graph Posted by randy requina @ 1/20/2014 8:43:27 AM
RE: Grid graph Posted by Stefan Wuebbe @ 1/20/2014 12:15:34 PM
RE: Grid graph Posted by randy requina @ 1/23/2014 9:43:20 AM
RE: Grid graph Posted by David Mustakim @ 1/23/2014 10:01:27 AM
RE: Grid graph Posted by Vilhelm-Ion Praisach @ 1/21/2014 9:48:19 AM
RE: Grid graph Posted by Stefan Wuebbe @ 1/21/2014 10:44:06 AM
RE: Grid graph Posted by Vilhelm-Ion Praisach @ 1/21/2014 11:06:06 AM
RE: Grid graph Posted by randy requina @ 2/22/2014 9:31:54 AM
RE: Grid graph Posted by Tore Bleken @ 1/21/2014 10:08:52 AM
RE: Grid graph Posted by Paul Gibson @ 1/21/2014 12:50:09 PM