Commit Graph

40217 Commits

Author SHA1 Message Date
Paul Cornett
a571ec6fbb Fix GTK wxPrinterDC gradient fill radius
All the other implementations use the rect width/height, not the diagonal
2021-02-02 10:16:42 -08:00
Paul Cornett
55b7198e92 Remove some run-time dependencies on X11 backend with GTK3
As with Wayland, the X11 backend may not be available at run-time,
so types defined in it can't be used
2021-02-02 10:15:35 -08:00
Lauri Nurmi
3514dda407 Fix compilation with curl <7.21.6 used under CentOS 6
According to cURL documentation, the CURLOPT_ACCEPT_ENCODING symbol
was called CURLOPT_ENCODING earlier.

Closes https://github.com/wxWidgets/wxWidgets/pull/2210
2021-02-02 13:03:06 +01:00
Vadim Zeitlin
bbd0c52440 Fix Left/Right arrows in multi-selection generic wxDataViewCtrl
They didn't reset the existing selection when used without Shift and
didn't extend the selection when used with Shift.

Fix both of these problems by reusing the existing logic from
GoToRelativeRow() and, added in this commit, GoToRow() which was
extracted from GoToRelativeRow().

Closes #19068.
2021-02-01 17:28:34 +01:00
Vadim Zeitlin
dbfa1c206e Rename and better document OnVerticalNavigation() helper function
This is not an event handler itself, so it shouldn't use "On" prefix
which is reserved, by convention, for the event handlers.

It also doesn't need wxKeyEvent, but just wxKeyboardState, so change its
signature accordingly. This will notably allow to use it from mouse
event handlers too if necessary.

No real changes.
2021-02-01 17:28:34 +01:00
Hiroshi Takey F. (hiro2233)
a291e1c004 Fix a problem with wxGetDisplay() in wxGTK/MSW build
Only define wxGetDisplay() in Unix builds.

Closes https://github.com/wxWidgets/wxWidgets/pull/2206
2021-02-01 13:30:31 +01:00
Hiroshi Takey F. (hiro2233)
7e4865c7c1 Build fixes for OpenGL support in wxGTK with Wayland
Don't try using X-specific symbols when GDK_WINDOWING_X11 is off.

Closes https://github.com/wxWidgets/wxWidgets/pull/2191
2021-02-01 10:45:26 +01:00
Paul Cornett
8d1ad482b6 Fix wxStatusBar size grip layout with GTK3 2021-01-31 21:11:42 -08:00
Paul Cornett
01223d6af2 Scrolling fixes for RTL layout with GTK3
Avoid some positioning hacks, they are not needed with GTK3
2021-01-31 21:06:18 -08:00
Paul Cornett
e85f89e522 Implement wxDC mirroring for RTL layout with GTK3
Co-Authored-By: AliKet <aliket1435@gmail.com>
2021-01-31 20:59:29 -08:00
Vadim Zeitlin
a1dd894c77 Merge branch 'appveyor-webrequest' of https://github.com/MaartenBent/wxWidgets
Fix bug in wxWebRequest data upload code in WinHTTP implementation.

See https://github.com/wxWidgets/wxWidgets/pull/2199
2021-01-31 14:08:48 +01:00
Maarten Bent
53a05f431f Set bytes written in callback in wxWebRequestWinHTTP 2021-01-30 22:14:19 +01:00
Maarten Bent
71a64f1d20 Get pointer to write buffer only once in wxWebRequestWinHTTP 2021-01-30 22:14:19 +01:00
Vadim Zeitlin
0d04792116 Show full text in single line MSW wxTextCtrl if possible
A single line MSW wxTextCtrl created with a value too long to fit into
it continued showing the value only partially even if its size was
subsequently increased to allow the entire value to be shown.

This apparently happens because changing the native EDIT control size
doesn't affect its (horizontal) scroll offset. Moreover, there doesn't
seem to be any way to explicitly tell the control to update it neither,
except for changing its text.

