This allows to avoid initializing the variables to 0 in all the
overloaded ctors: wxSize default ctor already does it.
It's also more convenient to use GetScaledSize() rather than assigning
m_width and m_height separately, even if the rest of the code is broadly
unchanged.
We can reuse another ctor taking wxWindow* instead. Although this does
require an ugly cast, it's more explicit than just passing 0 which
could, in principle, match both the ctor taking wxWindow* and another
one taking double, and so is still preferable.
This is similar to the previous commit and is done for the same reasons:
screen DC needs to use the same DPI as the screen itself, instead of the
default Cairo 72 DPI.
For wxDC associated with a window, such as wx{Window,Client,Paint}DC,
this method should return the window PPI, not the hard coded 72 DPI of
Cairo graphics context.
This still doesn't work correctly when using multiple monitors with
different DPI settings, but is still a (modest) improvement.
Recent sorting-related changes resulted in calling FindNode(), which
can only be used with the non-"virtual list" models, unconditionally,
after the items values was changed by user, resulting in a crash.
Add the missing IsVirtualList() check and also add a comment explicitly
stating that all code involving wxDataViewTreeNode can only be used
after checking that IsVirtualList() returns false.
Closes#18057.
The comparator used with std::sort() must return true only if the first
item is strictly less than the second one, this is a requirement of the
sorting algorithm and not respecting it results in wrong final order.
See https://github.com/wxWidgets/wxWidgets/pull/642
This reverts commit 1dd102d741 as it
introduced a crash in the same method when using generic wxDataViewCtrl
implementation, e.g. under MSW, and is not necessary to avoid the crash
with wxGTK3 any longer after the few previous commits.
There is an impedance mismatch between wxDataViewCtrl API, which allows
deleting all items of the model at once, and GtkTreeView, which only
allows deleting them one by one, so bad things happen when we start
deleting the items from the GTK+ model after already having deleted them
from the wxDataViewModel, due to dereferencing the already freed
pointers.
Work around this by explicitly marking the model as being "temporarily
unsafe to use" by setting the stamp, uniquely identifying it, to 0 (and
ensuring that it's never 0 during the normal operation), and checking
for it in all functions that are called by GTK+ from inside
gtk_tree_model_row_deleted() that we call from Cleared().
The fix is not ideal, as the list of these functions was determined
empirically and could change in the future GTK+ versions, and also ugly,
but there doesn't seem to be any other way around this and at least now
Valgrind doesn't report invalid memory reads after calling
wxTreeListCtrl::DeleteAllItems() as it did before.
Check that we have an associated text entry before clearing it.
Fixes a crash introduced by 72fe57ec18
without reverting it as it still seems reasonable to use Clear() here.
Closes#18013.
Do not enable debugrpt and flash examples.
Define UNICODE when building on Windows. This allows the sdk_exe example to build, because it includes the windows headers directly.
uuid should be linked before oleacc, otherwise it causes multiple definition of `IID_IAccessible' (with MinGW64 gcc).
To simplify even more, specify all required libraries in wxTOOLKIT_LIBRARIES, in the same order as in the makefiles.
Add uxtheme library, it is required since wxUxThemeEngine wrapper has been removed.
MinGW compiler predefines WIN32, meaning that wx/msw/winundef.h was
always included from wx/defs.h, even when it was completely unnecessary.
This was just inefficient, but harmless, until the changes of
042d922e88 which broke MinGW compilation
as wxUSE_UNICODE_WINDOWS_H was incorrectly defined during the very first
inclusion of wx/msw/winundef.h, before _UNICODE could be defined
correctly by windows.h.
Fix this by checking whether windows.h was really already included.
Remove various definitions and symbol declarations from
numerous files using msw/uxtheme.h to a single file.
When possible vssym32.h is included from the Windows SDK.
For older SDKs tmschema.h is included and missing symbols
are defined in msw/uxtheme.h.
This undocumented "private" class was used for various windows UxTheme
functions which are available since WinXP. As wxWidgets 3.1 is XP+ it
does not make sense anymore to load the theme functions dynamically.
When having a certain creation sequence, these popup windows were not focused correctly, see https://github.com/wxWidgets/wxWidgets/pull/672 , commit d2265136e359df4d14054860a68bbc7f4910279d , revert this change if problems arise to see whether this is a recursion
Commit bc13119494 removed the inclusion of
xlocale.h because it is not (and never was) needed under Linux with
glibc, but it is still needed under macOS, so this (silently) disabled
wxXLocale support under Mac when using configure and broke the build
when using cmake.
Fix both problems by using xlocale.h only if it's available, both in
configure and in cmake.
Almost totally rewrite the resize-after-toggle code in this control so
that it actually makes sense and works, especially in the situations
when the contents of wxCollapsiblePane changes, for example when it
contains another wxCollapsiblePane inside it which can be collapsed or
expanded. Previously, this didn't work at all in wxGTK and the inner
pane always remained at its minimal, collapsed size. Now it does, after
doing the following:
First, replace the completely useless DoGetBestSize() which just did the
same thing as its base class implementation with the code actually
determining the best size of the window that was previously hidden
inside gtk_collapsiblepane_expanded_callback() for some reason. Note
that the comment about "not caching the best size" in the old code was
very out of date and was probably left over from the days when
GetBestSize() itself was virtual, as caching is not done in
DoGetBestSize() anyhow, but in GetBestSize() itself.
So, second, do fix the best size invalidation by doing it explicitly
whenever the pane is toggled. And, relatedly, do not set the min size of
anything because this overrides the layout computations and is never
reset/invalidated, unlike the best size, even if the best size of the
pane changes, e.g. because of a change to its contents.
Finally, remove many thoroughly outdated comments, e.g. the one speaking
about OnStateChange() which doesn't exist at all in this implementation.
A pane using wxCP_NO_TLW_RESIZE would generate wxCollapsiblePaneEvent
even when toggled from a program because the GTK+ callback didn't take
m_bIgnoreNextChange flag into account in this case.
Fix this and also avoid duplicating the code for sending the event.