Some icon tweaking and miscellaneous twiddling

This commit is contained in:
Tim Warren 2015-04-17 12:48:00 -04:00
parent f9d677516a
commit 1b1c88e4ff
12 changed files with 102 additions and 301 deletions

View File

@ -74,7 +74,7 @@ exe: LDLIBS += resource.res
exe: msw_resource all exe: msw_resource all
Tyro.app: all resources/platform/osx/Info.plist Tyro.app: all resources/platform/osx/Info.plist
strip -sxX $(PROGRAM) strip -SXx $(PROGRAM)
SetFile -t APPL $(TARGET) SetFile -t APPL $(TARGET)
-mkdir Tyro.app -mkdir Tyro.app
-mkdir Tyro.app/Contents -mkdir Tyro.app/Contents

View File

@ -0,0 +1,72 @@
/* XPM */
const static char *document[] = {
/* columns rows colors chars-per-pixel */
"64 64 2 1 ",
" c #010101",
". c None",
/* pixels */
"................................................................",
"................................................................",
"................................................................",
"................................................................",
"............. ...........................",
"............ ..........................",
"............ ...................... .........................",
"............ ...................... ........................",
"............ ...................... .......................",
"............ ...................... . ......................",
"............ ...................... .. .....................",
"............ ...................... ... ....................",
"............ ...................... .... ...................",
"............ ...................... ..... ..................",
"............ ...................... ...... .................",
"............ ...................... ....... ................",
"............ ...... ........ ...............",
"............ ...... ......... ..............",
"............ ...................... .............",
"............ ....................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ ...... ...... ............",
"............ ...... ...... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ ...... ...... ............",
"............ ...... ...... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ ...... ...... ............",
"............ ...... ...... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ ...... ...... ............",
"............ ...... ...... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ .................................... ............",
"............ ............",
"............. .............",
"................................................................",
"................................................................",
"................................................................",
"................................................................"
};

View File

@ -1,40 +0,0 @@
/* XPM */
const static char *clipboard[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
" c #010101",
". c None",
/* pixels */
"................................",
".............. ..............",
"............. .... .............",
"............ ...... ............",
"...... .. .. ......",
"..... ...... .. .. ...... .....",
"..... ..... ...... ..... .....",
"..... .. .......... .. .....",
"..... . .............. . .....",
"..... . ................ . .....",
"..... . . .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .............. .. .....",
"..... .. .. .....",
"..... .................... .....",
"..... .................... .....",
"..... .................... .....",
"...... ......",
"................................"
};

View File

@ -1,40 +0,0 @@
/* XPM */
const static char *close[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
" c black",
". c None",
/* pixels */
"................................",
"................................",
"................................",
"............ ............",
".......... ...... ..........",
"........ ............ ........",
"....... .............. .......",
"...... ................ ......",
"..... .................. .....",
"..... ... ............ ... .....",
".... ..... .......... ..... ....",
".... ...... ........ ...... ....",
"... ....... ...... ....... ...",
"... ......... .... ......... ...",
"... .......... .. .......... ...",
"... ........... ........... ...",
"... ........... ........... ...",
"... .......... .. .......... ...",
"... ......... .... ......... ...",
"... ....... ...... ....... ...",
".... ...... ........ ...... ....",
".... ..... .......... ..... ....",
"..... ... ............ ... .....",
"..... .................. .....",
"...... ................ ......",
"....... .............. .......",
"........ ............ ........",
".......... ...... ..........",
"............ ............",
"................................",
"................................",
"................................"
};

View File

@ -1,40 +0,0 @@
/* XPM */
const static char *copy[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
" c #010101",
". c None",
/* pixels */
"................................",
"........... ...........",
".......... ......... ..........",
".......... ......... .........",
".......... ......... . ........",
".......... ......... .. .......",
".......... ......... ... ......",
"..... ..... .... .....",
".... ......... ..... ....",
".... ......... .......... ....",
".... ......... . ......... ....",
".... ......... .. ........ ....",
".... ......... ... ....... ....",
".... ......... .... ...... ....",
".... .......... ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ ..... ....",
".... ................ .....",
".... ................ ..........",
".... ................ ..........",
".... ................ ..........",
".... ................ ..........",
".... ................ ..........",
"..... ...........",
"................................"
};

View File

