Commit Graph

71065 Commits

Author SHA1 Message Date
Vadim Zeitlin
ac1fa83c20 Ensure initial value of generic wxSpinCtrl is always valid
Under MSW creating a wxSpinCtrl with a range of, say, 1..10 and the
default initial value of 0 sets its initial value to 1 (i.e. the closest
valid value) as expected, but the generic version still set it to the
invalid value of 0, which was unexpected, inconsistent and not useful.

Fix the generic version to follow MSW behaviour now and add a test
checking for this.
2021-08-17 23:15:49 +02:00
Vadim Zeitlin
b66656fbec Merge branch 'dvd-revert-performance-breaking-commits' of https://github.com/vslavik/wxWidgets
Revert recent changes to wxDataViewCtrl which resulted in unacceptable
performance regressions.

See https://github.com/wxWidgets/wxWidgets/pull/2461

See #14939, #19003.
2021-08-15 19:00:45 +02:00
Vadim Zeitlin
14d8548349 Merge branch 'misc-render-fixes' of https://github.com/discnl/wxWidgets
Fixes for rendering text with bottom/right alignment for wxMSW and not
only.

See https://github.com/wxWidgets/wxWidgets/pull/2446
2021-08-15 18:57:04 +02:00
Blake Madden
cb6db10199 Small typos in docs 2021-08-15 08:03:37 -04:00
Vadim Zeitlin
7b5783e4f8 Restore accidentally removed EVT_GRID_CMD_RANGE_SELECT macro
This was removed in 415f080c80 (Split wxGrid RANGE_SELECT event into
SELECTING and SELECTED, 2020-07-27) without preserving it for
compatibility. Do define it now, just as it was done for the non-CMD
equivalent of this macro EVT_GRID_RANGE_SELECT.

Also update the documentation to fix a typo from e2f316b19d (Mention
that wxEVT_GRID_RANGE_SELECT{ED,ING} are new in 3.1.5, 2020-08-18).
2021-08-14 01:10:14 +02:00
Stefan Csomor
61b0b9f421 lifting deployment_target to correct supported minimal macOS version 2021-08-12 14:32:32 +02:00
Stefan Csomor
2eed2e3b12 adding PCRE2 to Xcode projects 2021-08-12 14:17:39 +02:00
Stefan Csomor
00277531ed Adapting to current Xcode template 2021-08-11 19:38:53 +02:00
Stefan Csomor
b0de14a614 modify according to current Xcode iOS templates 2021-08-11 19:33:51 +02:00
Václav Slavík
8d4ab94500 Use -1 as uninitialized value for m_expanderWidth
Use -1, not 0, for the not-yet-computed value. Prevents CPU-intensive
recomputation when the calculated size _is_ zero - e.g. because the
column is hidden.
2021-08-10 20:04:50 +02:00
Václav Slavík
8081477a43 Revert "Mac: Fix truncation of images in wxDataViewCtrl"
This reverts commit d2fc88c03d.
2021-08-10 19:18:35 +02:00
Václav Slavík
2d302cf143 Revert "Fix expansion of the last column in macOS wxDataViewCtrl"
This reverts commit 7555d1b245 and 2a4c52a414.
2021-08-10 19:18:03 +02:00
Václav Slavík
4d62a7a08f Revert "Autosize the right columns in macOS wxDataViewCtrl"
This reverts commit 36ea7ff4d6.
2021-08-10 19:13:16 +02:00
Václav Slavík
5f34d07bc1 Revert "Fix sizing of temporarily last columns in macOS wxDataViewCtrl"
This reverts commit c9221fd538.
2021-08-10 19:12:53 +02:00
Dimitri Schoolwerth
accd43d76e Remove unnecessary calls to wxRound from wxImage code
No real changes: In wxImage::Rotate() don't needlessly wxRound numbers
that are already whole after having called ceil/floor.

Occurred since inception in 7a632f1056 (Added rotation to wxImage,
2000-02-06).

See https://github.com/wxWidgets/wxWidgets/pull/2460
2021-08-09 16:30:57 +02:00
Artur Wieczorek
8ca8c01356 Run all clipping region tests against wxClientDC 2021-08-08 21:54:40 +02:00
Artur Wieczorek
3ca74039da Add test of setting size of the window client area 2021-08-08 21:42:38 +02:00
Dimitri Schoolwerth
90ba137f20 Work around text extent differences resulting in clipped text
Under at least some versions of Windows 10 with wxDVC themed text can be
clipped horizontally because of discrepancies between the text extent
as drawn by DrawThemeTextEx() and calculated with GetTextExtent()
earlier.

