How to hide menu, command, property view ... ? (MFC/Rhino5)


I want to hide those bar like below red rectangles for only showing my dockbar.
How to do it ? Is it possible to implement this?

(Menno Deij - van Rijswijk) #2

Maybe you can make a “Skin”, that way you can customize Rhino to your liking.


I knew this example, but I still can’t set those interfaces. :dizzy_face:

(Menno Deij - van Rijswijk) #4

Oh. Ok, I did not know.

When I look in RhinoSdkApp.h I see the following four functions. Maybe they are what you need?

  bool HideControlBars(UINT  nCBMask=0xFFFFFFFF, int nDockState=0, bool bRedraw=true);

  bool RestoreControlBars(bool bRedraw=true);

  bool HideWindowBars(UINT  nWBMask=0xFFFFFFFF, bool bRedraw=true);

  bool RestoreWindowBars(bool bRedraw=true);

where the nCBMask can be any of

    HCB_COMMANDLINE_BAR         = 0x00000001,
    HCB_CURVATURE_GRAPH_BAR     = 0x00000004,
    HCB_DRAFT_ANGLE_BAR         = 0x00000008,
    HCB_EDGE_ANALYSIS_BAR       = 0x00000010,
    HCB_EMAP_BAR                = 0x00000020,
    HCB_LAYER_BAR               = 0x00000040,
    HCB_LAYER_MANAGER_BAR       = 0x00000080,
    HCB_MOVE_UVN_BAR            = 0x00000100,
    HCB_NOTES_BAR               = 0x00000200,
    HCB_OSNAP_BAR               = 0x00000400,
    HCB_PROPERTIES_BAR          = 0x00000800,
    HCB_VIEW_MANAGER_BAR        = 0x00001000,
    HCB_ZEBRA_BAR               = 0x00002000,
    HCB_COMMAND_CONTEXT_BAR     = 0x00004000,

and nWBMask can be any of

    HWB_TITLE_BAR     = 0x00000001,
    HWB_MENU_BAR      = 0x00000002,
    HWB_STATUS_BAR    = 0x00000004,

(Menno Deij - van Rijswijk) #5

Oh, and

  bool HideToolBars(int nDockState=0, bool  bRedraw=true);

  bool RestoreToolBars(bool  bRedraw=true);


It seem to useful. :smile:
Now, I meet a problem.
I use those SDK funcctions in the skin ? or plugIn (OnLoadPlugIn())?

I put it in EventWatcher::OnInitRhino( CRhinoApp& app ) for the time being.
When Command line hided, I want it visible so that I run the function ,

But, it still hide. :sob:


try this macro:

“-_commandprompt _show _toggle _enter”


Thank you! Jordy. :smile:
I still try to set those interface, menu, tool bar… , in my SKIN.
But, It seem to be difficult for me. :weary:
I think whether I should change those Keys before launching skin.


Oke if you want to hide the toolbars do something like this:

For i = 0 To Rhino.RhinoApp.ToolbarFiles.Count - 1

Next. For loading your toolbar:


Some helpful macros

//toggle commandprompt
"-_commandprompt _show _toggle_enter"

//Toggle menu show/hide

Hiding all panels:

For Each panel In Rhino.UI.Panels.GetOpenPanelIds

This should bring you close to what you want I guess xD


Thank you for help. :smile:
I can feel your enthusiasm.
But you know, I develop this plugin through MFC. :sob:
I should to learn C# in the future.


C++? Don’t know what MFC is :no_mouth:

(Menno Deij - van Rijswijk) #12

MFC == Microsoft Foundation Classes - it is C++


Right !
You don’t need to know what MFC is, but you only know “don’t touch it”. XD


Isn’t it that with C++ more is possible than vb.NET or C#? So the things that I explained above is possible in C++?
@menno probably knows xD

(Menno Deij - van Rijswijk) #15

I’ve tried to help @kaicihuang but I have never done this kind of thing.


Oke well C++ is out of my reach ^^ anyone else can translate it too C++? :slight_smile:

(Dale Fugier) #17

Something like this should work:

#include "/Program Files (x86)/Rhino 5.0 x64 SDK/inc/RhinoSdkUiFile.h"
void HideRhinoStuff()
  CRhinoAppAppearanceSettings settings = RhinoApp().AppSettings().AppearanceSettings();
  settings.m_show_menu = false;
  settings.m_cmdprompt_position = CRhinoAppAppearanceSettings::command_prompt_hidden;

  const int file_count = CRhinoUiFile::FileCount();
  for (int index = 0; index < file_count; index++)
    ON_UUID file_id = CRhinoUiFile::FileID(index);


Hi! Dale.
Where should I put it ? May I put it in Skin ?
I have three positions, SkinApp() constructor, OnLoadplugIn() and eventwatcher::OnInitRhino().
I had tried to put those positions, but those results were different for each position.

BTW, the file_count always is zero.

Three posiotion:
BOOL CDockbarPlugIn::OnLoadPlugIn(){}
void CEventWatcher::OnInitRhino( CRhinoApp& app ){}

Below it my result.

(Dale Fugier) #19

OnLoadPlugIn() is always a good place to put this kind of stuff…


Dale,I had done it, but the command view is still showed,not be hidden. :sob: