Commit Graph

68781 Commits

Author SHA1 Message Date
Vadim Zeitlin
d57c688d89 Return non-zero height from GetMultiLineTextExtent("") in wxMSW
This restores the previous behaviour inadvertently changed by bfeae1922d
(Minor optimizations in GetMultiLineTextExtent(), 2020-06-10) and makes
it official by documenting it and adding tests checking for it.

It wasn't completely obviously if this was intentional or accidental
before, but at least wxStaticText itself relied on the old behaviour,
and chances are that so did some code outside the library, so make this
part of the API now.

See #18825.
2020-07-15 02:10:49 +02:00
Vadim Zeitlin
46d6866c9f Make wxGCDC::GetTextExtent("") return (0, 0)
This seems more logical and is compatible with wxDC in wxMSW and wxGTK2,
as well as other kinds of DC, e.g. wxPostScriptDC.

It also looks like the current behaviour was unintentional as it
happened only because wxGCDCImpl::DoGetTextExtent() always passed all
non-null parameters to wxGraphicsContext::GetTextExtent(), even if it
didn't need the values for all of them, and thus bypassed the special
case for the empty string which was already present in the latter
function.

Fix this, making DoGetTextExtent() more efficient as a side effect (we
now avoid unnecessary calls to pango_layout_iter_get_baseline() in the
most common case), and also add another test for empty string to
wxGraphicsContext itself, for non-GTK case.

Also document this behaviour and add a test checking for it.
2020-07-15 02:10:34 +02:00
Vadim Zeitlin
a52a27ad90 Display wxSize less confusingly if any tests fail
Using "x" as separator between the components created confusion with
hexadecimal notation, resulting in confusing messages like "0x17==0x0"
that seemed to describe comparison of 2 numbers and not 2 wxSize
objects.

Using "*" is also more consistent with wxRect output format.
2020-07-15 02:09:42 +02:00
Vadim Zeitlin
844ec191f0 Use CallGetTextExtent() directly in GetMultiLineTextExtent()
There is no need to pass by GetTextExtent() now that we already make
sure width/height are non-null in this function, so just construct the
MeasuringGuard slightly earlier and call CallGetTextExtent() directly.

No real changes.
2020-07-15 01:23:23 +02:00
Vadim Zeitlin
55c71fdac9 Ensure that pointers in GetMultiLineTextExtent() are always valid
Do the same thing as in GetTextExtent() to simplify the code a little
and also avoid temporary variables.

No real changes.
2020-07-15 01:21:14 +02:00
Vadim Zeitlin
2280e43fe9 Factor out wxTextMeasureBase::GetEmptyLineHeight()
No real changes, just refactor to extract a trivial helper function.
2020-07-15 01:16:23 +02:00
Vadim Zeitlin
db556fc388 Remove CppUnit boilerplate from wxDC::GetTextExtent() unit tests
Drop the test case class and use CATCH macros.
2020-07-14 23:36:23 +02:00
Vadim Zeitlin
093c3067e8 Don't use windres --use-temp-file option
According to the manual, it should only be needed for Win9x systems not
supported since a long time anyhow and this option is apparently buggy
in recent MinGW binutils as it results in build errors when used, see
https://github.com/msys2/MINGW-packages/issues/6558

Closes https://github.com/wxWidgets/wxWidgets/pull/1961
2020-07-14 22:10:58 +02:00
PB
88a6c8c905 Fix building wxMSW using GCC 10.1 with C++20 standard
Add comparison operator overloads using NativeFormat to wxDataFormat
to prevent ambiguous operator overload errors.

Closes https://github.com/wxWidgets/wxWidgets/pull/1962
2020-07-14 22:09:47 +02:00
Hertatijanto Hartono
7f617d97a5 Add word 'be' for consistency of error message
No real change, just a typo fix after f1f27bc37c (Checks for 3rdparty
libraries availability in configure, 2020-07-13).

Closes https://github.com/wxWidgets/wxWidgets/pull/1969
2020-07-14 22:08:27 +02:00
Vadim Zeitlin
c073995352 Merge branch 'aui-dark-mode'
Fixes for AUI in dark mode, especially, but not only, under macOS.

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

Closes #18812.
2020-07-14 20:26:52 +02:00
Vadim Zeitlin
5bf7db419a Show whether generated setup.h files changed or not
Don't output "ok" for all files when running update-setup-h, this was
not very informative and possibly misleading. Only show "ok" for the
actually updated files and "unchanged" otherwise.
2020-07-14 20:24:52 +02:00
Vadim Zeitlin
e95ff829ef Remove extra quotes from --with-cxx error message
No real changes, just a cosmetic improvement to the error message given
if the value of --with-cxx=NN option is not recognized.
2020-07-14 20:21:00 +02:00
mimi89999
c63eefded1 Adjust disabled closed bitmap colour to better fit Linux themes
Change the lightness of INACTIVECAPTIONTEXT to make it stand out better.
2020-07-14 16:14:38 +02:00
mimi89999
b0f82d41a3 Use WINDOW/GRAYTEXT system colours for AUI tab art
Those are more appropriate than the previously used CAPTIONTEXT and
INACTIVECAPTIONTEXT under Linux and don't change anything under Mac,
where they map to the same colours anyhow.
2020-07-14 16:13:28 +02:00
Artur Wieczorek
cde033df8d Save initial wxPropertyGridManager extra style
Extra style bits used while initializing wxPropertyGridManager are
not saved and therefore cannot be returned by GetExtraStyle(). We need
to save them in a standard way to make them accessible for this function.

