From f3b08833b3ab00e4bb96d974b2e68d2c859b4e6c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 3 Jun 2019 11:14:38 -0400 Subject: [PATCH] Fix some bugs, add a proper license --- LICENSE | 7 +++++++ README.md | 14 +++----------- src/definitions.h | 2 +- src/widgets/EditPane.cpp | 13 +++++++++++++ 4 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5718127 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2019 Timothy J. Warren + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 048ef22..b92cbfd 100644 --- a/README.md +++ b/README.md @@ -15,23 +15,15 @@ A Cross-platform Code Editor Required packages: * build-essential +* cmake * libssh2-1-dev * libwxgtk3.0-dev After these packages are installed, the project should build with a simple `make` command. ### OS X -Building wxWidgets: - -If you want maximum compatibility with older versions of OS X, -view [the guide](./Mac-compatibility-build.md). Otherwise, these simpler -steps should work fine for a local build. - -1. Download the latest wxWidgets source (>= 3.0.2) -2. Run `export CXX="clang++ -std=c++11 -stdlib=libc++"` to compile with clang for better C++11 support -3. Make a new directory in the source tree, like `wxmac` -4. Run `../configure --disable-shared --disable-webviewwebkit --disable-compat28` in the new directory -5. Run `make && make install` +Install wxWidgets library (Using homebrew): +* `brew install wxmac` Install libssh2 (Using homebrew): diff --git a/src/definitions.h b/src/definitions.h index 5683326..a612cde 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -139,4 +139,4 @@ const wxString TYRO_FILE_SAVE_WILDCARDS = "Shell (*.sh, *.bsh)|*.sh;*.bsh|" "SQL (*.sql)|*.sql|" "Text (*.txt)|*.txt|" - "Yaml (.yml,*.yaml)| *.yml;*.yaml"; + "Yaml (.yml,*.yaml)| *.yml;*.yaml|"; diff --git a/src/widgets/EditPane.cpp b/src/widgets/EditPane.cpp index b677f5d..b0f860c 100644 --- a/src/widgets/EditPane.cpp +++ b/src/widgets/EditPane.cpp @@ -302,6 +302,19 @@ void EditPane::BindEvents() } }, wxID_ANY); + this->Bind(wxEVT_STC_SAVEPOINTREACHED, [=](wxStyledTextEvent& event) { + auto parent = (wxAuiNotebook*) this->GetParent(); + auto currentPage = parent->GetCurrentPage(); + auto idx = parent->GetPageIndex(currentPage); + wxString currentTitle = parent->GetPageText(idx); + + if (currentTitle.Contains("*")) + { + currentTitle.Replace("*", ""); + parent->SetPageText(idx, currentTitle); + } + }, wxID_ANY); + // this->Bind(wxEVT_STC_CHARADDED, &EditPane::OnCharAdded, this, wxID_ANY); }