From 4d81c04151ffeb64313fe8bc2f7c6a8759ad8f3c Mon Sep 17 00:00:00 2001 From: Tim Warren Date: Tue, 28 Apr 2015 16:14:04 -0400 Subject: [PATCH] Add menu images for Windows, update Windows readme --- README.md | 9 +++++++++ Windows-Build.md | 18 ++++++++++++++++-- src/TyroApp.cpp | 7 +++++++ src/widgets/MainFrame.cpp | 15 +++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 430d16c..91e850e 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,15 @@ Build the app: See the guide for building on Windows: [Windows-Build](./Windows-Build.md) +## Make commands +Please note that make commands are chainable. For a typical programming loop, `make clean dev run` is very useful. + +* all - Make a release binary in the build folder +* clean - Remove intermediate build files +* dev - Make a development binary in the build folder +* run - Run the current binary in the build folder +* release - Make a release binary, with the appropriate resources compiled in. Makes an app bundle on OS X, and adds the icon to the program on Windows. + diff --git a/Windows-Build.md b/Windows-Build.md index d4bf93f..7528ff5 100644 --- a/Windows-Build.md +++ b/Windows-Build.md @@ -5,9 +5,23 @@ In order to keep a consistent build system, Tyro is build with MinGW and Msys. T ## Build Environment Setup: 1. Download MinGW installer -2. Install MinGW & MSyS +2. Install MinGW & MSyS (at least the following packages) + + * mingw-developer-toolkit + * mingw32-base + * mingw32-gcc-g++ + * msys-base + 3. Add `{MinGW Path}\bin` and `{MinGW Path}\msys\1.0\bin` to the system Path environment variable 4. Get the latest wxWidgets 3.0 installer for Windows, and install 5. Open the Msys prompt at `{MinGW Path}\msys\1.0\msys.bat`. You'll probably want a shortcut to this, as it is what will be used for compiling everything from here on. +6. Install Git -## Build SFTP Dependencies \ No newline at end of file +## Build SFTP Dependencies + +1. Run `git clone https://github.com/timw4mail/Tyro-depends.git` in the folder of your choice. +2. Run `sh ./buildssh2.sh` to build the dependencies. + +## Build Tyro + +In the source folder, run `make dev run` to build the develop version and run it immediately \ No newline at end of file diff --git a/src/TyroApp.cpp b/src/TyroApp.cpp index 5884374..6e8cd8d 100644 --- a/src/TyroApp.cpp +++ b/src/TyroApp.cpp @@ -5,6 +5,7 @@ #include "wx_common.h" #include +#include #include class TyroApp : public wxApp @@ -16,6 +17,8 @@ public: private: }; +wxConfigBase *Config; + //************************************************************** #include "widgets/MainFrame.h" @@ -32,6 +35,7 @@ bool TyroApp::OnInit() this->SetAppName(APP_NAME); this->SetVendorName(APP_VENDOR); + Config = wxConfigBase::Get(); MainFrame* frame = new MainFrame(0L, APP_NAME); SetTopWindow(frame); @@ -50,5 +54,8 @@ bool TyroApp::OnInit() */ int TyroApp::OnExit() { + // Deallocate config object + delete wxConfigBase::Set((wxConfigBase *) NULL); + return close(true); } diff --git a/src/widgets/MainFrame.cpp b/src/widgets/MainFrame.cpp index 9358b4b..1cdbeeb 100644 --- a/src/widgets/MainFrame.cpp +++ b/src/widgets/MainFrame.cpp @@ -157,6 +157,21 @@ void MainFrame::SetupMenu() viewMenu->AppendCheckItem(myID_VIEW_WHITESPACE, "Show Invisible Characters\tCtrl+Shift+I", "Toggle visibility of white space characters"); helpMenu->Append(wxID_ABOUT, "&About...\tF1", "Show info about this application"); + + // Setup Menu Images +#ifndef __WXMAC__ + fileMenu->FindChildItem(wxID_NEW)->SetBitmap(wxArtProvider::GetBitmap(wxART_NEW, wxART_MENU)); + fileMenu->FindChildItem(wxID_OPEN)->SetBitmap(wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_MENU)); + fileMenu->FindChildItem(wxID_SAVE)->SetBitmap(wxArtProvider::GetBitmap(wxART_FILE_SAVE, wxART_MENU)); + fileMenu->FindChildItem(wxID_SAVEAS)->SetBitmap(wxArtProvider::GetBitmap(wxART_FILE_SAVE_AS, wxART_MENU)); + fileMenu->FindChildItem(wxID_EXIT)->SetBitmap(wxArtProvider::GetBitmap(wxART_QUIT, wxART_MENU)); + + editMenu->FindChildItem(wxID_UNDO)->SetBitmap(wxArtProvider::GetBitmap(wxART_UNDO, wxART_MENU)); + editMenu->FindChildItem(wxID_REDO)->SetBitmap(wxArtProvider::GetBitmap(wxART_REDO, wxART_MENU)); + editMenu->FindChildItem(wxID_CUT)->SetBitmap(wxArtProvider::GetBitmap(wxART_CUT, wxART_MENU)); + editMenu->FindChildItem(wxID_COPY)->SetBitmap(wxArtProvider::GetBitmap(wxART_COPY, wxART_MENU)); + editMenu->FindChildItem(wxID_PASTE)->SetBitmap(wxArtProvider::GetBitmap(wxART_PASTE, wxART_MENU)); +#endif // Add the menus to the menubar this->mbar->Append(fileMenu, "&File");