Work around the issue by always trying to use GetThemeTextExtent() in
DrawItemText(), not just for alignment of multi-line strings, and adjust
for any width differences similar to the existing adjustment for height.

See #18487.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
ebf1141db2 Improve text extent rounding in wxGCDCImpl::DoGetTextExtent()
Change wxGCDCImpl::DoGetTextExtent() from rounding to the nearest
integer to rounding up: if e.g. height is 15.3 then 16 pixels should be
used for height, and not 15. Rounding was previously improved from
casting (which appears to be the initial code) in 0417955ddb (adding
correct filling area to arc, correct rounding and clipping, 2007-10-21).

Issues with nearest rounding became more visible after off-by-one fixes
for wxDC::DrawLabel() with wxALIGN_RIGHT and wxALIGN_BOTTOM positioning.
When using e.g. wxALIGN_RIGHT with a width of 72.4 the text could now be
drawn beyond the extent on the right because the text is not offset by
one to the left any longer.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
9dd88e0159 Undo removal of text alignment for wxDataViewCtrl's RenderText()
Revert e2e7d3d391 (Fix wxELLIPSIZE_END with wxALIGN_RIGHT in wxMSW
wxDataViewCtrl, 2016-03-18). This fix is no longer needed after
the previous commit reverted b642747fd2.

Reverting also allows for text to be drawn vertically aligned again
instead of always using top-left alignment. While the difference in
appearance by not having alignment can be minor with default row
heights, it becomes more noticeable with taller rows:
a wxDataViewCheckIconText column with a tall icon will have its text
stuck to the top of a row while other columns have their text vertically
centered. This already occurs by default when not explicitly specifying
an alignment (wxDVR_DEFAULT_ALIGNMENT) which results in
wxALIGN_CENTRE_VERTICAL being used for row alignment when rendering.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
7a8b210dff Undo mimicking faulty wxDC::DrawLabel() wxALIGN_RIGHT positioning
Revert b642747fd2 (Fix right aligned text position in wxDVC on MSW with
system theme, 2015-09-30) which in wxRendererXP::DrawItemText() mimicks
the off-by-one with right alignment of wxDC::DrawLabel() that got fixed
by the previous commit.

There's not a similar change copying wxDC::DrawLabel()'s former
off-by-one behaviour with wxALIGN_BOTTOM that would need reverting.

Both alignments now result in the same text positioning with both
drawing functions.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
d83d126959 Fix off-by-ones with bottom and right aligned positioning
wxDC::DrawLabel() positions the text one to the left with wxALIGN_RIGHT
alignment and one up with wxALIGN_BOTTOM alignment. The same occurs in
wxControlRenderer::DrawBitmap() for bitmaps. Both off-by-ones exist
since inception in respectively 4d3c4c2f94 and bc60c3d699.

This fix vertically aligns wxALIGN_BOTTOM drawing of wxDC::DrawLabel()
with themed text drawing through wxRendererXP::DrawItemText().
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
b8af267bf9 Fix centered vertical and bottom aligned themed text drawing
When using non-TOP vertical alignment with wxRendererXP::DrawItemText()
either DT_VCENTER or DT_BOTTOM gets passed to DrawThemeTextEx() but
without the DT_SINGLELINE flag which is required for those alignment
flags to take effect, resulting in text always being top aligned.

Fix by passing DT_SINGLELINE when using either alignment, but only for
single lines as multi-lines are rendered as a single line with invisible
newline character. Draw multi-line text using top alignment and deal
with vertical alignment ourselves, using GetThemeTextExtent() to get
an accurate extent of the text.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
1eb7150309 Correct slightly misleading comment
Comment in wxRendererXP::DrawItemText() could be interpreted as
DrawThemeTextEx() being available for some XP editions but it is Vista+
only, so correct it.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
d654f30d14 Demonstrate wxRenderer::DrawItemText() alignment in render sample
This is intended for wxMSW to show differences between themed text
drawing (with wxRendererXP::DrawItemText() under Vista+) and
wxRendererGeneric::DrawItemText(). Use existing option to switch between
generic and native renderer (Ctrl-G) in the render sample to observe
the differences.
2021-08-08 20:21:31 +02:00
Dimitri Schoolwerth
8263e4b366 Avoid assert failures in render sample with generic renderer
Some generic render functions aren't implemented and result in obtrusive
assert failures when switching to use the generic renderer in the render
sample. Instead show text saying the drawing function is not implemented
in the location where the sample would ordinarily draw the control.
2021-08-08 20:21:30 +02:00
Dimitri Schoolwerth
d04dfd6f22 Add render-related options to dataview sample
To more easily expose problems add options to the dataview sample
related to rendering of items (applying mostly to the MyListModel page
only):

