Commit Graph

18684 Commits

Author SHA1 Message Date
Stefan Csomor
31c7073571 macOS: silence warning in non-ARC build
see f1aa3c1c9a
2019-12-05 20:36:29 +01:00
Vadim Zeitlin
462e7b7732 Avoid using invalid index in wxDisplayFactory under Mac
Partially work around currently unimplemented cache invalidation in
wxMac and do it on the fly if an invalid index is passed to
GetDisplay() to at least avoid crashing, even if this doesn't fully
solve the problem, e.g. we still can use stale information.

Closes #18607.
2019-12-04 19:22:07 +01:00
Vadim Zeitlin
7849d231d9 Merge branch 'build-option-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous build options fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1661
2019-12-03 02:27:52 +01:00
Vadim Zeitlin
00a56a28b6 Merge branch 'sock-event-fix'
Fix unwanted (and sometimes fatal) socket events for blocking sockets
under Unix.

See https://github.com/wxWidgets/wxWidgets/pull/1658
2019-12-03 02:25:18 +01:00
Vadim Zeitlin
14cfc2c2b2 Avoid clang -Wnon-virtual-dtor without triggering MSVC warnings
The change of 4990515aba resulted in
(disabled by default, but which may be enabled when building
applications using wxWidgets) MSVS 2017 warning C4265 ('class' : class
has virtual functions, but destructor is not virtual), so test for clang
explicitly instead of just testing for non-gcc.
2019-12-02 22:35:36 +01:00
Vadim Zeitlin
36546b6f3f Merge branch 'grid-editors-placement'
Fix positions of the checkboxes drawn by wxGridCellBoolRenderer and
shown by wxGridCellBoolEditor so that there is no jump when starting or
stopping to edit grid cells with boolean values.

See https://github.com/wxWidgets/wxWidgets/pull/1662
2019-11-29 16:24:07 +01:00
Vadim Zeitlin
abc8841f0b Use default wxCheckBox size in wxGridCellBoolEditor
Using wxRendererNative::GetCheckBoxSize() as the size of wxCheckBox just
doesn't work with GTK 3, as the control has additional padding between
its actual contents and the focus rectangle, which means that its actual
size must be greater than the size to be passed to DrawCheckBox() in
order to draw a checkbox of the same size.

However it isn't really necessary to resize wxCheckBox at all, it's
enough for DrawCheckBox() to produce a check mark of the same size as
that shown in a default-sized wxCheckBox and this does work in wxGTK.

So keep the default size of wxCheckBox to make everything work.

