Refuse to run if the taskbar button API is not available.
This wouldn't make much sense anyhow and is the simplest thing to do.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There is already defined a special code (wxPG_COLOUR_CUSTOM) to identify custom colour in wxColourProperty and wxSystemColourProperty but in practice item representing this colour is identified either by position (it is assumed it as always last item) or by fixed text label. This inconsistency makes the code unclear and can lead to problems (see workaround r76627).
Now, only wxPG_COLOUR_CUSTOM code is used to identify custom colour and hence "custom colour" item doesn't need to be the last item in the collection and doesn't need to have a fixed text label (like "Custom").
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unfortunately Direct2D-based wxGraphicsRenderer is not ready for use yet as it
doesn't draw lines with width 0, which are commonly used.
The code using it in GetDefaultRenderer() will need to be restored when this
bug is fixed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ID2D1DCRenderTarget was leaked every time a wxD2DContext was created because a
raw pointer was given to wxCOMPtr<> which didn't take its ownership.
Use wxCOMPtr instead of the raw pointer to fix this and also fix more rare but
still possible leak in case of error.
This fixes out of memory errors and crashes in the drawing sample after a few
seconds of constant window resizing/repainting.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In particular, allow switching between GDI+ and Direct2D under Windows, which
is very convenient for comparing the rendering results.
This can also be useful when using Cairo.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just make the "File" menu (which was also renamed to
"Drawing" as it has nothing to do with files) less long by splitting off the
screen selection in a separate menu.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is not only wasteful, but creating a Direct2D surface associated with a
wxDC makes it impossible to paint on the DC using GDI functions, so this
completely broke the initial display in the sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Due to a bug in MSVC handling of __VA_ARGS__ (see
https://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement)
wxCALL_FOR_EACH() didn't work correctly as long as more than two arguments
were used with it.
Work around the bug by protecting __VA_ARGS__ from being incorrectly passed as
a single token to the macro being called on every step: this was already done
for wxCALL_FOR_EACH itself with wxCALL_FOR_EACH_, but we need to do it for all
the helper macros too.
Also add a test checking that this does, actually, work.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFrame::m_taskBarButton needs to be initialized in its Init(), not Create(),
which is not necessarily used by the derived classes such as wxMDIParentFrame,
resulting in a guaranteed crash when deleting an uninitialized pointer later
in wxFrame dtor.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Vertical position of text field in wxOwnerDrawnComboBox control (instantiated at property selection) doesn't need any special adjustment.
Closes#16556.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Bail out earlier: if d2d1.dll is not there, it doesn't make sense to try to
load dwrite.dll.
Also use Load() return value directly instead of ignoring it and then checking
for IsLoaded().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxDL_QUIET flag when loading Direct2D DLLs as we're prepared to handle
their absence and don't need to show error messages if they're not available.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxDynamicLibrary::RawGetSymbol() (from inside wxDL_INIT_FUNC() macro)
instead of GetSymbol() to avoid the error message which was given every time a
new wxFrame was created after wxTaskBarButton changes under XP as
ChangeWindowMessageFilter() function is not available in it.
Also simplify the code a little and don't make pfnChangeWindowMessageFilter
static, we don't need to keep it around.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
DirectWrite GDI interop only works with Unicode LOGFONTW, so use it explicitly
instead of LOGFONT which is LOGFONTA in non-Unicode build.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Define it in wx/msw/setup_inc.h and not in wx/msw/setup0.h itself to ensure
that it survives the regeneration of this file using build/update-setup-h.
Also only set wxUSE_GRAPHICS_DIRECT2D to 1 for VC10+ and not VC9 as the latter
lacks Direct2D header in its default SDK version.
Finally also update comments to explain the various settings more clearly and
remove outdated information (wxGraphicsContext is not experimental any more).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ID2D1Image is not defined in v7.0A platform SDK used by VC10 and doesn't seem
to be needed here as we are only working with ID2D1Bitmaps (deriving from
ID2D1Image) anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The line defining PI didn't compile with VC10 because atan(1) is ambiguous
(argument could be float, double or long double). And it was not needed anyhow
as PI was not used anywhere (and if it were, we should be just using M_PI from
wx/math.h anyhow), so simply remove it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The use of variadic macros results in a warning/error if -pedantic[-errors]
is used when compiling C++98 code as they are only formally part of C99 (or
C++11). With g++ 4 and later, this can be avoided by using -Wno-variadic-macros
option, but it doesn't exist in g++ 3, so a nasty workaround in the header
itself is required: mark it as system header in order to fix compilation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This ensures that wxHtmlContainerCell height is set to some reasonable value
instead of 0 and fixes infinite loop which occurred in some circumstances in
wxGTL when trying to allocate size for wxHtmlListBox as it oscillated between
having a vertical scrollbar with bigger width and not having it with smaller
width. The latter was wrong as decreasing the width to 0 didn't really obviate
the need for the vertical scrollbar and was just an artefact due to not
setting wxHtmlContainerCell height at all in this case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The class TextEventHandler added in r77057 (see #3901) setup an event handler
which wasn't disconnected when the handler was destroyed, which resulted in a
crash later as the window it was connected to continued to exist and generate
wxEVT_TEXT events.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow calling any function compatible with the argument type instead of
requiring "bool" return type and the exact match of the parameter type, which
forced us to define a separate DoSetForAllParts() helper.
See #11583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Check if a top level menu is disabled and consume WM_[UN]INITMENUPOPUP that
Windows still generates for it when it's clicked for some reason.
Closes#2168.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is similar to the existing wxExpectModal<wxMessageDialog>, but can be
used to dismiss any dialog for which it's just enough to press some button,
not just wxMessageDialog.
It's convenient to use it as
wxTEST_DIALOG(wxYield(), wxExpectAny(wxID_OK));
if some custom dialog which can be safely dismissed is expected.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This should result in the default handler still being called and painting the
window, but the latter didn't happen because we called ::EndPaint(), and so
validated the window and reset its update region, before passing WM_PAINT to
DefWindowProc() in this case.
Closes#16381.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Apparently at least one printer driver doesn't report the memory needed by its
own DEVMODE struct correctly, resulting in a crash due to a buffer overflow
when printing using it.
Work around this by allocating slightly more memory than what we really need.
Closes#16274.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There doesn't seem to be any reason to forbid them and this change allows
wxExecute() without wxEXEC_NOEVENTS to work without assertion failures when
called from inside wxYield().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't report ERROR_NO_ASSOCIATION as an (unexpected) error, it is perfectly
normal to get it if a command is not defined for the given extension.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775