* Use left/centre/right alignment (Ctrl+1/2/3)
* Use top/centre/bottom alignment (Ctrl+4/5/6)
* Toggle tall row usage (Ctrl+7)
* Toggle keep on using small wx logo, regardless of row size (Ctrl+8)
* Toggle multi-line text usage (Ctrl+9)
2021-08-08 20:21:30 +02:00
Dimitri Schoolwerth
771ebfa9a9 Add wxDataViewCtrl debug option to display render bounds
For debugging convenience define DEBUG_RENDER_EXTENTS to draw a red
rectangle around a custom rendered cell's full rectangle, and a green
rect for the extent of the item appearing inside it. Custom renderers
ordinarily should not draw outside of the green rect. A notable
exception is drawn text, particularly multi-line ones.
2021-08-08 20:21:30 +02:00
Vadim Zeitlin
ebec1ff9f6 Rebake after removing shaped-ld-sh from bakefile
Simply remove the not existent any longer shared-ld-sh from clean
targets in all makefile.

This should have been done in e663d9af2b (Stop using shared-ld wrapper
script under Mac, 2021-07-06).
2021-08-06 21:51:40 +02:00
Arrigo Marchiori
30915c6163 Make wxrc independent from GUI support
The wxrc program does not depend on the GUI libraries, but only on
the base and XML libraries, so make it possible to build it in non-GUI
builds too.

Closes https://github.com/wxWidgets/wxWidgets/pull/2419
2021-08-06 21:51:11 +02:00
frederick-vs-ja
aaa2dabf5d Remove usage of __w64 for recent MSVC versions
__w64 just increases warnings and errors since VS 2013 (according to
https://docs.microsoft.com/en-us/cpp/cpp/w64?view=msvc-160), so don't
use it any longer.

Closes https://github.com/wxWidgets/wxWidgets/pull/2455
2021-08-06 20:30:43 +01:00
Vadim Zeitlin
b9261597bf Merge branch 'msw-combo-keys'
Fix behaviour of comboboxes in presence of accelerators in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/2443
2021-08-06 20:29:20 +01:00
Vadim Zeitlin
1e37f6e5ff Provide information in wxListEvent for generic virtual wxListCtrl
This wasn't done since the changes of c1c4c5516c (fixed unwanted owner
data accesses in virtual list ctrl, 2001-08-07), but there doesn't seem
to be any reason to avoid accessing the item in SendNotify() (any more?)
and if we ever did generate events for all the items in a virtual list
control, this would be already a problem, even if we didn't access the
line info from here.

So just revert the check for !IsVirtual() and always fill the item in
the generated event to make the behaviour of the generic version
consistent with the MSW one and slightly more useful.

See https://github.com/wxWidgets/wxWidgets/pull/2456

Closes #19235.
2021-08-06 21:28:24 +02:00
Vadim Zeitlin
c7ed88af7c Move comment in wxOSX wxToolBar code to a more logical place
No real changes, just move the comment in front of the line it
documents.
2021-08-06 21:22:08 +02:00
Vadim Zeitlin
ce48d01e8a Fix missing item labels in wxToolBar overflow menu under macOS
Always set the label, even when not using wxTB_TEXT style, as otherwise
the items shown in the native "overflow" menu use empty strings as
labels and so can't be distinguished at all.

This undoes part of the changes of 1f7cd4807f (Don't show labels for
toolbars showing icons only in wxOSX, 2016-02-23), but they don't seem
necessary any longer, i.e. calling SetToolShortHelp() doesn't show the
toolbar label when using non-native toolbars, so #16669 remains fixed.