This means wxGetGridCheckBoxRect() is not useful any more, so replace it
with wxGetContentRect() which just positions a rectangle of the given
size inside another one (this should probably be moved somewhere else,
as it's more general than wxGrid).
2019-11-29 04:57:59 +01:00
Maarten Bent
51254a148e Make wxSVGFileDC an abstract class 2019-11-29 01:10:43 +01:00
Maarten Bent
c6ce2a77bf Fix wxEditorDialogProperty type declaration 2019-11-29 00:23:26 +01:00
Vadim Zeitlin
2eb312b5f9 Avoid changing checkbox background in wxGrid under non-MSW
Doing this makes the checkbox unusable with the default GTK 3 theme as
the default grid background colour (white) is the same as the colour of
the check mark -- so changing the checkbox background to it makes it
invisible.

Work around this by adding a new SetTransparentPartColour() method that
can be used by wxGrid (and, in the future, user code if we decide that
this is really the best solution to this problem that we can provide) to
make the checkbox blend in with its background without actually changing
its appearance.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
851d11ba2c Determine the checkbox size in wxGetGridCheckBoxRect() itself
It doesn't make much sense to pass the size to the function supposed to
compute it, so call wxRendererNative::GetCheckBoxSize() from the
function itself instead of forcing its callers to do it.

No real changes.
2019-11-28 02:14:50 +01:00
Ilya Sinitsyn
3ca9491c5f Improve grid editors placing
Remove the code in wxGrid::ShowCellEditControl() which moves grid
editors unnecessarily and also remove workarounds that were required
because of it in the editors SetSize() functions.

This helps to ensure that the editor is placed at the same position the
renderer draws the cell value, so that it doesn't jump around annoyingly
when editing starts (which was especially noticeable for boolean-valued
cells).
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
6a21d6f2e4 Add missing required header to wx/generic/private/grid.h
Make this header self-sufficient, instead of requiring wx/headerctrl.h
to be included before including it.

Remove the now unnecessary wx/headerctrl.h inclusion from
src/generic/grideditors.cpp.
2019-11-28 02:14:50 +01:00
Ilya Sinitsyn
53ffbf6cf5 Allow ignoring margins in wxRendererNative::GetCheckBoxSize()
Add ability to get the size of the checkbox without any margins by
passing wxCONTROL_CELL flag: this can be useful when the checkbox is
part of some "cell", e.g. wxGrid one, and doesn't need any extra margins
around it.

Currently wxCONTROL_CELL is only really used by wxGTK2 implementation.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
4ca327b50a Declare AddTreeviewHeaderButton() only when it's defined
This method of wxGtkStyleContext uses a GTK function only available
since 3.20, and so can't be implemented for the earlier versions, hence
don't even define it in this case.

Note that the caller still needs to test for the run-time version.
2019-11-27 23:23:57 +01:00
Maarten Bent
5fefe1df11 wxUSE_ACCESSIBILITY requires wxUSE_OLE 2019-11-27 21:24:33 +01:00
Paul Cornett
ae7fcc440c Use C++11 default copy ctor for wxUniCharRef
It's a little simpler, and still suppresses -Wdeprecated-copy warnings
2019-11-25 21:27:09 -08:00
Paul Cornett
4990515aba Avoid clang-cl -Wnon-virtual-dtor warning
Extend the existing workaround to all compilers, not just GCC
2019-11-25 21:16:00 -08:00
Paul Cornett
ef99c2a6db Avoid warning from clang-cl about unrecognized pragma 2019-11-25 21:05:35 -08:00
Vadim Zeitlin
d51a9f9686 Use "wxWidgets application" in the manifests descriptions
We don't use "wxWindows" since many years.
2019-11-22 15:21:15 +01:00
GH Cao
c0c2260944 Add MSW manifests for ARM and ARM64 platforms
Closes https://github.com/wxWidgets/wxWidgets/pull/1657
2019-11-22 15:17:40 +01:00
Vadim Zeitlin
73f0c9dff8 Fix crash with blocking accepting sockets in threads under Unix
Sockets returned by wxSocket::Accept() are non-blocking by default and
the only way to use them safely in worker threads is by switching them
to the blocking mode by calling SetFlags(wxSOCKET_BLOCK).

However this didn't work correctly since at least 2.8 days, as turning
wxSOCKET_BLOCK on didn't unregister the socket from the event loop, with
which it had been registered on creation. Fix this by doing this now,
which ensures that the main thread doesn't get any notifications about
the socket if it's used, in a blocking way, in a worker thread.

Note that making the new socket blocking after accpeting is still pretty
inefficient and pre-creating the socket as blocking and using
AcceptWith() is still preferable, but at least it does work now.

Closes #12886.
2019-11-20 20:21:25 +01:00
Vadim Zeitlin
51ea713826 Extend and rename wxSocketImpl::UnblockAndRegisterWithEventLoop()
In addition to unblocking and registering the socket, also support using
this function to make the socket blocking and unregistering it from the
event loop, if its flags include wxSOCKET_BLOCK.

This was already half-done by wxMSW, which took wxSOCKET_BLOCK presence
into account in its implementation, but not by the Unix implementation.
Now do it under all platforms, as this will be useful for switching a
previously non-blocking socket to blocking mode.

Finally, rename the function to better reflect what it really does.

See #12886.
2019-11-20 18:59:51 +01:00
Vadim Zeitlin
e0102c2396 Allow disabling events for blocking sockets in Unix version
It should still be possible to use DoEnableEvents() to disable events
for blocking sockets and this can be useful if a previously non-blocking
socket became blocking due to a SetFlags(wxSOCKET_BLOCK) call, so adjust
the fix of e18c8fd29a (see #17031) to
avoid calling EnableEvents() for blocking sockets instead of ignoring
them in DoEnableEvents() itself.

Also add an assert checking that we never try enabling events for
blocking sockets as this still doesn't make sense and so shouldn't
happen.

No real changes yet, but this is necessary for the upcoming commits.

See #12886.
2019-11-20 18:47:09 +01:00
Vadim Zeitlin
5cf9c735cb Handle taskbar updates not removing notification icons from it
Fix bug with not being able to update wxTaskBarIcon under MSW after a
DPI scale change or [dis]connection of another monitor using different
DPI: this resulted in "TaskbarCreated" message being sent by the system,
which we handled by trying to create the taskbar icon again. However in
this case, recreating it failed, presumably because it still existed, as
modifying the existing icon still worked.

Change the handle of "TaskbarCreated" to try both adding and updating
the icon, as it seems that we can't be sure whether we still have it or
not when we get this message.

Refactor the existing code to specify the operation to perform when
calling the new DoSetIcon(). This actually makes things slightly simpler
for it, as it doesn't need to update m_iconAdded inside it any more.

Closes #18588.
2019-11-18 19:14:38 +01:00
Vadim Zeitlin
8005c59615 Stop truncating all wxString::Printf() arguments to 65535 chars
There is absolutely no good reason to do it and it resulted in
silently truncating all the string formatted using "%s" to their first
65535 characters when using our wxPrintf() implementation.

Closes #18586.
2019-11-17 18:30:33 +01:00
Vadim Zeitlin
428d47f534 Merge branch 'wxwebviewieimpl' of https://github.com/MaartenBent/wxWidgets
Actually allow using wxWebVieWIE-specific methods for setting the
emulation level.

Make it possible to include wx/msw/webvieW_ie.h by removing inclusion of
the private headers from it, which was in turn achieved by moving all
the implementation details into a private class.

See https://github.com/wxWidgets/wxWidgets/pull/1647
2019-11-14 17:26:00 +01:00
Vadim Zeitlin
2da8426ed6 Merge branch 'gtk-spin-width-from-text'
Fixes for wxSpinCtrl::GetSizeFromTextSize() and best size in wxGTK.

Closes #18568.

See https://github.com/wxWidgets/wxWidgets/pull/1645
2019-11-14 16:07:05 +01:00
Maarten Bent
e67c814765 Make webview_missing.h a private header 2019-11-14 00:04:56 +01:00
Maarten Bent
67ace7b243 Move wxWebViewIE classes to private header
Cleanup includes.
2019-11-13 23:56:40 +01:00
Maarten Bent
7e682a09d6 Add wxWebViewIEImpl class for all private wxWebViewIE members and functions
Move wxWebViewIE::Find implementation to wxWebViewIEImpl because it has a lot
of member accesses.
2019-11-13 23:46:13 +01:00
Vadim Zeitlin
9b43bd8af2 Merge branch 'dpi-textctrl' of https://github.com/MaartenBent/wxWidgets
Improvements for wxTextCtrl, wxSearchCtrl, wxButton when using
non-default DPI.

See https://github.com/wxWidgets/wxWidgets/pull/1634
2019-11-13 15:47:59 +01:00
Vadim Zeitlin
7f368872d7 Adjust entry width of wxSpinCtrl in wxGTK to its range
Ensure that the entry is always (just) big enough to show any value
valid in this spin control.

This also ensures that GetBestSize() doesn't need to be overridden to
use GetSizeFromTextSize() any longer as the best size will be determined
correctly by GTK itself.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
b891ffe8d0 Factor out another wxSpinCtrl helper for getting its max length
This will be used in wxGTK implementation.

For now no real changes yet.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
eb3d8395c2 Rename wxSpinCtrl helper functions
Put them in wxSpinCtrlImpl namespace and remove "wxSpinCtrl" prefix from
the function names themselves, this was ugly.

No real changes.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
4444694043 Move private wxSpinCtrl helpers into a private header
Np real changes, just don't put these functions in the public
wx/spinctrl.h, they have nothing to do there.
2019-11-13 02:59:42 +01:00
Stefan Csomor
f1aa3c1c9a add bridging info for apps using ARC
this is not wx building with -fobjc-arc but for apps using wx
2019-11-12 15:03:03 +01:00
Paul Cornett
df9f4af357 Improve our estimate of GtkEntry margins
For GTK2, get the "inner border" the same way GTK does it. And for GTK3,
provide an actual implementation. Also, don't return a wxPoint for a size.
See #18567
2019-11-11 08:29:28 -08:00
Vadim Zeitlin
0b16b4f439 Merge branch 'primary-display'
Handle the situation when primary display is not the first one.

See https://github.com/wxWidgets/wxWidgets/pull/1641
2019-11-10 00:39:14 +01:00
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
Maarten Bent
57d054cf95 Fix font size of rich wxTextCtrl when created on display with non-system DPI
Apply a zoom factor based on the active DPI and the system DPI. On the first
DPI change, revert the scaling factor.
2019-11-08 20:46:47 +01: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
d8cd02b480 Create primary monitor when using wxDisplay default ctor
Previously, the first monitor was created instead and while it was often
also the primary one, this wasn't always the case.

In particular, this makes wxGetDisplayPPI() always return something
reasonable instead of returning (0, 0) when the first monitor is not the
primary one, as expected by plenty of code, including our own printing
sample, which divides by the values returned from wxGetDisplayPPI()
without checking if they're zero.
2019-11-08 00:26:20 +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
Maarten Bent
82668e1e85 Remove FromDIP in wxGetEditHeightFromCharHeight
This caused wxTextCtrl to become to high at higher DPI.

It was added to fix appearance of wxSearchCtrl at high DPI. Remove an unneeded
FromDIP there too, so it gets the same height as a normal wxTextCtrl.
And centre the textctrl inside the searchctrl.
2019-11-03 21:50:24 +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
Vadim Zeitlin
9e8352b5cb Document in comments that wxAuiToolBarArt element sizes use DIPs
This is not as good as relying on the type system, but better than
nothing.
2019-10-10 14:00:51 +02:00
Vadim Zeitlin
cc7c0bbd9c Merge branch 'msw-richedit-paste'
Fix pasting long strings into wxTextCtrl in wxMSW.
2019-10-10 13:56:00 +02:00
Maarten Bent
c538e8f9d6 Add wxGraphicsRenderer::CreateFontAtDPI to support font with fractional pixel-size 2019-10-09 22:24:28 +02:00
Vadim Zeitlin
efc2a9da2d Fix pasting long strings in wxTextCtrl under MSW
Adjust the length limit before pasting to ensure that all text on
clipboard will be successfully pasted, instead of only pasting the part
of it which fits.

Add a unit test checking that this works.

Closes #4646.
2019-10-09 14:40:53 +02:00
Vadim Zeitlin
612634fffd Merge branch 'spinctrl-fixes'
Various improvements to wxSpinCtrl and wxGridCellNumberEditor, using it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1588
2019-10-09 01:52:10 +02:00
Ilya Sinitsyn
8dadc2e68c Improve wxGridCellNumberEditor placement in the grid
Use the best height and don't let the editor be smaller then min size.
Also align center vertically.
2019-10-09 01:44:32 +02:00
Ilya Sinitsyn
1be43ed67b Improve best size determination for wxSpinCtrl
Use the range and the base to determine the widest value string and use
it to calculate the best size.
2019-10-09 01:44:13 +02:00
Ilya Sinitsyn
9ef1b1529d Add wxControl::GetSizeFromText() helper function
Add the helper function that combines GetSizeFromTextSize() and
GetTextExtent() as they are often used together.
2019-10-09 01:43:50 +02:00
Olly Betts
e2b4cd9f77 Fix typos in comments and assertion messages
Closes https://github.com/wxWidgets/wxWidgets/pull/1596
2019-10-08 23:30:22 +02:00
Stefan Csomor
f83577df45
Changing datatransfer implementation from CFPasteboard to NSPasteboard API (#1264)
* changing datatransfer from CFPasteboard to NSPasteboard API

* factoring and cleaning up

* Switching back naming

* missed file

* getting wxCFStringRef to be independent of system headers

* add unichar include

* using wxCFStringRef in header

* moving to private headers, change method name

* adapting to lesser content in cfstring.h

* Removing malloc/free usage

* use wxScopedArray throughout

* using wxMemoryBuffer instead of char[]

* fixing nonprecomp headers

* missing forward decl in non-precomp builds
2019-10-08 06:32:44 +02:00
Vadim Zeitlin
654bfaea31 Add wxListCtrl::IsEmpty()
Add a simple accessor for consistency with the other controls.
2019-10-08 01:20:44 +02:00
Vadim Zeitlin
f95ce8d9d5 Add wxListCtrlBase::GetItemCount() pure virtual
No real changes, just ensure that all derived classes implement this
method (which already was the case).
2019-10-08 01:16:50 +02:00
Vadim Zeitlin
30dabbdf69 Merge branch 'grid-native-header-autosize'
Fixes for auto-sizing grid columns when using native header control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1579
2019-10-07 22:26:02 +02:00
Ilya Sinitsyn
b2194d9ad5 Fix the native header column minimal width determination
wxGrid::AutoSizeColumn can set per column minimal width and this values
must be used for native headers columns.
2019-10-07 22:25:10 +02:00
Ilya Sinitsyn
8971321542 Send the autosize column event for grid native header columns
Send wxEVT_GRID_COL_AUTO_SIZE on double clicking on a separator line of
the grid native header to allow override default behaviour.
2019-10-07 22:25:10 +02:00
Maarten Bent
87a97054f2 Allow to retrieve the wxWindow associated with a wxBufferedPaintDC
When a wxBufferedPaintDC is created, the base classes does not initialize the
m_window variable with the used wxWindow. Only the associated m_paintdc
initializes this variable. Add a protected function that allows to set the
wxWindow of a wxDC so GetWindow() will return the window.

This fixes the font size of custom attributes in wxDataViewCtrl when the DPI
changes.
2019-10-07 00:54:59 +02:00
Maarten Bent
a1c3fa0468 Fix wxPropertyGrid row height on DPI change
Fix collapse button size of wxPropertyGrid in High DPI.
2019-10-07 00:54:59 +02:00
Maarten Bent
62c5b2d8d1 Support DPI change in wxStyledTextCtrl
Change to zoom-level and margin width based on the active DPI.
Send wxDPIChangedEvent to all controls and windows.
2019-10-07 00:54:58 +02:00
Vadim Zeitlin
2c604863de Fix compilation after fpos_t change in with MinGW runtime 5.2
fpos_t is now a union and not just a simple typedef any more, so we
can't cast between it and long long. Unfortunately we still need to
convert between the two, so add an explicit version check and use the
private union field to make this work with the latest MinGW 32 versions.
2019-10-06 00:17:57 +02:00
Vadim Zeitlin
4c517dea40 Merge branch 'qt_clipboard_bitmap' of https://github.com/GeoTeric/wxWidgets
Implement copying bitmap to clipboard for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1368
2019-10-05 15:04:47 +02:00
Vadim Zeitlin
4a1b1b6373 Merge branch 'fix-html-selection'
Improvements to wxHtmlWindow selection handling: use inactive background
for it when the window doesn't have focus; allow copying it with
Ctrl-Ins and fix annoying changes in layout while selecting.

Closes https://github.com/vadz/wxWidgets/pull/12
2019-10-05 14:58:38 +02:00
Pavel Kalugin
a7dc1c0e0f Fix text jumps during selection dragging on MSW
When selecting the text in wxHtmlWindow by dragging the mouse the text
to the right of the selection sometimes jumps horizontally. This happens
only on MSW and only for TrueType fonts. The reason is that
wxDC::GetPartialTextExtents() and wxDC::GetTextExtent() give different
results if the text contains characters with underhangs or overhangs.

Fix this by caching results of wxDC::GetPartialTextExtents() and using
them instead of calling wxDC::GetTextExtent().
2019-10-05 14:56:46 +02:00
Pavel Kalugin
65771f685b Add wxHtmlCell::GetRect() 2019-10-05 14:56:46 +02:00
Pavel Kalugin
3db142e58f Redraw selection in wxHtmlWindow on focus event 2019-10-05 14:56:46 +02:00
Pavel Kalugin
ef524931cc Fix selection background colour in wxHtmlWindow
Use inactive selection colour when the window doesn't have focus.
2019-10-05 14:56:46 +02:00
Vadim Zeitlin
c30daf10cc Explicitly cast -1 to fpos_t in our wxFtell() definition
Apparently in at least some gcc versions fpos_t is not the same thing as
long long int, resulting in compilation problems due to using different
types for the ternary operator arguments.
2019-10-05 14:43:06 +02:00
Robin Dunn
c49672691e CanHideColumns should be const 2019-10-04 16:36:10 -07:00
Vadim Zeitlin
878eb6af87 Remove unused return value of wxDataViewColumn::WXUpdateWidth()
The return value was never used, so just don't bother returning it.

No real changes.
2019-10-03 02:11:44 +02:00
Vadim Zeitlin
0c90ea40c3 Don't auto-resize wxDataViewCtrl columns below their initial size
It's unexpected that decreasing the width of the control makes the last
column diminish in size until nothing (at least if it's minimum size was
not set), instead of showing horizontal scrollbar, so prevent this from
happening by considering the initial column width as being "manually
set", which prevents the code from making the column narrower than it
automatically.

This seems to make sense and is consistent with the handling of initial
size, which becomes "best", and hence "minimal", size of the control,
for wxWindow.

Closes #18343.
2019-10-03 02:04:36 +02:00
Artur Wieczorek
42ed52aec8 Don't use void for functions without arguments 2019-10-02 20:40:51 +02:00
Matthew Griffin
5c169c0cf2 Update function names, indentation and added comments 2019-10-02 15:40:16 +01:00
Matthew Griffin
531e988e5d Refactor to do custom qt clipboard actions without dynamic cast 2019-10-02 13:22:16 +01:00
Artur Wieczorek
a771da5623 Don’t use void for functions without arguments 2019-10-02 00:54:14 +02:00
Vadim Zeitlin
43e1066f10 Merge branch 'collpane-bestsize'
Fix generic collapsible pane best size determination.

See https://github.com/wxWidgets/wxWidgets/pull/1580
2019-10-01 20:28:21 +02:00
Vadim Zeitlin
ef7ab73206 Fix wxGenericCollapsiblePane best size calculation
DoGetBestSize() actually calculated the best client size and not the
full size, as it didn't take the pane border into account.

Fix this in the simplest possible way, by just renaming the function to
DoGetBestClientSize() instead.

This ensures that the pane is actually big enough to show its contents,
without cutting off the text shown in its header.

Closes #18515.
2019-09-30 23:36:58 +02:00
Vadim Zeitlin
0c1c13883c Merge branch 'per-monitor-dpi-aware-controls-2'
Improve Per-Monitor DPI awareness in more controls.

See https://github.com/wxWidgets/wxWidgets/pull/1572
2019-09-29 23:23:57 +02:00
Artur Wieczorek
90e4ceb1c6 Make wxMask::GetBitmap a public function
According to the documentation this function should be declared as public,
not protected.
2019-09-29 20:19:10 +02:00
Maarten Bent
2b41ba2702 Apply review comments 2019-09-29 19:30:39 +02:00
Artur Wieczorek
ac9c4d06e2 Fix creating wxMask image from raw data
In the function wxMask::OSXCreate() to create a mask image, data copying
from the supplied memory buffer was not actually implemented and therefore
created mask was invalid.

Closes #18513.
2019-09-29 16:21:45 +02:00
Maarten Bent
017978a139 Fix font of custom attributes in wxTreeCtrl on DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
b075465645 Fix wxSearchCtrl buttons on DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
2c6d132efe Resize wxListCtrl columns on DPI change
Fix font of custom attributes in wxListCtrl on DPI change.
2019-09-28 23:37:01 +02:00
Maarten Bent
56fab0aabb Improve wxDataView on DPI change
Fix the row heights after a DPI change and adjust the column widths.
Use DPIChangedEvent instead of MSWUpdateFontOnDPIChange because the child
controls (m_clientArea, m_headerArea) need to update their font sizes first.
2019-09-28 23:37:01 +02:00
Maarten Bent
fd2cf1f4e2 Fix wx[Check]ListBox font and margin on DPI change
These control are drawn using a wxDC. When the DPI changes, call SetFont
to update the font of the wxDC. First call wxListBoxBase::SetFont() so
m_font is updated to the new DPI, then use this font in the wxDC.
For wxCheckListBox update the margins to fit the changed checkbox size.
2019-09-28 23:37:01 +02:00
Maarten Bent
123da53306 Fix wxBitmapComboBox size in high DPI
Convert hard-coded sizes to DPI depended size, remove unused size.
Implement MSWUpdateFontOnDPIChange() and update the control elements.
2019-09-28 23:37:01 +02:00
Vadim Zeitlin
37be4adec6 Don't change RICHEDIT control font on DPI change
The control seems to somehow react to DPI changes on its own (which is
rather mysterious as we don't forward WM_DPICHANGED to it, so it's not
really clear how does it do it, but it does) and changing its font is
worse than useless, as it's not just redundant, but also resets all the
styles used inside the control and so is really undesirable.

Hence override the just added MSWUpdateFontOnDPIChange() to do nothing
for rich edit controls, while still updating the font for the plain EDIT
ones (which is required as they don't scale correctly on their own).
2019-09-28 23:37:01 +02:00
Maarten Bent
32aabf7a41 Update font of wxSpinCtrl when DPI changes
Fix position of spin control in wxSpinCtrlDouble after DPI change
The old size of the control was used to determine the position. Use GetBestSize
instead, which will return the correct size.
2019-09-28 23:37:01 +02:00
Maarten Bent
8bff737438 Support DPI change in wxToolBar
Manually resize the embedded controls and Realize the toolbar again.
2019-09-28 23:37:01 +02:00
Maarten Bent
e57139bb21 Use system DPI for some native Windows dialogs
Some native dialogs do not scale correctly (color picker, font picker,
open file with custom controls). ALl other native dialogs do scale correctly
(open file, open directory, find replace, print).

Change the DPI Awareness Context temporarily to SystemAware, so Windows handles
the scaling.
2019-09-28 23:37:01 +02:00
New Pagodi
203074567c Regenerate wxSTC files after recent changes 2019-09-28 00:50:47 -05:00
Vadim Zeitlin
04949050b2 Merge branch 'qt-fixes'
A multitude of miscellaneous Qt fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1552
2019-09-27 19:18:11 +02:00
Vadim Zeitlin
1dfdd93a2a Merge branch 'qt-listctrl'
New version of wxListCtrl for wxQt, supporting virtual list controls,
checkboxes, sorting and with other fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1551
2019-09-27 19:16:56 +02:00
Matthew Griffin
f608b340c2 Send set cursor events whenever there is mouse movement
This is required in order to allow application code to change the cursor
dynamically.

Closes https://github.com/wxWidgets/wxWidgets/pull/1549
2019-09-27 14:00:02 +02:00
Vadim Zeitlin
3a918864f9 Make accelerators work for menu items created in the code too
The previous commit fixed accelerators support in wxQt for the items
created in XRC, but not for those created directly in the code, as
wxMenuItem::SetItemLabel() is not called in this case.

Refactor the code to extract UpdateShortcutsFromLabel() from
SetItemLabel() and call the new function both from there and from
wxMenuItem ctor, to ensure that the accelerators are taken into account
in any case.

This commit is best viewed with "git diff --color-moved".

See https://github.com/wxWidgets/wxWidgets/pull/1544
2019-09-27 13:47:45 +02:00
Matthew Griffin
2c91463c81 Enable mouse tracking on construction of every wxQt widget
Not all controls use wxWindow::Create(), so move setMouseTracking() call
where it is always executed.

Closes https://github.com/wxWidgets/wxWidgets/pull/1528
2019-09-27 13:24:29 +02:00
Ilya Sinitsyn
7f91481294 Add XRC handler for wxInfoBar
Update the schema and the sample to show it in action.

Closes https://github.com/wxWidgets/wxWidgets/pull/1564
2019-09-27 12:57:01 +02:00
Vadim Zeitlin
68b36aed6d Only give messages about unsupported accelerators in wxGTK
Doing this under all platforms results in too many false positives,
which can't be avoided currently, e.g. even if an application uses "Tab"
as an accelerator only under MSW, these messages still appear (in debug
builds, but this is more than sufficient for them to be annoying).

For now, restrict the messages to wxGTK only. In the future we could
revert to giving them under all platforms if we provide some way of
disabling them, e.g. qualifying accelerators with "[port]" or "[!port]"
string before them.

This partially reverts 6596f5a98d, see
https://github.com/wxWidgets/wxWidgets/pull/1505

Closes https://github.com/wxWidgets/wxWidgets/pull/1566
2019-09-27 12:47:03 +02:00
Vadim Zeitlin
b0ff3bf3ea Ensure that wxGrid appearance always reflects its enabled state
Override DoEnable() in wxGrid instead of Enable() to ensure that the
grid is shown appropriately for its current state whenever either it or
its parent is disabled.

Note that this also fixes the bug with only the main grid window being
refreshed, but not the row/column headers, which also need to be.
2019-09-24 01:44:55 +02:00
Graham Dawes
cd7594e639 Don't include scrollbars in client area size
Return the size of just the viewport when using QScrollArea.

Closes https://github.com/wxWidgets/wxWidgets/pull/1418
2019-09-22 02:37:11 +02:00
David Roberts
18b87b2ab5 Send wxEVT_CHECKLISTBOX when a checkbox is clicked
Fix sending events from wxCheckListBox in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1403
2019-09-22 02:30:05 +02:00
Graham Dawes
cc1ec9e562 Show tooltip in wxTreeCtrl when item text doesn't fit on screen
This matches the behaviour of the native control in wxMSW and is
generally useful.

Closes https://github.com/wxWidgets/wxWidgets/pull/1397
2019-09-22 02:12:35 +02:00
Matthew Griffin
9434a443f5 Ensure that QCloseEvents can be vetoed by wx
These events use a different convention from all the other ones in Qt
and need to be ignored, rather than accepted, to prevent the default
action from occurring.

And these events are also sent to disabled windows, which are never
supposed to receive them in wx API.

Closes https://github.com/wxWidgets/wxWidgets/pull/1371
2019-09-22 02:05:32 +02:00
Artur Wieczorek
f7247086c2 Fix storing wxBitmap data in GdkPixbuf
Under wxGTK+2 bitmap data with mask and without it (raw) should be stored
in the separate GdkPixbuf buffers - just like it's done in wxGTK+3. These
two buffers are necessary because only GdkPixbuf with raw bitmap data
(original, non-masked) should be copied when wxBitmapRefData instance is
cloned e.g. in SetMask(). GdkPixbuf with masked data is not copied and is
created on first use in wxBitmap::GetPixbuf().

Closes #18508.
See #18498.
2019-09-18 23:34:35 +02:00
Vadim Zeitlin
bb1c3c4ebb Merge branch 'osx-dvc'
Some wxOSX wxDataViewCtrl fixes OSX.

See https://github.com/wxWidgets/wxWidgets/pull/1556
2019-09-18 14:34:10 +02:00
Vadim Zeitlin
da1944a5cc Merge branch 'grid-autosize-native-header'
Fix auto-sizing column labels when using native header in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/1559
2019-09-18 14:32:02 +02:00
Vadim Zeitlin
8ed487923d Fix QT version in a comment for wxPORT_QT
No real changes.
2019-09-18 02:19:13 +02:00
Ilya Sinitsyn
0766283b2e Add wxHeaderCtrl::GetColumnTitleWidth() overload taking index
This makes it possible to get the appropriate column width from outside
the class, as GetColumn() itself is currently protected and so the
existing overload couldn't easily used.
2019-09-18 01:21:36 +02:00
Ilya Sinitsyn
e26d90028b Allow disabling hiding columns when using wxHeaderCtrl in wxGrid
Add wxGrid::DisableHidingColumns() method which can be used to prevent
wxHeaderCtrl from allowing the user to hide columns interactively, which
is something it allows to do by default, unlike the "built-in" wxGrid
header.

Also add EnableHidingColumns() and CanHideColumns() for consistency with
the other similar methods.

Closes https://github.com/wxWidgets/wxWidgets/pull/1554
2019-09-16 23:32:59 +02:00
Artur Wieczorek
2d15218c9d Fix drawing wxBitmap with both alpha channel and mask
For 32 bpp wxBitmap with both alpha channel and mask we have to apply mask on our own while drawing the bitmap because MaskBlt() API doesn't work properly with 32 bpp RGBA bitmaps. To do so we need to create a temporary bitmap with copy of original RGB data and with alpha channel being a superposition of the original alpha values and the mask.

See #18498.
2019-09-16 18:37:52 +02:00
Vadim Zeitlin
c0df6ec475 Merge two wxDataViewWidgetImpl::Remove() overloads into one
Having 2 different overloads might have been useful for Carbon
implementation, but as they do exactly the same thing in the Cocoa
version, leave only one of them -- and don't pass it the item, or items,
being deleted as they're not used anyhow.

No real changes.
2019-09-16 17:48:00 +02:00
Liam Treacy
4bfb3a5f01 Implement wxFrame::DoSetClientSize()
Resize the central widget to fit the new size.

See https://github.com/wxWidgets/wxWidgets/pull/1340
2019-09-15 01:35:54 +02:00
Vadim Zeitlin
b8d5c85ecb Make Reparent() work for wxFrame in wxQt
Use the correct parent window, i.e. the one of the central widget and
not of the frame itself.
2019-09-15 01:35:54 +02:00
Graham Dawes
7454fc151b Rewrite wxListCtrl to use QTreeView and a custom model
This notably allows to support wxLC_VIRTUAL style.

Also implement support for checkboxes, improve in-place editing and
implement many other methods and missing functionality (e.g. send the
expected events now).

Closes https://github.com/wxWidgets/wxWidgets/pull/1229
2019-09-15 00:14:02 +02:00
Vadim Zeitlin
93815ad2d2 Merge branch 'listctrl-itemrect'
Improve wxListCtrl::GetSubItemRect() and add a unit test for it.

See https://github.com/wxWidgets/wxWidgets/pull/1511
2019-09-14 16:37:57 +02:00
Ilya Sinitsyn
dda6aa6bdc Fix assert with setting current cell in wxGrid::Redimension()
Avoid calling wxGrid::SetCurrentCell(0, 0) when the grid has no columns
or rows, as it doesn't have any cells then and doing this logically
fails the precondition assert in GetColPos().

Also refactor all 6 different snippets calling SetCurrentCell() in
Redimension() into a single function to simplify the code and make it
more maintainable.

Add a unit test verifying that this works as intended.

Closes https://github.com/wxWidgets/wxWidgets/pull/1546
2019-09-13 00:47:48 +02:00
Robin Dunn
41b444e011
Merge pull request #1455 from wxWidgets/gradient-pen
Add support for gradients in wxGraphicsPen
2019-09-11 20:17:34 -07:00
Kvaz1r
3fffc0782c Make wxThread::OnExit() protected rather than private
This allows calling the base class version from the derived classes and
also, at least as importantly, make sure that the function is actually
documented as private functions are not extracted by Doxygen by default.

Closes #16749.

Closes https://github.com/wxWidgets/wxWidgets/pull/1543
2019-09-12 00:55:32 +02:00
Vadim Zeitlin
be53b3fb20 Fix infinite recursion if wxGrid is modified from event handler
Calling wxGrid::{Insert,Delete}{Rows,Cols}() from wxEVT_GRID_CELL_CHANGE
event handler resulted in infinite recursion because it tried to hide
the grid editor control again, which resulted in another CELL_CHANGE
event being generated and so on.

Break this infinite recursion in the usual way, i.e. by updating the
state of wxGrid before invoking the user-defined event handler.

This required separating SaveEditControlValue() in 2 functions, the main
one retaining IsCellEditControlEnabled() check for compatibility, and
the new DoSaveEditControlValue() that can be called even after disabling
the editor.

Closes #2287.

Closes https://github.com/wxWidgets/wxWidgets/pull/1540
2019-09-12 00:53:21 +02:00
Ilya Sinitsyn
e2bd6ec8f7 Fix clearing selection in a grid with reordered columns
Since the changes of 04f7f1fd32 (frozen
rows/columns implementation), RefreshBlock() could call GetColPos() with
an invalid index. This didn't matter most of the time as the function
simply returned the same index as long as the columns were using their
natural order, but resulted in a crash due to an out of bound access to
m_colAt array as soon as they were reordered.

Fix this by avoiding using invalid indices in RefreshBlock() and, more
generally, improving its precondition check and making the assumptions
about the input parameters more clear. Also add a defensive check to
GetColPos() itself.

Finally, add a unit test exercising this code.

Closes https://github.com/wxWidgets/wxWidgets/pull/1536
2019-09-10 19:41:45 +02:00
Kvaz1r
16b08c6ef9 Allow updating wxBusyInfo text while it's shown
Add UpdateText() and UpdateLabel() updating the text (i.e. possibly
containing markup) or the label (just plain text) shown in the window.

Closes #14743.

Closes https://github.com/Kvaz1r/wxWidgets.git BusyInfoUpdateText14743
2019-09-08 23:13:00 +02:00
Vadim Zeitlin
7811d1a833 Merge branch 'per-monitor-dpi-aware-controls-1' of https://github.com/MaartenBent/wxWidgets
Update the font of some buddy controls when the DPI changes. Fix the
position of the statusbar after a DPI change. Add some changes that were
suggested in https://github.com/wxWidgets/wxWidgets/pull/1499 but left
out from it.

Some sizes are cached to improve the speed of the library. These sizes
become incorrect when the DPI changes. And are incorrect when a window
is created on a display with a different DPI. Fix this by checking if
the current DPI is the same as the DPI that was used when calculating
the size, otherwise recalculate the size.

Closes https://github.com/wxWidgets/wxWidgets/pull/1530
2019-09-07 14:57:54 +02:00
Maarten Bent
462f2a4686 Add optional wxWindow parameter to wxButtonBase::GetDefaultSize()
When per-monitor DPI is used, the default button size depends on the DPI of the
display. Use the window to determine this DPI.
2019-09-06 20:59:59 +02:00
Maarten Bent
fa2242a0a6 Reset static sizes when DPI changes 2019-09-06 20:59:59 +02:00
Maarten Bent
e312569b94 Fix wxStatusBar font and position after DPI changes
Update the font of the associated wxDC so ellipsization uses the correct font
size.
2019-09-06 20:59:56 +02:00
Vadim Zeitlin
c12b0e8509 Merge branch 'grid-fixes'
Fixes for wxGrid when using native header control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1529
2019-09-05 23:36:50 +02:00
Maarten Bent
4713301cf5 Fix font and thumb size of wxSlider after DPI change 2019-09-05 23:14:25 +02:00
Maarten Bent
587f894f96 Fix font of wxRadioBox after DPI change 2019-09-05 23:14:25 +02:00
Maarten Bent
13cb9d41d8 Require wxWindow parameter for wxNativeFontInfo constructor in MSW
Use the DPI of the window to determine the correct font pointSize.

To not break user code, add a default argument when not building the library.
2019-09-05 23:14:25 +02:00
Robin Dunn
a8a19e25ee Various typo and coding style fixes 2019-09-05 13:33:15 -07:00
Ilya Sinitsyn
120b33746a Implement scrolling for MSW wxHeaderCtrl correctly
Due to lack of support for horizontal scrolling in the native control,
scrolling it was implementing by offsetting the entire control window.
However this didn't work correctly when the window was not positioned
at the leftmost border of its parent window, as the part of it that was
scrolled off could still be visible in this case, and this is exactly
what happened when the native header was used in wxGrid: scrolling it
overwrote the corner part of wxGrid.

Fix this by embedding the actual native control inside an outer wxWindow,
to ensure that the scrolled off part is clipped by the parent window.

Note that this commit is best viewed with "git show --color-moved" as
most of the code was just moved from the header into the implementation
file and is not really new.
2019-09-05 20:11:09 +02:00
Ilya Sinitsyn
e5d59c6b7f Respect minimum grid column width when using native header too
Override wxHeaderColumn::GetMinWidth() to return the actual minimum
width instead of just returning 0.

Add a unit test verifying that this works as intended.
2019-09-05 20:11:09 +02:00
Robin Dunn
f7896d4dff Use new parameter names in the existing CreateRadialGradientBrush methods too 2019-09-04 14:19:24 -07:00
Robin Dunn
30dfe45759 undo incorrect search/replace 2019-09-04 14:19:24 -07:00
Robin Dunn
80f24d9e74 User more easily understandable names for the radial gradient coordinate parameters in wxGraphicsPenInfo 2019-09-04 14:19:24 -07:00
Robin Dunn
177f5d4f2a tweak comments 2019-09-04 14:19:24 -07:00
Robin Dunn
62ea72e937 Adding a matrix to wxGraphicsPenInfo means the classes need reordered again 2019-09-04 14:19:23 -07:00
Robin Dunn
7c33d3f969 Gradients can have matrix transforms too. Updates for Cairo. 2019-09-04 14:19:23 -07:00
Robin Dunn
e297b5ded9 Deindent inline code blocks 2019-09-04 14:19:23 -07:00
Robin Dunn
7367f1803d Reorder classes a bit to resolve ordering conflicts 2019-09-04 14:19:23 -07:00
Robin Dunn
0265312297 Update include/wx/graphics.h
fix style

Co-Authored-By: VZ <vadim@wxwidgets.org>
2019-09-04 14:19:23 -07:00
Robin Dunn
06bf8e0d41 Update include/wx/graphics.h
fix opening brace style

Co-Authored-By: VZ <vadim@wxwidgets.org>
2019-09-04 14:19:23 -07:00
Robin Dunn
59ce48924a Add gradient pen support for Cairo 2019-09-04 14:19:23 -07:00
Robin Dunn
4708d2539e Add gradient-related attributes to wxGraphicsPenInfo 2019-09-04 14:19:23 -07:00
Paul Cornett
92cbb02e9f Fix erroneous header click event after double click
See #18490
2019-09-04 11:41:28 -07:00
Vadim Zeitlin
417eff2bf8 Add missing wxUSE_MENUS checks to generic MDI classes
Make mdig.cpp compile with wxUSE_MENUS==0, as it already had many
wxUSE_MENUS checks and only missed a few more of them.

See #9626.
2019-08-28 20:11:23 +02:00
Paul Cornett
df450566dd Avoid including X11 headers from <wx/glcanvas.h>
It's generally wxWidgets policy not to include platform-specific headers from our own
to avoid namespace pollution issues, in this case with names like "None" and "Window".
2019-08-28 09:37:49 -07:00
Vadim Zeitlin
20b9964007 Avoid warnings about deprecated wxPG_XXX when building wx itself
Getting the warnings about deprecated macros when building the library
itself is not useful, as it must continue to use them as long as
WXWIN_COMPATIBILITY_3_0 exists.

Closes https://github.com/wxWidgets/wxWidgets/pull/1510
2019-08-27 22:21:01 +02:00
Vadim Zeitlin
32fe124899 Add support for icon/label rectangles to generic wxListCtrl
Honour the value of "code" parameter in GetSubItemRect().
2019-08-27 17:12:14 +02:00