So do change its text every time its width changes, as long as it is not
visible (because visible jumps in the visible text position could be an
even worse problem than the one we're trying to solve here). This fixes
the originally reported bug at the cost of a bunch of extra calls to
DoWriteText() which should hopefully be not too expensive for single
line controls that don't typically contain that much text.

Closes #18268.
2021-01-30 20:43:14 +01:00
Vadim Zeitlin
247bb98d07 Generate Enter/Tab events even in readonly MSW wxTextCtrl
Respect wxTE_PROCESS_TAB and wxTE_PROCESS_ENTER flags even for readonly
text controls. Previously there were ignored for them due to the changes
of 080c709f70 (fix for handling TAB presses in readonly text controls,
2002-09-07), but there doesn't seem to be any good reason to do this, so
revert the changes of that commit by removing IsEditable() check from
our WM_GETDLGCODE handler.

We also need to avoid inserting TABs into readonly controls ourselves in
the default wxEVT_CHAR handler, so add a check for IsEditable() there to
compensate for the fact that these events are now received even for the
readonly controls.

This commit is best viewed ignoring whitespace-only changes.

Closes #19064.
2021-01-30 20:42:52 +01:00
Václav Slavík
8e80941183 Make refcounting actually work in wxFileSystemWatcher::Add()
The order of refcounting operations should be the opposite of what it
was: first check if the path is not watched already and only if it is
not call m_service->Add() to actually watch it. (Previously reference
count was kept track of, but m_service->Add() was always called, i.e.
the calls were repeated and unbalanced with Remove() calls.)

Remove() already has the correct order and only calls
m_service->Remove() when the path's refcount reaches zero.

This fixes a problem which was there since the original code was added
back in 76cfd1bf95 (Make wxFileSystemWatcher watch entries
reference-counted., 2012-10-15).

Closes https://github.com/wxWidgets/wxWidgets/pull/2203
2021-01-30 20:40:45 +01:00
Jouk
c65d5110aa update OpenVMS makefiles for credential dialog 2021-01-29 08:51:11 +01:00
Vadim Zeitlin
68a824da3c Fix using gethostbyxxx_r() with newer Android NDK
This might break using it with the older versions, but it's not clear
whether we still need to support them, so for now apply the simplest fix
which works with the recent NDK and we'll add configure tests later if
we really need them.

See https://github.com/wxWidgets/wxWidgets/pull/2195
2021-01-28 22:08:35 +01:00
Artur Wieczorek
914cc63d32 Fix navigating through wxPropertyGrid with wxPG_ACTION_EDIT
wxPG_ACTION_EDIT should not be considered done when wxPGProperty is
not editable (i.e. is disabled, read-only, is a wxPropertyCategory)
to prevent from blocking secondary actions (like
wxPG_ACTION_NEXT_PROPERTY) in this case.

Closes #19060.
2021-01-28 19:13:09 +01:00
Tobias Taschner
7532f93f7e macOS: Fix WebView print hang
At least under macOS 11 calling just runOperation: hangs, so use
runOperationModalForWindow: instead.

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

Closes #19063.
2021-01-28 17:34:11 +01:00
Paul Cornett
22349a79aa Use more accurate source for wxClientDC size with GTK3
Because GdkWindow size is updated somewhat asynchronously, it can lag behind
current window size. So get size from wxWindow instead. See #19062
2021-01-28 07:30:19 -08:00
Dimitri Schoolwerth
2a4c52a414 Fix recently introduced typo in a variable reference 2021-01-27 19:38:11 +01:00
dsr
a3d58dadd9 Implement wxGestureEvent support for wxQt
Do it generically in wxWindow and also provide a special version for
wxGLCanvas for which the standard implementation doesn't work well.
2021-01-27 19:01:50 +01:00
dsr
7cd90e5b82 Reset stored window pointer in wxWindow dtor
This protects against orphan Qt events and signals.
2021-01-27 18:56:21 +01:00
dsr
2cf57fda36 Avoid crashes when destroying wxGLCanvas
Block signals that are not safe to process any more.
2021-01-27 18:42:16 +01:00
Vadim Zeitlin
d046a8fbc6 Remove currently unused wxGLContext::m_glContext
No real changes, just remove unused private field.
2021-01-27 18:41:06 +01:00
dsr
98e4f910a5 Implement setting wxGLCanvas attributes in wxQt
Simply remove the premature "return true" which was somehow added back
in df13791078 (Merge wxQT branch into the trunk., 2014-08-24) and add
WX_GL_MAJOR_VERSION support.
2021-01-27 18:34:54 +01:00
dsr
b692dd8aef Implement wxMenuItem::SetFont() for wxQt 2021-01-27 18:31:49 +01:00
Vadim Zeitlin
bb0f2f9768 Fix endptr output value in android_wcstoxxx()
These functions incorrectly multiplied an increment of wchar_t pointer
by sizeof(wchar_t), which made the result quite wrong, so just don't do
this.

See 744ea8a618 (For Android (wxQT), add private wcstol, wcstoul and
wcstod, 2015-02-11).
2021-01-27 18:29:57 +01:00
Vadim Zeitlin
a3b655fd60 Ensure that HAVE_GETHOSTBYADDR is defined under Android too
This is supposed to always be the same as HAVE_GETHOSTBYNAME, but
wasn't, because the latter was explicitly defined for Android after
defining the former as it.
2021-01-27 18:16:06 +01:00
dsr
7d7c43c4c3 Use localeconv() under Android, it's available there now
As of NDK21d, localeconv() is available under Android and can be used in
wxQt there.
2021-01-27 18:09:43 +01:00
Dimitri Schoolwerth
ddec29c338 Don't check for DrawThemeTextEx availability every DrawItemText()
Check for DrawThemeTextEx availability only once, which also seems to be
what ddceaab001 (Remove MSW wxUxThemeEngine class, 2017-10-27) intended
to do here by already introducing a static function pointer. Simply add
an init guard, also because the repeated check is not a cheap operation
(judging by comparing performance with drawing short texts).

Closes https://github.com/wxWidgets/wxWidgets/pull/2196
2021-01-27 17:57:19 +01:00
Vadim Zeitlin
871b928388 Merge branch 'mac-fixes'
Miscellaneous fixes for wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/2185
2021-01-27 17:54:45 +01:00
Vadim Zeitlin
78e7a966cc Revert "Fix wxSYS_COLOUR_BTNFACE value under macOS < 10.14"
This reverts commit 8e26b8d54e because it
has been superseded by 17239d5c3d (macOS add fallback for retrieving
color channels from dynamic system colors on pre 10.14 systems,
2021-01-26) in master.

See #18977.
2021-01-27 17:53:42 +01:00
Andreas Falkenhahn
7555d1b245 Fix expansion of the last column in macOS wxDataViewCtrl
It should always take the rest of the available space.

See #14939.
2021-01-26 22:58:01 +01:00
Stefan Csomor
17239d5c3d macOS add fallback for retrieving color channels from dynamic system colors on pre 10.14 systems
the channel conversion was only working on systems starting from 10.14, using the CGColor as a fallback
2021-01-26 16:40:41 +01:00
Vadim Zeitlin
56a5512b37 Merge branch 'selstore-insert-fix'
Fix state of multiple items inserted into wxSelectionStore and improve
its tests.

See https://github.com/wxWidgets/wxWidgets/pull/2182
2021-01-25 13:02:34 +01:00
Vadim Zeitlin
867a02e646 Merge branch 'webview-edge-unload'
Simplify and fix wxWebViewEdge initialization.

See https://github.com/wxWidgets/wxWidgets/pull/2188
2021-01-25 13:01:45 +01:00
Vadim Zeitlin
b65799448b Merge branch 'gtk-value'
Use wxGtkValue RAII wrapper in wxGTK code.

See https://github.com/wxWidgets/wxWidgets/pull/2187
2021-01-25 13:01:03 +01:00
Vadim Zeitlin
b48c46285c Avoid creating empty bitmap in MSW wxNotebook::OnPaint()
It can apparently happen that the window has 0 size and in this creating
the bitmap is useless and just triggers an assert.

Closes #18879.
2021-01-25 00:32:12 +01:00
Vadim Zeitlin
bc825de1fe Simplify and make more robust wxWebViewEdge initialization
Get rid of ms_isInitialized as it must be kept synchronized with
ms_loaderDll.IsLoaded() anyhow, and it's simpler to not have it at all
rather than ensuring this.

Also ensure that calling Initialize() again, after doing it first
unsuccessfully, doesn't assert because ms_loaderDll is already loaded,
by only leaving it with a valid handle if the initialization succeeded.

Closes #19041.
2021-01-25 00:15:24 +01:00
Vadim Zeitlin
3568a160a9 Use wxGtkValue RAII wrapper in wxGTK code
wxGtkValue class was added back in 3f84cb17ca (Add wxActivityIndicator
control., 2015-03-06), but somehow never used. Start using it now
(better late than never...) as it makes the code simpler, shorter and
more robust.

No real changes.
2021-01-24 23:55:43 +01:00
Julian Smart
678b641950 Fix initial focus problem for hidden windows under Mac
Assume that hidden windows do accept focus because, even if this is
still wrong, in general, it is less harmful than wrongly returning false
from CanFocus() for them.

Closes #18987.
2021-01-24 23:45:24 +01:00
Andreas Falkenhahn
b2675d6a60 Fix sending event when cancelling editing in wxDVC under Mac
Move existing code for sending wxEVT_DATAVIEW_ITEM_EDITING_DONE to a new
sendEditingDoneEvent:isCancelled function and also call it, with true
argument, from cancelOperation: to generate the expected event.

Closes #17835.
2021-01-24 21:16:23 +01:00
Vadim Zeitlin
c714e75555 Generate wxEVT_CHAR_HOOK events before accelerators
This is more consistent with the other ports and allows to use
wxEVT_CHAR_HOOK handler to preempt processing of the accelerators (but
notice that under macOS this only works for accelerators that are part
of wxAcceleratorTable and not those associated with the menu items, as
the latter ones are not handled by this code at all).

Also simplify the code structure a little by getting rid of an
unnecessary and more confusing than helpful "handled" variable.
2021-01-24 21:09:05 +01:00
Vadim Zeitlin
f8d4bba9e7 Fix handling of accelerators in wxOSX
Check accelerator tables when handling wxEVT_CHAR_HOOK, not
wxEVT_KEY_DOWN, as we don't get the latter at all for some events, e.g.
Cmd-Alt-1 doesn't generate wxEVT_KEY_DOWN (which looks like another bug)
but does generate wxEVT_CHAR_HOOK.

Closes #13937.
2021-01-24 20:57:20 +01:00
Vadim Zeitlin
5f30f79bc8 Remove unnecessary checks of wxEvent::GetSkipped()
HandleWindowEvent() already returns false if the event handler skipped
the event, there is no need to test for it explicitly.

No real changes.
2021-01-24 20:56:38 +01:00
Stefan Csomor
0f4c65dd4f respecting UTI string rules when constructing native format in wxDataFormat::SetId
adding part from 4ae329472c
2021-01-24 19:51:33 +01:00
Stefan Csomor
3ccfa976aa guard against nullptr exception in wxLogGui::Flush
happened eg during wxUnitialize in dnd sample on macOS (open new frame, add shape, quit app)
2021-01-24 19:40:01 +01:00
Julian Smart
8e26b8d54e Fix wxSYS_COLOUR_BTNFACE value under macOS < 10.14
Use fallback value which isn't just RGB(0,0,0) when building under 10.15
but running under 10.13.

Closes #18977.
2021-01-24 19:09:31 +01:00