I try to show a spezial layer from an view in an overview. Is this possible without an affect to the view which is observed by the overview??
thanks for any help.
Yes, you can modify the GoView.Layers collection (a GoLayerCollection) to have references to only the layers you want. You can be selective about the observed view’s document layers you show (and in the order you want to show them). And you can add your own overview-specific view layers too, again in any order you want, interleaved with the document layers of the observed view’s document.
An implementation suggestion: If you are just observing a single view and that view’s document isn’t replaced, you can just make the changes to the GoOverview’s layers collection. But if you expect to change the value of GoOverview.Observed to watch a different GoView, or if the observed GoView.Document might be replaced or might get different layers, then it’s wiser to put your code (that figures out what layers to show in your overview) into an override of GoView.InitializeLayersFromDocument(). That method is called whenever GoView.Document is replaced or when GoOverview.Observed changes.
Thank you for your fast answer.
but i’ ve got another question. I read in your UserGuide :
“There is no guarantee of ordering of objects within a layer. If you really want to make sure that an object will always appear in front of another object when they overlap, then you will need to put them in different layers.”
To avoid this, i used something like a “Dummy-Group”.Every Layer gets this dummy and I put all objects in this to realize an order. But this is also not very nice.
Is there another way to solve this?Or will this be solved in further versions of GoDiagramm??
Greetings from Germany.
Yes, that’s another way to meet that requirement.
Occasionally we get requests for support for ordering within a layer, but not too often. Perhaps we could add a property to GoLayer that would control that, along with methods to move objects behind or in front of other objects in that same layer.
I’m trying to implement this and I’m having difficulty. My parent
view is generated elsewhere and has several layers. I wish to
only show the top layer in the overview.
My latest attempt used the code like this.
public void updateOverview( GoView view )
this.myOverviewTool = new Northwoods.Go.GoOverview();
myOverviewTool .Observed = new GoView();
myOverviewTool.Observed.Layers.Top, view.Document.Layers.Top );
I get “Layer to be inserted into a view layer collection must be a document layer in the view’s document.”
I also tried:
myOverviewTool.Observed = view;
myOverviewTool.Layers.Remove( myOverviewTool.Observed.Layers.Bottom ); // TODO: Loop thru all but one layers
But, this shows all the layers anyways. I checked the sample code
given, but the Web Walker is the only example with an overview.
Can you give me an example snippit for assigning a layer to the
A couple of comments first: using the term “Tool” for a window is confusing, and it doesn’t make sense to ignore the “view” argument by setting the GoOverview.Observed to a new GoView. And I hope this updateOverview isn’t called more than once, because you’ll be throwing away any old GoOverview each time.
Code like this might make more sense (but I haven’t tried this!):
myOverview = new GoOverview();
myOverview.Observed = goView1;
The code you had was trying to remove an observed view layer from the overview, not a document layer from the overview.