X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4693b20c7500190c3cc8c02919c45436bf5efbc9..cb7acf9cc78c309026bed1038631f2663cd90bda:/samples/menu/menu.cpp diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 29da4ca89f..63a7454627 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -18,19 +18,19 @@ // ---------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx/wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP - #include - #include - #include - #include - #include - #include + #include "wx/app.h" + #include "wx/frame.h" + #include "wx/menu.h" + #include "wx/msgdlg.h" + #include "wx/log.h" + #include "wx/textctrl.h" #endif #if !wxUSE_MENUS @@ -253,6 +253,7 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, -1, "wxWindows menu sample", wxDefaultPosition, wxSize(300, 200)) { + m_textctrl = NULL; m_menu = NULL; m_countDummy = 0; m_logOld = NULL; @@ -701,6 +702,9 @@ void MyFrame::OnRightUp(wxMouseEvent &event) void MyFrame::OnSize(wxSizeEvent& event) { + if ( !m_textctrl ) + return; + // leave a band below for popup menu testing wxSize size = GetClientSize(); m_textctrl->SetSize(0, 0, size.x, (3*size.y)/4);