In wxMSW, the value of the control was modified after executing the
user-defined wxEVT_SPINCTRL handler which meant that any calls to
SetValue() there were effectively ignored.
Fix this and add a unit test checking for the described scenario.
Closes https://github.com/wxWidgets/wxWidgets/pull/1027Closes#18187.
RandomAccessIterator requirements include LessThanComparable, so
implement the missing comparison operators for this class, as well as
for const_reverse_iterator.
This also fixes compilation problems with MSVS 2013 in debug mode, where
the CRT uses these operators to check the iterators correctness.
See https://github.com/wxWidgets/wxWidgets/pull/1048
Don't use the template specified by the filter in the file open dialog
if it's incapable of actually handling the current file.
This fixes a regression compared to 2.8 in docview code and allows
opening a file using the correct template for its extension even if an
incorrect (e.g. default) filter is chosen in the file open dialog.
Closes#18123.
wxScrollBar::SetScrollbar() now blocks the signals of QScrollBar before
setting a value, which avoids behaviour where slots are called before
the QScrollBar is displayed.
Closes https://github.com/wxWidgets/wxWidgets/pull/1050
Make sure rasterColourOp is always initialized, even if none of the
switch cases matches, to avoid warnings about possibly uninitialized
variable.
See https://github.com/wxWidgets/wxWidgets/pull/1048
The code handling right button click used the path of the item under
mouse without checking if there was any item, resulting in GTK+ warnings
due to the use of an invalid item.
Simply add a check for the item validity: we definitely don't want to
select it if it's invalid anyhow.
Previously, the editor was hidden if the left mouse button was pressed,
but not for the right (or any other) button, which could result in a
confusing situation when a user could select a command from a context
menu shown from the corresponding event handler and start editing
another item while the current one was still being edited too.
Avoid creating a default wxGraphicsContext unnecessarily, only to
immediately delete it and replace it with the provided one.
This was at best unnecessary and at worst resulted in a crash if the
default context couldn't be created, as happened on a headless system
(where wxImage-based wxGraphicsContext can still be created
successfully).
If nothing else, this avoids 2 calls to each of wxGetDisplaySize() and
wxGetDisplaySizeMM() on each and every wxGCDC construction which are
completely unnecessary as wxGCDCImpl uses its own hardcoded resolution
of 72 DPI, as do some other classes deriving from wxDCImpl.
And even for the classes which do compute these fields using the display
resolution, it may still be unnecessary to do it as they can be never
used if neither GetSizeMM() nor SetLogicalScale() are called on the
corresponding wxDC object.
Finally, this is more than an optimization as when using Cairo-based
wxGCDC without display (which is explicitly supported), calling
wxGetDisplaySize() simply doesn't work at all.
Removing a page from wxToolbook could result in crashes due to
dereferencing the now invalid page index. Fix this by not assuming that
the page index is the same as its tool ID, but adding functions to
explicitly map one to the other.
Also fix inserting pages into wxToolbook, which worked as appending them
before.
Closes https://github.com/wxWidgets/wxWidgets/pull/1042Closes#18275.
The default value of QProgressBar is -1, while wxGauge initial value
must be 0, so set it explicitly to fix a unit test failure with wxQt.
Closes https://github.com/wxWidgets/wxWidgets/pull/1043
::GetThemeMargins() may fail if the custom theme being currently used
doesn't implement the required functionality, so initialize MARGINS with
some reasonable values before calling it, if only in order to avoid
using uninitialized (and so wildly wrong) margin values in this case.
Closes https://github.com/wxWidgets/wxWidgets/pull/1036Closes#18278.
When creating a QSpinBox, the range must be set before setting the
initial value as otherwise setting it would fail if it were outside of
the default [0, 99] range.
This fixes a test failure in the corresponding unit test.
Closes https://github.com/wxWidgets/wxWidgets/pull/1041
wxMSW and wxOSX/Cocoa show the labels vertically for the tabs positioned
on the left- or right-hand side of wxNotebook, but wxGTK showed them
horizontally.
Bring it in sync with the other ports by rotating the labels to draw
them vertically as the other ports do in wxGTK too.
Closes https://github.com/wxWidgets/wxWidgets/pull/1032
Update the colours used when the system theme changes.
This is especially important to use the colour scheme compatible with
macOS 10.14+ dark mode.
Note that this commit is best viewed with "git diff --color-moved".
Closes https://github.com/wxWidgets/wxWidgets/pull/916
Add functions to enable or disable pages inside wxToolbook.
Using the new functions you can present disabled icons so that the user
can expect more functionality and you do not need to add/remove pages in
different states.
Closes https://github.com/wxWidgets/wxWidgets/pull/1038