added close event so application got shutdown correctly
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1083 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
46c284f7a9
commit
135b6e1eb8
|
@ -80,6 +80,7 @@ static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
|
|||
const wxEventType wxEVT_HOST_COMMAND = wxNewEventType();
|
||||
|
||||
BEGIN_EVENT_TABLE(CFrame, wxFrame)
|
||||
EVT_CLOSE(CFrame::OnClose)
|
||||
EVT_MENU(wxID_OPEN, CFrame::OnOpen)
|
||||
EVT_MENU(wxID_EXIT, CFrame::OnQuit)
|
||||
EVT_MENU(IDM_HELPWEBSITE, CFrame::OnHelp)
|
||||
|
@ -367,16 +368,22 @@ void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
|
|||
|
||||
void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
// Don't forget the skip of the window won't be destroyed
|
||||
event.Skip();
|
||||
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
Core::Stop();
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
Close(true);
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnHelp(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
|
|
|
@ -80,6 +80,7 @@ class CFrame : public wxFrame
|
|||
void OnHostMessage(wxCommandEvent& event);
|
||||
void OnLoadState(wxCommandEvent& event);
|
||||
void OnSaveState(wxCommandEvent& event);
|
||||
void OnClose(wxCloseEvent &event);
|
||||
|
||||
|
||||
wxStatusBar* m_pStatusBar;
|
||||
|
|
Loading…
Reference in New Issue