Remove some redudant declaration in Main file and fix toolbar styling
This commit is contained in:
parent
f7f45ade77
commit
ccb3de679a
@ -8,56 +8,52 @@
|
|||||||
#include <wx/app.h>
|
#include <wx/app.h>
|
||||||
#include <wx/debug.h>
|
#include <wx/debug.h>
|
||||||
|
|
||||||
class TyroApp : public wxApp
|
|
||||||
{
|
|
||||||
friend class MainFrame;
|
|
||||||
public:
|
|
||||||
virtual bool OnInit();
|
|
||||||
virtual int OnExit();
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
//**************************************************************
|
|
||||||
|
|
||||||
IMPLEMENT_APP(TyroApp);
|
|
||||||
|
|
||||||
// Some global stuff
|
// Some global stuff
|
||||||
wxConfigBase *Config;
|
wxConfigBase *Config;
|
||||||
TyroMenu *mbar;
|
TyroMenu *mbar;
|
||||||
MainFrame *main_frame;
|
MainFrame *main_frame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the event loop and create the main window
|
* Class with main method
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
bool TyroApp::OnInit()
|
class TyroApp : public wxApp
|
||||||
{
|
{
|
||||||
this->SetAppName(APP_NAME);
|
public:
|
||||||
this->SetVendorName(APP_VENDOR);
|
/**
|
||||||
|
* Start the event loop and create the main window
|
||||||
Config = wxConfigBase::Get();
|
*
|
||||||
mbar = new TyroMenu();
|
* @return bool
|
||||||
main_frame = new MainFrame(0L, APP_NAME);
|
*/
|
||||||
|
bool OnInit()
|
||||||
|
{
|
||||||
|
this->SetAppName(APP_NAME);
|
||||||
|
this->SetVendorName(APP_VENDOR);
|
||||||
|
|
||||||
SetTopWindow(main_frame);
|
Config = wxConfigBase::Get();
|
||||||
|
mbar = new TyroMenu();
|
||||||
main_frame->Layout();
|
main_frame = new MainFrame(0L, APP_NAME);
|
||||||
main_frame->CenterOnScreen();
|
|
||||||
main_frame->Show(true);
|
|
||||||
|
|
||||||
return true;
|
SetTopWindow(main_frame);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
main_frame->Layout();
|
||||||
* Exit handler
|
main_frame->CenterOnScreen();
|
||||||
*
|
main_frame->Show(true);
|
||||||
* @return int
|
|
||||||
*/
|
return true;
|
||||||
int TyroApp::OnExit()
|
}
|
||||||
{
|
|
||||||
// Deallocate config object
|
|
||||||
delete wxConfigBase::Set((wxConfigBase *) NULL);
|
|
||||||
|
|
||||||
return close(true);
|
/**
|
||||||
}
|
* Exit handler
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int OnExit()
|
||||||
|
{
|
||||||
|
// Deallocate config object
|
||||||
|
delete wxConfigBase::Set((wxConfigBase *) NULL);
|
||||||
|
|
||||||
|
return close(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
IMPLEMENT_APP(TyroApp);
|
||||||
|
@ -58,7 +58,12 @@ void MainFrame::DoLayout()
|
|||||||
|
|
||||||
// Setup properties for each AUI pane
|
// Setup properties for each AUI pane
|
||||||
wxAuiPaneInfo toolBarPaneInfo;
|
wxAuiPaneInfo toolBarPaneInfo;
|
||||||
toolBarPaneInfo.ToolbarPane().Top();
|
toolBarPaneInfo
|
||||||
|
.Top()
|
||||||
|
.ToolbarPane()
|
||||||
|
.Gripper(false)
|
||||||
|
.DockFixed(true)
|
||||||
|
.Resizable(true);
|
||||||
this->manager->AddPane(toolBar, toolBarPaneInfo);
|
this->manager->AddPane(toolBar, toolBarPaneInfo);
|
||||||
|
|
||||||
wxAuiPaneInfo notebookPaneInfo;
|
wxAuiPaneInfo notebookPaneInfo;
|
||||||
@ -133,7 +138,10 @@ void MainFrame::SetupToolbar()
|
|||||||
toolBar->AddTool(wxID_NEW, "New", new_file_icon, "New file");
|
toolBar->AddTool(wxID_NEW, "New", new_file_icon, "New file");
|
||||||
toolBar->AddTool(wxID_OPEN, "Open", open_file_icon, "Open file");
|
toolBar->AddTool(wxID_OPEN, "Open", open_file_icon, "Open file");
|
||||||
toolBar->AddTool(wxID_SAVE, "Save", save_file_icon, "Save file");
|
toolBar->AddTool(wxID_SAVE, "Save", save_file_icon, "Save file");
|
||||||
|
|
||||||
|
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
|
|
||||||
toolBar->AddTool(wxID_COPY, "Copy", copy_icon, "Copy");
|
toolBar->AddTool(wxID_COPY, "Copy", copy_icon, "Copy");
|
||||||
toolBar->AddTool(wxID_CUT, "Cut", cut_icon, "Cut");
|
toolBar->AddTool(wxID_CUT, "Cut", cut_icon, "Cut");
|
||||||
toolBar->AddTool(wxID_PASTE, "Paste", paste_icon, "Paste");
|
toolBar->AddTool(wxID_PASTE, "Paste", paste_icon, "Paste");
|
||||||
|
Loading…
Reference in New Issue
Block a user