Commit Graph

70266 Commits

Author SHA1 Message Date
Vadim Zeitlin
2e8e0197d7 Add wxSetlocaleTryAll() helper to simplify Unix locale code
Define the function calling setlocale("xx_YY") first and then just
setlocale("xx") if the former failed, instead of doing the same thing
manually in 3 different places.

Also avoid attempting the second setlocale() call completely if there is
no "_YY" part in the first place.

No real changes.
2021-02-28 22:48:52 +01:00
Tobias Taschner
5e35e6c635 Clear script ids in RemoveAllUserScripts() 2021-02-28 22:38:09 +01:00
Tobias Taschner
5a30bbe38f Apply suggestions from code review
Co-authored-by: PB <PBforDev@gmail.com>
2021-02-28 22:33:15 +01:00
Tobias Taschner
e8371824bd Disable new methods for webkit1 2021-02-28 20:48:01 +01:00
Tobias Taschner
f419240335 Add Apple transport security to wxWebView docs 2021-02-28 20:44:38 +01:00
Tobias Taschner
ca5133fff7 Add usage documentation to wxWebView::AddScriptMessageHandler() 2021-02-28 20:41:49 +01:00
Tobias Taschner
d4a9ec2448 Define unused parameters differently to improve intellisense 2021-02-28 20:14:38 +01:00
Tobias Taschner
166d7e2c83 Fix unused warning in sample 2021-02-28 20:06:59 +01:00
Vadim Zeitlin
91ec900034 Explicitly disallow wxLANGUAGE_UNKNOWN in wxLocale::Init()
This value doesn't make here, so be upfront about it.
2021-02-28 20:04:33 +01:00
Tobias Taschner
575ae90d85 Fix trailing whitespace 2021-02-28 20:03:36 +01:00
Tobias Taschner
2a16638e2a Fix EOL issues 2021-02-28 20:03:31 +01:00
Vadim Zeitlin
18bf718f60 Support wxLANGUAGE_DEFAULT in wxLocale even when it is unknown
Don't give an error if we can't recognize the current system language,
as we may still be able to use it even in this case.

Closes #19082.
2021-02-28 20:00:27 +01:00
Tobias Taschner
2c3d179923 Implement common web message identifier for macOS 2021-02-28 19:57:33 +01:00
Tobias Taschner
a27f73367c Implement AddUserScript() for WKWebView backend 2021-02-28 19:55:19 +01:00
Vadim Zeitlin
3e395f9b5f Micro optimization for wxLANGUAGE_UNKNOWN in GetLanguageInfo()
Don't bother iterating over all the languages if we can be sure we're
not going to find anything anyhow.
2021-02-28 01:12:57 +01:00
Vadim Zeitlin
d029279227 Rename local variable to a more consistent name
Call the info->CanonicalName "shortName", as it's done in many other
places in the code instead of using "locale" for it here, even though we
do use it as a name of locale.

No real changes.
2021-02-28 01:11:34 +01:00
Vadim Zeitlin
5fd85d422f Add a trivial test for setting default locale
Initializing wxLocale using wxLANGUAGE_DEFAULT should work, unless
LC_ALL is explicitly set to an invalid value.
2021-02-28 01:07:47 +01:00
Vadim Zeitlin
7b6894ea41 Reuse Unix branch of wxLocale::Init() for macOS too
There doesn't seem to be any reason to partially duplicate Unix-specific
code in a separate Mac branch when we can just use the same code. Parts
of it which are not necessary under Mac, such as trying ".UTF-8" locales
in wxSetlocaleTryUTF8(), can be separately disabled there (even though
they are harmless), but other parts are probably needed, e.g. setting
Norwegian locale failed under macOS before because we didn't translate
nb_NO that we use to no_NO actually supported under macOS.
2021-02-28 01:02:59 +01:00
Vadim Zeitlin
0aba9fe112 Remove useless fallback from wxLocale::Init()
There is no need to try setting "loc.UTF-8" and "loc.UTF8" when we had
just called wxSetlocaleTryUTF8() which tried these variants and also
their lower-case equivalents already.
2021-02-27 17:52:08 +01:00
Artur Wieczorek
04ea7b552a Fix wxBitmapButon used as wxPG editor button under wxGTK2
wxBitmapButton without inner border should work better with themes
if we reduce inner border in a more GTK-compliant way by applying
a dedicated GTK style to the button.
2021-02-27 17:15:39 +01:00
Artur Wieczorek
9a29ea6e63 Fix setting wxBU_EXACTFIT style for wxButton under wxGTK2
The way wxBU_EXACTFIT is implemented in commit c1bb80987f
("Improve implementation of wxBU_EXACTFIT style for wxButton under wxGTK2",
2020-04-12) is too intrusive and disrupts button's appearance in some
themes. It should work better with themes if we reduce inner border in
a more GTK-compliant way by applying a dedicated GTK style to the button.

