From ccb3de679a94e5a50f9c4e4f8a40cd68bccab7c2 Mon Sep 17 00:00:00 2001 From: Tim Warren Date: Tue, 12 May 2015 14:09:40 -0400 Subject: [PATCH] Remove some redudant declaration in Main file and fix toolbar styling --- src/TyroApp.cpp | 78 +++++++++++++++++++-------------------- src/widgets/MainFrame.cpp | 10 ++++- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/TyroApp.cpp b/src/TyroApp.cpp index af2df74..c1a6f30 100644 --- a/src/TyroApp.cpp +++ b/src/TyroApp.cpp @@ -8,56 +8,52 @@ #include #include -class TyroApp : public wxApp -{ - friend class MainFrame; -public: - virtual bool OnInit(); - virtual int OnExit(); -private: -}; - -//************************************************************** - -IMPLEMENT_APP(TyroApp); - // Some global stuff wxConfigBase *Config; TyroMenu *mbar; MainFrame *main_frame; /** - * Start the event loop and create the main window - * - * @return bool + * Class with main method */ -bool TyroApp::OnInit() +class TyroApp : public wxApp { - this->SetAppName(APP_NAME); - this->SetVendorName(APP_VENDOR); - - Config = wxConfigBase::Get(); - mbar = new TyroMenu(); - main_frame = new MainFrame(0L, APP_NAME); +public: + /** + * Start the event loop and create the main window + * + * @return bool + */ + bool OnInit() + { + this->SetAppName(APP_NAME); + this->SetVendorName(APP_VENDOR); - SetTopWindow(main_frame); - - main_frame->Layout(); - main_frame->CenterOnScreen(); - main_frame->Show(true); + Config = wxConfigBase::Get(); + mbar = new TyroMenu(); + main_frame = new MainFrame(0L, APP_NAME); - return true; -} + SetTopWindow(main_frame); -/** - * Exit handler - * - * @return int - */ -int TyroApp::OnExit() -{ - // Deallocate config object - delete wxConfigBase::Set((wxConfigBase *) NULL); + main_frame->Layout(); + main_frame->CenterOnScreen(); + main_frame->Show(true); + + return true; + } - return close(true); -} + /** + * Exit handler + * + * @return int + */ + int OnExit() + { + // Deallocate config object + delete wxConfigBase::Set((wxConfigBase *) NULL); + + return close(true); + } +}; + +IMPLEMENT_APP(TyroApp); diff --git a/src/widgets/MainFrame.cpp b/src/widgets/MainFrame.cpp index af32f37..f84863d 100644 --- a/src/widgets/MainFrame.cpp +++ b/src/widgets/MainFrame.cpp @@ -58,7 +58,12 @@ void MainFrame::DoLayout() // Setup properties for each AUI pane wxAuiPaneInfo toolBarPaneInfo; - toolBarPaneInfo.ToolbarPane().Top(); + toolBarPaneInfo + .Top() + .ToolbarPane() + .Gripper(false) + .DockFixed(true) + .Resizable(true); this->manager->AddPane(toolBar, toolBarPaneInfo); wxAuiPaneInfo notebookPaneInfo; @@ -133,7 +138,10 @@ void MainFrame::SetupToolbar() toolBar->AddTool(wxID_NEW, "New", new_file_icon, "New file"); toolBar->AddTool(wxID_OPEN, "Open", open_file_icon, "Open file"); toolBar->AddTool(wxID_SAVE, "Save", save_file_icon, "Save file"); + + toolBar->AddSeparator(); + toolBar->AddTool(wxID_COPY, "Copy", copy_icon, "Copy"); toolBar->AddTool(wxID_CUT, "Cut", cut_icon, "Cut"); toolBar->AddTool(wxID_PASTE, "Paste", paste_icon, "Paste");