Commit Graph

40190 Commits

Author SHA1 Message Date
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
Paul Cornett
4d7ca07211 Fix RTL layout of menus with GTK
Set layout direction for all menu items and sub-menus,
setting just the top level menu doesn't do much
2021-01-24 09:20:54 -08:00
Paul Cornett
4fdcdc07d2 Set horizontal scrollbar layout direction from SetLayoutDirection()
Rather than when it is created, which is too early
2021-01-24 09:09:49 -08:00
Paul Cornett
043183356b Set text layout direction earlier during window creation
Code later in the same function was using the direction before it was set
2021-01-24 08:59:12 -08:00
Stefan Csomor
c5394cea63 Fix handling of standard edit commands in context menu under Mac
Feed back standard commands like copy, paste into wxMenItem if possible.

This way commands that don't exist in the global menubar can still be
fed back eg when originating from a context menu.

See #18738.
2021-01-24 15:54:02 +01:00
rk
fd839c4bd6 Fix selection when inserting multiple items into wxSelectionStore
When inserting more than one item into wxSelectionStore in the
default-selected state, the state of all the items bug the first one was
wrongly set to "selected" initially.

Just fix the typo in the AddAt() call, which was passed a wrong
variable, to fix this.

Closes #19040.
2021-01-23 16:40:30 +01:00
Paul Cornett
c5aee91847 Fix highlighting wxTimePickerCtrl fields on GTK
GtkEntry automatically selects all the text in many situations,
so do the field highlighting later to override GTK's behavior.
2021-01-21 11:38:22 -08:00
Vadim Zeitlin
3c7326205f Merge branch 'grid-fix-drawing-invalid-cells' of https://github.com/discnl/wxWidgets
Fix drawing of grid cells appearing inside a multicell.

See https://github.com/wxWidgets/wxWidgets/pull/2176
2021-01-21 00:50:09 +01:00
Vadim Zeitlin
7911fdc253 Merge branch 'webrequest_additions' of git://github.com/TcT2k/wxWidgets
wxWebRequest improvements: add DisablePeerVerify(), improve
documentation.

See https://github.com/wxWidgets/wxWidgets/pull/2175
2021-01-21 00:44:37 +01:00
Artur Wieczorek
4590f28f7e Fix converting wxBitmap with alpha and mask to wxImage (wxOSX)
When pixel is not masked it should be stored in the target wxImage
in non-premultiplied format.
2021-01-20 19:37:12 +01:00
Paul Cornett
892795ac9c Apply a better fix for HitTest failures in the tests with GTK3
The actual cause of the problem was the tests making the single-line
text control height far too large. So just use the default height for
single-line controls.
2021-01-19 22:50:41 -08:00
Paul Cornett
c530b89ffa Apply anti-alias mode to fonts with Cairo, see #19049 2021-01-19 20:16:16 -08:00
Dimitri Schoolwerth
1f5b77bad3 Make use of grid helper function GetCellSpan()
Also gets rid of an additional attribute lookup that was recently
added in 00c497125e containing a minimal fix.
2021-01-19 22:30:33 +01:00
Dimitri Schoolwerth
860d9d09bc Refactor code deciding the kind of span of a grid cell
Move wxGrid's GetCellSize() cell span logic into GetCellSpan() for
future usage.
2021-01-19 22:26:03 +01:00
Dimitri Schoolwerth
00c497125e Fix drawing of grid cells appearing inside a multicell
Grid cells are considered for redrawing solely based on having
a (text) value. This can lead to infinite recursion with overflowing
inside cells if wxGridCellStringRenderer::Draw() wants to draw cells
appearing after this one but instead visits the same cell again (because
of a negative cell size as opposed to expected default cell size of 1x1
or a larger spanning size) and calls DrawCell() again for this cell
which will call the renderer's Draw() again etc...

