First commit
This commit is contained in:
commit
facb4f69f1
45
Tyro.cbp
Normal file
45
Tyro.cbp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?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" />
|
||||||
|
</Compiler>
|
||||||
|
</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="gccs" />
|
||||||
|
<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 />
|
||||||
|
<debugger />
|
||||||
|
</Extensions>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
1464
Tyro.depend
Normal file
1464
Tyro.depend
Normal file
File diff suppressed because it is too large
Load Diff
24
Tyro.layout
Normal file
24
Tyro.layout
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<ActiveTarget name="Debug" />
|
||||||
|
<File name="TyroMain.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="382" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="TyroApp.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="673" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="TyroMain.cpp" open="1" top="1" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="689" topLine="1" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="TyroApp.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="0" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
</CodeBlocks_layout_file>
|
26
TyroApp.cpp
Normal file
26
TyroApp.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/***************************************************************
|
||||||
|
* Name: TyroApp.cpp
|
||||||
|
* Purpose: Code for Application Class
|
||||||
|
* Author: Timothy J Warren (tim@timshomepage.net)
|
||||||
|
* Created: 2015-03-30
|
||||||
|
* Copyright: Timothy J Warren (https://timshomepage.net)
|
||||||
|
* License:
|
||||||
|
**************************************************************/
|
||||||
|
|
||||||
|
#ifdef WX_PRECOMP
|
||||||
|
#include "wx_pch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "TyroApp.h"
|
||||||
|
#include "TyroMain.h"
|
||||||
|
|
||||||
|
IMPLEMENT_APP(TyroApp);
|
||||||
|
|
||||||
|
bool TyroApp::OnInit()
|
||||||
|
{
|
||||||
|
TyroFrame* frame = new TyroFrame(0L, _("wxWidgets Application Template"));
|
||||||
|
|
||||||
|
frame->Show();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
21
TyroApp.h
Normal file
21
TyroApp.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/***************************************************************
|
||||||
|
* Name: TyroApp.h
|
||||||
|
* Purpose: Defines Application Class
|
||||||
|
* Author: Timothy J Warren (tim@timshomepage.net)
|
||||||
|
* Created: 2015-03-30
|
||||||
|
* Copyright: Timothy J Warren (https://timshomepage.net)
|
||||||
|
* License:
|
||||||
|
**************************************************************/
|
||||||
|
|
||||||
|
#ifndef TYROAPP_H
|
||||||
|
#define TYROAPP_H
|
||||||
|
|
||||||
|
#include <wx/app.h>
|
||||||
|
|
||||||
|
class TyroApp : public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool OnInit();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TYROAPP_H
|
95
TyroMain.cpp
Normal file
95
TyroMain.cpp
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/***************************************************************
|
||||||
|
* Name: TyroMain.cpp
|
||||||
|
* Purpose: Code for Application Frame
|
||||||
|
* Author: Timothy J Warren (tim@timshomepage.net)
|
||||||
|
* Created: 2015-03-30
|
||||||
|
* Copyright: Timothy J Warren (https://timshomepage.net)
|
||||||
|
* License:
|
||||||
|
**************************************************************/
|
||||||
|
|
||||||
|
#ifdef WX_PRECOMP
|
||||||
|
#include "wx_pch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "TyroMain.h"
|
||||||
|
|
||||||
|
//helper functions
|
||||||
|
enum wxbuildinfoformat {
|
||||||
|
short_f, long_f };
|
||||||
|
|
||||||
|
wxString wxbuildinfo(wxbuildinfoformat format)
|
||||||
|
{
|
||||||
|
wxString wxbuild(wxVERSION_STRING);
|
||||||
|
|
||||||
|
if (format == long_f )
|
||||||
|
{
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
wxbuild << _T("-Windows");
|
||||||
|
#elif defined(__WXMAC__)
|
||||||
|
wxbuild << _T("-Mac");
|
||||||
|
#elif defined(__UNIX__)
|
||||||
|
wxbuild << _T("-Linux");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxbuild << _T("-Unicode build");
|
||||||
|
#else
|
||||||
|
wxbuild << _T("-ANSI build");
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxbuild;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(TyroFrame, wxFrame)
|
||||||
|
EVT_CLOSE(TyroFrame::OnClose)
|
||||||
|
EVT_MENU(idMenuQuit, TyroFrame::OnQuit)
|
||||||
|
EVT_MENU(idMenuAbout, TyroFrame::OnAbout)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
TyroFrame::TyroFrame(wxFrame *frame, const wxString& title)
|
||||||
|
: wxFrame(frame, -1, title)
|
||||||
|
{
|
||||||
|
#if wxUSE_MENUS
|
||||||
|
// create a menu bar
|
||||||
|
wxMenuBar* mbar = new wxMenuBar();
|
||||||
|
wxMenu* fileMenu = new wxMenu(_T(""));
|
||||||
|
fileMenu->Append(idMenuQuit, _("&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"));
|
||||||
|
mbar->Append(helpMenu, _("&Help"));
|
||||||
|
|
||||||
|
SetMenuBar(mbar);
|
||||||
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
// create a status bar with some information about the used wxWidgets version
|
||||||
|
CreateStatusBar(2);
|
||||||
|
SetStatusText(_("Hello Code::Blocks user!"),0);
|
||||||
|
SetStatusText(wxbuildinfo(short_f), 1);
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TyroFrame::~TyroFrame()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void TyroFrame::OnClose(wxCloseEvent &event)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TyroFrame::OnQuit(wxCommandEvent &event)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TyroFrame::OnAbout(wxCommandEvent &event)
|
||||||
|
{
|
||||||
|
wxString msg = wxbuildinfo(long_f);
|
||||||
|
wxMessageBox(msg, _("Welcome to..."));
|
||||||
|
}
|
37
TyroMain.h
Normal file
37
TyroMain.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/***************************************************************
|
||||||
|
* Name: TyroMain.h
|
||||||
|
* Purpose: Defines Application Frame
|
||||||
|
* Author: Timothy J Warren (tim@timshomepage.net)
|
||||||
|
* Created: 2015-03-30
|
||||||
|
* Copyright: Timothy J Warren (https://timshomepage.net)
|
||||||
|
* License:
|
||||||
|
**************************************************************/
|
||||||
|
|
||||||
|
#ifndef TYROMAIN_H
|
||||||
|
#define TYROMAIN_H
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include <wx/wx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "TyroApp.h"
|
||||||
|
|
||||||
|
class TyroFrame: public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TyroFrame(wxFrame *frame, const wxString& title);
|
||||||
|
~TyroFrame();
|
||||||
|
private:
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
idMenuQuit = 1000,
|
||||||
|
idMenuAbout
|
||||||
|
};
|
||||||
|
void OnClose(wxCloseEvent& event);
|
||||||
|
void OnQuit(wxCommandEvent& event);
|
||||||
|
void OnAbout(wxCommandEvent& event);
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // TYROMAIN_H
|
Loading…
Reference in New Issue
Block a user