2 Commits

Author SHA1 Message Date
Simon Rozman
cdefd74f3f wxHexValidator extended with leading zeros support
Version set to 1.2
2016-05-23 14:05:37 +02:00
Simon Rozman
28f244cf2f German and Russian translation stub added 2016-05-13 20:03:44 +02:00
10 changed files with 97 additions and 24 deletions

View File

@@ -40,13 +40,13 @@ Component ComponentId Directory_ Attributes Condition KeyPath
s$(MSIBUILD_LENGTH_ID) S38 s$(MSIBUILD_LENGTH_ID) i2 S255 S$(MSIBUILD_LENGTH_ID)
Component Component
!IF "$(PLAT)" == "Win32"
compwxExtend.dll.Win32 {239F2FF9-E998-4F81-85A8-DA2C0A5F860B} $(WXEXTEND_BIN_DIR) 0 filewxExtend.dll.Win32
compwxExtend.dll.Win32 {7645D753-4A8C-40C6-BD6F-6DDE54F2B8F8} $(WXEXTEND_BIN_DIR) 0 filewxExtend.dll.Win32
!ENDIF
!IF "$(PLAT)" == "x64"
compwxExtend.dll.x64 {AA798500-8E4F-4554-8611-F2C225046606} $(WXEXTEND_BIN_DIR) 256 filewxExtend.dll.x64
compwxExtend.dll.x64 {919135CB-B106-467E-A3DA-CBC463FBB7FF} $(WXEXTEND_BIN_DIR) 256 filewxExtend.dll.x64
!ENDIF
!IF "$(LANG)" == "Sl"
compwxExtend.mo.sl_SI {026F2E74-4190-4B49-820B-94141F32F04B} WXEXTENDLOCSLSIDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) filewxExtend.mo.sl_SI
compwxExtend.mo.sl_SI {08656BB6-0887-4605-B6D3-20B0444624BA} WXEXTENDLOCSLSIDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) filewxExtend.mo.sl_SI
!ENDIF
<<NOKEEP
@@ -79,22 +79,22 @@ s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l255 i4 S$(MSIBUILD_LENGTH_ID) S20
File File
!IF "$(PLAT)" == "Win32"
!IF "$(CFG)" == "Release"
filewxExtend.dll.Win32 compwxExtend.dll.Win32 WXEXTE~2.DLL|wxExtend11u_vc100.dll 0 0 1536 1
filewxExtend.dll.Win32 compwxExtend.dll.Win32 WXEXTE~2.DLL|wxExtend12u_vc100.dll 0 0 1536 1
!ENDIF
!IF "$(CFG)" == "Debug"
filewxExtend.dll.Win32 compwxExtend.dll.Win32 WXEXTE~4.DLL|wxExtend11ud_vc100.dll 0 0 1536 1
filewxExtend.dll.Win32 compwxExtend.dll.Win32 WXEXTE~4.DLL|wxExtend12ud_vc100.dll 0 0 1536 1
!ENDIF
!ENDIF
!IF "$(PLAT)" == "x64"
!IF "$(CFG)" == "Release"
filewxExtend.dll.x64 compwxExtend.dll.x64 WXEXTE~6.DLL|wxExtend11u_vc100_x64.dll 0 0 1536 1
filewxExtend.dll.x64 compwxExtend.dll.x64 WXEXTE~6.DLL|wxExtend12u_vc100_x64.dll 0 0 1536 1
!ENDIF
!IF "$(CFG)" == "Debug"
filewxExtend.dll.x64 compwxExtend.dll.x64 WXEXTE~8.DLL|wxExtend11ud_vc100_x64.dll 0 0 1536 1
filewxExtend.dll.x64 compwxExtend.dll.x64 WXEXTE~8.DLL|wxExtend12ud_vc100_x64.dll 0 0 1536 1
!ENDIF
!ENDIF
!IF "$(LANG)" == "Sl"
filewxExtend.mo.sl_SI compwxExtend.mo.sl_SI WXEXTE~1.MO|wxExtend11.mo 0 1060 0 1
filewxExtend.mo.sl_SI compwxExtend.mo.sl_SI WXEXTE~1.MO|wxExtend12.mo 0 1060 0 1
!ENDIF
<<NOKEEP

View File

@@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<wxExtendVersion>11</wxExtendVersion>
<wxExtendVersion>12</wxExtendVersion>
</PropertyGroup>
<PropertyGroup>
<OutDir>..\..\..\output\$(Platform).$(Configuration)\</OutDir>

View File

@@ -45,6 +45,8 @@
<ClInclude Include="..\src\stdafx.h" />
</ItemGroup>
<ItemGroup>
<POCompile Include="..\locale\de_DE.po" />
<POCompile Include="..\locale\ru_RU.po" />
<POCompile Include="..\locale\sl_SI.po" />
</ItemGroup>
<ItemGroup>

View File

@@ -85,6 +85,12 @@
<POCompile Include="..\locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="..\locale\de_DE.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="..\locale\ru_RU.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\res\wxExtend.rc">

View File

