Commit Graph

18492 Commits

Author SHA1 Message Date
Paul Cornett
a5b03ea23c Suppress -Wdeprecated-declarations warnings from GTK2 headers
GLib has deprecated some things used by GTK2
2019-11-09 12:07:07 -08:00
Artur Wieczorek
6eccec3ae7 Use empty() member function to determine if string is empty
Use this dedicated function instead of checking if length() function returns zero/non-zero value.
2019-11-08 18:53:03 +01:00
Artur Wieczorek
6b00cc80f1 Revert making wxComboCtrl a wxCompositeWindow
Commit 70e9dbd756 has fixed #18394 but unfortunately it also caused several other issues observed e.g. in #18540. Apparently wxComboCtrl doesn't fit well to the wxCompositeWindow framework -  especially when wxCB_READONLY flag is set and there is no main editor control what is problematic for wxCompositeWindow implementation. At the moment it is more pragmatic to go back to the original wxComboCtrl concept as a plain compound control to fix the regression and try to fix #18394 in an alternative way.

Closes #18540.
See #18394.
2019-11-08 18:51:07 +01:00
Vadim Zeitlin
cdc588e4eb Don't resize the parent from wxToolBar::SetSize() in wxUniv
This could result in infinite recursion in wxX11, as the test for the
new size being different from the old one which was supposed to stop the
recursion, failed there in case the new size was 0: as wxX11 can't use 0
size for the window, the actual size was always different and so we kept
sending size events to the parent, which kept resizing the toolbar etc.

It could be argued that there is a bug in wxX11 and that GetSize() must
return the same value as was passed to SetSize(), even if it was 0, and
this might even be correct, in theory, but it doesn't seem worth to do
it just to accommodate this weird use case, especially because resizing
the parent from the child shouldn't be necessary in the first place and
none of wxToolBar implementations in the other ports does it.

So just remove this code completely.

Closes #18554.
2019-11-06 15:06:36 +01:00
Stefan Csomor
294c8a6b23 moving datatransfer.h to source files
former place in private.h broke Audacity builds
2019-11-05 19:20:51 +01:00
Stefan Csomor
715cb66ac4 Fixing IconRef Build re adding support for reading icns files 2019-11-05 09:46:02 +01:00
Vadim Zeitlin
0dfafdcafb Merge branch 'pmdpi-sizers' of https://github.com/MaartenBent/wxWidgets
Update sizer borders and spacers on DPI change.

Closes #18551.

See https://github.com/wxWidgets/wxWidgets/pull/1628
2019-11-02 16:26:14 +01:00
Maarten Bent
918e102533 Support DPI change in sizers
Return the size of DoGetDefaultBorderInPx as float, so no precision is lost
when multiplying it for DoubleBorder and TripleBorder.

Closes #18551.
2019-11-01 21:07:15 +01:00
Vadim Zeitlin
be83879733 Merge branch 'always-use-wchar_t'
Remove obsolete wxUSE_WCHAR_T option, it must be always 1.

See https://github.com/wxWidgets/wxWidgets/pull/1624
2019-11-01 14:32:42 +01:00
Paul Cornett
4697ce23d9 Don't allow DestroyClippingRegion() to remove paint update area clipping with GTK3
See #18560
2019-10-31 23:30:18 -07:00
Vadim Zeitlin
c0d992cf67 Improve wording of MSWGetFocusHWND() comment
No real changes, just try to explain what this function is for better.
2019-10-31 23:58:21 +01:00
Vadim Zeitlin
96da0060ca Remove MSWGetFocusHwnd() helper
It doesn't seem worth having it when it's only used in a couple of
places in a single file, unlike GetHwnd() which is used in dozens of
places across entire wxMSW.
2019-10-31 23:56:55 +01:00
Ilya Sinitsyn
bfde3d3e08 Fix focus behaviour of the spin control under MSW
Override MSWGetFocusHwnd for wxSpinCtrl to focus the right subwindow.
So the correct window will be used in wxWindowMSW::SetFocusFromKbd and
the spin controls content will be selected on TAB key.
2019-11-01 00:27:43 +07:00
Ilya Sinitsyn
1b6dc0a2fb Add MSWGetFocusHWND to allow focus a subwindow
Under MSW allow override which subwindow will be focused for composite
windows which are implemented not as a set of wxControl (i.e. using only
Windows native controls).
2019-11-01 00:19:53 +07:00
Vadim Zeitlin
d7a640933d Remove wxUSE_WCHAR_T, it must always be 1 anyhow
This is not really an option as building requires it to be 1, so don't
make it one in setup.h/configure/cmake and just hardcode it as 1 for
compatibility.

Closes #18558.
2019-10-31 02:16:19 +01:00
Vadim Zeitlin
349e73994b Merge branch 'dpi-awareness-option' of https://github.com/MaartenBent/wxWidgets
Add wxUSE_DPI_AWARE_MANIFEST option allowing to choose to use a manifest
specifying per-monitor DPI awareness.

See https://github.com/wxWidgets/wxWidgets/pull/1622
2019-10-30 21:25:45 +01:00
Maarten Bent
d0b26a90ff Resolve -Wdeprecated-copy warning in wxDataFormat
Implicitly-declared 'constexpr wxDataFormat::wxDataFormat(const wxDataFormat&)'
is deprecated because 'wxDataFormat' has user-provided
'wxDataFormat& wxDataFormat::operator=(const wxDataFormat&)'.
2019-10-29 23:49:51 +01:00
Maarten Bent
6f02c3a897 Add DPI Awareness option to CMake
For VS solutions, the DPI aware manifest is added as additional manifest.
For makefiles, the DPI aware manifest is included via the resource file.

Set the default DPI Awareness to per-monitor.
2019-10-29 23:49:36 +01:00
Artur Wieczorek
9e4d28ba7f Fix names of wxDirProperty ctor parameters
First two paramaters of ctors of wxPGProperty and its derivates are named
'label' and 'name' so wxDirProperty ctor should conform to this convention.

Close #18547.
2019-10-29 23:34:37 +01:00
Vadim Zeitlin
0a02f4c190 Increment version number to 3.1.4
Done by running misc/scripts/inc_release, manually updating version.bkl,
rebaking and rerunning autoconf.

Also a header for the next version to the change log.
2019-10-28 14:11:00 +01:00
Vadim Zeitlin
67739303fd Don't force wxAuiToolBar size to be less than its parent
This results in the toolbar being too small to show any items in it
in wxGTK and wxOSX, because the parent window size is still the default
small one and not the actual size it will be when shown, when the size
of the toolbar is first set.

And it seems completely unnecessary to do this anyhow, as toolbar is
resized by wxAuiManager in any case.

Closes #18218.
2019-10-27 17:41:05 +01:00
Vadim Zeitlin
d38d8f4f9c Remove Carbon-specific code from wxScreenDC implementation
Carbon is not supported any more and defining m_overlayWindow, which was
only used by Carbon code, resulted in "unused private variable" warning
from clang.
2019-10-27 01:44:29 +02:00
Vadim Zeitlin
87bba02fef Stop handling performKeyEquivalent: in wxOSX
We can't handle the accelerators (known as "key equivalents" in Cocoa)
in this function because it is called for the views in top to bottom
order, while wx semantics is for accelerators to be handled in the
accelerator table closest to the focused window.

So just remove this code and rely on accelerator handling happening in
wxWindowMac::OSXHandleKeyEvent() instead.

Closes #13937.
2019-10-27 00:02:29 +02:00
Vadim Zeitlin
198a4e97a0 Fix wrongly cached state of children focusability under Mac
Remove caching of whether any of the children accept focus in
wxControlContainer as it can change at any moment under Mac, due to full
keyboard access being turned on and off (which can be done using
Ctrl-F7, i.e. easily, and so this might be something users actually do
and not just a theoretical edge case). This also incidentally fixes
caching of the wrong focusability state during window initialization,
when its children are not yet shown, as [NSView canBecomeKeyView:] used
for AcceptsFocusFromKeyboard() implementation under Mac, apparently
always returns false for hidden windows.

The behaviour under the other platforms should remain the same, but
AcceptsFocus() is slower now as it always has to query children instead
of being able to avoid doing it when we know that none of them accepts
focus anyhow. OTOH this only happens to the windows that don't accept
focus themselves and, at least at some moment, don't have any children
accepting focus neither, which should be quite rare and optimizing this
case doesn't seem to be worth the extra code complexity due to extra
preprocessor platform checks.

