As long as focus is being switched only between subcontrols of the active editor the state of the edited wxPGProperty remains unchanged and there is no need to explicitly reset the editor.
Unwanted editor resets could happen if such internal focus changes would be captured in EVT_IDLE handler.
Closes#18162.
wxWindow::GetContentScaleFactor() always returned 1 before the window
was shown in wxGTK, which was rather annoying as typically icons are
initialized on application startup, i.e. before showing the windows, and
so the wrong scale factor was silently used for them.
ChangeValue() must not send events, but did in wxGTK when changing the
contents of a wxTextCtrl to be empty when it had been non-empty before.
Closes#18264.
Make the code simpler and, in a couple of places where the fall back to
the primary display in case wxDisplay::GetFromWindow() returned -1 was
missing, also more correct.
Neither GetWidth() nor GetScaledWidth() (nor the corresponding
height-related methods) can be called if the bitmap is invalid and the
resulting assert led to a crash when it happened in wxAuiToolBarArt
drawing code, as it was triggered on each redraw.
Just use bitmap size of (0, 0) if we're not going to draw it anyhow.
Closes#18263.
Don't skip MakeFromTimeZone() for the current time zone, this is still
necessary.
Fixes a failure in the unit tests when running during a DST period with
TZ=Europe/London, for example.
Closes https://github.com/wxWidgets/wxWidgets/pull/966
There doesn't seem to be any point in storing pointers to wxBitmap or
wxIcon and storing the objects directly allows to avoid an extra heap
allocation and all the code dealing with freeing memory when replacing
or removing images from the list, making things much simpler.
Also use wxVector<> for storage instead of the obsolete and ugly
wxObjectList.
There shouldn't be any user-visible changes.
RefreshRow() is called very frequently, and in particular after every
ItemChanged notification. Calling GetEndOfLastCol() in it repeatedly is
extremely inefficient in presence of auto-sizing columns, and doesn't
make much sense anyway - controls with significant space unoccupied by
columns are rare, and rendering of such unused space is efficient (just
background erase). It is therefore more performant to simply refresh
the entire row instead of repeatedly and expensively calculating the
smallest rectangle that needs repainting.
Fixes previously wrong calculation of the refreshed rectangle in
RefreshRows() in the process.
Fixes major performance regression introduced in
77c7c80696.
Closes https://github.com/wxWidgets/wxWidgets/pull/970
Cache labels for "Next>" or "Finish" button in wxWizard so that their
translations stay consistent throughout wizard's lifetime: previously,
this button could use a label in a different language if the currently
used translations have changed since the wizard creation, as this label
was recreated on every page change, unlike the other labels which were
only translated once in the very beginning.
Closes https://github.com/wxWidgets/wxWidgets/pull/1000
If we can't determine the display-specific PPI value, use the global one
which seems to be always available (and always equal to 96*96 in my
testing -- but this is what previous versions of wxWidgets returned, so
it's still better than nothing).
Under macOS colors can be patterns, then accessors for RGB values are useless, IsSolid returns true if the color can be expressed in RGB values at all.
Get rid of wxOSX wxImageList implementation as it was 99% identical to
the generic version and the non-identical parts should really have been
made part of the generic version too from the beginning.
Notably, use GetScaled{Width,Height}() in Add() method in the generic
version too now.
This is not necessary as wxIcon is implicitly convertible to wxBitmap
anyhow, so calling Add(icon) works using the existing Add(wxBitmap)
overload, and is actually harmful because of the wrong icon size check
in this function, which used physical bitmap size instead of the logical
(scaled) size.
Closes#18188.
Comment stated that InsertionPoint() didn't pass, but it was actually
already running (and passing) and the only excluded test was the
TextChangeEvents() one which really should pass for multiline controls
as well, so run it too.
These functions combine the sizes of all displays and so only return the
correct size when there is only a single display.
This fixes wildly wrong PPI values returned when more than one display
is used.
We need to account for the scale factor under GTK+ (and, presumably,
under macOS) to compute the correct PPI value as it must use the number
of physical and not logical pixels.
Reimplement wxCheckOsVersion() to use wxGetOsVersion() on windows.
An executable without the Windows 8.1+ compatibility info in a
manifest would not detect the version based on the VerifyVersionInfo()
API previously used.
Closes https://github.com/wxWidgets/wxWidgets/pull/992
Surprisingly, ::SuspendThread() doesn't actually do it, but only
schedules the thread for suspension in some undetermined near future.
This could result in problems as Pause() could exit, releasing the CS
protecting wxThread internal data in the main thread, and allowing the
worker thread to enter it (e.g. in its TestDestroy()) before being
actually suspended, meaning that the thread got suspended inside a CS,
which resulted in later deadlocks.
Fix this by calling ::GetThreadContext() which is supposed to ensure
that the scheduler does really suspend the thread before it returns (as
it's impossible to get the context of a thread while it's running).
Closes#18137.