Tabbed dock bar on the side (C++)

Hi,

We have a skin where we remove most of the Rhino UI and then create an instance of CRhinoTabbedDockBarDialog. We do it like in @dale’s SampleTabbedDockBar.

The problem is that the first time we call this window it’s floating on the screen:

We need to have it docked on the side from the beginning, like this:

How to achieve this? Maybe there’s a way through CRhinoUiDockBar, how exactly?

Pablo

@JohnM, is this something you can help with?

Is your goal to make tabbed panels or just to make something that is dockable? If you just want to make some UI in a docked container you should use CRhinoUiDocBar. Tabbed panels are a little harder to control since the host container is controlled by the user tearing tabs off or dragging them from container to container. You can get he CRhinoUiDockBar that the tab is currently in then tell the dock bar manager to dock it on the right.

Hi @JohnM ,

It works! I call

CRhinoUiDockBarManager::DockDockBar(UUID uuid, UINT dock_location, LPCRECT lpRect);

passing CRhinoTabbedDockbarDialog::m_dockbar_id and AFX_IDW_DOCKBAR_RIGHT.

One last question: how can I control the width of the tab/dockbar to make it larger? The default width with which it appears is too narrow.
I tried inserting different rectangles CRect to the parameter LPCRECT lpRect above but I see no change.
I see there’s CRhinoUiDockBar::SetInitialSizeDockedHorz(CSize size) in the SDK but I’m not sure where and when to call it as I’m sticking to CRhinoTabbedDockBarDialog.

Thanks,
Pablo

If it is docked on the right or left you need to use SetInitialSizeDockedVert(), the horizontal version is for docking on the top and bottom in the horizontal hosts.

Hi @JohnM ,

If I’m using CRhinoTabbedDockbarDialog, when should I call CRhinoUiDockBar::SetInitialSizeDockedVert(CSize size)?

In the SDK it says “Should be called prior to calling CRhinoUiDockBar::CreateRhinoDockBar()”, but I don’t know when the dockbar to which CRhinoTabbedDockbarDialog belongs (CRhinoTabbedDockBarDialog::DockBar) is created. I tried accessing it in my constructor but it’s null at that moment.

Pablo

Pablo,

Unfortunately you will not have access to the dock bar until well after it has been created, I looked at the code and calling it while floating prior to docking it is your best chance at getting it to do what you want.

Hi @JohnM,

Ok, I switched to CRhinoUiDockBar and now it’s perfect. Thanks for your help + previous posts (specially this one).

Pablo