See #18813.
2020-07-14 12:21:35 +02:00
Paul Cornett
5325ccfda6 Update generic wxTreeCtrl appearance when theme changes
See #18823
2020-07-13 20:26:59 -07:00
Hertatijanto Hartono
f1f27bc37c Checks for 3rdparty libraries availability in configure
Abort configure run with an error if a 3rd party library doesn't seem to
be present, when it's supposed to be used during the build, as this is
better than postponing the error until make runs into it much later and
also allows us to give a hopefully helpful message telling people that
they might be missing the relevant submodules.

Also add --disable-tests configure option to allow skipping building
tests entirely. In particular, this allows to avoid cloning any
submodules at all when using system libraries on a Unix system.

Closes https://github.com/wxWidgets/wxWidgets/pull/1954
2020-07-13 23:36:31 +02:00
Vadim Zeitlin
3ec166f960 Merge branch 'dos_BuildTools' of https://github.com/doscott/wxWidgets
Official build/packaging scripts fixes: specify TARGET_CPU explicitly
for 32 bit builds (and also document it); don't bother modifying
wxwidgets.props as it now works out of the box.

See https://github.com/wxWidgets/wxWidgets/pull/1960
2020-07-13 20:54:27 +02:00
Vadim Zeitlin
6eab84e26d Use wxSYS_COLOUR_GRAYTEXT for disabled AUI buttons labels
This is more appropriate than wxSYS_COLOUR_INACTIVECAPTIONTEXT which
just happened to be the same as wxSYS_COLOUR_GRAYTEXT under Mac, but
this is not true elsewhere.
2020-07-13 20:24:57 +02:00
dos
5ed09da80c Copy wxwidgets.props to root of *Dev.7z packages; use full source path with fciv command. 2020-07-13 13:34:02 -03:00
dos
050df54930 Add TARGET_CPU=X86 to 32 bit builds. 2020-07-13 13:32:24 -03:00
dos
db01789373 Add TARGET_CPU requirement for x86 DLL build. 2020-07-13 13:28:53 -03:00
mimi89999
87d2f35f37 Change AUI pane top and left colors to wxSYS_COLOUR_WINDOW
Closes #18820
2020-07-13 18:20:26 +02:00
Vadim Zeitlin
77095c5fbd Remove the now unused DISABLED_TEXT_COLOR constant
The previous commit removes all references to this hardcoded colour.
2020-07-13 16:01:05 +02:00
Daniel Kulp
01e9bd008d Use previously Mac-specific colours for all platforms in wxAUI
Get rid of platform checks in wxAUI and use (the same) system colours
everywhere.
2020-07-13 15:59:46 +02:00
Daniel Kulp
623c116b7a Honour the colour alpha channel in wxAuiBitmapFromBits()
This fixes creating wrong bitmaps for system colours with alpha and
allows to use the correct wxSYS_COLOUR_INACTIVECAPTIONTEXT constant
in wxAuiGenericTabArt instead of a wrong but, due to the loss of alpha,
better looking wxSYS_COLOUR_INACTIVECAPTION which was used before.
2020-07-13 15:57:59 +02:00
Vadim Zeitlin
69e27acf0d Merge branch 'im/clipboard' of https://github.com/imciner2/wxWidgets
Ensure the clipboard contents are stored properly on GTK.

See https://github.com/wxWidgets/wxWidgets/pull/1953
2020-07-13 15:33:58 +02:00
Vadim Zeitlin
325648136c Fix system colours in wxGTK wxSysColourChangedEvent handlers
Using wxSystemSettings::GetColour() in wxSysColourChangedEvent handler
in wxGTK could return the old colour value, before the change, because
the callback for notify::gtk-theme-name signal defined in wxTLW, which
generates wxSysColourChangedEvent, could be invoked before the callback
for the same signal in wxSystemSettings, which invalidated its cache.

Fix this by registering the former using g_signal_connect_after() and
thus ensuring that wxSystemSettings callback runs before it, and the
cache is cleared before wxSysColourChangedEvent handlers can use it.

Closes #18818.
2020-07-13 14:23:42 +02:00
Stefan Csomor
f9618ebe5b Revert "disable this test when no wxMenuBar is present"
This reverts commit 769881a45b.
2020-07-13 11:24:16 +02:00
Stefan Csomor
769881a45b disable this test when no wxMenuBar is present
it just is full of calls to menubars ..
2020-07-13 11:19:52 +02:00
Daniel Kulp
872692132a Use more appropriate colours for AUI dock art under Mac
Use system colours instead of hard-coding white.