Closes #18089.
2019-10-26 02:58:29 +02:00
Vadim Zeitlin
6d1b6c71c4 Fix wxUpdateUIEvent prcoessing for standard menu items under Mac
Handle these events in the menu itself first, then the window and only
then at the application level instead of falling back on the application
before searching the window for the handler.

This requires using the logic already present in the base class
DoProcessEvent() method, so make it protected to allow reuse.

Closes #4769.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
288b570e11 Don't account for size grip under platforms not showing it
Size grip in generic wxStatusBar is only supported in wxGTK as it's
drawn using GTK functions, but this is not really a problem as other
platforms either use native implementations (MSW, Qt) or shouldn't show
size grip anyhow as it looks non-native (Mac).

So just ensure we don't leave space for the grip if it's not shown,
correcting the change of 6c1b2b23cf.

Closes #18469.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
b8c9e6754d Merge branch 'msvc-warns'
Fix an annoying MSVC warning in SDK headers.

Remove wxUSE_IOSTREAMH.

See https://github.com/wxWidgets/wxWidgets/pull/1614
2019-10-23 19:50:14 +02:00
Stefan Csomor
235e61c311 Implement macOS-specific wxDataViewCheckIconTextRenderer
This implementation suffers at least from 2 problems:

1. It doesn't support icons at all.
2. It toggles the checkbox when clicking on the text and not just on the
   checkbox itself, as would be expected.

but it's still better than the current version which simply doesn't work
at all, i.e. can't be toggled in any way (and also doesn't draw itself
correctly when using dark mode under macOS 10.14+), so use it for now.

