Hi, in my PlugIn I’m writing a code that shows/hides the Rhinoceros dock bar tabs.
For example the tabs are invisible when the user click with left mouse button on a point on screen and otherwise the are shown when the user moves the mouse to the right side of the desktop.
The function that do this job is this:
/*!
\brief Toggle the visibily of the Rhinoceros dock bar tabs
\param in_visible Visibility input
*/
void DockTreeSliding::ToggleDockTreeVisibility(const bool in_visible)
{
if (!in_visible)
{
// Clear the array of the actual visible tabs ID
m_uuidVisibleDockBarArray.clear();
ON_SimpleArray<ON_UUID> tabIds;
CRhinoTabbedDockBarDialog::GetOpenTabIds(tabIds);
for (int i = 0; i < tabIds.Count(); i++)
{
ON_UUID tabId = tabIds[i];
// Fill the array and close the visible tabs
if (CRhinoTabbedDockBarDialog::IsTabVisible(*RhinoApp().ActiveDoc(), tabId))
{
m_uuidVisibleDockBarArray.push_back(tabId);
CRhinoTabbedDockBarDialog::CloseDockbarTab(*RhinoApp().ActiveDoc(), tabId, nullptr);
}
}
m_state = COLLAPSED;
}
else
{
// Iterate the previous visible tabs and put visible
for (int i = 0; i < m_uuidVisibleDockBarArray.size(); i++)
{
ON_UUID tabID = m_uuidVisibleDockBarArray[i];
CRhinoTabbedDockBarDialog::OpenDockbarTab(*RhinoApp().ActiveDoc(), tabID, false);
}
m_state = EXPANDED;
}
}
The code hides/shows the right dock bar tabs correctly but if I change the tab order when I re-put visible the tabs the order is different.
Maybe this isn’t the correct way to do this job.
thank you very much for your help.