diff --git a/TyroApp.cpp b/TyroApp.cpp index d13330c..6374a47 100644 --- a/TyroApp.cpp +++ b/TyroApp.cpp @@ -21,6 +21,7 @@ bool TyroApp::OnInit() TyroFrame* frame = new TyroFrame(0L, _("Tyro")); frame->Show(true); + SetTopWindow(frame); return true; } diff --git a/TyroMac.cbp b/TyroMac.cbp index 6fca0c2..53cf258 100644 --- a/TyroMac.cbp +++ b/TyroMac.cbp @@ -17,7 +17,7 @@ - + diff --git a/TyroMain.cpp b/TyroMain.cpp index 0331a00..c3e6868 100644 --- a/TyroMain.cpp +++ b/TyroMain.cpp @@ -52,15 +52,22 @@ TyroFrame::TyroFrame(wxFrame *frame, const wxString& title) { // create a menu bar wxMenuBar* mbar = new wxMenuBar(); + + // Create Base menus wxMenu* fileMenu = new wxMenu(_T("")); wxMenu* editMenu = new wxMenu(_T("")); - - - fileMenu->Append(wxID_EXIT, _("&Quit"), _("Quit the application")); - mbar->Append(fileMenu, _("&File")); - wxMenu* helpMenu = new wxMenu(_T("")); + + // Add items to top-level menus + fileMenu->Append(wxID_OPEN, _T("&Open"), _T("Opens an existing file")); + fileMenu->Append(wxID_SAVE, _T("&Save"), _T("Save the content")); + fileMenu->AppendSeparator(); + fileMenu->Append(wxID_EXIT, _("&Quit"), _("Quit the application")); + helpMenu->Append(wxID_ABOUT, _("&About"), _("Show info about this application")); + + // Add the menus to the menubar + mbar->Append(fileMenu, _("&File")); mbar->Append(editMenu, _("&Edit")); mbar->Append(helpMenu, _("&Help")); @@ -73,6 +80,21 @@ SetMenuBar(mbar); CreateStatusBar(2); SetStatusText(_(""),0); SetStatusText(wxbuildinfo(short_f), 1); + + // Set up control layout + wxBoxSizer *base_sizer = new wxBoxSizer(wxVERTICAL); + + base_sizer->Add( + CreateNotebook(), + 1, + wxEXPAND | wxALL, + 5 + ); + + base_sizer->SetContainingWindow(this); + base_sizer->SetMinSize(800,600); + + SetSizerAndFit(base_sizer); } @@ -80,9 +102,11 @@ TyroFrame::~TyroFrame() {} wxAuiNotebook *TyroFrame::CreateNotebook() { -wxAuiNotebook *ctrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE); + wxAuiNotebook *ctrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE); -return ctrl; + + + return ctrl; } void TyroFrame::OnClose(wxCloseEvent &event) diff --git a/TyroMain.h b/TyroMain.h index 69b260b..a37d3fe 100644 --- a/TyroMain.h +++ b/TyroMain.h @@ -27,6 +27,7 @@ class TyroFrame: public wxFrame idMenuQuit = 1000, idMenuAbout }; + wxAuiManager m_mgr; void OnClose(wxCloseEvent& event); void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event);