Commit Graph

18607 Commits

Author SHA1 Message Date
Lauri Nurmi
84f7e925e5 Fix wxThread::SetPriority() documentation
The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
2019-12-28 00:06:28 +01:00
Vadim Zeitlin
00d113c341 Fix wxSocketImplUnix compilation under OpenVMS
Don't pass "const void*" pointer to ioctl(), it seems to be declared as
taking "void*" on this platform and so doesn't accept it.
2019-12-19 18:36:22 +01:00
Jouk
d90953d8c6 wxGTK1 : change type of wxMask.GetBitmap() from GdkBitmap* to wxBitmap 2019-12-19 09:20:36 +01:00
Vadim Zeitlin
24042b2a2a Fix build with generic wxDataViewCtrl under Mac
Generic wxDataViewCheckIconTextRenderer is needed under Mac too if the
generic version of wxDVC is used.

Closes #18632.
2019-12-15 16:44:42 +01:00
Vadim Zeitlin
028afa194a Add wxUSE_NATIVE_DATAVIEWCTRL build option
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.

This can, unfortunately, be useful to work around various but multiple
native control limitations.
2019-12-15 16:23:47 +01:00
Vadim Zeitlin
f3217573d7 Merge branch 'rc-manifest' of https://github.com/MaartenBent/wxWidgets
Fix using manifest from rc file with VC compiler.

See https://github.com/wxWidgets/wxWidgets/pull/1678
2019-12-15 03:44:39 +01:00
Maarten Bent
cd1d15351c Fix concatenating manifest name in resource file 2019-12-13 22:21:40 +01:00
Maarten Bent
083f4b3c32 Rename manifests to use underscores 2019-12-13 21:44:26 +01:00
Vadim Zeitlin
7b8cdd441d Return (0, 0) from wxMDIChildFrame::GetPosition() in wxGTK
This makes more sense for a page of a GtkNotebook, which is always
positioned at (0, 0) relative to its client area, and is also more
compatible with wxMSW.

Closes #18548.

Closes https://github.com/wxWidgets/wxWidgets/pull/1670
2019-12-10 22:42:00 +01:00
Ian McInerney
b17aa08c26 Allow automatic OS-provided tabbing to be disabled in wxOSX
macOS 10.12+ implements automatic tabbing in the OS. This adds
entries to the menus and also adds a tab bar. Some applications
might want to disable this, so provide an interface for doing this.

Closes https://github.com/wxWidgets/wxWidgets/pull/1674
2019-12-09 22:46:04 +01:00
Ian McInerney
540fed9216 Implement background color attribute for wxDataViewCtrl in wxOSX
Add support for this attribute for text-like cells to the native macOS
version too, to bring it up to parity with the generic and GTK ones.

Closes https://github.com/wxWidgets/wxWidgets/pull/1673
2019-12-09 22:45:06 +01:00
Paul Kulchenko
1c754fe71c Make wxAuiNotebook wxAuiTabCtrl-related methods public
Allow retrieving the active tab control or tab at the given position.

Closes #16262.
2019-12-07 15:13:06 +01:00
Artur Wieczorek
389944a116 wxOSX: Implement function to retrieve pattern image for non-solid colour
Under wxOSX non-solid wxColour with NSColor backend is represented by
pattern image and it would be useful to have ability to get it e.g. to help
dealing with non-solid wxColours by frameworks not supporting such colours,
like e.g. Cairo.
2019-12-06 20:33:35 +01:00
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