Auto-dock a Custom Command?

Cheesehole wrote on 6/28/2008, 1:11 PM
I noticed that Edward Troxel's Excalibur script opens up in the docked area by default. I figured out how to make a dockable script using VS2008, but I don't see any way to automatically dock it like that. Mine comes up as a floating window and I have to drag it into the docking area each time.

I wonder what the trick is...?

Comments

JohnnyRoy wrote on 6/28/2008, 1:39 PM
> I wonder what the trick is...?

The trick is to set the PersistDockWindowState property of your DockableControl to True. Then it will remember the last state (docked or undocked) even if you close the window and reopen it. I usually set this in my HandleCmdInvoked method before I call LoadDockView().

~jr
Cheesehole wrote on 6/29/2008, 12:30 AM
Hey thanks for responding man!

I set that property just like you said and it worked like a charm! Woohoo! ;)

Ben

P.S. It think Edward might still be doing a trick to make it dock the first time it opens... but I can live with what I've got for now!
Rosebud wrote on 6/29/2008, 6:14 AM
myDockView.DefaultDockWindowStyle = DockWindowStyle.Docked;
Cheesehole wrote on 6/29/2008, 9:48 AM
Great! Thanks Rosebud!
Cheesehole wrote on 6/29/2008, 10:31 AM
Okay one more... to complete the picture. I notice that scripts like Show Event Length and Project Inspector will remember that they are open even after I close and re-open Vegas. My script has to be invoked from the menu each time...
Cheesehole wrote on 6/29/2008, 9:43 PM
HA! I'm learning. To answer my own question:

dockView.AutoLoadCommand = myViewCommand;

(myViewCommand is the var name of the CustomCommand whose Invoked method opens the panel)

If a DockableControl is visible when Vegas exits, it can be automatically reloaded when Vegas runs the next time if its AutoLoadCommand property is set to the CustomCommand that creates it.
Cheesehole wrote on 8/24/2008, 1:24 PM
Has anyone else noticed that the Docked command always comes up as the last tab in the first dock unless you have more than one Custom Command docked? If I load two custom commands I can get one of them to stay anywhere I want. That's what I really want to do. But if I only have one custom command docked it always ends up buried in the last tab of the first dock... !@#!$

Ben
jetdv wrote on 8/25/2008, 5:47 AM
The docking area is loaded with the Vegas windows first followed by the Custom Commands. There's no way around that at this time. So if you want your Custom Command to be the first tab, you'll have to move it every time.

There are also other quirks as well with the return location of Custom Commands. I've found it best to leave them docked in the main docking area and accept that they're going to show up last.
Cheesehole wrote on 8/25/2008, 7:51 AM
Yeah seems a bit quirky sometimes... oh well at least it works! Thanks again Edward!

Ben
Videoimpressions0622 wrote on 1/12/2009, 7:53 AM
Where exactly do you modify this property? Excalibur always loads docked in the upper left corner next to the mixer, but i want it with the rest of the tabs (Explorer, Video Scopes, Project Inspector, etc.).