There was confusing with the method GTKIMFilterKeypress() in wxGTK
wxTextEntry: it was called the same as wxWindow virtual method of the
same name, but didn't override it, of course, as wxTextEntry doesn't
derive from wxWindow.
It also wasn't called for wxComboBox which inherited from wxTextEntry
but didn't override wxWindow::GTKIMFilterKeypress() to actually call its
method.
Fix this and rename the wxTextEntry to use a different name for clarity.
And reuse EnableTextChangedEvents() between these classes as well.
No real changes so far, this is just a refactoring to centralize the
code in a single place before modifying it.
Check whether we should ignore the event and mark the control as being
dirty if necessary in a virtual method, which can be defined in
wxTextEntry and overridden by wxTextCtrl, instead of doing it in GTK
callback itself.
This will allow to reuse wxTextEntry callback for wxTextCtrl too in the
upcoming commits.
No real changes so far.
Add IsUsingLogWindow() that can be used to check if the log messages go
into the listbox instead of being shown in a message box, which was
annoying when starting or quitting the sample.
This is a bit more complicated than the hack previously used in
TextWidgetsPage::OnText(), but more general and can be easily reused for
the focus loss messages, for example.
This is useful for quickly checking that we're getting expected events
when modifying the control and/or not getting any unexpected ones and
was already done on wxComboBox page, but not for wxTextCtrl.
With the generic hint support (used in pre-Vista wxMSW, wxGTK2, ...),
defining a wxEVT_TEXT handler not skipping the event completely broke
the control functionality as it was cleared, i.e. replaced the
user-entered text with the hint, whenever it lost focus.
This happened because wxTextEntryHintData::OnTextChanged() was never
called in this case, as the user-defined wxEVT_TEXT handler preempted
it. Work around this by pushing an event handler to the front of the
window event handlers chain instead of just binding to the window events
directly -- this could still potentially result in the same problem if
the user code pushes their own event handler, but this should be much
more rare and, in any case, there is not much we can do about this (the
only solution would seem to be to modify all platform-specific code to
update wxTextEntryHintData explicitly whenever the text changes).
This function is almost exclusively called from IsLevelEnabled() which
doesn't get inlined (at least by MSVS) when wxString is passed by value
to it, and so had to be updated to take a const reference instead, which
means that a copy is always going to be made anyhow, so don't try to be
smart and avoid it -- it doesn't work anyhow and just results in unusual
code, requiring explanatory comments (not needed any longer) and
upsetting static code analyzers.
No real changes.
See https://github.com/wxWidgets/wxWidgets/pull/1387
Tick marks were not available for wxSlider under GTK+ 2 or GTK+ 3
implementations of wxWidgets. However, tick marks have been available
for the GtkScale widget since GTK+ 2 version 2.16.
This change adds similar functionality in relation to tick marks
as was already available in wxMSW builds.
Closes https://github.com/wxWidgets/wxWidgets/pull/1355
Document the discrepancy between constructing wxGCDC from
wxGraphicsContext directly or default-constructing it and calling
SetGraphicsContext() later.
Current behaviour is somewhat inconsistent, but useful, because it
allows to draw on wxGraphicsContext using wxDC API using any kind of pen
and brush, even those not supported by this API, while remaining
backwards-compatible (i.e. we can't change SetGraphicsContext() to not
re-apply font, pen and brush, as this would break any existing code
relying on this happening), so it seems like the best alternative.
The changes of ae2cb7d347 resulted in
transformation matrix not being initialized correctly any more.
Fix this by adding yet another helper, DoInitContext(), called both when
initializing wxGCDC using an existing wxGraphicsContext in the
corresponding ctor and the just created one in the other ones.
Closes#18429.
Ensure static text fields use the alignment specified by WX on creation.
This is the second commit doing this, the first one was reverted because
it accidentally included unrelated changes, sorry for the trouble.
See https://github.com/wxWidgets/wxWidgets/pull/1381
When WXWIN_COMPATIBILITY_3_0 is on, compiling this header results in a
bunch of harmless but annoying -Winconsistent-missing-override clang
warnings, so add wxOVERRIDE to silence them.
No real changes.
Prevent wxComboBox from generating a wxEVT_KILL_FOCUS event when the
user opens the drop-down list under wxQt, as logically the drop-down is
part of wxComboBox, even if it's a separate window at Qt level.
Closes https://github.com/wxWidgets/wxWidgets/pull/1377
Center the items vertically, as this looks much better, and is also more
consistent with the appearance in the generic version, which was
previously used.
Closes https://github.com/wxWidgets/wxWidgets/pull/1378
Return false if the item is expanded but scrolled outside of the
viewport, to conform to the function documentation and the behaviour in
the other ports.
Closes https://github.com/wxWidgets/wxWidgets/pull/1380
This has been broken by dce65bed1c after
which the actual font used for the control was not taken into account
any longer. Fix this by ensuring the wxTextCtrl used for size
calculation uses the same font as wxSpinCtrl itself.
See #12297, #18391.
Closes#18427.
When creating wxGCDC from an existing wxGraphicsContext, it is better to
keep using the attributes (such as font, pen, brush) already configured
for it rather than overwriting them with the default values, which is
not very useful, unlike the new behaviour, which allows to configure
wxGraphicsContext using features not supported by wxDC API (e.g. alpha
channel for pens/brushes) and then use it via wxDC API only (allowing
the existing legacy code to use alpha, for example).
This makes the code slightly simpler, as there is just one function
instead of two, and also changes the meaning of the value stored in the
cookie parameter as a side effect: previously, it was the index of the
last retrieved item, while now it's the index of the next item to
retrieve.
The difference is not huge, but the latter is more usual and, more
importantly, avoids a stack overflow due to infinite recursion in the
treectrl sample, which assumed that cookie is never null after a
successful call to GetFirstChild(). The code in the sample is arguably
incorrect, as the cookie is supposed to be opaque, but it's still better
to avoid crashing, especially because similar code is almost certainly
present in user code if it was copied from the sample.
wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only.