If the item was not found at all, which can happen if all its parents
are not expanded, this function still returned a valid but completely
wrong row index.
This affected many functions which could call it for the items which
were not necessarily visible, i.e. all of them except for the event
handlers as events can only affect the visible items, including but not
limited to SetCurrentItem(), all the selection-related functions, all
the expansion-related functions, EnsureVisible(), HitTest() and
GetItemRect().
It doesn't make much sense to use an "unsigned int" variable only to
cast it to int everywhere where it's used. Just make it "int" from the
get go and have a single cast to int in the caller.
Also make m_row const as it never changes.
For consistency with the other similar events and because it is more
useful for the code handling it, send this event when the new page is
already shown instead of doing it before showing it.
Closes https://github.com/wxWidgets/wxWidgets/pull/1007
Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.
Closes https://github.com/wxWidgets/wxWidgets/pull/1009
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.
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
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.
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.