Merge branch 'master' of https://github.com/Amebis/wxExtend into HEAD

This commit is contained in:
Simon Rozman 2016-02-05 10:04:44 +01:00
commit f14e5948a5
8 changed files with 110 additions and 1 deletions

8
build/wxExtend.props Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup />
</Project>

View File

@ -20,6 +20,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\src\appbar.cpp" /> <ClCompile Include="..\src\appbar.cpp" />
<ClCompile Include="..\src\appex.cpp" />
<ClCompile Include="..\src\stdafx.cpp"> <ClCompile Include="..\src\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@ -29,6 +30,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\include\wxex\appbar.h" /> <ClInclude Include="..\include\wxex\appbar.h" />
<ClInclude Include="..\include\wxex\appex.h" />
<ClInclude Include="..\include\wxex\common.h" /> <ClInclude Include="..\include\wxex\common.h" />
<ClInclude Include="..\src\stdafx.h" /> <ClInclude Include="..\src\stdafx.h" />
</ItemGroup> </ItemGroup>
@ -66,21 +68,25 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\Win32.props" /> <Import Project="..\..\..\include\Win32.props" />
<Import Project="..\..\..\include\Debug.props" /> <Import Project="..\..\..\include\Debug.props" />
<Import Project="wxExtend.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\x64.props" /> <Import Project="..\..\..\include\x64.props" />
<Import Project="..\..\..\include\Debug.props" /> <Import Project="..\..\..\include\Debug.props" />
<Import Project="wxExtend.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\Win32.props" /> <Import Project="..\..\..\include\Win32.props" />
<Import Project="..\..\..\include\Release.props" /> <Import Project="..\..\..\include\Release.props" />
<Import Project="wxExtend.props" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\x64.props" /> <Import Project="..\..\..\include\x64.props" />
<Import Project="..\..\..\include\Release.props" /> <Import Project="..\..\..\include\Release.props" />
<Import Project="wxExtend.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup /> <PropertyGroup />

View File

@ -21,6 +21,9 @@
<ClCompile Include="..\src\appbar.cpp"> <ClCompile Include="..\src\appbar.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\appex.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\src\stdafx.h"> <ClInclude Include="..\src\stdafx.h">
@ -32,5 +35,8 @@
<ClInclude Include="..\include\wxex\common.h"> <ClInclude Include="..\include\wxex\common.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\include\wxex\appex.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -24,6 +24,7 @@
#include <ShlObj.h> #include <ShlObj.h>
#include <wx/frame.h> #include <wx/frame.h>
#include <wx/string.h>
#define wxABT_AUTOHIDETIMERID 1 #define wxABT_AUTOHIDETIMERID 1

42
include/wxex/appex.h Normal file
View File

@ -0,0 +1,42 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <wx/app.h>
#include <wx/intl.h>
///
/// Extended application
///
class wxAppEx : public wxApp
{
public:
///
/// Called when application initializes.
///
/// \returns
/// - true if initialization succeeded
/// - false otherwise
virtual bool OnInit();
protected:
wxLocale m_locale; ///< Current locale
};

View File

@ -1,5 +1,6 @@
/* /*
Copyright 2016 Amebis Copyright 2016 Amebis
Based on code written by Jeffrey Richter.
This file is part of wxExtend. This file is part of wxExtend.

41
src/appex.cpp Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

View File

@ -19,9 +19,13 @@
#pragma once #pragma once
// Since including <wx/app.h> introduces wrong include order in 3.0.2,
// include the grand <wx/wx.h> at a cost of longer pre-compilation phase.
#include <wx/wx.h>
#include "../include/wxex/appbar.h" #include "../include/wxex/appbar.h"
#include "../include/wxex/appex.h"
#include "../include/wxex/common.h" #include "../include/wxex/common.h"
#include <Windowsx.h> #include <Windowsx.h>
#include <wx/msgdlg.h>