@ -1,40 +0,0 @@
/* XPM */
const static char *diskette[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
" c #010101",
". c None",
/* pixels */
"................................",
"................................",
"................................",
"................................",
".... .......",
".... ...... ......... ... ......",
".... ...... ...... . .... .....",
".... ...... ...... . ..... ....",
".... ...... ...... . ..... ....",
".... ...... ...... . ..... ....",
".... ...... ...... . ..... ....",
".... ...... ......... ..... ....",
".... ...... ..... ....",
".... ...................... ....",
".... ...................... ....",
".... ...................... ....",
".... ... ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ... .............. ... ....",
".... ....",
"................................",
"................................",
"................................",
"................................"
};

View File

@ -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 */
"................................",
"................................",
"....... .............",
"...... ........... ............",
"...... ........... ...........",
"...... ........... . ..........",
"...... ........... .. .........",
"...... ........... ... ........",
"...... ........... .... .......",
"...... ............ ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... ........ ......... ......",
"...... ........ ......... ......",
"...... ........ ......... ......",
"...... ..... ...... ......",
"...... ........ ......... ......",
"...... ........ ......... ......",
"...... ........ ......... ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"...... .................. ......",
"....... .......",
"................................",
"................................"
};

View File

@ -1,40 +0,0 @@
/* XPM */
const static char *folder[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
" c #010101",
". c None",
/* pixels */
"................................",
"................................",
"................................",
"................................",
"... .....................",
"... ...... .....................",
".. ....... ....................",
".. ........ ......",
".. ..................... ......",
".. ..................... .....",
".. ..... ..",
".. ... .",
".. ... ...................... .",
".. ... ...................... .",
".. .. ...................... ..",
".. .. ...................... ..",
".. .. ...................... ..",
".. .. ...................... ..",
".. .. ...................... ..",
".. . ...................... ...",
".. . ...................... ...",
".. . ...................... ...",
".. . ...................... ...",
".. ...................... ....",
".. ...................... ....",
"... ...................... ....",
"... .....",
"................................",
"................................",
"................................",
"................................",
"................................"
};

View File

@ -1,40 +0,0 @@
/* XPM */
const static char *scissors[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
" c #010101",
". c None",
/* pixels */
"................................",
"................................",
"......... ....................",
"........ ... ...................",
"....... ..... ..................",
"....... ..... ..................",
"....... ..... ..................",
"........ ... ..................",
"......... . ........ .....",
"............. ....... ... .....",
"............. ...... ..... ....",
"............. ..... ..... ....",
"............. ... . ..... ....",
"............. ... . .....",
"............ ... ..... ......",
"........... ... ...............",
".......... .. ...............",
"......... .. . ...............",
"........ .. .. ...............",
"........ .. .. ...............",
"....... .. . .. ...............",
"...... .. .. .. ...............",
"...... . ... .. ...............",
"..... . .... .. ...............",
"..... ..... . ................",
"..... ...... . ................",
"............. . ................",
"............. .................",
"............. .................",
"................................",
"................................",
"................................"
};

View File

@ -6,8 +6,9 @@
#define DEFINITIONS_H #define DEFINITIONS_H
// Application config // Application config
const wxString APP_NAME = _T("Tyro"); const wxString APP_NAME = "Tyro";
const wxString APP_VENDOR = _T("Aviat Ion"); const wxString APP_VENDOR = "Aviat Ion";
const wxString APP_VERSION = "0.0.1";
// EditPane file extension to lexer mapping // EditPane file extension to lexer mapping
typedef pair<string, int> StringConstMapData; typedef pair<string, int> StringConstMapData;

View File

@ -58,6 +58,11 @@ bool EditPane::LoadAndHighlight(wxString filePath)
this->SetLexer(wxSTC_LEX_NULL); 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 // Get the list of keywords for the current language
JsonValue keywords_array = config->GetLangKeywords(lang); JsonValue keywords_array = config->GetLangKeywords(lang);
@ -204,6 +209,9 @@ bool EditPane::SaveFile()
bool EditPane::SaveFile(const wxString &filename) bool EditPane::SaveFile(const wxString &filename)
{ {
if ( ! this->IsModified()) return true; if ( ! this->IsModified()) return true;
this->SetSavePoint();
return wxStyledTextCtrl::SaveFile(filename); return wxStyledTextCtrl::SaveFile(filename);
} }

View File

