Add some more menus

This commit is contained in:
Tim Warren 2015-03-31 14:22:10 -04:00
parent 6d87f0a004
commit 4794e0b2dd
4 changed files with 34 additions and 8 deletions

View File

@ -21,6 +21,7 @@ bool TyroApp::OnInit()
TyroFrame* frame = new TyroFrame(0L, _("Tyro"));
frame->Show(true);
SetTopWindow(frame);
return true;
}

View File

@ -17,7 +17,7 @@
<Add option="-mmacosx-version-min=10.5 -I/usr/local/lib/wx/include/osx_cocoa-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__" />
</Compiler>
<Linker>
<Add option="-mmacosx-version-min=10.5 -L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /usr/local/lib/libwx_osx_cocoau_xrc-3.0.a /usr/local/lib/libwx_osx_cocoau_qa-3.0.a /usr/local/lib/libwx_baseu_net-3.0.a /usr/local/lib/libwx_osx_cocoau_html-3.0.a /usr/local/lib/libwx_osx_cocoau_adv-3.0.a /usr/local/lib/libwx_osx_cocoau_core-3.0.a /usr/local/lib/libwx_baseu_xml-3.0.a /usr/local/lib/libwx_baseu-3.0.a -lpng -ljpeg -ltiff -framework WebKit -lexpat -lwxregexu-3.0 -lz -lpthread -liconv" />
<Add option="-mmacosx-version-min=10.5 -L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /usr/local/lib/libwx_osx_cocoau_xrc-3.0.a /usr/local/lib/libwx_osx_cocoau_stc-3.0.a /usr/local/lib/libwx_osx_cocoau_richtext-3.0.a /usr/local/lib/libwx_osx_cocoau_ribbon-3.0.a /usr/local/lib/libwx_osx_cocoau_propgrid-3.0.a /usr/local/lib/libwx_osx_cocoau_aui-3.0.a /usr/local/lib/libwx_osx_cocoau_gl-3.0.a /usr/local/lib/libwx_osx_cocoau_qa-3.0.a /usr/local/lib/libwx_baseu_net-3.0.a /usr/local/lib/libwx_osx_cocoau_html-3.0.a /usr/local/lib/libwx_osx_cocoau_adv-3.0.a /usr/local/lib/libwx_osx_cocoau_core-3.0.a /usr/local/lib/libwx_baseu_xml-3.0.a /usr/local/lib/libwx_baseu-3.0.a -lwxscintilla-3.0 -framework OpenGL -framework AGL -lpng -ljpeg -ltiff -framework WebKit -lexpat -lwxregexu-3.0 -lz -lpthread -liconv" />
</Linker>
</Target>
<Target title="Release">

View File

@ -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)

View File

@ -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);