A better solution would be to fix the problem with ActivateCell() not
working at all (see #17746) and update the code to respect drawing in
dark mode.

Closes #17473.

Closes https://github.com/wxWidgets/wxWidgets/pull/904
2019-10-21 21:14:54 +02:00
Vadim Zeitlin
ad6799f249 Merge branch 'grid-uitests-gtk'
Fixes to wxUIActionSimulator allowing the tests using it to work for
wxGrid in wxGTK.

And some improvements and bug fixes to wxGrid itself.

Closes https://github.com/wxWidgets/wxWidgets/pull/1609
2019-10-21 21:12:01 +02:00
Vadim Zeitlin
271711b030 Get rid of spurious warning in CRT malloc.h with MSVS 2017
Recent MSVS 2017 versions (15.9.x) as well as MSVS 2019 give warning
C4548 about "expression before comma having no effect" when including
standard CRT headers.

This happens because when building projects targeting 8.1 SDK, as the
IDE uses the hard coded 10.0.240.0 version of UCRT headers in this case
(see \Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props), and the
headers in this version haven't been, and will never be, updated to
avoid this warning, as was done in later 10.0.x UCRT versions.

Fix this by explicitly disabling the warning in wx/beforestd.h, as even
setting the warning level to 1 for the standard headers somehow isn't
enough to suppress it if it's enabled.
2019-10-21 20:52:49 +02:00
Vadim Zeitlin
fc711f869f Remove obsolete wxUSE_IOSTREAMH option
This is always 0 for any still supported compiler, so remove the option
and configure checks for it.

Still define it as 0 for compatibility, just in case it's used outside
of the library.
2019-10-21 20:46:21 +02:00
Vadim Zeitlin
416fc8582d Remove unused code inside MSVC 6 version checks
We don't support MSVC 6 (__VISUALC__ == 1200) or eVC (1201) since more
than 5 years (see f4b80e5337), so it's
useless to keep code compiled only when this compiler is used.
2019-10-21 20:36:08 +02:00
Vadim Zeitlin
4fac71fc29 Merge branch 'per-monitor-dpi-aware-controls-3' of https://github.com/MaartenBent/wxWidgets
Add, or improve, per-monitor DPI awareness to/for more controls.

See https://github.com/wxWidgets/wxWidgets/pull/1589
2019-10-19 20:10:05 +02:00
Artur Wieczorek
bae8bb4c45 Optimize drawing horizontal/vertical lines
On DC with a non-rotated coordinate system drawing a filled rectangle with ExtTextOut() Win API is faster than drawing a line with MoveTo()/LineTo() so on such DCs we can use ExtTextOut() to draw horizontal/vertical lines with solid colors and square ends instead of calling MoveTo()/LineTo().

See #18517.
2019-10-18 18:06:12 +02:00
Vadim Zeitlin
b4dee76b4c Set focus to the main grid window in wxGrid::SetFocus()
After changing wxGrid to not inherit from wxPanel, this needs to be done
explicitly now.
2019-10-18 04:00:46 +02:00
Vadim Zeitlin
38247f596c Remove wrong wxGrid::GetMainWindowOfCompositeControl() override
This method is supposed to be overridden in the sub-windows of a
composite control (and is indeed correctly implemented in
wxGridSubwindow), but it doesn't make any sense to implement it in the
parent window itself.

This method was probably never executed (which is how the problem went
unnoticed for 10+ years since 760be3f7cb),
but it's still wrong to define it here, so remove it.
2019-10-18 04:00:46 +02:00
Vadim Zeitlin
9a424602e4 Stop deriving wxGrid from wxPanel
This is unnecessary as TAB navigation is not supposed to work between
wxGrid children and actually harmful as this resulted in SetFocus()
doing nothing, instead of setting focus to wxGridWindow, if the focus
was on wxGrid itself for some reason (this happened at least in the grid
unit tests and resulted in failures because the in-place editor didn't
appear as expected).
2019-10-18 04:00:46 +02:00
Vadim Zeitlin
ad7fb7f4aa Merge branch 'warnings' of https://github.com/catalinr/wxWidgets
Fix MSVS analyzer warnings about int multiplication overflow and
uninitialized member variables.

See https://github.com/wxWidgets/wxWidgets/pull/1606
2019-10-15 22:50:17 +02:00
catalinr
67dd28619f Cast more int vars to double to avoid overflow warning 2019-10-14 22:20:37 +03:00
catalinr
62981e1561 Move member initialization in default ctor 2019-10-14 21:34:00 +03:00
Paul Cornett
2ece977ed7 Add copy ctor for wxUniCharRef
It just does the default, but C++11 deprecates having copy assignment operator
without copy ctor. Eliminates many GCC -Wdeprecated-copy warnings.
2019-10-14 09:08:13 -07:00
Paul Cornett
a3598ba33f Remove unnecessary copy ctors/copy assignment operators
C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
2019-10-14 09:07:21 -07:00
Paul Cornett
764c01832d Use C++11 member-delete in NO_COPY_CLASS/NO_ASSIGN_CLASS macros 2019-10-14 09:06:48 -07:00
catalinr
0508764973 Initialize isLSB to avoid warning 2019-10-14 08:10:41 +03:00
catalinr
2fc569f0c2 Initialize member variables to avoid warnings 2019-10-14 08:09:47 +03:00
catalinr
c150ece20f Cast int to double to avoid arithmetic overflow warning 2019-10-14 07:49:28 +03:00
Maarten Bent
05e0fad687 Resolve some recently introduced warnings 2019-10-13 08:34:30 -07:00
Paul Cornett
0cced058d8 Fix linking when wxUSE_VALIDATORS==0
The changes from 25e9be6873 don't work, at least with GCC 9, as the compiler
seems to be removing the definition of the wxDefaultValidator variable.
2019-10-12 09:18:19 -07:00
Vadim Zeitlin
9e2ff111a4 Restore, but deprecate, default ctor of wxTimerEvent
Apparently some existing code still used it, even though it only created
an object that could never be used for anything, so undo its removal in
bd09b4132d and deprecate it instead.

Unfortunately, this also requires changing wxTimerEvent::m_timer type
back to pointer, even though it should be a reference.
2019-10-11 19:22:55 +02:00
Vadim Zeitlin
a668db8b64 Do nothing in wxListCtrl::SetDoubleBuffered() in wxMSW
Setting WS_EX_COMPOSITED, as the base class version does, just results
in visual artefacts and is useless, as we turn on LVS_EX_DOUBLEBUFFER
already, if it's supported, anyhow.

So don't break the display if people call SetDoubleBuffered() in the
mistaken belief that it does something useful in this case.
2019-10-11 15:34:49 +02:00