if i have a large sub tree then when its minimized the focus stays at the bottom opposed to refocusing back up to the top of the page / or to the focal point of the graph
is it possible, seeing as i am using layout.Angle = 0; to get the top level part of the tree to always dock right up against the left hand side of the go view? its very annoying having to do horizontal scrolling. And on the topic of horizontal scrolling, is there anyway to keep that to a minimum?
You can “scroll” the view under program control, which I think that gets to both your issues here.
Read through the API reference for GoView.DocExtent, DocPosition, DocExtentCenter. And search the forum here for those methods too, as you’ll see various sample code.
Hi Jake, i’ve spent a day or two now looking through the stuff you posted and I still cant seem to find how to scale a picture appropriately to fit in to its container so that horizontal scrolling is disabled.
Add to that i still can’t see how to dock the left most part of the tree to the left most part of the container either :/
i am disappointed in myself to be asking this question :$
when exactly should i be calling that method if i want it done on the drawing of a graph?
i have a display class which gets a goview object from a graph
i set the container and then add the goview object to my forms controls collection.
If i call the fithorizontal method just before adding to the controls collection i get a really small graph in the upper left hand corner, its very small tbh, so small you cant see anything.
if i put the method call in the click event of a graph
I’m not entirely sure what you’re going for here, but there may be a couple of points where you call this… it seems like whenever you call PerformLayout is one. This would handle all the times where you are expanding/collapsing the tree, right?
Another time might be after you load the Document, but…you’re probably doing a Layout there, so the earlier suggestion would handle that.
i cant find an appropriate place in any of those to call the method you suggested? If i place it in the MainContainer(gui constructor) after i placed it in the panel1.controls then nothing happens, if i place it in the click event for the graph then it resizes only when minimising a subgraph opposed to maximising
[QUOTE=Jake]edit: fixed to the point where i know that the method has to be called in my main gui when its set as the goview gets passed to the display class for display, and until then the goview has no size as its not on the screen. The issue is, when i expand and contract a node i still get the same problem, which means i guess i need to call the fithorizontal method from the expand and collapse method in the treeappnode class.
The issue here is that treeappnode class has no reference to a graphing object.
Can i get a GoView object from a node? something like
private void collapse()
{
Graph v = this.parent()//which gets my Graph object
GoView gv = v.getView() which gets the the goview for this graph?
…
…
//do collapsing stuff
v.FitHorizontal(gv);
}
or am i miles off ?
edit2: i found i can get the view but its null :/. I was going to make the fithorizontal static and pass the goview in which i cant do now as i only have the document available.
GoObject.View is only non-null when the object has been added to a View Layer, which typically doesn’t happen (except for things like selection handles).
Yes, sometimes getting the GoView can be a pain.
What GoDocument does is calls RaiseChanged(hint, …) and relies on the GoView to catch the event and handle it appropriately.
In fact, the PerformLayout does a RaiseChanged(GoDocument.AllArranged, …) just before it returns, so I think your view could look for that… and do your “Fit” thing there. (I’ve never tried this.)