Commit Graph

67891 Commits

Author SHA1 Message Date
Vadim Zeitlin
b4eb5438a4 Add a unit test for wxTextCtrl event generation on creation
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).
2020-04-02 09:10:36 -07:00
Paul Cornett
6240ecf153 Fix virtual call of Destroy() in wxDocChildFrameAny
Allow derived class override to be called.
See #18694
2020-04-02 09:03:35 -07:00
Paul Cornett
3e7e7dd24c Avoid generating wxEVT_TEXT when wxTextCtrl initial value is not empty
See #18714
2020-04-01 10:23:44 -07:00
NancyLi1013
d781764d6d Add vcpkg installation instructions for wxMSW
Closes https://github.com/wxWidgets/wxWidgets/pull/1777
2020-04-01 13:24:24 +02:00
Vadim Zeitlin
06af121e9c Add wxObjectDataPtr::release()
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
2020-03-31 02:57:01 +02:00
Vadim Zeitlin
15b5a1865c Add a simple wxGrid::AssignTable() wrapper for SetTable()
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.
2020-03-31 02:43:08 +02:00
Vadim Zeitlin
3674240146 Add missing wx/scopedptr.h in wxMSW wxFileDialog code
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.
2020-03-30 23:10:13 +02:00
Vadim Zeitlin
6c061b6bf9 Fix compilation of spinctrlcmn.cpp when wxUSE_SPINCTRL==0
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
2020-03-30 15:26:00 +02:00
Vadim Zeitlin
00f6cfec51 Fix wxUniv build with wxNO_RTTI
ForceUpperFunctor must have a default ctor when wxNO_RTTI is on, i.e.
when wxRTTI is used.

Closes #18707.
2020-03-30 00:57:16 +02:00
Vadim Zeitlin
c6a4cc80fe Merge branch 'pmdpi-build' of git://github.com/MaartenBent/wxWidgets
Improve DPI aware builds with .vc and .vcproj files.

See https://github.com/wxWidgets/wxWidgets/pull/1769
2020-03-28 14:10:17 +01:00
Maarten Bent
343bd89b63 Rebake after changes 2020-03-27 23:15:03 +01:00
Maarten Bent
3978733a37 CMake: Enable DPI awareness options for demos 2020-03-27 23:11:00 +01:00
Maarten Bent
820234340f Remove unnecessary arguments for nmake in AppVeyor script 2020-03-27 23:11:00 +01:00
Maarten Bent
f1a017539a Generate an error when the CPU parameter is not specified and cannot be determined
See #18640
2020-03-27 23:11:00 +01:00
Maarten Bent
284b25ce02 Automatically detect if target architecture is x64 in .vc file
This allows a successful build even if the user omits specifying CPU=X64.

See #18640
2020-03-27 23:11:00 +01:00
Maarten Bent
3c53fbb94b Add DPI manifest only for MSVS 2015 and later in .vc file
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
2020-03-27 23:10:56 +01:00
Vadim Zeitlin
42c9375c14 Merge branch 'drawing-lines'
Fix drawing of dotted/hatched lines in wxMSW and some drawing sample
improvements.

Closes #7097.

See https://github.com/wxWidgets/wxWidgets/pull/1771
2020-03-27 20:22:17 +01:00
Anton Triest
53d51105be Fix drawing of non-solid lines with width 0 using wxDC in wxMSW
::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.
2020-03-27 12:02:36 +01:00
Anton Triest
d245dc9e1f Fix drawing of dotted lines with wxDC in wxMSW
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.
2020-03-27 11:59:10 +01:00
Vadim Zeitlin
bb489418b0 Number renderers using consecutive digits in the sample
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.
2020-03-27 11:51:56 +01:00
Vadim Zeitlin
e7c8039d13 Simplify renderer selection in the drawing sample
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.
2020-03-27 11:43:19 +01:00
Vadim Zeitlin
62bb47cfdb Use white background for drawing lines in the drawing sample
This makes the display more readable, black on red was really not ideal.

No real changes.
2020-03-27 11:39:03 +01:00
Scott Talbert
8886f47ee4 Update GPL and LGPL license texts to the latest versions
This corrects the outdated FSF address and reformats the text slightly.

References:
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt
2020-03-26 19:50:13 -04:00
Maarten Bent
5767a906eb Disable embedding manifest via linker in .vcproj files
This causes errors (<=2010) and warnings (<=2012) with older VS versions.

See #18665
2020-03-26 22:51:38 +01:00
Robin Dunn
501e55f949 Add missing wxMemoryDC::GetSelectedBitmap 2020-03-23 20:17:22 -07:00
Vadim Zeitlin
eb0b4af073 Merge branch 'travis-test-fail'
Run "make failtest" in Travis CI builds.

