From c44754e941c2ee99546f31be53fbf44962053554 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 5 Feb 2016 09:13:28 +0100 Subject: [PATCH 1/5] Folder specific GIT ignores added --- build/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 build/.gitignore diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..7077b7c --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,2 @@ +/*.user +/temp From 286b9af74ca232aab933ddec4718367afa3c3c3f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 5 Feb 2016 09:14:57 +0100 Subject: [PATCH 2/5] Project specific property sheet added. --- build/wxExtend.props | 8 ++++++++ build/wxExtend.vcxproj | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 build/wxExtend.props diff --git a/build/wxExtend.props b/build/wxExtend.props new file mode 100644 index 0000000..08b2b3e --- /dev/null +++ b/build/wxExtend.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/build/wxExtend.vcxproj b/build/wxExtend.vcxproj index 0845e5b..5427335 100644 --- a/build/wxExtend.vcxproj +++ b/build/wxExtend.vcxproj @@ -66,21 +66,25 @@ + + + + From a72d1584097bd85c65b99c4cecfc82a22008b99f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 5 Feb 2016 09:20:33 +0100 Subject: [PATCH 3/5] Updated copyright notice --- src/appbar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/appbar.cpp b/src/appbar.cpp index 8d76148..acc2c3f 100644 --- a/src/appbar.cpp +++ b/src/appbar.cpp @@ -1,5 +1,6 @@ /* Copyright 2016 Amebis + Based on code written by Jeffrey Richter. This file is part of wxExtend. From 48767ae1b61132baf5077349a7efcd2c3f131037 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 5 Feb 2016 09:20:55 +0100 Subject: [PATCH 4/5] wxAppEx class added --- include/wxex/appex.h | 35 +++++++++++++++++++++++++++++++++++ src/appex.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ src/stdafx.h | 1 + 3 files changed, 77 insertions(+) create mode 100644 include/wxex/appex.h create mode 100644 src/appex.cpp diff --git a/include/wxex/appex.h b/include/wxex/appex.h new file mode 100644 index 0000000..1ec3765 --- /dev/null +++ b/include/wxex/appex.h @@ -0,0 +1,35 @@ +/* + Copyright 2016 Amebis + + This file is part of wxExtend. + + wxExtend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + wxExtend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with wxExtend. If not, see . +*/ + +#pragma once + +#include + + +/// +/// Extended application +/// +class wxAppEx : public wxApp +{ +public: + virtual bool OnInit(); + +protected: + wxLocale m_locale; +}; diff --git a/src/appex.cpp b/src/appex.cpp new file mode 100644 index 0000000..9ec22d8 --- /dev/null +++ b/src/appex.cpp @@ -0,0 +1,41 @@ +/* + Copyright 2016 Amebis + + This file is part of wxExtend. + + wxExtend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + wxExtend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with wxExtend. If not, see . +*/ + +#include "stdafx.h" + + +////////////////////////////////////////////////////////////////////////// +// wxAppEx +////////////////////////////////////////////////////////////////////////// + +bool wxAppEx::OnInit() +{ + if (!wxApp::OnInit()) + return false; + + if (wxLocale::IsAvailable(wxLANGUAGE_SLOVENIAN)) { + wxString sPath(wxPathOnly(argv[0])); + sPath << wxT("\\..\\locale"); + m_locale.AddCatalogLookupPathPrefix(sPath); + wxVERIFY(m_locale.Init(wxLANGUAGE_SLOVENIAN)); + wxVERIFY(m_locale.AddCatalog(wxT("ZRCola"))); + } + + return true; +} diff --git a/src/stdafx.h b/src/stdafx.h index e2693c8..d73f3b6 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -20,6 +20,7 @@ #pragma once #include "../include/wxex/appbar.h" +#include "../include/wxex/appex.h" #include "../include/wxex/common.h" From d15383ce6ec367bc17d227b0ebd62ac1096175bd Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 5 Feb 2016 09:54:11 +0100 Subject: [PATCH 5/5] Work on wxAppEx continues... --- build/wxExtend.vcxproj | 2 ++ build/wxExtend.vcxproj.filters | 6 ++++++ include/wxex/appbar.h | 1 + include/wxex/appex.h | 9 ++++++++- src/stdafx.h | 5 ++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/build/wxExtend.vcxproj b/build/wxExtend.vcxproj index 5427335..d6f4265 100644 --- a/build/wxExtend.vcxproj +++ b/build/wxExtend.vcxproj @@ -20,6 +20,7 @@ + Create Create @@ -29,6 +30,7 @@ + diff --git a/build/wxExtend.vcxproj.filters b/build/wxExtend.vcxproj.filters index ec75aac..7f2eee1 100644 --- a/build/wxExtend.vcxproj.filters +++ b/build/wxExtend.vcxproj.filters @@ -21,6 +21,9 @@ Source Files + + Source Files + @@ -32,5 +35,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/include/wxex/appbar.h b/include/wxex/appbar.h index 2f2cd0a..bae751f 100644 --- a/include/wxex/appbar.h +++ b/include/wxex/appbar.h @@ -24,6 +24,7 @@ #include #include +#include #define wxABT_AUTOHIDETIMERID 1 diff --git a/include/wxex/appex.h b/include/wxex/appex.h index 1ec3765..7b08537 100644 --- a/include/wxex/appex.h +++ b/include/wxex/appex.h @@ -20,6 +20,7 @@ #pragma once #include +#include /// @@ -28,8 +29,14 @@ class wxAppEx : public wxApp { public: + /// + /// Called when application initializes. + /// + /// \returns + /// - true if initialization succeeded + /// - false otherwise virtual bool OnInit(); protected: - wxLocale m_locale; + wxLocale m_locale; ///< Current locale }; diff --git a/src/stdafx.h b/src/stdafx.h index d73f3b6..439ed65 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -19,10 +19,13 @@ #pragma once +// Since including introduces wrong include order in 3.0.2, +// include the grand at a cost of longer pre-compilation phase. +#include + #include "../include/wxex/appbar.h" #include "../include/wxex/appex.h" #include "../include/wxex/common.h" #include -#include