Commit Graph

70266 Commits

Author SHA1 Message Date
Václav Slavík
9e0a2c04a8 Don't truncate item text in wxCheckListBox on macOS
wxListBox's width adjustment code appears to have been written before
wxCheckListBox's existence, and still assumed there's only one column, at
index 0, in some places.

In wxCheckListBox, however, there are two columns, and column 0 is the
non-resizable checkbox one. We need to use column 1 (aka the last
column) for automatic width updates, because that's where the text is.
2021-03-09 18:38:59 +01:00
Václav Slavík
bc28cb42c2 Fix wxCheckListBox checkbox size on macOS
Decrease the size of checkbox column so that it's not downright
excessive.
2021-03-07 18:26:24 +01:00
Václav Slavík
1d23f7befe Don't show focus ring on wxListBox
In native OS X apps, focus ring is not shown around NSTableView controls
(focus is indicated differently, with selection's color).

See eece498 for the same fix in wxDataViewCtrl.
2021-03-07 18:25:30 +01:00
Vadim Zeitlin
8d01aaf783 Make WebRequest::Get::Param unit test more forgiving
The simple test added in 59a8f26b01 (Add a unit test for wxWebRequest
query using URL parameters, 2021-03-06) worked when using httpbin.org,
but not when running httpbin locally, as it doesn't pretty-print JSON by
default.

Skip optional whitespace to make it work in both cases.
2021-03-06 14:44:56 +01:00
Vadim Zeitlin
bf8be6c58d Merge branch 'mac-filedlg-improvements' of https://github.com/discnl/wxWidgets
macOS wxFileDialog improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2234
2021-03-06 12:18:43 +01:00
Vadim Zeitlin
26635c2718 Merge branch 'webrequest-fix-param'
Fix URL parameters handling in WinHTTP wxWebView backend.

See https://github.com/wxWidgets/wxWidgets/pull/2264
2021-03-06 12:16:26 +01:00
Vadim Zeitlin
59a8f26b01 Add a unit test for wxWebRequest query using URL parameters
Check that passing URL parameters in the query string works as expected
(this was broken with WinHTTP backend until the parent commit).
2021-03-06 12:11:59 +01:00
Vadim Zeitlin
3c92573dd7 Recommend using wxStaticBox as parent more strongly
Not doing it, i.e. creating the window inside the static box as its
siblings, rather than children, may appear to work, but actually doesn't
always do it, for example the windows are not shown correctly when using
RTL locale.

Closes #19086.
2021-03-05 22:53:27 +01:00
Artur Wieczorek
c1fa4cc7be Refactor: Use dedicated Win API to modify RECT structures 2021-03-05 20:11:04 +01:00
Vadim Zeitlin
39a46db345 Merge branch 'gtk-x-checks-simplify'
Simplify X11 checks and make them work when using Wayland-only GTK.

See https://github.com/wxWidgets/wxWidgets/pull/2261
2021-03-05 18:52:23 +01:00
Andriy Byelikov
b2d97d1393 Add support for English locale for Israel (en_IL)
This locale is recognized by glibc, so add it to the known locales
database.

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

See #19082.
2021-03-05 18:51:10 +01:00
Vadim Zeitlin
7bcac7bfde Merge branch 'unix-default-locale'
Improve handling of default locale and other locale-related fixes.

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

Closes #11594.
2021-03-05 18:48:30 +01:00
Vadim Zeitlin
3701baecde Merge branch 'webview_script_message' of https://github.com/TcT2k/wxWidgets
Add WebView script message and user scripts.

See https://github.com/wxWidgets/wxWidgets/pull/2237
2021-03-05 18:44:46 +01:00
Paul Cornett
30637ad3b6 Make wxGridEvent methods GetRow() and GetCol() const and not virtual
See #19085
2021-03-05 07:38:32 -08:00
Paul Cornett
4388b9bd6b Make some member functions const 2021-03-04 11:49:33 -08:00
Artur Wieczorek
613dce3d4b Adjust picker button size for generic wxDirPickerCtrl and wxFilePickerCtrl
For generic wx{Dir|File}PickerCtrl with text field the picker button
should be as high as the associated text field also when
wx{FLP|DIRP}_SMALL flag is set.

Closes #19087.
2021-03-04 19:14:00 +01:00
Tobias Taschner
a6c9fd2603 Fix WinHTTP GET parameter
An additional ? was send to the server, resulting in ignoring the first get parameter
2021-03-04 17:00:45 +01:00
Artur Wieczorek
1c57699e92 Add ability to set bitmap margins for wxButton in widgets sample
This is to demonstrate the margins between the bitmap and the text
of the button.
2021-03-02 22:47:37 +01:00
Artur Wieczorek
ae5593bd23 Fix wxButton page in widgets sample
Enable image alignment radio box only if button with text and image
is active because it is applicable only in this case.
2021-03-02 22:34:44 +01:00
Vadim Zeitlin
e9ea0f53f6 Refactor platform checks in wxLocale::Init()
Avoid the need for ugly WX_NO_LOCALE_SUPPORT macro at the cost of a
couple of extra #ifs, which seems to be a worthy trade-off.

This also allows making the code calling setlocale("") for the default
language platform-independent.

No real changes.
2021-03-02 22:07:44 +01:00
Vadim Zeitlin
502114261a Handle wxLANGUAGE_DEFAULT in wxLocale specially under MSW too
Even if we do know about the system language, it's still better to let
OS/CRT handle it, as we may not know enough about it. E.g. "system
language" may actually be a mix of the different languages and formats
and we don't handle this case at all, while OS/CRT do just fine.
2021-03-02 22:07:44 +01:00
Vadim Zeitlin
9c4ab145e9 Add SetThreadUILanguage() wrapper
Make it possible to reuse the code dynamically loading this function
from elsewhere.

No real changes.
2021-03-02 22:07:44 +01:00
Vadim Zeitlin
9600c29ff2 Fix default language determination in wxLocale under MSW
We must use GetUserDefaultUILanguage() and not GetUserDefaultLCID().
Although still not ideal, this is much better when the UI language and
the locale differ: when everything is in some language, it's better to
use this language and wrong date/number format than use correct
date/number format but a wrong language.

See #11594.
2021-03-02 22:07:44 +01:00
Paul Cornett
0d80050057 Make wxGCDC behavior with 0-width wxPen consistent with MSW wxDC
MSW uses a 1-pixel width in that case. See #19077
2021-03-02 10:50:39 -08:00
PB
9d0aee5ee6 Fix using invalid string index in wxIsAbsolutePath()
Check if the path is at least two characters long before accessing its
second character.

Add test cases for wxIsAbsolutePath() on MS Windows.

Closes https://github.com/wxWidgets/wxWidgets/pull/2262
2021-03-02 16:00:59 +01:00
Vadim Zeitlin
9a84e0b25e Don't require X11 in CMake builds using Wayland-only GTK
X11 headers and libraries are only required if we're actually using X11
which may not be the case.

This allows to build wxGTK on the systems using Wayland-only GTK.
2021-03-01 13:32:57 +01:00
Vadim Zeitlin
a8e918727a Only include X11 headers when we actually need X11 support
These headers may not be available at all when building wxGTK with
Wayland-only GTK version.
2021-03-01 13:06:17 +01:00
Tobias Taschner
80c04e3941 Merge branch 'master' into webview_script_message 2021-03-01 09:57:13 +01:00
Vadim Zeitlin
b8f63fc7c5 Skip wxLocale wxLANGUAGE_DEFAULT test in ANSI builds
The test fails there, but we don't really care about it, Unicode is
required for any level of acceptable locale support anyhow.
2021-03-01 00:22:39 +01:00
Maarten Bent
401d547b2a Fix -Wdeprecated-copy warning when using Scintilla Window
Don't use the copy constructor, use a constructor accepting the windowID.

Closes https://github.com/wxWidgets/wxWidgets/pull/2259
2021-03-01 00:11:03 +01:00
Vadim Zeitlin
afb57182e1 Merge branch 'gcc-edge'
Make it possible to build wxWebViewEdge with gcc or clang too.

Closes https://github.com/wxWidgets/wxWidgets/pull/2245
2021-03-01 00:09:52 +01:00
Maarten Bent
7532532800 Mention GCC/Clang support in wxWebViewEdge documentation
And add a comment explaining the name of the EventRegistrationToken include guard.
2021-03-01 00:09:23 +01:00
Maarten Bent
272c903234 Silence unknown pragmas warning in the WebView2 header
Using wxGCC_WARNING_SUPPRESS(unknown-pragmas) around the webview2 header does
not work, so suppress it for the entire webview project.
2021-03-01 00:09:23 +01:00
Maarten Bent
fc3cfb67cf Add missing UUIDs for wxWebViewEdge 2021-03-01 00:09:23 +01:00
Maarten Bent
09bc566b60 Support building wxWebViewEdge with GCC or Clang
Add EventToken.h with EventRegistrationToken implementation, that can be used by the WebView2 header.
2021-03-01 00:09:23 +01:00
Maarten Bent
b43803703d Move Callback implementation to separate header file 2021-03-01 00:09:23 +01:00
Maarten Bent
66d314c232 Implement QueryInterface of wxWebViewEdge CInvokable 2021-03-01 00:09:23 +01:00
Maarten Bent
156eda92d7 Use WRL when building with MSVC 2021-03-01 00:09:23 +01:00
Maarten Bent
a8b726359b Format wxWebViewEdge Callback code 2021-03-01 00:09:23 +01:00
Maarten Bent
ad1219d0a2 Fix building with MSVC 32 bit 2021-03-01 00:09:23 +01:00
Maarten Bent
84b19a0ce0 Use the same function signature as the WebView2 SDK 2021-03-01 00:09:23 +01:00
nns52k
b465a95dcc Make it possible to compile wxWebView Edge backend with gcc
Remove the requirement to include wrl/event.h so that GNU C++ (maybe
Clang C++ as well) can compile this file without error.
2021-03-01 00:08:08 +01:00
nns52k
df20e5ec76 Fix case of WebView2.h in the #inclue directive
Using the correct case is important when using case-sensitive file
systems as when cross-compiling, for example.
2021-03-01 00:08:08 +01:00
PB
a75aa78263 Fix dragging file in DnD sample
At least on Microsoft Windows, it is possible to start dragging an unselected
wxTreeCtrl item. Therefore, in wxEVT_TREE_BEGIN_DRAG handler do not use the
path that is currently selected in the control but the one that is actually
being dragged.

Closes https://github.com/wxWidgets/wxWidgets/pull/2258
2021-03-01 00:03:21 +01:00
Vadim Zeitlin
fa3cf06273 Avoid possible "unreachable statement" warnings
Don't return unconditionally before another return. Somehow gcc doesn't
warn about it, but other compilers (and static analyzer tools)
definitely do.

No real changes.
2021-02-28 23:59:51 +01:00
Vadim Zeitlin
f11db09e9b Ad wxHAS_X11_SUPPORT helper to simplify the code
This is much more readable than the existing (and now duplicated)
__WXGTK__ || !__WXGTK20__ || GDK_WINDOWING_X11 check.

No real changes.
2021-02-28 23:58:07 +01:00
Vadim Zeitlin
810b342411 Avoid useless check for GTK_CHECK_VERSION
Just use it inside the existing check for GTK itself.

No real changes.
2021-02-28 23:53:49 +01:00
Vadim Zeitlin
d03f193719 Recognize "ll_LL" as at language "ll" in GetSystemLanguage()
If we can't find an exact match for the system locale in the database,
try to at least find the corresponding language.

This is almost certainly what the intention of the original code was, as
otherwise the entire loop was useless because it couldn't find anything
that wouldn't have been found in the loop just above.

This allows to correctly load German translations when using unsupported
locale such as "de_IT", for example.

See #19082.
2021-02-28 23:39:20 +01:00
Scott Talbert
f6a53b59b2 Fix regression in wxGetKeyState() on GTK3 w/ X11
wxGetKeyStateGTK() is intended to be used only with non-X11 GTK backends.
wxGetKeyStateX11() should still be used on GTK3 w/ X11 as the GTK
variant does not provide all key states.
2021-02-28 14:11:26 -08:00
Vadim Zeitlin
73b41dda91 Remove redundant #if/#endif in Unix locale code
Put both Unix-only functions inside the same #ifdef __UNIX__.

No real changes.
2021-02-28 22:50:35 +01:00