Check that creating a wxTextCtrl doesn't generate any events to verify
that this problem doesn't exist in other ports, after fixing it in
wxGTK in 3e7e7dd24c (Avoid generating wxEVT_TEXT when wxTextCtrl initial
value is not empty, 2020-04-01).
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
In many case SetTable() is called with its takeOwnership parameter set
to true, as shown by the grid sample in which all 3 of the calls to
SetTable() set it to true, but calling it in this case is awkward, as
bare "true" in the caller is unreadable and almost invariably requires
an explanatory comment.
Improve the API by adding AssignTable(), which is the same to SetTable()
as the existing AssignImageList() to SetImageLabel(), which always takes
ownership of the table pointer.
This file uses wxScopedPtr<> and so needs to include this header
explicitly instead of relying on it being included indirectly from some
other header, as happens in the default build, but not always.
Closes#18711.
Don't include wx/private/spinctrl.h header (nor the other ones) at all
in this case, as it doesn't compile in this build configuration.
This fixes one of build problems under iOS.
See https://github.com/wxWidgets/wxWidgets/pull/1773
Prevent errors and warnings when embedding the manifest.
Check if environment variable VISUALSTUDIOVERSION (set by VS developer command
prompt) is 14.0, 15.0 or 16.0.
See #18665
::ExtCreatePen() doesn't allow the pen width to be 0, unlike
::CreatePen() and failed to create the brush in this case.
Use width of 1 to draw e.g. hatched lines of width 0 correctly.
See #7097.
Use ::ExtCreatePen() for creating pens for such lines, as it results in
much better appearance for them than ::CreatePen(), which draws dashed,
and not dotted, lines in this case.
See #7097.
This has the disadvantage of not using the same accelerators in
different wxWidgets builds, but the advantage of appearing logical to a
casual user when running the sample, while having "0, 1, 3, 4" sequence
was surprising.
Alternatively, we could always add all menu items, but disable the ones
that are not available in the current build. It could be surprising to
see "GDI+" under non-MSW systems too though.
Make "Use default wxGraphicsContext" part of the renderer selection
radio group and put it in correct order, as having "1, 0, 3, 4"
accelerators order in the menu was really surprising.
Remove wxEVT_UPDATE_UI handlers as they complicated things in the sample
code (which is supposed to be simple, after all) without much benefit
and arguably even added to the confusion during run-time as menu items
could both be manually selected and checked automatically.
Explicitly include <commctrl.h> instead of relying on it being done
implicitly by wx/msw/uxtheme.h, as this doesn't happen when
wxUSE_UXTHEME is 0.
Closes#18702.
This file doesn't need to be created initially, as it will be done
automatically during the build, but it does need to be updated whenever
setup0.h changes, so explain this in both the README-GIT.md file and the
main build instructions.
Closes#18699.
"failtest" target is not built by default and it's not trivial to change
this, as it needs to be built before anything else (and not in parallel
with it, as otherwise object files created while building the tests
could be removed), so just build it manually before building the tests
themselves in Travis CI builds (or at least those of them using
configure and make).
The change in the value can be greater than 1 when the arrows are held
pressed, contrary to what the logic of determining the wraparound added
in 086793ceef supposed.
Replace this with a check of whether we switch from the min value
directly to the max one or vice versa, which mostly works and avoids
asserts, even if it can still fail and produces wrong events when the
arrows are held pressed for long enough to increase the delta to the
range of the control, in which case we just can't distinguish between
wraparound and passing from min to max (or vice versa) in a single step,
which means that we have no way to determine the right event to send.
But producing a wrong event is better than asserting, so this still
counts as an improvement.
Closes https://github.com/wxWidgets/wxWidgets/pull/1764
See #17957.
Closes#18695.
This variable was written to and read from different threads without any
synchronization, which resulted in tons of TSAN warnings -- in addition
to being incorrect, of course.
Fix this by using C++11 atomic type for it if available and just not
doing anything otherwise, as there doesn't seem to be any simple
workaround for this problem without an atomic 64 bit type that our own
wx/atomic.h doesn't currently provide.
Make the left arrow collapse the item if it's currently expanded before
falling back to its previous behaviour of going to the item parent and
the right arrow to go to the first child if the item is already
expanded.
This is compatible with the native MSW control behaviour, but mostly
just more useful and convenient.
Closes#18684.
Don't deselect all the other items when an item is collapsed or expanded
in wxGenericTreeCtrl with wxTR_MULTIPLE style, this was completely
unexpected and seems to have been accidentally introduced back in
35cf1ec63cCloses#18680.
Don't call GetSelections() unnecessarily if we're not going to use its
result in any case because either Shift or Command/Control key was
pressed when the mouse button was released.
See #18680.
This test remained since 902725eefe but
should have been simply removed back then, as we return if the item is
null due to a test above.
No real changes.
Set LVCFMT_IMAGE, meaning that the column just uses an image from the
image list, instead of LVCFMT_COL_HAS_IMAGES, meaning that the column
contains the image from the image list and do not set LVCF_IMAGE when
resetting the image, as this still reserved space for the (invalid)
image, resulting in an extra blank area in the column header.
Closes https://github.com/wxWidgets/wxWidgets/pull/1739Closes#18617.