Simplify frame construction in the toolbar sample
Also stop hard-coding (100, 100) position for it, there is no real need for it and it's better to let the window be positioned automatically. No real changes.
This commit is contained in:
@@ -96,12 +96,7 @@ public:
|
|||||||
class MyFrame: public wxFrame
|
class MyFrame: public wxFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyFrame(wxFrame *parent,
|
MyFrame();
|
||||||
wxWindowID id = wxID_ANY,
|
|
||||||
const wxString& title = "wxToolBar Sample",
|
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
|
||||||
const wxSize& size = wxDefaultSize,
|
|
||||||
long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN);
|
|
||||||
virtual ~MyFrame();
|
virtual ~MyFrame();
|
||||||
|
|
||||||
void PopulateToolbar(wxToolBarBase* toolBar);
|
void PopulateToolbar(wxToolBarBase* toolBar);
|
||||||
@@ -312,9 +307,7 @@ bool MyApp::OnInit()
|
|||||||
wxImage::AddHandler(new wxPNGHandler);
|
wxImage::AddHandler(new wxPNGHandler);
|
||||||
|
|
||||||
// Create the main frame window
|
// Create the main frame window
|
||||||
MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY,
|
MyFrame* frame = new MyFrame();
|
||||||
"wxToolBar Sample",
|
|
||||||
wxPoint(100, 100), wxDefaultSize);
|
|
||||||
|
|
||||||
frame->Show(true);
|
frame->Show(true);
|
||||||
|
|
||||||
@@ -512,13 +505,8 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Define my frame constructor
|
// Define my frame constructor
|
||||||
MyFrame::MyFrame(wxFrame* parent,
|
MyFrame::MyFrame()
|
||||||
wxWindowID id,
|
: wxFrame(NULL, wxID_ANY, "wxToolBar Sample")
|
||||||
const wxString& title,
|
|
||||||
const wxPoint& pos,
|
|
||||||
const wxSize& size,
|
|
||||||
long style)
|
|
||||||
: wxFrame(parent, id, title, pos, size, style)
|
|
||||||
{
|
{
|
||||||
m_tbar = NULL;
|
m_tbar = NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user