The bug fix of r67990 relied on DateTime_SetSystemtime() returning FALSE if
setting the date failed but, unfortunately, this function doesn't behave
correctly under XP (and presumably earlier systems) and returns TRUE even if
it didn't actually change the date because it was out of range.
Implement an alternative solution not relying on this function return value
but simply checking the range ourselves.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes of r67619 changed the signature of the virtual Initialize() method
and in doing so broke the existing code overriding it. Avoid this problem by
restoring the old method signature and adding a function with a different name
providing the new functionality.
Also notice in the documentation that there is no real need to override
Initialize() in any case (but this doesn't change the fact that there is
existing code that does do it).
See #13108.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
MinGW headers define MSVC-compatible _strdup() even in strict ANSI mode so we
can always use it with MinGW.
This fixes a linking problem when wx itself was built without strict ANSI but
the program using it does use strict ANSI mode (e.g. due to the use of
-std=c++0x g++ option).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The view doesn't have any associated frame when using the special "single
view" mode in the sample, so don't try to show it when creating a new view.
This resulted in a crash when starting the sample with --single command line
parameter.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The internally stored date value was getting out of sync with the real date in
the control itself when SetValue() was called with a date out of the currently
set range. This resulted in an assert failure and other unpleasantness later.
Fix the bug and add a unit test checking for it (and also with some other
basic wxDatePickerCtrl checks).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just refactor the code to allow using CPPUNIT_ASSERT_EQUAL
with wxDateTime in other tests in the future.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMSW native control always has a built-in lower limit as MSW doesn't support
the dates before the year 1601 so wxDatePickerCtrl::GetRange() always returns
a valid range start, even if SetRange() hadn't been called to set it.
As this can be unexpected, document this behaviour clearly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While GTK+ doesn't support imposing ranges for dates selection natively, we
can do it ourselves by preventing the user from selecting any date outside of
the currently valid range.
This allows to use ranges under all platforms and not only in wxCalendarCtrl
itself but in wxDatePickerCtrl as well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Latest mingw64 MinGW compiler has the headers required for enabling
wxUSE_DBGHELP, fix the warnings given by g++ when compiling wxDbgHelpDLL code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't declare variables extern when initializing them, this is already the
case implicitly anyhow and explicit "extern" results in g++ warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When using GDI+ with MinGW, the same hack as for Cygwin is needed (see r66787)
as it uses the same w32api headers and libraries for GDI+ support (if it has
them at all).
See #11716.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Due to the changes in gcc 4.5, copies of dllexported inline functions are now
generated in all object files including their declarations, increasing their
sizes tenfold, and they are also now instantiated in the DLL itself increasing
its size fourfold. Moreover, linking such a gigantic DLL requires inordinate
amounts of memory and takes a very long time, see some statistics at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601.
To avoid all these problems, don't use dllexport at all any more but rely on
binutils support for auto export/import which seems to work fine and results
in much smaller DLLs which are created much faster.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
UINT16 is incorrectly defined inside Gdiplus namespace in w32api gdiplus.h
used by Cygwin and MinGW resulting in compilation errors about ambiguous
symbols.
Fix this by forcefully redefining UINT16 in our own code.
Closes#13113.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For some reason the conversion of the bytes written to this stream to Unicode
was only done in wxUSE_UNICODE_WCHAR build but not in wxUSE_UNICODE_UTF8 one.
Do it in any wxUSE_UNICODE build now.
This allows to use wxStringOutputStream under Unix again, in particular it
fixes an assert in samples/html/zip when trying to load the raw contents of a
ZIP file in wxHtmlWindow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67968 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFileSystemWatcher requires threads under MSW so disable it automatically in
configure if --disable-threads was used to avoid compilation errors in
wx/msw/chkconf.h later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, simply add casts to make the implicit conversions that g++
warns about when using -Wconversion explicit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Round the values instead of truncating them when converting from pixel values
to Win32 ::mouse_event() 0..65535 scale. This probably doesn't make any real
difference in practice but seems more correct and also avoids g++ warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67963 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just make the code slightly more readable by using a symbolic
constant instead of a magic value.
This also avoids g++ warnings about implicit conversion of a signed value (-1)
to unsigned type (DWORD).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make the conversion of logical coordinates to the device ones more precise by
avoiding errors due to truncation of floating point values to integer ones.
See #13284.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This was mainly done to suppress g++ warning about implicit float to int
conversion but it also seems to make more sense to round the value here
instead of truncating it to int.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775