NDockingToolbar persistence


Author
Message
Craig Swearingen
Craig Swearingen
Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)
Group: Forum Members
Posts: 99, Visits: 654

I've been using NDockingToolbars just fine but I've disabled letting the user move them around til now.  I've turned on the properties to allow the toolbars to be moved around and that operation works as expected.  I've been trying to persist the toolbar location for several hours now and can't make it work reasonably.

I build my toolbars (1 MenuBar and 2 icon bars) mostly dynamically by adding an NCommand to my NDockingToolbar Commands collection.  Works great. 

I briefly tried using the NCommandBarsState class to save my toolbars state.  When I loaded a saved state my click events on my commands were unknown.  I gave up at that point.  I would imagine the way I build my toolbars is not compatible with this persisting approach. 

Thus I'm trying to persist the toolbar Dock, Location, and RowIndex properties.  I don't allow the user to edit the toolbars themselves so I was hoping that would be sufficient to remember and it nearly is.

1) When calling toolbar.Dock = DockStyle.None my toolbar properly floats out from the docked position.  If I then call toolbar.Dock = DockStyle.Top the toolbar docks back at the top but its height is wrong and it continues to show parts of the floated toolbar visual.  I've tried setting the above properties in different orders and using the NCommandBarsManager Suspend/ResumeDockLayout methods as well as setting the FloatingSize/Location to 0 but nothing helps.  Works great when the user docks using the mouse.  What else can I do programatically to get the visual to look the same?  (I attached a scribbled out picture of this docked toolbar visual issue.)

2) I read on this forum that the ability to move a toolbar above the menu bar (which is a toolbar too) is by design.  Someone has already asked if there was a way to stop this.  I can't think of a single application that has allowed me to move my toolbars above a menu bar.  This should be optional.  I briefly tried persisting my menubar as a toolbar too so as to accomodate the user doing this and began getting some form of exception (not in my code).  I did not persue this further.

3) I tried setting CanFloat to false.  When doing this the user can't move the toolbar to any other dock state.  I was hoping they could move it around the borders but it seems its stuck.  Anyway to not support float but move around all borders?

I'm running on Win7 using build 11.12.14.12.  I would appreciate any suggestions on the proper persisting of toolbars and recommendations on these issues I've seen.


Attachments
dockedtoolbarvisual.GIF (404 views, 8.00 KB)
Reply
Craig Swearingen
Craig Swearingen
Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)
Group: Forum Members
Posts: 99, Visits: 654

Given the indication that you may provide a fix for the programatic docking of the toolbar painting issue in a future release I went further and tried to persist the floating toolbar state.  Thus I'm trying to persist the FloatingLocation and FloatingSize parameters of an NDockingToolbar.

1) When a toolbar is already floating and I subsequently want to have it floating with a different size and location its not clear how to make this work.  Setting the FloatingLocation and FloatingSize sometimes doesn't change the values.  Its as though they are in a state where they can not be updated.

2) There seems to be an issue with persisting the FloatingSize initially.  Perhaps too soon after the toolbar is created.  The first time I try to set the size the toolbar comes out a little smaller than it should and thus flows differently.

I'd like to be able to provide multiple layouts a user could switch to for my NDockingToolbars much like I can for my NDocuments.  Can I do this?


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search