Some basic groundwork changes
This commit is contained in:
parent
facb4f69f1
commit
7ee0143418
@ -20,7 +20,13 @@ bool TyroApp::OnInit()
|
||||
{
|
||||
TyroFrame* frame = new TyroFrame(0L, _("wxWidgets Application Template"));
|
||||
|
||||
frame->Show();
|
||||
frame->Show(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int TyroApp::OnExit(wxCommandEvent &WXUNUSED(event))
|
||||
{
|
||||
close(true);
|
||||
return 1;
|
||||
}
|
||||
|
@ -14,8 +14,10 @@
|
||||
|
||||
class TyroApp : public wxApp
|
||||
{
|
||||
friend class TyroFrame;
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
virtual int OnExit(wxCommandEvent &WXUNUSED(event));
|
||||
};
|
||||
|
||||
#endif // TYROAPP_H
|
||||
|
52
TyroMac.cbp
Normal file
52
TyroMac.cbp
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Tyro" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="clang" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/Tyro" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wextra" />
|
||||
<Add option="-g" />
|
||||
<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="-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" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/Tyro" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectLinkerOptionsRelation="2" />
|
||||
<Compiler>
|
||||
<Add option="-Os" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="`wx-config --cflags`" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="`wx-config --libs`" />
|
||||
</Linker>
|
||||
<Unit filename="TyroApp.cpp" />
|
||||
<Unit filename="TyroApp.h" />
|
||||
<Unit filename="TyroMain.cpp" />
|
||||
<Unit filename="TyroMain.h" />
|
||||
<Extensions>
|
||||
<code_completion>
|
||||
<search_path add="/usr/local/lib" />
|
||||
</code_completion>
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
23
TyroMain.cpp
23
TyroMain.cpp
@ -43,34 +43,33 @@ wxString wxbuildinfo(wxbuildinfoformat format)
|
||||
|
||||
BEGIN_EVENT_TABLE(TyroFrame, wxFrame)
|
||||
EVT_CLOSE(TyroFrame::OnClose)
|
||||
EVT_MENU(idMenuQuit, TyroFrame::OnQuit)
|
||||
EVT_MENU(idMenuAbout, TyroFrame::OnAbout)
|
||||
EVT_MENU(wxID_EXIT, TyroFrame::OnQuit)
|
||||
EVT_MENU(wxID_ABOUT, TyroFrame::OnAbout)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
TyroFrame::TyroFrame(wxFrame *frame, const wxString& title)
|
||||
: wxFrame(frame, -1, title)
|
||||
{
|
||||
#if wxUSE_MENUS
|
||||
// create a menu bar
|
||||
// create a menu bar
|
||||
wxMenuBar* mbar = new wxMenuBar();
|
||||
wxMenu* fileMenu = new wxMenu(_T(""));
|
||||
fileMenu->Append(idMenuQuit, _("&Quit\tAlt-F4"), _("Quit the application"));
|
||||
|
||||
fileMenu->Append(wxID_EXIT, _("&Quit\tAlt-F4"), _("Quit the application"));
|
||||
mbar->Append(fileMenu, _("&File"));
|
||||
|
||||
wxMenu* helpMenu = new wxMenu(_T(""));
|
||||
helpMenu->Append(idMenuAbout, _("&About\tF1"), _("Show info about this application"));
|
||||
helpMenu->Append(wxID_ABOUT, _("&About\tF1"), _("Show info about this application"));
|
||||
mbar->Append(helpMenu, _("&Help"));
|
||||
|
||||
SetMenuBar(mbar);
|
||||
#endif // wxUSE_MENUS
|
||||
#ifdef __WXMAC__
|
||||
wxMenuBar::MacSetCommonMenuBar(mbar);
|
||||
#endif // __WXMAC__
|
||||
SetMenuBar(mbar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// create a status bar with some information about the used wxWidgets version
|
||||
CreateStatusBar(2);
|
||||
SetStatusText(_("Hello Code::Blocks user!"),0);
|
||||
SetStatusText(_(""),0);
|
||||
SetStatusText(wxbuildinfo(short_f), 1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#include <wx/string.h>
|
||||
#include "TyroApp.h"
|
||||
|
||||
class TyroFrame: public wxFrame
|
||||
|
Loading…
Reference in New Issue
Block a user