See https://github.com/wxWidgets/wxWidgets/pull/1767
2020-03-24 03:24:00 +01:00
Vadim Zeitlin
ebb6f89e13 Fix wxMSW build error with wxUSE_UXTHEME==0
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.
2020-03-24 03:22:13 +01:00
Vadim Zeitlin
2a2faa73ea Correct wx/msw/setup.h instructions in the documentation
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.
2020-03-24 03:19:38 +01:00
Vadim Zeitlin
98206975f5 Run compilation failures tests on Travis
"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).
2020-03-24 00:02:38 +01:00
Vadim Zeitlin
7696fa1bb7 Mark failtest_xxx targets as phony
This doesn't really change anything, but is more correct, as the targets
names don't correspond to any physical files.
2020-03-24 00:01:15 +01:00
Vadim Zeitlin
335565076e Fix event propagation test build for !wxUSE_DOC_VIEW_ARCHITECTURE
Avoid compiling the test using wxDocument etc when they're not
available.

Closes #18700.
2020-03-19 01:16:52 +01:00
Vadim Zeitlin
9b36924258 Merge branch 'generic-treectrl-fixes'
Several improvements to generic wxTreeCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1765
2020-03-19 01:13:49 +01:00
Vadim Zeitlin
10c51dbf28 Avoid spurious asserts when holding arrows in GTK wxSpinButton
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.
2020-03-19 01:11:06 +01:00
Vadim Zeitlin
34ade14c0f Avoid data races on wxMutexInternal::m_owningThread under Unix
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.
2020-03-18 19:34:16 +01:00
Anton Triest
6b04c9938d Improve behaviour of Left/Right arrow keys in wxGenericTreeCtrl
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.
2020-03-16 00:55:04 +01:00
Anton Triest
730b3d1a44 Allow accepting edit with Numpad Enter key in wxTreeCtrl too
This key should work in the same way as normal Enter key and accept the
changes.

Closes #18682.
2020-03-16 00:34:31 +01:00
Anton Triest
0c6d6e6472 Fix deselecting items on branch toggle in wxTR_MULTIPLE control
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
35cf1ec63c

Closes #18680.
2020-03-16 00:30:41 +01:00
Vadim Zeitlin
8bc830337c Slightly optimize Shift/Control-clicking in wxTR_MULTIPLE case
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.
2020-03-16 00:27:12 +01:00
Vadim Zeitlin
2f05f5e2eb Remove unnecessary commented out test
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.
2020-03-16 00:24:03 +01:00
Vadim Zeitlin
eaaad6471d Merge branch 'aui-delete-tool'
Provide work around for surprising behaviour of
wxAuiToolBar::DeleteTool().

Closes https://github.com/wxWidgets/wxWidgets/pull/1758
2020-03-15 17:10:41 +01:00
Vadim Zeitlin
ea359e02ab Rename tool ID parameter in wxAuiToolBar documentation
Use "toolId" to match the actual name in the header instead of
"tool_id".

No real changes.
2020-03-15 17:09:54 +01:00
Vadim Zeitlin
700eaff131 Add wxAuiToolBar::DestroyTool() and DestroyToolByIndex()
These new functions destroy the associated window too, unlike the
existing DeleteTool() and DeleteByIndex().

Closes #16552.
2020-03-15 17:09:51 +01:00
Vadim Zeitlin
5a9938aa67 Merge branch 'log-dangling-else-warns'
Fix dangling else warnings in wxLog macros.

See https://github.com/wxWidgets/wxWidgets/pull/1755
2020-03-15 17:05:23 +01:00
Robin Dunn
5c039e080c Add missing IsAcceptedKey to the wxGridCellEditor interface 2020-03-13 11:50:41 -07:00
ali kettab
40cbea298d Make wxGrid::SetLabelXXX() work when using native header as well
Allow changing label colours and font of the native column header too.

Closes https://github.com/wxWidgets/wxWidgets/pull/1762

Closes #18605.
2020-03-13 00:43:34 +01:00
followait
95eea38eb0 Fix bug when resetting wxListCtrl column header image in wxMSW
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/1739

Closes #18617.
2020-03-12 23:54:29 +01:00
Vadim Zeitlin
c4a95ab32c Merge branch 'grid-live-resize'
Implement live-resizing of rows/columns in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/1754
2020-03-12 23:09:48 +01:00
Vadim Zeitlin
2ccc990ee4 Document change of wxAuiMDIChildFrame base class
This should have been done in c1bcf16eb9.
2020-03-12 13:54:54 +01:00
Paul Cornett
81309f083d Ensure that scrollbar GtkRange page increment is set to a positive value
It should not be less than the step increment, which is always one.
See #18688
2020-03-11 22:10:22 -07:00
Vadim Zeitlin
4a8a61f6d6 Merge branch 'staging' of https://github.com/stahta01/wxWidgets_PR
Document building wxGTK3 and wxQT with MSys2.

See https://github.com/wxWidgets/wxWidgets/pull/1741
2020-03-11 23:25:16 +01:00