Misc changes

This commit is contained in:
Timothy Warren 2015-04-01 15:15:29 -04:00
parent a4449a64b3
commit 7d94beb874
5 changed files with 24 additions and 12 deletions

View File

@ -5,7 +5,7 @@ END_EVENT_TABLE()
DocFrame::DocFrame(wxWindow *parent, wxWindowID id) DocFrame::DocFrame(wxWindow *parent, wxWindowID id)
{ {
//editor = new wxStyledTextCtrl(this); editor = new wxStyledTextCtrl(parent);
} }
DocFrame::~DocFrame() DocFrame::~DocFrame()

View File

@ -13,8 +13,8 @@ public:
DocFrame(wxWindow *parent, wxWindowID id); DocFrame(wxWindow *parent, wxWindowID id);
~DocFrame(); ~DocFrame();
private: private:
//wxStyledTextCtrl *editor; wxStyledTextCtrl *editor;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif // TYRODOC_FRAM_H #endif // TYRODOC_FRAM_H

View File

@ -25,12 +25,10 @@ END_EVENT_TABLE()
TyroFrame::TyroFrame(wxFrame *frame, const wxString& title) TyroFrame::TyroFrame(wxFrame *frame, const wxString& title)
: wxFrame(frame, -1, title) : wxFrame(frame, -1, title)
{ {
this->SetupMenu(); this->SetupMenu();
// create a status bar with some information about the used wxWidgets version // create a status bar with some information about the used wxWidgets version
CreateStatusBar(2);
SetStatusText(_(""), 0);
SetStatusText(_(""), 1);
// Set up control layout // Set up control layout
wxBoxSizer *base_sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *base_sizer = new wxBoxSizer(wxVERTICAL);
@ -51,6 +49,17 @@ TyroFrame::TyroFrame(wxFrame *frame, const wxString& title)
TyroFrame::~TyroFrame() {} TyroFrame::~TyroFrame() {}
void TyroFrame::SetupStatusBar()
{
CreateStatusBar(2);
SetStatusText(_(""), 0);
SetStatusText(_(""), 1);
}
void TyroFrame::SetupToolbar()
{
}
void TyroFrame::SetupMenu() void TyroFrame::SetupMenu()
{ {
// create a menu bar // create a menu bar
@ -95,10 +104,10 @@ wxAuiNotebook *TyroFrame::CreateNotebook()
wxAuiNotebook *ctrl = new wxAuiNotebook(this); wxAuiNotebook *ctrl = new wxAuiNotebook(this);
//DocFrame *editor = new DocFrame(ctrl, wxID_ANY); DocFrame *editor = new DocFrame(ctrl, wxID_ANY);
wxWindow *editor = new wxWindow(ctrl, wxID_ANY); //wxWindow *editor = new wxWindow(ctrl, wxID_ANY);
ctrl->AddPage(editor, "Untitled"); //ctrl->AddPage(editor, "Untitled");
return ctrl; return ctrl;
} }
@ -110,7 +119,7 @@ void TyroFrame::OnClose(wxCloseEvent &WXUNUSED(event))
void TyroFrame::OnMenuFileOpen(wxCommandEvent &WXUNUSED(event)) void TyroFrame::OnMenuFileOpen(wxCommandEvent &WXUNUSED(event))
{ {
wxFileDialog *OpenDialog = new wxFileDialog(this, _T("Choose a file"), _(""), _(""), _("*.*"), wxFD_OPEN); wxFileDialog *OpenDialog = new wxFileDialog(this, _T("Choose a file"), _(""), _(""), _("*.*"), wxFD_OPEN);
if (OpenDialog->ShowModal() == wxID_OK) if (OpenDialog->ShowModal() == wxID_OK)
{ {
// Load the file into a new notebook tab and styled text control // Load the file into a new notebook tab and styled text control

View File

@ -29,6 +29,8 @@ class TyroFrame: public wxFrame
idMenuAbout idMenuAbout
}; };
void SetupMenu(); void SetupMenu();
void SetupToolbar();
void SetupStatusBar();
void OnMenuFileOpen(wxCommandEvent &event); void OnMenuFileOpen(wxCommandEvent &event);
void OnMenuFileSave(wxCommandEvent &event); void OnMenuFileSave(wxCommandEvent &event);
void OnClose(wxCloseEvent &event); void OnClose(wxCloseEvent &event);

View File

@ -11,6 +11,7 @@
#define TYROAPP_H #define TYROAPP_H
#include <wx/app.h> #include <wx/app.h>
#include <wx/debug.h>
#include <wx/aui/aui.h> #include <wx/aui/aui.h>
class TyroApp : public wxApp class TyroApp : public wxApp