Extract and pull the common functions from wxButton and wxToggleButton to
wxAnyButton in wxUniv too.
Also make wxToggleButton inherit from wxToggleButtonBase correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
SetSize() doesn't have any dependent parameters so call it via an explicit
"this->" to make it work with standard conforming compilers (and not MSVC).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The children layout will almost always depend on the layout direction, so redo
it when the latter changes.
In particular, this fixes changing the layout of wxSpinCtrlDouble under MSW.
See #11583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Position the spin control components (the button and the text) correctly for
the current layout.
Also update the layout of the text explicitly.
See #11583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The EDIT control used by the native combobox is different from normal EDIT
controls and has to be handled specially.
We also need to explicitly forward WS_EX_LAYOUTRTL to the dropdown window as
it doesn't inherit it from the combobox itself automatically.
See #11583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is unnecessary, COM is already initialized on the application startup and
Direct2D can't be used before that anyhow.
This also fixes lack of matching CoUninitialize() call.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is not a very useful method, but by providing at least some documentation
for it, we prevent it from inheriting the docs for the next method, which have
nothing to do with it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't compare nLength with "nFirst + nCount" as this could wrap around.
Compare nCount with maximal allowed count, after ensuring that nFirst itself
is valid first, instead.
Closes#16572.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is mostly done to avoid warnings about converting the result of
multiplying and dividing an int by doubles back to int, but is also more
correct as wxMulDivInt32() rounds the result correctly instead of truncating
the fractional part, and is also a tiny bit more efficient under MSW where the
native ::MulDiv() is available.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class doesn't really need a virtual dtor as it's never used
polymorphically, but add it to avoid g++ warnings about it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
::SetThreadExecutionState() returns a DWORD, which is not a pointer, so
compare its return value with 0, not NULL.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class requires wxTaskBarButton to be really implemented, so there is no
need to even define the MSW-specific version of it if wxUSE_TASKBARBUTTON is 0
anyhow.
This fixes a compilation problem with wxUSE_TASKBARBUTTON==0 but, more
importantly, just makes more sense.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is more informative than showing just the title and we can do it for the
message boxes and it's worth handling them specially just because they are so
common.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Extract creation of the message describing an unexpected dialog in a separate
virtual method in order to allow customizing it, notably in order to add more
useful description of custom application dialogs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It's not very helpful to just say that an unexpected dialog was shown, using
its title provides at least some hint as to what dialog it was.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It was unexpected that wxMessageDialog::GetTitle() returned empty string even
when non-empty caption, which is just another word for title, was specified.
Implement GetTitle() as synonym for GetCaption() and also provide SetTitle()
for consistency.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If keyword 'custom' is entered into the edit field of wxColourProperty or wxSystemColourProperty (with wxPGEditor_ComboBox) then dialog box to query for custom colour should be invoked. Afterwards, when control value is updated, its selection index should be also updated respectively.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Initialize m_buffer to avoid crashes when deleting it in Cairo-based
wxGraphicsContext implementation for bitmaps created from the native ones.
Don't leave the bitmap size uninitialized neither, this might not result in
crashes, but is definitely wrong as well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Define it and wxUSE_GRAPHICS_DIRECT2D, when it's supposed to be enabled, as
wxUSE_GRAPHICS_CONTEXT instead. This ensures they are set to 0 if the use of
wxGraphicsContext is entirely disabled, as is the case when using MinGW under
MSW by default for example.
Closes#16558.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This didn't work correctly if a header was updated from its corresponding
setup0.h first as it was then newer than include/wx/msw/setup_inc.h even
though it had been older than it at the start of the script execution.
Just keep things simple and get rid of the check.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
First of all, do define it under non-MSW platforms.
Second, don't crash in it when running under XP where wxTaskBarButton is not
available.
Also add IsAvailable() method to check for its availability explicitly and add
a demonstration of this class to the dialogs sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to encapsulate checking for errors, which should be handled when
using this class as task bar buttons API is not available under Windows XP.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The check for top level menus being disabled added in r77657 is broken as it's
used, with the expectedly bad consequences, for non top level menus as well,
as can be seen by opening any submenu, so revert it.
See #2168.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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