First load UI configuration

rhino
toolbar

#1

Hello!:blush:
I’m developing plug-in using C++.
I met next difficulties in adjusting of Rhinoceros UI state at the very first load (empty machine -> install Rhinoceros -> install Plug-in -> Run):

  1. Rhinoceros window is loaded as “restored”. Can it be loaded as “maximized”?
  2. I need to open my tab on this right dockbar %D0%91%D0%B5%D0%B7%D1%8B%D0%BC%D1%8F%D0%BD%D0%BD%D1%8B%D0%B9
    Inside OnNewDocument() I search for the right docked dockbar and open my tab on it. The problem is that at the very first load inside OnNewDocument() all the dockbars are still floating. So the solution I found is to open my tab on dockbar with ID “5A5B89A0-830F-C90D-5F60-35C2E907E18C” (haven’t found such define) and somewhere after “OnNewDocument” it becomes docked. The question is: is it a possible solution? and is it possible to make my tab active after loading (now “Properties” is active).
  3. I have a toolbar collection with the name of plugin and “.tb”. At the very first loading the problem is that after creation of new CRhinoUiToolBarCollection and showing of one toolbar from it, all the toolbars are shown and can be hidden only by mouse click.

Thanks for any help you can provide


(Dale Fugier) #2

Hi @zer41k,

Sure, something like this should do it:

::ShowWindow(RhinoApp().MainWnd(), SW_SHOWMAXIMIZED);

Rather than doing this when your CRhinoEventWatcher::OnNewDocument handler is called, make yourself an CRhinoIsIdle derived object. When Rhino is finished loading and is ready for work, an OnIdle event will be triggered. Here, you can be assured the tabbed dockbars will be loaded.

Make sure your .tb file has been saved in the state you want your users to see.

– Dale


#3

Many thanks :star_struck:
Each point work perfectly now