Close the gestures frame too in the event sample
Make "Exit" menu item really exit the sample again instead of just closing the main window, but possibly leaving the gestures testing window still open and thus not really exiting the program. Also avoid creating more than one gesture window, use the existing one if we had already opened it.
This commit is contained in:
@@ -182,7 +182,7 @@ private:
|
||||
// the button used to highlight the event handlers execution order
|
||||
MyEvtTestButton *m_testBtn;
|
||||
|
||||
MyGestureFrame *m_gestureFrame;
|
||||
wxWindowRef m_gestureFrame;
|
||||
|
||||
|
||||
// any class wishing to process wxWidgets events must use this macro
|
||||
@@ -457,7 +457,8 @@ MyFrame::~MyFrame()
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// true is to force the frame to close
|
||||
if ( m_gestureFrame )
|
||||
m_gestureFrame->Close(true);
|
||||
Close(true);
|
||||
}
|
||||
|
||||
@@ -589,8 +590,15 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnGesture(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_gestureFrame = new MyGestureFrame();
|
||||
m_gestureFrame->Show(true);
|
||||
if ( m_gestureFrame )
|
||||
{
|
||||
m_gestureFrame->Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_gestureFrame = new MyGestureFrame();
|
||||
m_gestureFrame->Show(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))
|
||||
|
Reference in New Issue
Block a user