put frame creation code all inside MyFrame ctor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -98,9 +98,30 @@ bool MyApp::OnInit()
|
|||||||
MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"),
|
MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"),
|
||||||
wxDefaultPosition, wxSize(500, 400),
|
wxDefaultPosition, wxSize(500, 400),
|
||||||
wxDEFAULT_FRAME_STYLE);
|
wxDEFAULT_FRAME_STYLE);
|
||||||
|
frame->Show(true);
|
||||||
|
|
||||||
// Give it an icon
|
SetTopWindow(frame);
|
||||||
frame->SetIcon(wxICON(sample));
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// MyFrame
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "wx/wfstream.h"
|
||||||
|
|
||||||
|
// Define my frame constructor
|
||||||
|
MyFrame::MyFrame(wxWindow *parent,
|
||||||
|
const wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const long style)
|
||||||
|
: wxFrame(parent, id, title, pos, size,
|
||||||
|
style | wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// Make a menubar
|
// Make a menubar
|
||||||
wxMenu *file_menu = new wxMenu;
|
wxMenu *file_menu = new wxMenu;
|
||||||
@@ -132,36 +153,13 @@ bool MyApp::OnInit()
|
|||||||
menu_bar->Append(play_menu, _T("&Animation"));
|
menu_bar->Append(play_menu, _T("&Animation"));
|
||||||
menu_bar->Append(help_menu, _T("&Help"));
|
menu_bar->Append(help_menu, _T("&Help"));
|
||||||
|
|
||||||
// Associate the menu bar with the frame
|
// Associate the menu bar with this frame
|
||||||
frame->SetMenuBar(menu_bar);
|
SetMenuBar(menu_bar);
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
frame->CreateStatusBar();
|
CreateStatusBar();
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
frame->Show(true);
|
|
||||||
|
|
||||||
SetTopWindow(frame);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// MyFrame
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include "wx/wfstream.h"
|
|
||||||
|
|
||||||
// Define my frame constructor
|
|
||||||
MyFrame::MyFrame(wxWindow *parent,
|
|
||||||
const wxWindowID id,
|
|
||||||
const wxString& title,
|
|
||||||
const wxPoint& pos,
|
|
||||||
const wxSize& size,
|
|
||||||
const long style)
|
|
||||||
: wxFrame(parent, id, title, pos, size,
|
|
||||||
style | wxNO_FULL_REPAINT_ON_RESIZE)
|
|
||||||
{
|
|
||||||
// use a wxBoxSizer otherwise wxFrame will automatically
|
// use a wxBoxSizer otherwise wxFrame will automatically
|
||||||
// resize the m_animationCtrl to fill its client area on
|
// resize the m_animationCtrl to fill its client area on
|
||||||
// user resizes
|
// user resizes
|
||||||
|
Reference in New Issue
Block a user