hide MDI child menubar icon and window menu?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Shadowblitz16
Earned a small fee
Earned a small fee
Posts: 14
Joined: Sun Oct 13, 2019 2:32 am

hide MDI child menubar icon and window menu?

Post by Shadowblitz16 » Sun Oct 13, 2019 11:00 pm

is there a way I can get rid of these in a MDI child menu?
Image

Code: Select all

#include "MainWindow.h"
#include <wx/artprov.h>



MainWindow::MainWindow(const wxString& title) : wxMDIParentFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150))
{

	menuBar     = new wxMenuBar();
	menu1       = new wxMenu();
	menu2       = new wxMenu();


	//wxWidgets default wxMenuItem example
	menu1->Append(wxID_ANY, _("&New\tCtrl+N"  ));
	menu1->Append(wxID_ANY, _("&Open\tCtrl+O" ));
	menu1->Append(wxID_ANY, _("&Save\tCtrl+S" ));
	menu1->Append(wxID_ANY, _("&Quit\tCtrl+Q" ));

	//wxWidgets default wxMenuItem example
	menu2->Append(wxID_ANY, _("&Gfx Editor\tCtrl+N"));
	menu2->Bind(wxEVT_COMMAND_MENU_SELECTED, &MainWindow::OnMenuGfxClicked, this);

	menuBar->Append(menu1, _("&File" ));
	menuBar->Append(menu2, _("&View" ));
	SetMenuBar(menuBar);

	childWindow = new ChildWindow(this, "hi");

}


MainWindow::~MainWindow()
{
}

void MainWindow::OnMenuGfxClicked(wxCommandEvent& WXUNUSED(event))
{
	if (childWindow->IsVisible()) childWindow->Hide();
	else                          childWindow->Show();
}

Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: hide MDI child menubar icon and window menu?

Post by Nunki » Mon Oct 14, 2019 6:28 am

Hi Shadowblitz16

I'm not sure about the icon, but the window menu is appended automatically. Simply because it's part of using MDI I guess. As you may see in the screenshot. That menu is used to give you the ability to order your open windows, arrange icons and for the system to add entries for every MDI child window. Even if there would be a way to remove that 'window' menu, you risk the application to crash when the MDI system tries to add an entry for an MDI child window you create.
MDIappmenu.png
MDIappmenu.png (7.71 KiB) Viewed 418 times
with regards,
Nunki

Post Reply