Removed lots of OnClose functions; doc'ed OnCloseWindow better;
MM_... -> wxMM_... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -340,10 +340,8 @@ bool wxResourceManager::ShowResourceEditor(bool show, wxWindow *WXUNUSED(parent)
|
||||
else
|
||||
{
|
||||
wxFrame *fr = m_editorFrame;
|
||||
if (m_editorFrame->OnClose())
|
||||
if (m_editorFrame->Close())
|
||||
{
|
||||
fr->Show(FALSE);
|
||||
delete fr;
|
||||
m_editorFrame = NULL;
|
||||
m_editorPanel = NULL;
|
||||
}
|
||||
@@ -2076,6 +2074,7 @@ BEGIN_EVENT_TABLE(wxResourceEditorFrame, wxFrame)
|
||||
EVT_MENU(RESED_DELETE, wxResourceEditorFrame::OnDeleteSelection)
|
||||
EVT_MENU(RESED_RECREATE, wxResourceEditorFrame::OnRecreateSelection)
|
||||
EVT_MENU(RESED_TEST, wxResourceEditorFrame::OnTest)
|
||||
EVT_CLOSE(wxResourceEditorFrame::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxResourceEditorFrame::wxResourceEditorFrame(wxResourceManager *resMan, wxFrame *parent, const wxString& title,
|
||||
@@ -2157,12 +2156,15 @@ void wxResourceEditorFrame::OnRecreateSelection(wxCommandEvent& WXUNUSED(event))
|
||||
manager->RecreateSelection();
|
||||
}
|
||||
|
||||
bool wxResourceEditorFrame::OnClose()
|
||||
void wxResourceEditorFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
if (manager->Modified())
|
||||
{
|
||||
if (!manager->Clear(TRUE, FALSE))
|
||||
return FALSE;
|
||||
if (!manager->Clear(TRUE, FALSE))
|
||||
{
|
||||
event.Veto();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Iconized())
|
||||
@@ -2181,7 +2183,7 @@ bool wxResourceEditorFrame::OnClose()
|
||||
manager->SetEditorFrame(NULL);
|
||||
manager->SetEditorToolBar(NULL);
|
||||
|
||||
return TRUE;
|
||||
this->Destroy();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -357,7 +357,7 @@ class wxResourceEditorFrame: public wxFrame
|
||||
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
|
||||
~wxResourceEditorFrame();
|
||||
|
||||
bool OnClose();
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
void OnNew(wxCommandEvent& event);
|
||||
void OnOpen(wxCommandEvent& event);
|
||||
|
@@ -78,11 +78,6 @@ void MyFrame::OnExit(wxCommandEvent& event)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
bool MyFrame::OnClose(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(TestGLCanvas, wxGLCanvas)
|
||||
EVT_SIZE(TestGLCanvas::OnSize)
|
||||
EVT_PAINT(TestGLCanvas::OnPaint)
|
||||
|
@@ -30,7 +30,6 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
void OnExit(wxCommandEvent& event);
|
||||
bool OnClose(void);
|
||||
public:
|
||||
TestGLCanvas* m_canvas;
|
||||
|
||||
|
@@ -298,12 +298,6 @@ void MyFrame::OnExit(wxCommandEvent& event)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
bool MyFrame::OnClose(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* TestGLCanvas implementation
|
||||
*/
|
||||
|
@@ -42,7 +42,6 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
void OnExit(wxCommandEvent& event);
|
||||
bool OnClose(void);
|
||||
public:
|
||||
TestGLCanvas* m_canvas;
|
||||
|
||||
|
@@ -76,11 +76,6 @@ void MyFrame::OnExit(wxCommandEvent& event)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
bool MyFrame::OnClose(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(TestGLCanvas, wxGLCanvas)
|
||||
EVT_SIZE(TestGLCanvas::OnSize)
|
||||
EVT_PAINT(TestGLCanvas::OnPaint)
|
||||
|
@@ -53,7 +53,6 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
void OnExit(wxCommandEvent& event);
|
||||
bool OnClose(void);
|
||||
public:
|
||||
TestGLCanvas* m_canvas;
|
||||
|
||||
|
@@ -103,8 +103,7 @@ NPError wxPluginApp::NPP_Destroy(NPP instance, NPSavedData** save)
|
||||
wxPluginFrame *frame = FindFrame(instance);
|
||||
if ( frame )
|
||||
{
|
||||
frame->OnClose();
|
||||
delete frame;
|
||||
frame->Close();
|
||||
}
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
@@ -143,6 +143,7 @@ IMPLEMENT_CLASS(MyFrame, wxDocParentFrame)
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxDocParentFrame)
|
||||
EVT_MENU(OGLEDIT_ABOUT, MyFrame::OnAbout)
|
||||
EVT_SIZE(MyFrame::OnSize)
|
||||
EVT_CLOSE(MyFrame::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title,
|
||||
@@ -174,15 +175,15 @@ void MyFrame::OnSize(wxSizeEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
bool MyFrame::OnClose(void)
|
||||
void MyFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
if (wxDocParentFrame::OnClose())
|
||||
{
|
||||
wxOGLCleanUp();
|
||||
return TRUE;
|
||||
this->Destroy();
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
event.Veto();
|
||||
}
|
||||
|
||||
// Intercept menu commands
|
||||
|
@@ -55,7 +55,7 @@ class MyFrame: public wxDocParentFrame
|
||||
|
||||
MyCanvas *CreateCanvas(wxView *view, wxFrame *parent);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
bool OnClose(void);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -1026,8 +1026,7 @@ bool Tex2RTFConnection::OnExecute(const wxString& topic, char *data, int size, i
|
||||
}
|
||||
else if (strcmp(firstArg, "EXIT") == 0)
|
||||
{
|
||||
if (frame && frame->OnClose())
|
||||
delete frame;
|
||||
if (frame) frame->Close();
|
||||
}
|
||||
else if (strcmp(firstArg, "MINIMIZE") == 0 || strcmp(firstArg, "ICONIZE") == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user