Tabs and Containers in c++ plugin

Hey,

I try to arrange the UI elements of my plugin in a meaningful way after a fresh installation.
UI is implemented in a CRhinoTabbedDockBarDialog, that works fine.
I would like to dock that as a tab in the default “Right Container”. Currently it is initialized by Rhino in a new, floating container.

Is there any way to access and modify containers from C++?

Up to RH7 it was possible to use things like CRhinoTabbedDockBarDialog::DockBarName() to figure out where the Dialog tab is currently docked, but since RH8 that always seems to return a nullptr.
Similarly CRhinoTabbedDockBarDialog::OpenTabOnDockBar() and CRhinoTabbedDockBarDialog::DockBarsForTab don’t seem to return anything useful in RH8.

Hi @Florens,

Rhino’s UI framework changed dramatically between Rhino 7 and Rhino 8. And the old MFC docking framework is obsolete even though the classes are still in the Rhino SDK.

One option you might consider is taking advantage of the new Window Layout feature of Rhino 8.

Start Rhino and load your plug-in. Organize the window layout however you want: panels docked to where you want, etc.

When you’re done organizing the layout, run the WindowLayout command and save the current layout. Then, right-click on the window layout and export to a .rhw file.

Now that you’ve exported your window layout, restore the “Default Window Layout” and delete the layout you just created. Close Rhino.

Reopen Rhino 8 and script the _-WindowLayout command. Run the import option to import the file you just exported. Then make the layout current.

For example:

_-WindowLayout _Import "C:\Users\Dale\Downloads\Test.rhw" Test

If your plug-in did this the very first time it was loaded, perhaps this would resolve the issue?

Note, if you are using the Rhino 8.18 C++ SDK, you can use the RhinoImportWindowLayout and RhinoRestoreWindowLayout functions, instead of command scripting. See RhinoSdkUiDockBarManager.h for details.

– Dale