Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Default Docking Idea
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Default Docking Idea

 Post Reply Post Reply
Author
Message
jemery View Drop Down
Groupie
Groupie


Joined: 09 January 2008
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote jemery Quote  Post ReplyReply Direct Link To This Post Topic: Default Docking Idea
    Posted: 09 January 2008 at 6:25pm
Just came up with one of those 'duh' moments I thought I'd share.

Not sure how other people have their docking systems set up, but I create a default docking pane setup using the manual pane code first.  Then I do a check to see if a configuration exists in the registry and load that.  This overrides the manual pane setup, naturally.

However, I find that users sometimes manage to totally screw up their pane setups and this doesn't provide for a good way over overriding this.  Since I already was allowing them to save docking configurations (an earlier request as teams like to share configs for different projects), I created an extra config file automatically saved before loading from the registry.  This allows for a default config file that can never go out of date (as it's automatically generated).  So, it's a simple matter for a user to reload to a default window state by loading that file.

Problem solved. :)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 30 January 2008 at 5:58am
Jemery,
 
First of all I am pretty new with DockingPanes. This is what I do:
1) Create the panes and attach them to form.hwnd. (when the app runs for the first time there's nothing in the registry)
2) Use the DockingPaneManager_AttachPane event to attach the panes to the forms. (simular to the CreatePanes function).
 
The first time the app runs, the panes will be positioned like I wanted in the CreatePanes function. On shutdown the positions will be saved with DockingPaneManager.SaveState function. When starting the app again the registry will be filled with the settings saved the last time the app was running. Now to get these settings I use the DockingPaneManager.LoadState function. So now all the code in the CreatePanes function doesn't do anything anymore because the DockingPaneManager.LoadState overrides that. Now the DockingPaneManager_AttachPane event will attach the pane to the form.
 
This will work because the user will position the panes to their own needs. BUT: I'm still working on my project and create a pane that I want to add to my main window. This pane doesn't exist in the registry so the pane will not be visible, I don't know why, but it doesn't. This is what I do: don't call Loadstate, then all the panes will be created and shown. Position the panes like I want to and shut the app. SaveState function will save the settings and voila. Next time the panes are positioned with LoadState function.
 
I don't know if this is the right approach.
Maybe you have a better solution for me, please let me know
 
Thank you in advance  
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.