Closes #19226.
2021-08-06 21:17:51 +02:00
Vadim Zeitlin
d8fe06891e Avoid bool argument in wxListMainWindow::RecalculatePositions()
Use 2 separate functions instead to make the code more clear, as passing
false for indicate the refresh shouldn't be done was quite confusing.

Also get rid of a separate RefreshAll() which was called only from
RecalculatePositions().

No real changes.
2021-08-06 21:09:29 +02:00
Vadim Zeitlin
36e9576d42 Fix not refreshing wxListCtrl properly under macOS
Refresh() called from inside wxEVT_PAINT handler doesn't seem to have
any effect, so use CallAfter() to call it slightly later instead.

Closes #19139.
2021-08-06 21:05:49 +02:00
David Connet
233c487dfd Fix direction of mouse wheel zoom in print preview
Make zooming work the same as in all the other programs rather than
zooming in/out in the reverse direction.

Closes #19215.
2021-08-06 19:34:19 +02:00
Vadim Zeitlin
de2b81b06f Ignore error in another wxWebRequest test under AppVeyor
This is similar to b03eaceea6 (Disable WebRequest::SSL::Ignore unit test
under AppVeyor, 2021-08-04) and just warns about the wxWebRequest
cancelling test failure when running it under AppVeyor instead of
failing the entire test suite, as this does happen sporadically (but
regularly) there for as yet unknown reason.
2021-08-05 23:42:53 +01:00
Vadim Zeitlin
56eeb694e7 Fix tests compilation with glibc >= 2.34
Update CATCH submodule to include the workaround for SIGSTKSZ not being
a constant any longer in the latest GNU libc versions.

Closes #19158.
2021-08-05 23:03:20 +02:00
Vadim Zeitlin
dc9dc39970 Fix typos and formatting in wxRegEx incompatibilities section
Double the backslashes to prevent Doxygen from interpreting them as
commands and remove a redundant word.
2021-08-04 21:19:14 +01:00
Vadim Zeitlin
09cbec0373 Allow calling wxListCtrl::SetImageList() before Create() in wxMSW
This already worked with the generic version, but silently failed with
wxMSW, so make it work with wxMSW too as it doesn't cost much and makes
wxListCtrl behave in the same way under all platforms.

Also document that SetImageList() can be used before the window is
created.
2021-08-04 21:09:04 +01:00
Vadim Zeitlin
b03eaceea6 Disable WebRequest::SSL::Ignore unit test under AppVeyor
This test sporadically fails in builds with different compilers (both
MSVC and gcc) there for unknown reasons. Until we can find, and fix, the
underlying problem, disable this test to avoid spurious CI failures.
2021-08-04 18:24:28 +02:00
Vadim Zeitlin
ef21046c2c Document more incompatibilities between PCRE and old wxRegEx
Also try to make the reference to this documentation in the change log
more clear.
2021-08-04 01:36:46 +02:00
Vadim Zeitlin
232a3ab577 Allocate more space for the wxRegEx error message buffer
We need to account for the trailing NUL explicitly here, so add 1 to the
length returned by the first call to wx_regerror() to avoid chopping off
the last character of the error message.
2021-08-04 01:29:44 +02:00
Vadim Zeitlin
bdee83d5ff Fix checks for submodules when using configure --srcdir option
In this case ac_confdir variable is not set, but srcdir still is, so
just use the standard (and also more clear) variable instead.

See https://github.com/wxWidgets/wxWidgets/pull/1954

Closes #19236.
2021-08-02 19:23:40 +02:00
Vadim Zeitlin
a4a65f16f6 Fix linking with builtin regex library
Use the value of wxUSE_REGEX in configure, not its name.
2021-08-02 18:10:20 +02:00
Vadim Zeitlin
a4d06b6c88 Explicitly include wx/scopedptr.h when using wxScopedPtr
Don't rely on it being implicitly included from other headers.
2021-08-01 00:43:31 +01:00
Vadim Zeitlin
55d57c0f68 Remove another obsolete Borland hdrstop pragma
See f57f214122 (Remove BCC-specific hdrstop pragma from everywhere,
2020-10-12).
2021-08-01 00:43:31 +01:00
Vadim Zeitlin
6e40b2525e Stop updating non-existent MSVC 7 project files
MSVC 7 project files don't exist any longer, so don't try updating them
in upmake.

This should have been done in 8b854d2f92 (Remove MSVC 7 project files
and support for generating them, 2021-04-26).
2021-07-31 19:12:41 +01:00