This header doesn't really need to be included from here and it was done
solely in order to get the value of wxALWAYS_NATIVE_DOUBLE_BUFFER from
it.
Move the code using this macro in the .cpp file instead.
This prevented TAB navigation from doing anything at all when the focus
was on wxComboCtrl in wxGTK and, probably, all the other non-MSW ports
(in wxMSW TAB navigation happens before normal key processing, so this
check was irrelevant there).
It is often useful to know where is the focus coming from, for example
to determine if was in another window of the same composite control.
Remember the last focus in yet another global variable in wxGTK code to
allow setting wxFocusEvent::m_window correctly when generating
wxEVT_SET_FOCUS events.
The old wxEVT_SEARCHCTRL_{SEARCH,CANCEL}_BTN event names were unwieldy
and misleading because both of these events can be generated without
using the buttons, but by pressing Enter or Esc (the latter currently
works under macOS only, but this could change in the future).
Set background style to indicate that wxSearchButton is painted entirely
by its wxEVT_PAINT handler.
This should eliminate potential flicker under MSW.
This event doesn't make any sense for this control, was never generated
by the native macOS version and couldn't be generated under MSW neither
as it's only supported by the multiline control and not the single-line
version used here, so having this code in wxSearchCtrl just made no
sense at all.
Make it possible to bind to just wxEVT_SEARCHCTRL_SEARCH_BTN under all
platforms: previously, it was also necessary to bind to wxEVT_TEXT_ENTER
when using the generic implementation, as pressing Enter in the text
control didn't generate the dedicated SEARCH event.
It does now, and, to avoid any confusion, the control does not generate
wxEVT_TEXT_ENTER events at all any more. This is not really
incompatible, as wxOSX never generated these events anyhow and the
generic version only did for a couple of days, since the changes of
9816970797 which were, finally, misguided
and so are undone by this commit.
Closes#17911.
There doesn't seem to be any need for painstakingly translating STC font
weight to DWRITE_FONT_WEIGHT when they seem to use exactly the same
numeric values anyhow.
This also fixes compilation when using older SDK versions that don't
define DWRITE_FONT_WEIGHT_SEMI_LIGHT constant, which is relatively
recent (and presence of which can't be easily checked, as it's an enum
element and not a preprocessor constant).
This was broken because wxSearchCtrl inherited the base class version of
ChangeValue() which didn't really work for it due to the poor way in
which wxTextEntry is designed (see #18071).
Closes#16998.
This was useless as wxCompositeWindow, from which the generic
wxSearchCtrl derives, already sets focus to its first child and, since
the last commit, even harmful as it now resulted in calls to SetFocus()
from inside wxEVT_SET_FOCUS handler which is forbidden at least under
MSW.
See #15569.
wxCompositeWindow already connected to child wxEVT_KILL_FOCUS events and
generated the same event for the composite window itself, but didn't do
it for wxEVT_SET_FOCUS, resulting in not getting these events for the
main window as expected. E.g. this resulted in never getting any
wxEVT_SET_FOCUS events for wxSearchCtrl when using its generic version
(i.e. not under Mac).
Fix this by connecting to wxEVT_SET_FOCUS events for the children too.
Note that this relies on having a correct "previously focused window" in
these events, if this doesn't work reliably for some ports, we might
need to maintain a "bool m_hasFocus" field in wxCompositeWindow itself
instead.
Also note that we might avoid having all this code in wxCompositeWindow
if we translated the underlying native focus event to wxFocusEvents for
both the real window and its GetMainWindowOfCompositeControl() if it's
different. This could potentially be simpler and would definitely be
more efficient, but would require more changes.
Closes#15569.
The change of 2a8c290e0d was wrong as it
unconditionally restored m_oldClipRect in dtor, even when it was empty,
indicating that no clipping had been in effect when wxDCClipper was
constructed. This totally broke all the code using wxDCClipper, notably
generic wxListCtrl which wasn't repainted correctly at all.
Fix this by checking if the clipping rectangle is not empty before
restoring it, this should work as well as we can make it without having
GetClippingRegion() that could return an invalid region if no clipping
is in effect.
See #13834.
Closes#18066.
This is more of a test as the security vulnerability (CVE-2017-9935)
fixed in the upstream doesn't affect our use of the library, but still
update it to check if we can do this as easily as by just merging the
new upstream version into our submodule.
Overlong (and hence invalid) 4-byte encoding was used for this character
instead of the correct 3-byte 0xEF 0xBF 0xBF sequence.
Fix this by using 3 bytes for the code points up to 0xFFFF included,
instead of excluding it as was done before.
Closes#17920.
Don't overwrite options in setup.cmake.
Align text in summary message.
Always set wxUSE_XRC to values of wxUSE_XRC, same as in setup.h.
Disable wxUSE_XRC when expat is disabled.
wxMediaCtrl doesn't compute its best size correctly until a video is
available and this resulted in using the best size of (0, 0) for it and
nothing being shown at all on the screen, even after starting to play a
video.
This is almost certainly a problem on its own, as there is some existing
code for updating the best size and redoing the layout of the parent
sizer when a new video is loaded, but for now just make the control
visible in the sample again by always expanding it to fill up all the
available size, as this is the smallest possible fix and this is how it
used to behave before, until 9aaa38c7c8,
which allowed to meaningfully use wxALIGN_CENTER_HORIZONTAL and wxEXPAND
together: until then, this didn't work at all, but the sample still used
wxALIGN_CENTER_HORIZONTAL by mistake, so just remove it now to restore
the original behaviour.
Closes#17917.
ProcessPendingEvents() was never called when using MFC event loop,
meaning that queued events were never processed, so that using
CallAfter() didn't work.
Fix this and also ensure that these events are processed soon enough by
also implementing WakeUpIdle() for such applications, as wxWakeUpIdle()
didn't do anything neither for them.
Check whether wxTextCtrl has focus using Win32 ::GetFocus() instead of
by comparing FindFocus() with "this" pointer, as the latter fails when
wxTextCtrl is part of a composite control, such as wxSearchCtrl.
This is enough to make pressing TAB in wxSearchCtrl correctly go to the
next control instead of just beeping.
Note that we could also use DoFindFocus() here, but this would be
needlessly less efficient as we don't really need to find wxWindow
corresponding to the focused HWND, as that function does. But we can't
use HasFocus() here as it wouldn't work correctly here when the focus is
on another sub-window of a composite control also containing this
wxTextCtrl.
wxSearchCtrl never generated this event, at least under MSW, even though
the code to forward it from wxSearchTextCtrl was present in it, because
it was never generated in the first place without wxTE_PROCESS_ENTER.
Fix this by simply always using this style in wxSearchTextCtrl.
Fix a trivial "TODO" remaining from 2.8 days and declare the functions
that are part of the public control API as pure virtuals in the base
class.
No real changes.
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).