@@ -23,17 +23,17 @@
///
/// wxExtend Version
///
#define wxEXTEND_VERSION 0x01010000
#define wxEXTEND_VERSION 0x01020000
#define wxEXTEND_VERSION_MAJ 1
#define wxEXTEND_VERSION_MIN 1
#define wxEXTEND_VERSION_MIN 2
#define wxEXTEND_VERSION_REV 0
#define wxEXTEND_VERSION_BUILD 0
#define wxEXTEND_VERSION_STR "1.1"
#define wxEXTEND_VERSION_STR "1.2"
#define wxEXTEND_BUILD_YEAR_STR "2016"
#define wxExtendVersion "11"
#define wxExtendVersion "12"
#if !defined(RC_INVOKED) && !defined(MIDL_PASS)

View File

@@ -51,8 +51,14 @@ protected:
#endif
wxString ToString(LongestValueType value) const;
protected:
void DoSetWidth(unsigned int width) { m_width = width; }
private:
virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const;
private:
unsigned int m_width; ///< Preferred width of the string - zero padding (<=1 disables padding)
};
@@ -65,8 +71,9 @@ class wxHexValidator : public wxPrivate::wxNumValidator<wxHexValidatorBase, T>
public:
typedef wxPrivate::wxNumValidator<wxHexValidatorBase, T> Base;
wxHexValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) : Base(value, style)
wxHexValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT, unsigned int width = 0) : Base(value, style)
{
this->DoSetWidth(width);
this->DoSetMin(std::numeric_limits<ValueType>::min());
this->DoSetMax(std::numeric_limits<ValueType>::max());
}

28
locale/de_DE.po Normal file
View File

@@ -0,0 +1,28 @@
msgid ""
msgstr ""
"Project-Id-Version: wxExtend\n"
"POT-Creation-Date: 2016-05-13 19:22+0200\n"
"PO-Revision-Date: 2016-05-13 19:33+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: include/wxex/appbar.h:981
msgid ""
"There is already an auto hidden bar on this edge.\n"
"Only one auto hidden bar is allowed on each edge.\n"
"Auto-hide feature is now off."
msgstr ""
#: include/wxex/appbar.h:981
#, fuzzy
msgid "Warning"
msgstr "Warnung: "

28
locale/ru_RU.po Normal file
View File

@@ -0,0 +1,28 @@
msgid ""
msgstr ""
"Project-Id-Version: wxExtend\n"
"POT-Creation-Date: 2016-05-13 19:23+0200\n"
"PO-Revision-Date: 2016-05-13 19:32+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: include/wxex/appbar.h:981
msgid ""
"There is already an auto hidden bar on this edge.\n"
"Only one auto hidden bar is allowed on each edge.\n"
"Auto-hide feature is now off."
msgstr ""
#: include/wxex/appbar.h:981
msgid "Warning"
msgstr ""

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: wxExtend\n"
"POT-Creation-Date: 2016-03-14 17:16+0100\n"
"PO-Revision-Date: 2016-03-14 17:20+0100\n"
"PO-Revision-Date: 2016-05-13 19:32+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
@@ -10,13 +10,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: src\n"
"X-Poedit-SearchPath-1: include\n"
#: include/wxex/appbar.h:981
msgid ""

View File

@@ -24,12 +24,16 @@
// wxHexValidatorBase
//////////////////////////////////////////////////////////////////////////
wxHexValidatorBase::wxHexValidatorBase(int style) : wxIntegerValidatorBase(style)
wxHexValidatorBase::wxHexValidatorBase(int style) :
m_width(0),
wxIntegerValidatorBase(style)
{
}
wxHexValidatorBase::wxHexValidatorBase(const wxHexValidatorBase& other) : wxIntegerValidatorBase(other)
wxHexValidatorBase::wxHexValidatorBase(const wxHexValidatorBase& other) :
m_width(other.m_width),
wxIntegerValidatorBase(other)
{
}
@@ -59,13 +63,13 @@ bool wxHexValidatorBase::FromString(const wxString &s, wxLongLong_t *value)
wxString wxHexValidatorBase::ToString(LongestValueType value) const
{
const wxStringCharType hexa = (HasFlag((wxNumValidatorStyle)wxNUM_VAL_HEX_LOWERCASE) ? wxT('a') : wxT('A')) - 0xa;
int offset = sizeof(LongestValueType)*8 - 4;
unsigned int offset = sizeof(LongestValueType)*8 - 4, offset_s = m_width*4 - 4;
wxULongLong_t m = ((wxULongLong_t)0xf) << offset;
unsigned int x = 0;
// Skip leading zeros.
while (m && !x) {
x = (int)((m & (wxULongLong_t)value) >> offset);
while (m && !x && offset >= offset_s) {
x = (unsigned int)((m & (wxULongLong_t)value) >> offset);
m >>= 4, offset -= 4;
}
@@ -74,7 +78,7 @@ wxString wxHexValidatorBase::ToString(LongestValueType value) const
// Rest of the digits.
while (m) {
x = (int)((m & (wxULongLong_t)value) >> offset);
x = (unsigned int)((m & (wxULongLong_t)value) >> offset);
m >>= 4, offset -= 4;
str += (wxStringCharType)((x < 0xa ? wxT('0') : hexa) + x);
}