Don't use a dummy menu with wxHtmlHelpFrame under OS X
Contrary to the comment in wxHtmlHelpFrame::Create(), this doesn't seem to be necessary and can be actually problematic. Never adding this menu obviates the need for the wxHF_MENU style from #15538. Closes #15538.
This commit is contained in:
@@ -126,11 +126,6 @@ protected:
|
|||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
void OnActivate(wxActivateEvent& event);
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
|
||||||
void OnClose(wxCommandEvent& event);
|
|
||||||
void OnAbout(wxCommandEvent& event);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Images:
|
// Images:
|
||||||
enum {
|
enum {
|
||||||
IMG_Book = 0,
|
IMG_Book = 0,
|
||||||
|
@@ -60,11 +60,6 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpFrame, wxFrame);
|
|||||||
wxBEGIN_EVENT_TABLE(wxHtmlHelpFrame, wxFrame)
|
wxBEGIN_EVENT_TABLE(wxHtmlHelpFrame, wxFrame)
|
||||||
EVT_ACTIVATE(wxHtmlHelpFrame::OnActivate)
|
EVT_ACTIVATE(wxHtmlHelpFrame::OnActivate)
|
||||||
EVT_CLOSE(wxHtmlHelpFrame::OnCloseWindow)
|
EVT_CLOSE(wxHtmlHelpFrame::OnCloseWindow)
|
||||||
#ifdef __WXMAC__
|
|
||||||
EVT_MENU(wxID_CLOSE, wxHtmlHelpFrame::OnClose)
|
|
||||||
EVT_MENU(wxID_ABOUT, wxHtmlHelpFrame::OnAbout)
|
|
||||||
EVT_MENU(wxID_HELP_CONTENTS, wxHtmlHelpFrame::OnAbout)
|
|
||||||
#endif
|
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
wxHtmlHelpFrame::wxHtmlHelpFrame(wxWindow* parent, wxWindowID id, const wxString& title,
|
wxHtmlHelpFrame::wxHtmlHelpFrame(wxWindow* parent, wxWindowID id, const wxString& title,
|
||||||
@@ -127,27 +122,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
|
|
||||||
SetIcons(wxArtProvider::GetIconBundle(wxART_HELP, wxART_FRAME_ICON));
|
SetIcons(wxArtProvider::GetIconBundle(wxART_HELP, wxART_FRAME_ICON));
|
||||||
|
|
||||||
// On the Mac, each modeless frame must have a menubar.
|
|
||||||
// TODO: add more menu items, and perhaps add a style to show
|
|
||||||
// the menubar: compulsory on the Mac, optional elsewhere.
|
|
||||||
#ifdef __WXMAC__
|
|
||||||
wxMenuBar* menuBar = new wxMenuBar;
|
|
||||||
|
|
||||||
wxMenu* fileMenu = new wxMenu;
|
|
||||||
fileMenu->Append(wxID_HTML_OPENFILE, _("&Open..."));
|
|
||||||
fileMenu->AppendSeparator();
|
|
||||||
fileMenu->Append(wxID_CLOSE, _("&Close"));
|
|
||||||
|
|
||||||
wxMenu* helpMenu = new wxMenu;
|
|
||||||
helpMenu->Append(wxID_ABOUT, _("&About"));
|
|
||||||
// Ensures we don't get an empty help menu
|
|
||||||
helpMenu->Append(wxID_HELP_CONTENTS, _("&About"));
|
|
||||||
|
|
||||||
menuBar->Append(fileMenu,_("&File"));
|
|
||||||
menuBar->Append(helpMenu,_("&Help"));
|
|
||||||
SetMenuBar(menuBar);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_HtmlHelpWin->GetHtmlWindow()->SetRelatedFrame(this, m_TitleFormat);
|
m_HtmlHelpWin->GetHtmlWindow()->SetRelatedFrame(this, m_TitleFormat);
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
m_HtmlHelpWin->GetHtmlWindow()->SetRelatedStatusBar(0);
|
m_HtmlHelpWin->GetHtmlWindow()->SetRelatedStatusBar(0);
|
||||||
@@ -251,17 +225,4 @@ void wxHtmlHelpFrame::SetShouldPreventAppExit(bool enable)
|
|||||||
m_shouldPreventAppExit = enable;
|
m_shouldPreventAppExit = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
|
||||||
void wxHtmlHelpFrame::OnClose(wxCommandEvent& WXUNUSED(event))
|
|
||||||
{
|
|
||||||
Close(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxHtmlHelpFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|
||||||
{
|
|
||||||
wxMessageBox(wxT("wxWidgets HTML Help Viewer (c) 1998-2006, Vaclav Slavik et al"), wxT("HelpView"),
|
|
||||||
wxICON_INFORMATION|wxOK, this);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // wxUSE_WXHTML_HELP
|
#endif // wxUSE_WXHTML_HELP
|
||||||
|
Reference in New Issue
Block a user