Profile Picture

Docking Framework Question -- Lock Panels down

Posted By Jeff McMahon 14 Years Ago
Author
Message
Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hello Jeff,

For this task you can use nested docking managers.

Please, take a look at the code example below:

 

NDockManager mainManager = new NDockManager();

NDockingPanelHost mainHost = new NDockingPanelHost();

NDockingPanel navPanePanel = new NDockingPanel();

mainManager.Form = this;

mainManager.RootContainer.RootZone.Orientation = Orientation.Horizontal;

mainManager.DocumentStyle.DocumentViewStyle = DocumentViewStyle.SingleDocument;

mainManager.RootContainer.RootZone.AddChild(mainHost);

mainHost.AddChild(navPanePanel);

mainHost.Orientation = Orientation.Horizontal;

mainHost.Index = 0;

navPanePanel.Permissions.AllowAutoHide = false;

navPanePanel.Permissions.AllowFloat = false;

navPanePanel.Permissions.AllowHide = false;

navPanePanel.Permissions.AllowedDockAreas = DockAreaMask.None;

navPanePanel.Permissions.ExposedDockAreas = DockAreaMask.None;

NUIDocument doc1 = new NUIDocument();

Form form = new Form();

form.TopLevel = false;

form.Dock = DockStyle.Fill;

form.FormBorderStyle = FormBorderStyle.None;

form.Show();

doc1.Client = form;

mainManager.DocumentManager.AddDocument(doc1);

NDockManager manager = new NDockManager();

manager.Form = form;

NDockingPanel panel = new NDockingPanel();

NDockingPanelHost host = new NDockingPanelHost();

host.Orientation = Orientation.Horizontal;

host.AddChild(panel);

manager.RootContainer.RootZone.AddChild(host);

//And so on ...

You can host your navigation pane in navPanePanel and this way it will always be at the same state and position regardless the panels and documents in the child docking manager.

Regards,

Angel.

 

 



Jeff McMahon
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 5, Visits: 1
I am creating a Winforms app, trying to mimic a combination Visual Studio interface with left / right / bottom panels and a Doc View in the middle and an Outlook style UI where there is a NavigationPane on the left that is locked down (can't move it, nor dock anything to the left of it).

DockManger makes quick work of this, but I can't seem to figure out how to prevent docking child panels to the left of the document view and left of the NavigationPanel.

Also, I want to make sure the left NavigationPane is always the dominant left docking panel (don't want any other panel to dock to bottom and span the entire width of the form.)

I have tried the following:

-add the NavPane to the left DockZone and played with properties like DockManager::StickToMainForm and trying to change the DockAreaMask of the DockManager.RootContainer.DockAreaProviders with no luck.

-tried to put the NavPane right on the form and try to dock a DockManager beside it -- problem is the NMenuBar always seems to dock back to the top of the dockManager and does not span the width of the form.

Any thoughts ?

Thanks
Jeff




Similar Topics


Reading This Topic