@ -5,7 +5,12 @@
MainFrame::MainFrame(wxFrame *frame, const wxString& title) MainFrame::MainFrame(wxFrame *frame, const wxString& title)
: wxFrame(frame, -1, title) : wxFrame(frame, -1, title)
{ {
#include "../../resources/xpm/document.xpm"
wxIcon app_icon(document);
this->SetIcon(app_icon);
// Create menus and bars // Create menus and bars
this->SetupMenu(); this->SetupMenu();
this->SetupStatusBar(); this->SetupStatusBar();
@ -58,13 +63,13 @@ void MainFrame::SetupToolbar()
wxBitmap cut_icon(scissors); wxBitmap cut_icon(scissors);
wxBitmap paste_icon(clipboard); wxBitmap paste_icon(clipboard);
#else #else
wxBitmap new_file_icon = wxArtProvider::GetBitmap(wxART_NEW); wxBitmap new_file_icon = wxArtProvider::GetBitmap(wxART_NEW, wxART_TOOLBAR);
wxBitmap open_file_icon = wxArtProvider::GetBitmap(wxART_FILE_OPEN); wxBitmap open_file_icon = wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_TOOLBAR);
wxBitmap save_file_icon = wxArtProvider::GetBitmap(wxART_FILE_SAVE); wxBitmap save_file_icon = wxArtProvider::GetBitmap(wxART_FILE_SAVE, wxART_TOOLBAR);
wxBitmap close_file_icon = wxArtProvider::GetBitmap(wxART_CLOSE); wxBitmap close_file_icon = wxArtProvider::GetBitmap(wxART_CLOSE, wxART_TOOLBAR);
wxBitmap copy_icon = wxArtProvider::GetBitmap(wxART_COPY); wxBitmap copy_icon = wxArtProvider::GetBitmap(wxART_COPY, wxART_TOOLBAR);
wxBitmap cut_icon = wxArtProvider::GetBitmap(wxART_CUT); wxBitmap cut_icon = wxArtProvider::GetBitmap(wxART_CUT, wxART_TOOLBAR);
wxBitmap paste_icon = wxArtProvider::GetBitmap(wxART_PASTE); wxBitmap paste_icon = wxArtProvider::GetBitmap(wxART_PASTE, wxART_TOOLBAR);
#endif #endif
CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL); 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_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");
#ifndef __WXWIN__
toolBar->AddTool(wxID_CLOSE, "Close", close_file_icon, "Close file"); toolBar->AddTool(wxID_CLOSE, "Close", close_file_icon, "Close file");
#endif
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");
@ -210,10 +217,7 @@ void MainFrame::OnCloseTab(wxCommandEvent &WXUNUSED(event))
void MainFrame::OnSave(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnSave(wxCommandEvent &WXUNUSED(event))
{ {
EditPane *editor = notebook->GetCurrentEditor(); EditPane *editor = notebook->GetCurrentEditor();
wxString file = editor->fileName; editor->SaveFile();
editor->SetSavePoint();
editor->SaveFile(file);
} }
void MainFrame::OnSaveAs(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnSaveAs(wxCommandEvent &WXUNUSED(event))
@ -269,8 +273,8 @@ void MainFrame::OnAbout(wxCommandEvent &WXUNUSED(event))
{ {
wxAboutDialogInfo info; wxAboutDialogInfo info;
info.SetName("Tyro"); info.SetName(APP_NAME);
info.SetVersion("0.0.1", "Prerelease"); info.SetVersion(APP_VERSION, "Prerelease");
info.AddDeveloper("Tim Warren, Programmer"); info.AddDeveloper("Tim Warren, Programmer");
@ -288,8 +292,6 @@ void MainFrame::EnableEditControls()
fileMenu->Enable(wxID_SAVE, true); fileMenu->Enable(wxID_SAVE, true);
fileMenu->Enable(wxID_SAVEAS, true); fileMenu->Enable(wxID_SAVEAS, true);
//editMenu->Enable(wxID_UNDO, false);
//editMenu->Enable(wxID_REDO, false);
editMenu->Enable(wxID_CUT, true); editMenu->Enable(wxID_CUT, true);
editMenu->Enable(wxID_COPY, true); editMenu->Enable(wxID_COPY, true);
editMenu->Enable(wxID_PASTE, true); editMenu->Enable(wxID_PASTE, true);
@ -312,8 +314,6 @@ void MainFrame::DisableEditControls()
fileMenu->Enable(wxID_SAVE, false); fileMenu->Enable(wxID_SAVE, false);
fileMenu->Enable(wxID_SAVEAS, false); fileMenu->Enable(wxID_SAVEAS, false);
editMenu->Enable(wxID_UNDO, false);
editMenu->Enable(wxID_REDO, false);
editMenu->Enable(wxID_CUT, false); editMenu->Enable(wxID_CUT, false);
editMenu->Enable(wxID_COPY, false); editMenu->Enable(wxID_COPY, false);
editMenu->Enable(wxID_PASTE, false); editMenu->Enable(wxID_PASTE, false);