Hi,
Is there any way to have multiple views in a single document. If it is possible means , how to assign multiple views in a single document ?
Scenario : I have 3 saved Document’s views. I want to organize those three documents’ views into a single document one by one.
Is it possible…Please help me…
Thanks and Regards,
Natraj.
Certainly, you can create as many GoViews as you want, all viewing the same GoDocument. All of the MDI sample applications support having multiple windows looking at the same document. And the ObjectBrowser sample application shows two views on the same document–one showing links and one not.
But i need to do that dynamically…
Here is my scenario…
I’ve stored three documents as named doc1.xml, dco2.xml and doc3.xml…
I will show that document’s name in seperate window as List… when dragging the document’s name into GraphDoc window , i need to show all the three document’s diagram in the same existing window…
Then i need to connect the three diagrams…
Here i need to have all the three diagrams in a existing doc’s view.
Is it possible ?
I don’t understand what you are trying to do.
A GoView can only view one GoDocument at a time. However, you can have all kinds of things in a GoDocument, perhaps stored in multiple files. Perhaps you could have each “application document” represented by GoObjects in a separate GoLayer, or perhaps each “app doc” would use two GoLayers, all present simultaneously in one GoDocument.
Instead of using GoLayers to separate the objects for different “app docs”, you could just associate other information with each GoObject so that you know which “app doc” they belong to.
I too have similar requirement, but in a different fashion.
<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
<?:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
GoFileDocument
ChildViewClass
GoCategoryLayer1[ TabPage with ChildViewClass.obj1] |
GoCategoryLayer2[ TabPage with ChildViewClass.obj2] |
GoCategoryLayer3[ TabPage with ChildViewClass.obj3] |
GoCategoryLayer5[ TabPage with ChildViewClass.obj5] |
GoCategoryLayer10[ TabPage with ChildViewClass.obj10] |
GoDocument has a Layers collection. By default, each GoView picks up that same collection of GoLayers. But… you can set the Layers collection for each GoView.
GoDocument doc = goView1.Document;
protolink.ToArrow = true;
protolink.PenColor = Color.Red;
protolink.BrushColor = Color.Red;
protolink.PenWidth = 3;
goView1.NewLinkPrototype = protolink;
myLayer1 = doc.Layers.Default;
myLayer2 = doc.Layers.CreateNewLayerAfter(myLayer1);
goViewLayer1.Document = doc;
goViewLayer2.Document = doc;
goViewLinksLayer.Document = doc;
goViewLayer1.Layers.Remove(doc.LinksLayer);
goViewLayer2.Layers.Remove(doc.LinksLayer);
goViewLinksLayer.Layers.Remove(myLayer2);
l1.Text = "Layer 1";
l1.TextColor = Color.Red;
l1.Selectable = false;
l1.Location = new PointF(10, 10);
myLayer1.Add(l1);
l2.Text = "Layer 2";
l2.TextColor = Color.Red;
l2.Selectable = false;
PointF loc = l1.GetSpotLocation(GoObject.BottomRight);
loc.X += 10;
l2.Location = loc;
myLayer2.Add(l2);
l3.Text = "Links Layer";
l3.TextColor = Color.Red;
l3.Selectable = false;
loc = l2.GetSpotLocation(GoObject.BottomRight);
loc.X += 10;
l3.Location = loc;
doc.LinksLayer.Add(l3);
}
Thanks Jake, This is what I am looking for.
The given code will suffice for me.
Hi,
When you set “Observed” property in GoOverview, it calls the virtual InitializeLayersFromDocument.
I need copy/paste a set of selected nodes and connections from one layer to another layer with location of each node and links has to be offset to new location.
Golayer.Add will move an object to a new layer if it already in a different layer in the same document.