From 1b1c88e4ffdd6b4caf15678994b831a47810e11c Mon Sep 17 00:00:00 2001 From: Tim Warren Date: Fri, 17 Apr 2015 12:48:00 -0400 Subject: [PATCH] Some icon tweaking and miscellaneous twiddling --- Makefile | 2 +- resources/xpm/document.xpm | 72 +++++++++++++++++++++++++++++++ resources/xpm/small/clipboard.xpm | 40 ----------------- resources/xpm/small/close.xpm | 40 ----------------- resources/xpm/small/copy.xpm | 40 ----------------- resources/xpm/small/diskette.xpm | 40 ----------------- resources/xpm/small/file_add.xpm | 40 ----------------- resources/xpm/small/folder.xpm | 40 ----------------- resources/xpm/small/scissors.xpm | 40 ----------------- src/definitions.h | 5 ++- src/widgets/EditPane.cpp | 8 ++++ src/widgets/MainFrame.cpp | 36 ++++++++-------- 12 files changed, 102 insertions(+), 301 deletions(-) create mode 100644 resources/xpm/document.xpm delete mode 100644 resources/xpm/small/clipboard.xpm delete mode 100644 resources/xpm/small/close.xpm delete mode 100644 resources/xpm/small/copy.xpm delete mode 100644 resources/xpm/small/diskette.xpm delete mode 100644 resources/xpm/small/file_add.xpm delete mode 100644 resources/xpm/small/folder.xpm delete mode 100644 resources/xpm/small/scissors.xpm diff --git a/Makefile b/Makefile index 2830104..d8ccaa4 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ exe: LDLIBS += resource.res exe: msw_resource all Tyro.app: all resources/platform/osx/Info.plist - strip -sxX $(PROGRAM) + strip -SXx $(PROGRAM) SetFile -t APPL $(TARGET) -mkdir Tyro.app -mkdir Tyro.app/Contents diff --git a/resources/xpm/document.xpm b/resources/xpm/document.xpm new file mode 100644 index 0000000..7338601 --- /dev/null +++ b/resources/xpm/document.xpm @@ -0,0 +1,72 @@ +/* XPM */ +const static char *document[] = { +/* columns rows colors chars-per-pixel */ +"64 64 2 1 ", +" c #010101", +". c None", +/* pixels */ +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"............. ...........................", +"............ ..........................", +"............ ...................... .........................", +"............ ...................... ........................", +"............ ...................... .......................", +"............ ...................... . ......................", +"............ ...................... .. .....................", +"............ ...................... ... ....................", +"............ ...................... .... ...................", +"............ ...................... ..... ..................", +"............ ...................... ...... .................", +"............ ...................... ....... ................", +"............ ...... ........ ...............", +"............ ...... ......... ..............", +"............ ...................... .............", +"............ ....................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ ...... ...... ............", +"............ ...... ...... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ ...... ...... ............", +"............ ...... ...... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ ...... ...... ............", +"............ ...... ...... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ ...... ...... ............", +"............ ...... ...... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ .................................... ............", +"............ ............", +"............. .............", +"................................................................", +"................................................................", +"................................................................", +"................................................................" +}; diff --git a/resources/xpm/small/clipboard.xpm b/resources/xpm/small/clipboard.xpm deleted file mode 100644 index 1708da3..0000000 --- a/resources/xpm/small/clipboard.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *clipboard[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c #010101", -". c None", -/* pixels */ -"................................", -".............. ..............", -"............. .... .............", -"............ ...... ............", -"...... .. .. ......", -"..... ...... .. .. ...... .....", -"..... ..... ...... ..... .....", -"..... .. .......... .. .....", -"..... . .............. . .....", -"..... . ................ . .....", -"..... . . .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .............. .. .....", -"..... .. .. .....", -"..... .................... .....", -"..... .................... .....", -"..... .................... .....", -"...... ......", -"................................" -}; diff --git a/resources/xpm/small/close.xpm b/resources/xpm/small/close.xpm deleted file mode 100644 index 4753604..0000000 --- a/resources/xpm/small/close.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *close[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c black", -". c None", -/* pixels */ -"................................", -"................................", -"................................", -"............ ............", -".......... ...... ..........", -"........ ............ ........", -"....... .............. .......", -"...... ................ ......", -"..... .................. .....", -"..... ... ............ ... .....", -".... ..... .......... ..... ....", -".... ...... ........ ...... ....", -"... ....... ...... ....... ...", -"... ......... .... ......... ...", -"... .......... .. .......... ...", -"... ........... ........... ...", -"... ........... ........... ...", -"... .......... .. .......... ...", -"... ......... .... ......... ...", -"... ....... ...... ....... ...", -".... ...... ........ ...... ....", -".... ..... .......... ..... ....", -"..... ... ............ ... .....", -"..... .................. .....", -"...... ................ ......", -"....... .............. .......", -"........ ............ ........", -".......... ...... ..........", -"............ ............", -"................................", -"................................", -"................................" -}; diff --git a/resources/xpm/small/copy.xpm b/resources/xpm/small/copy.xpm deleted file mode 100644 index e44048e..0000000 --- a/resources/xpm/small/copy.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *copy[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c #010101", -". c None", -/* pixels */ -"................................", -"........... ...........", -".......... ......... ..........", -".......... ......... .........", -".......... ......... . ........", -".......... ......... .. .......", -".......... ......... ... ......", -"..... ..... .... .....", -".... ......... ..... ....", -".... ......... .......... ....", -".... ......... . ......... ....", -".... ......... .. ........ ....", -".... ......... ... ....... ....", -".... ......... .... ...... ....", -".... .......... ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ ..... ....", -".... ................ .....", -".... ................ ..........", -".... ................ ..........", -".... ................ ..........", -".... ................ ..........", -".... ................ ..........", -"..... ...........", -"................................" -}; diff --git a/resources/xpm/small/diskette.xpm b/resources/xpm/small/diskette.xpm deleted file mode 100644 index 9e58ec1..0000000 --- a/resources/xpm/small/diskette.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *diskette[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c #010101", -". c None", -/* pixels */ -"................................", -"................................", -"................................", -"................................", -".... .......", -".... ...... ......... ... ......", -".... ...... ...... . .... .....", -".... ...... ...... . ..... ....", -".... ...... ...... . ..... ....", -".... ...... ...... . ..... ....", -".... ...... ...... . ..... ....", -".... ...... ......... ..... ....", -".... ...... ..... ....", -".... ...................... ....", -".... ...................... ....", -".... ...................... ....", -".... ... ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ... .............. ... ....", -".... ....", -"................................", -"................................", -"................................", -"................................" -}; diff --git a/resources/xpm/small/file_add.xpm b/resources/xpm/small/file_add.xpm deleted file mode 100644 index 8fef469..0000000 --- a/resources/xpm/small/file_add.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *file_add[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c #010101", -". c None", -/* pixels */ -"................................", -"................................", -"....... .............", -"...... ........... ............", -"...... ........... ...........", -"...... ........... . ..........", -"...... ........... .. .........", -"...... ........... ... ........", -"...... ........... .... .......", -"...... ............ ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... ........ ......... ......", -"...... ........ ......... ......", -"...... ........ ......... ......", -"...... ..... ...... ......", -"...... ........ ......... ......", -"...... ........ ......... ......", -"...... ........ ......... ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"...... .................. ......", -"....... .......", -"................................", -"................................" -}; diff --git a/resources/xpm/small/folder.xpm b/resources/xpm/small/folder.xpm deleted file mode 100644 index ad38e22..0000000 --- a/resources/xpm/small/folder.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *folder[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c #010101", -". c None", -/* pixels */ -"................................", -"................................", -"................................", -"................................", -"... .....................", -"... ...... .....................", -".. ....... ....................", -".. ........ ......", -".. ..................... ......", -".. ..................... .....", -".. ..... ..", -".. ... .", -".. ... ...................... .", -".. ... ...................... .", -".. .. ...................... ..", -".. .. ...................... ..", -".. .. ...................... ..", -".. .. ...................... ..", -".. .. ...................... ..", -".. . ...................... ...", -".. . ...................... ...", -".. . ...................... ...", -".. . ...................... ...", -".. ...................... ....", -".. ...................... ....", -"... ...................... ....", -"... .....", -"................................", -"................................", -"................................", -"................................", -"................................" -}; diff --git a/resources/xpm/small/scissors.xpm b/resources/xpm/small/scissors.xpm deleted file mode 100644 index 6a3b992..0000000 --- a/resources/xpm/small/scissors.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -const static char *scissors[] = { -/* columns rows colors chars-per-pixel */ -"32 32 2 1 ", -" c #010101", -". c None", -/* pixels */ -"................................", -"................................", -"......... ....................", -"........ ... ...................", -"....... ..... ..................", -"....... ..... ..................", -"....... ..... ..................", -"........ ... ..................", -"......... . ........ .....", -"............. ....... ... .....", -"............. ...... ..... ....", -"............. ..... ..... ....", -"............. ... . ..... ....", -"............. ... . .....", -"............ ... ..... ......", -"........... ... ...............", -".......... .. ...............", -"......... .. . ...............", -"........ .. .. ...............", -"........ .. .. ...............", -"....... .. . .. ...............", -"...... .. .. .. ...............", -"...... . ... .. ...............", -"..... . .... .. ...............", -"..... ..... . ................", -"..... ...... . ................", -"............. . ................", -"............. .................", -"............. .................", -"................................", -"................................", -"................................" -}; diff --git a/src/definitions.h b/src/definitions.h index 2b45572..846991c 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -6,8 +6,9 @@ #define DEFINITIONS_H // Application config -const wxString APP_NAME = _T("Tyro"); -const wxString APP_VENDOR = _T("Aviat Ion"); +const wxString APP_NAME = "Tyro"; +const wxString APP_VENDOR = "Aviat Ion"; +const wxString APP_VERSION = "0.0.1"; // EditPane file extension to lexer mapping typedef pair StringConstMapData; diff --git a/src/widgets/EditPane.cpp b/src/widgets/EditPane.cpp index f711176..50e1b1d 100644 --- a/src/widgets/EditPane.cpp +++ b/src/widgets/EditPane.cpp @@ -58,6 +58,11 @@ bool EditPane::LoadAndHighlight(wxString filePath) this->SetLexer(wxSTC_LEX_NULL); } + // Some basic properties to set + this->SetProperty("technology", "2"); + this->SetProperty("error.inline", "0"); + this->SetProperty("font.quality", "3"); // LCD Optimized + // Get the list of keywords for the current language JsonValue keywords_array = config->GetLangKeywords(lang); @@ -204,6 +209,9 @@ bool EditPane::SaveFile() bool EditPane::SaveFile(const wxString &filename) { if ( ! this->IsModified()) return true; + + this->SetSavePoint(); + return wxStyledTextCtrl::SaveFile(filename); } diff --git a/src/widgets/MainFrame.cpp b/src/widgets/MainFrame.cpp index 017118b..d8286c4 100644 --- a/src/widgets/MainFrame.cpp +++ b/src/widgets/MainFrame.cpp @@ -5,7 +5,12 @@ MainFrame::MainFrame(wxFrame *frame, const wxString& title) : wxFrame(frame, -1, title) -{ +{ + #include "../../resources/xpm/document.xpm" + + wxIcon app_icon(document); + this->SetIcon(app_icon); + // Create menus and bars this->SetupMenu(); this->SetupStatusBar(); @@ -58,13 +63,13 @@ void MainFrame::SetupToolbar() wxBitmap cut_icon(scissors); wxBitmap paste_icon(clipboard); #else - wxBitmap new_file_icon = wxArtProvider::GetBitmap(wxART_NEW); - wxBitmap open_file_icon = wxArtProvider::GetBitmap(wxART_FILE_OPEN); - wxBitmap save_file_icon = wxArtProvider::GetBitmap(wxART_FILE_SAVE); - wxBitmap close_file_icon = wxArtProvider::GetBitmap(wxART_CLOSE); - wxBitmap copy_icon = wxArtProvider::GetBitmap(wxART_COPY); - wxBitmap cut_icon = wxArtProvider::GetBitmap(wxART_CUT); - wxBitmap paste_icon = wxArtProvider::GetBitmap(wxART_PASTE); + wxBitmap new_file_icon = wxArtProvider::GetBitmap(wxART_NEW, wxART_TOOLBAR); + wxBitmap open_file_icon = wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_TOOLBAR); + wxBitmap save_file_icon = wxArtProvider::GetBitmap(wxART_FILE_SAVE, wxART_TOOLBAR); + wxBitmap close_file_icon = wxArtProvider::GetBitmap(wxART_CLOSE, wxART_TOOLBAR); + wxBitmap copy_icon = wxArtProvider::GetBitmap(wxART_COPY, wxART_TOOLBAR); + wxBitmap cut_icon = wxArtProvider::GetBitmap(wxART_CUT, wxART_TOOLBAR); + wxBitmap paste_icon = wxArtProvider::GetBitmap(wxART_PASTE, wxART_TOOLBAR); #endif CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL); @@ -74,7 +79,9 @@ 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"); +#ifndef __WXWIN__ toolBar->AddTool(wxID_CLOSE, "Close", close_file_icon, "Close file"); +#endif toolBar->AddSeparator(); toolBar->AddTool(wxID_COPY, "Copy", copy_icon, "Copy"); toolBar->AddTool(wxID_CUT, "Cut", cut_icon, "Cut"); @@ -210,10 +217,7 @@ void MainFrame::OnCloseTab(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnSave(wxCommandEvent &WXUNUSED(event)) { EditPane *editor = notebook->GetCurrentEditor(); - wxString file = editor->fileName; - - editor->SetSavePoint(); - editor->SaveFile(file); + editor->SaveFile(); } void MainFrame::OnSaveAs(wxCommandEvent &WXUNUSED(event)) @@ -269,8 +273,8 @@ void MainFrame::OnAbout(wxCommandEvent &WXUNUSED(event)) { wxAboutDialogInfo info; - info.SetName("Tyro"); - info.SetVersion("0.0.1", "Prerelease"); + info.SetName(APP_NAME); + info.SetVersion(APP_VERSION, "Prerelease"); info.AddDeveloper("Tim Warren, Programmer"); @@ -288,8 +292,6 @@ void MainFrame::EnableEditControls() fileMenu->Enable(wxID_SAVE, true); fileMenu->Enable(wxID_SAVEAS, true); - //editMenu->Enable(wxID_UNDO, false); - //editMenu->Enable(wxID_REDO, false); editMenu->Enable(wxID_CUT, true); editMenu->Enable(wxID_COPY, true); editMenu->Enable(wxID_PASTE, true); @@ -312,8 +314,6 @@ void MainFrame::DisableEditControls() fileMenu->Enable(wxID_SAVE, false); fileMenu->Enable(wxID_SAVEAS, false); - editMenu->Enable(wxID_UNDO, false); - editMenu->Enable(wxID_REDO, false); editMenu->Enable(wxID_CUT, false); editMenu->Enable(wxID_COPY, false); editMenu->Enable(wxID_PASTE, false);