#if defined(__WXMAC__)
#include <CoreFoundation/CoreFoundation.h>
+#undef T_DATA
+#include <Carbon/Carbon.h>
#endif
#pragma mark ====== MyApp ======
// EVT_MENU(myMenuID_ReadParameters, MyApp::OnReadParameters)
EVT_MENU(myMenuID_ViewGlobalParameters, MyApp::OnViewGlobalParameters)
EVT_MENU(myMenuID_ViewParameterFilesList, MyApp::OnViewParameterFilesList)
+#if defined(__WXMAC__)
+ EVT_ACTIVATE(MyApp::OnActivate)
+#endif
EVT_END_PROCESS(-1, MyApp::OnEndProcess)
END_EVENT_TABLE()
#if defined(__WXMAC__)
frame->Move(-10000, -10000); // Set invisible
+ frame->Show(false);
#else
frame->Show(true);
#endif
dialog->Destroy();
}
+void
+MyApp::OnActivate(wxActivateEvent &event)
+{
+#if defined(__WXMAC__)
+ MyFrame *frame = GetMainFrame();
+ frame->Show(false); /* Sometimes this "parent" frame gets visible and screw up the menus */
+#endif
+ event.Skip();
+}
+
wxString
MyApp::DefaultSettingsPath()
{
wxDocMDIParentFrame(manager, frame, wxID_ANY, title, pos, size, type, _T("myFrame"))
{
editMenu = (wxMenu *) NULL;
+#if defined(__WXMAC__)
+ /* Avoid this "dummy" top-level window to appear in the window menu.
+ It should not happen because MyApp::OnActivate() tries to hide this window,
+ but this is still here just in case. */
+ OSStatus sts;
+ sts = ChangeWindowAttributes((WindowRef)m_macWindow, 0, kWindowInWindowMenuAttribute);
+/* printf("m_macWindow = %p, status = %d\n", m_macWindow, (int)sts); */
+#endif
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
void OnEndProcess(wxProcessEvent &event);
int CallSubProcess(const char *cmdline, const char *procname);
+ void OnActivate(wxActivateEvent &event);
+
MyListCtrl *GetGlobalParameterListCtrl();
#if __WXMAC__
virtual void MacNewFile();