Fix by not taking inside cells into consideration for redrawing. This
is the right thing to do as earlier on in the same function a cell is
not drawn for the same reason. Also the aforementioned Draw() mentions
it shouldn't be called for cell sizes <= 0.

Also fixes the crashing grid test just introduced in 6d3dbc3fe5.
2021-01-19 22:17:41 +01:00
Tobias Taschner
4727693584 Silence harmless warning with wxWebWebRequest CURL 2021-01-19 21:08:01 +01:00
Tobias Taschner
457b213315 Apply suggestions from code review
Co-authored-by: VZ <vz-github@zeitlins.org>
2021-01-19 21:06:31 +01:00
Tobias Taschner
036b7f29a7 Add wxWebRequest::DisablePeerVerify()
This method allows insecure HTTPS connections when required
2021-01-19 13:16:25 +01:00
Paul Cornett
cea8e60dea Don't set focus from wxTimePickerCtrl::SetValue() on GTK
Match the wxMSW behavior. See #19047
2021-01-18 22:24:39 -08:00
Artur Wieczorek
79be42122f Don't convert mask to alpha values while converting wxImage to wxBitmap (wxOSX)
wxImage with mask should be converted to wxBitmap with mask and not to
wxBitmap with alpha channel values. Converting wxImage mask to wxBitmap
alpha is not implemented under wxMSW and wxGTK and wxOSX implementation
should adhere to this convention.
2021-01-18 22:29:40 +01:00
Daniel Kulp
3c28244806 Improve wxGrid appearance in dark mode under macOS
Use more appropriate colours for the row/column cell headers and don't
hardcode black (i.e. at least use white instead in dark mode) for the
frozen border.

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

See #18941.
2021-01-18 00:03:10 +01:00
Stefan Csomor
f8af2601c2 Add wxOSX_VERIFY_NOERR macro and use it in wxOSX code
This macro replaces the deprecated __Verify_noErr defined in the SDK.

It is different from assert, as the expression given to the macro is
always evaluated and then, if the result is not zero, and asserts are
on, an assert containing a human readable message with the description
of the error code is triggered.

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

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2021-01-17 23:57:38 +01:00
Vadim Zeitlin
51cc083f31 Cast error code only once in wxSysErrorMsgStr()
No real changes, just simplify code a little bit by replacing multiple
casts with a single one -- and explaining why is it necessary.
2021-01-17 23:37:38 +01:00
Vadim Zeitlin
febd185fc6 Merge branch 'web-request'
Add wxWebViewRequest and related classes allowing to use HTTPS and
HTTP/2.

See https://github.com/wxWidgets/wxWidgets/pull/977
2021-01-17 18:19:47 +01:00
Vadim Zeitlin
10c85670dc Merge branch 'choice-getstring'
Make wxChoice::GetString() consistently assert in all ports when given
invalid index.

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

Closes #18852.
2021-01-17 18:18:44 +01:00
Vadim Zeitlin
cc28cd6816 Fix logging when timestamps are disabled after recent changes
The changes of 1065e61ab7 (Merge branch 'log-ms', 2021-01-16) broke
logging when timestamps were disabled as they still tried to format the
timestamp in this case, using empty timestamp, which resulted in an
assert.

Fix this and also make new code more similar to the existing one by
adding wxLog::TimeStampMS() helper parallel to the already existing
TimeStamp() and write it in the same way -- which notably ensures that
it does nothing when the timestamp is empty.

See #13059.
2021-01-17 17:44:51 +01:00
Vadim Zeitlin
910dfbc010 Assert in wxGTK wxChoice::GetString() if the index is invalid
Similar to the previous commit for wxMSW.

This commit is best viewed ignoring whitespace-only changes.
2021-01-17 00:41:15 +01:00
Vadim Zeitlin
98aaeadf54 Assert in wxMSW wxChoice::GetString() if the index is invalid
Do it for consistency with SetString() and other controls.
2021-01-17 00:41:15 +01:00