In a twist on the usual theme, the previous commits broke the Unix build
when _using_ PCH because wx/textcompleter.h was only included from
inside "#ifndef WX_PRECOMP" check, but it needs to be always included as
wx/wx.h doesn't include it.
Call DoUseCustomAutoComplete() function instead of using an artificial
event.
Also move the menu item in the radio group with the other
autocomplete-related commands as it's exclusive with them.
Don't do it only when the text entry is (or becomes again) empty, this
breaks dynamic completers such as the one used in the widgets sample,
which determines its completions depending on the already entered text
(of course, the sample example is not particularly useful, as the
completions are always the same, but it's supposed to show that they
could dynamically depend on the already entered part of the string).
Doing two different things in the same class, using m_isDynamicCompleter
to determine which kind of completion is used, was not very clear, so
create two simple classes each of which does one and one thing only and
create the one we need in wxTextEntry methods.
Note that wxTextAutoCompleteDynamic can assume to always have a valid
wxTextCompleter as otherwise no wxTextAutoCompleteData is needed at all,
which results in more simplifications.
There should be no changes in behaviour.
There should be no need to handle this class specially and it's supposed
to be just an implementation detail, so don't add any dependencies on it
(if it's really important to optimize for this case, the check should be
done for wxTextCompleterSimple and use wxRTTI as wxWidgets still
supports being built without standard C++ RTTI).
This function was now used only once and it's not really useful to have
a trivial wrapper around the corresponding GTK+ function, just use it
directly.
The new function both sets the new model and calls
gtk_entry_completion_complete() instead of always doing first the one
and then the other: if both calls needs to always be done together, it
makes sense to have a function doing both of them.
Use factory function instead of ctor and IsOk() check, as this
simplifies the code using this class: if factory function fails, it can
just return NULL, which is what the caller used to do explicitly after
freeing the new object before.
Also don't assert if there is no associated GtkEntry, AutoComplete() is
supposed to just return false if using it with the given control is not
implemented under the current platform.
Provide an accelerator for the menu command which contains all of the
test functionality to make it simpler to test it.
Also use CreateButtonSizer() instead of creating wxStdDialogButtonSizer
manually to make the code shorter and to also ensure that the "OK"
button is correctly set up as the default one, allowing to press "Enter"
in this dialog to accept the entry on any control, which didn't work
before.
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.