This is still not ideal because ideally the same wxSYS_COLOUR_XXX
constants should be usable under all platforms, but better than just
using completely wrong colours when using dark mode under Mac.
2020-07-13 01:50:21 +02:00
Daniel Kulp
a829b1df06 Simplify bitmap initialization in wxAuiDefaultDockArt
Reduce the number of __WXMAC__ checks by using helper wxColour variables
which have different values under Mac and non-Mac.

No real changes.
2020-07-13 01:50:21 +02:00
Daniel Kulp
f3d4f01513 Improve dark mode test in wxAuiGenericTabArt
Use wxSystemSettings for this instead of manually checking the base
colour components which is both more verbose/difficult and less
reliable.
2020-07-13 01:50:21 +02:00
Daniel Kulp
3d33fcdba8 Adapt the gradient used in AUI tab art in dark mode
Invert its direction and make it darker for better fit.
2020-07-13 01:49:51 +02:00
Daniel Kulp
e12a9b11e4 Update AUI art colours after system colours change
Move code initializing colours and colour-dependent bitmaps from ctor to
UpdateColoursFromSystem(), which means that now this is done not only
once, when creating the object, but also later if the system colours
change (e.g. due to turning on or off the dark mode).
2020-07-13 00:54:02 +02:00
Daniel Kulp
88928e712a Use system colours in wxAuiGenericTabArt
Don't hardcode black and grey, which don't look right in all themes.
2020-07-13 00:52:50 +02:00
Vadim Zeitlin
e779450638 Merge branch 'tipwindow'
Miscellaneous wxTipWindow enhancements, including better high DPI
support.

See https://github.com/wxWidgets/wxWidgets/pull/1949
2020-07-12 22:31:08 +02:00
Vadim Zeitlin
32489c914c Merge branch 'vector-reverse-iter'
Fix wxVector reverse iterator base().

See https://github.com/wxWidgets/wxWidgets/pull/1948
2020-07-12 22:30:42 +02:00
Vadim Zeitlin
98241e21cd Merge branch 'colour-as-string'
Return empty string from wxColour::GetAsString() if it's invalid.

See https://github.com/wxWidgets/wxWidgets/pull/1947
2020-07-12 22:29:09 +02:00
tm
f6cc8ff52c Add GetOpenGLScaleFactor() to abstract OpenGL coordinates scaling
The fix for OpenGL coordinates when using high DPI in b134589cbb (Fix
OpenGL samples when using HiDPI displays, 2019-08-06) did fix it for GTK
3 and macOS, but broke it for MSW and other platforms not using pixel
scaling, as window coordinates are the same as OpenGL ones there, while
GetContentScaleFactor() can still return values > 1 even on these
platforms.

Provide new GetOpenGLScaleFactor() function abstracting this platform
difference and use it in all OpenGL samples to make them work correctly
in high DPI under all platforms.

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

Closes #17391.
2020-07-12 22:28:29 +02:00
Ian McInerney
8f322ffb23 Replace g_clipboardAtom with GDK_SELECTION_CLIPBOARD
GDK_SELECTION_CLIPBOARD is the prefered way of referencing
the GdkAtom for the clipboard, and using it provides a clearer
distinction between the primary clipboard and the normal clipboard.
2020-07-12 20:14:41 +01:00
Stefan Csomor
01d7fa8116 adding utf8 as when data is read from the pasteboard 2020-07-12 20:59:32 +02:00
Stefan Csomor
1e64278150 macOS fixing potential crash in PasteboardWriter
using a pasteboard peeker tool lead to a crash when the drag pasteboard was accessed after our session has long finished. Make sure the writer is working correctly event after the data object is not valid anymore
2020-07-12 20:58:41 +02:00
Artur Wieczorek
95b5fcc0ea Use empty() function to check if vector is empty
Use this dedicated function instead of checking if size() function
returns zero/non-zero value.
2020-07-12 20:07:29 +02:00
Artur Wieczorek
c1cbc1aee7 Suppress MSVC++ performance warning
This is to prevent warning C4800: 'LRESULT': forcing value to bool 'true'
or 'false' (performance warning).
2020-07-12 20:04:59 +02:00
Artur Wieczorek
3feea201da Add tests of setting wxSpinCtrl base and range 2020-07-12 19:58:30 +02:00
Artur Wieczorek
a4928c0fde Use Catch in wxSpinCtrl unit tests
Use Catch instead of CppUnit for unit tests of wxSpinCtrl.
2020-07-12 19:58:30 +02:00
Artur Wieczorek
776b28cba7 Don't allow wxSpinCtrl range to include negative values if base != 10 (wxOSX)
For the sake of consistency with another ports only unsigned
hexadecimal numbers should be supported. To do so we need
to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.

Closes #18805.
2020-07-12 19:58:30 +02:00
Artur Wieczorek
845988e0ed Don't allow wxSpinCtrl range to include negative values if base != 10 (wxGTK)
Hexadecimal numbers are always unsigned in the native wxSpinCtrl
implementation under wxMSW so for the sake of consistency we need
to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.

See #18805.
2020-07-12 19:58:30 +02:00