Closes #19081.
2021-02-27 17:08:37 +01:00
Tobias Taschner
29bfcdfd5e Add common web message identifier 2021-02-27 11:55:50 +01:00
Tobias Taschner
c9606d7b5a Implement AddUserScript() for GTK 2021-02-27 10:59:23 +01:00
Tobias Taschner
4d78437a77 Implement AddUserScript() for edge backend 2021-02-26 23:41:39 +01:00
Tobias Taschner
6f7ac6a934 Add wxWebView::AddUserScript()
This allows to inject javascript code across multiple pages
2021-02-26 23:41:39 +01:00
Tobias Taschner
f2bfa7d446 Initial AddScriptMessageHandler() documentation 2021-02-26 22:35:49 +01:00
Tobias Taschner
b1d558a612 Disabled dev tools per default for Edge
This unifies the behavior among backends and is probably
the more useful default for most applications.
2021-02-26 21:55:10 +01:00
Tobias Taschner
2d007ff3f1 Add named script handler to edge 2021-02-26 21:51:15 +01:00
Tobias Taschner
140e9825b7 Log error if script handler cannot be added 2021-02-26 21:41:02 +01:00
Tobias Taschner
a09713de5f Decode web message result like RunScript() result 2021-02-26 21:37:23 +01:00
Tobias Taschner
71f745e647 Implement script message for GTK backend 2021-02-26 21:27:50 +01:00
Tobias Taschner
3af4702b11 Implement wxWebView::EnableAccessToDevTools() for GTK 2021-02-26 18:53:46 +01:00
Tobias Taschner
302ae644dd Fix mixed EOL 2021-02-26 17:11:33 +01:00
Tobias Taschner
3f23273f46 Fix typo in sample 2021-02-26 16:59:57 +01:00
Tobias Taschner
04d22cc9f6 Add RemoveScriptMessage handler and return bool 2021-02-26 16:59:57 +01:00
Tobias Taschner
c3d0d7d000 Identify script handler in message event 2021-02-26 16:59:56 +01:00
Tobias Taschner
c78147b267 Add script command handler to sample 2021-02-26 16:59:56 +01:00
Tobias Taschner
5b838ae6c1 Fix unused warning 2021-02-26 16:59:56 +01:00
Tobias Taschner
a7ff7a8012 Implement script message for WKWebView backend 2021-02-26 16:59:56 +01:00
Vadim Zeitlin
94812c9e06 Merge branch 'sorted-array-str-search'
Fix searching in wxSortedArrayString with custom compare function.

Also improve array unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/2251/
2021-02-26 16:51:11 +01:00
Ian McInerney
063dd3e852 Remove hardcoded max width from STC autocomplete listbox
The Scintilla engine will automatically truncate lines in the
autocomplete listbox based on the call to AutoCompSetMaxWidth().
It is not good to do it in the wx implementation code as well,
since then the meaning of AutoCompSetMaxWidth(0) (e.g. no truncation)
is not valid and the list items will be truncated anyway.

Closes https://github.com/wxWidgets/wxWidgets/pull/2250
2021-02-26 16:49:35 +01:00
Vadim Zeitlin
b113635111 Use CHECK() instead of CPPUNIT_ASSERT_XXX in arrays tests
This could be further improved by defining array matchers instead of
using the macros, but for now just get rid of the last traces of CppUnit
in this file.

No real changes.
2021-02-26 16:36:10 +01:00
Vadim Zeitlin
eb3fdfe82f Get rid of ArraysTestCase class in the dyn arrays unit tests
Just remove more CppUnit boilerplate, no real changes.
2021-02-26 16:32:45 +01:00
Vadim Zeitlin
6819b5512b Make BinarySearch() interface slightly more readable
Replace "equal" parameter with the (opposite) "lowerBound" one with a
more descriptive name, add a comment describing it and also remove the
default value to force explaining how it is used in the caller.

No real changes.
2021-02-26 16:25:28 +01:00
Tobias Taschner
edcaf5210e Implement script message for edge backend 2021-02-26 15:41:42 +01:00
Tobias Taschner
011035ef08 Add wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED event 2021-02-26 15:41:41 +01:00
Pavel Tyunin
00fec01308 Fex search in wxSortedArrayString with custom compare function in STL build 2021-02-26 11:52:44 +02:00
Pavel Tyunin
2451f8085b Fix search in wxSortedArrayString with custom compare function 2021-02-25 21:28:32 +02:00
Vadim Zeitlin
752ba82041 Fix format specifier used for wParam in wxMSW WM_POWER handler
wParam is 64 bits in 64 bit builds and can't be used with "%d", we need
"%zd" for it.

Closes #19080.
2021-02-24 13:29:27 +01:00
Paul Cornett
f25d48fbd5 Use a more accurate size for wxTimePickerCtrlGeneric
See #19078
2021-02-23 23:12:43 -08:00