Commit Graph

18921 Commits

Author SHA1 Message Date
michael
6023925ef6 Allow using XMLHTTP ActiveX object with custom scheme handlers
Fix the problem of the access-denied error when using a 'new
window.ActiveXObject("Microsoft.XMLHTTP")' to access URIs from custom
WebView scheme handler of the Internet Explorer WebView.

The solution here is to implement PARSE_SECURITY_URL and
PARSE_SECURITY_DOMAIN in ParseUrl of the IInternetProtocolInfo interface
of the Internet Explorer Control.

The direct implementation of VirtualProtocol::QueryInterface() instead
of using IMPLEMENT_IUNKNOWN_METHODS works, but is not nice. The better
approach would be probably enhancing ADD_RAW_IID to support multiple
inheritance.

Closes #17893.
2020-07-19 14:28:33 +02:00
Stefan Csomor
051152ff95 Support GetFilterIndex() when filter choice is not shown in wxOSX
Platform native behaviour is not to show a filter, but to allow all
supported types to be selectable. Make sure GetFilterIndex still is a
valid choice (and not -1 as before).

Closes https://github.com/wxWidgets/wxWidgets/pull/1976
2020-07-17 15:06:58 +02:00
Daniel Kulp
6d12e746e1 Fix regression with making sockets non-blocking under Unix
The refactoring in the commit 51ea713826 (Extend and rename
wxSocketImpl::UnblockAndRegisterWithEventLoop(), 2019-11-20)
accidentally inverted the test for wxSOCKET_BLOCK, restore the correct
logic to make non-blocking sockets work again.

Closes #18834.
2020-07-16 11:51:51 +02:00
Vadim Zeitlin
7687d10c51 Merge branch 'empty-text-extent'
Make Get[MultiLine]TextExtent() behave consistently for empty strings on
all platforms, in particular return (0, 0) size for them from
GetTextExtent() in wxGTK, which is an incompatible change but is needed
to make it behave in the same way as the others.

See https://github.com/wxWidgets/wxWidgets/pull/1970
2020-07-16 11:43:05 +02:00
Lauri Nurmi
e6945aeedc Eliminate public header file's dependency on CoreServices.h
wx public headers are not supposed to include platform-specific headers
defining many macros that can conflict with the identifiers defined in
the application code. In this particular case, including CoreServices.h
ultimately #included AssertMacros.h, which by default on older SDKs
(<10.12) introduces various macros whose names very easily conflict with
user code.

For example, if you #included <wx/fswatcher.h> in your own code, and
your code happened to contain a symbol called 'check', or 'verify',
compilation failed.

Fix this by using pImpl idiom to move the variable requiring a type
defined in the SDK header into the source file.

Closes https://github.com/wxWidgets/wxWidgets/pull/1666
2020-07-16 01:54:24 +02:00
Vadim Zeitlin
857bb9e806 Merge branch 'im/gridcombo' of https://github.com/imciner2/wxWidgets
Close the cell editor when the editor's combobox is closed.

See https://github.com/wxWidgets/wxWidgets/pull/1941
2020-07-15 16:15:42 +02:00
Vadim Zeitlin
1bf5e536e9 Merge branch 'generic-treectrl-cleanup'
Improve wxGenericTreeCtrl code handling system colours/theme changes.

See #18823.
2020-07-15 14:26:55 +02:00
Vadim Zeitlin
c14053c211 Merge branch 'osx-11'
Adaptations for macOS 11.0.

See https://github.com/wxWidgets/wxWidgets/pull/1940
2020-07-15 14:26:05 +02:00
Vadim Zeitlin
33e8684356 Merge branch 'ios-menu'
Add support for wxMenu under iOS.

See https://github.com/wxWidgets/wxWidgets/pull/1965
2020-07-15 14:25:30 +02:00
Vadim Zeitlin
2280e43fe9 Factor out wxTextMeasureBase::GetEmptyLineHeight()
No real changes, just refactor to extract a trivial helper function.
2020-07-15 01:16:23 +02:00
PB
88a6c8c905 Fix building wxMSW using GCC 10.1 with C++20 standard
Add comparison operator overloads using NativeFormat to wxDataFormat
to prevent ambiguous operator overload errors.

Closes https://github.com/wxWidgets/wxWidgets/pull/1962
2020-07-14 22:09:47 +02:00
Vadim Zeitlin
33038a2ce7 Remove the now unnecessary empty wxMessageDialog dtor
No real changes, just some minor cleanup after 220dfe17ea (Replace
deprecated API usage for window modal dialogs, 2020-07-09).
2020-07-14 20:16:03 +02:00
Stefan Csomor
ab858b5805 Produce NFD in wxConvFileName::FromWChar() on macOS
This ensures that fn_str() returns the string in the expected,
decomposed, format.

Also simplify the code by removing workarounds for old systems which are
not supported any more and make explicit the fact that under macOS
ToWChar() always produced NFC.
2020-07-14 20:15:04 +02:00
Stefan Csomor
74bc9b5f71 Avoid infinite recursion between wxStockGDI and wxSystemSettions
There was a possible recursion from wxStockGDI::GetFont to
wxSystemSettings::GetFont and back, resolve by using direct font
creation, adding fixed system font.
2020-07-14 20:10:46 +02:00
Stefan Csomor
220dfe17ea Replace deprecated API usage for window modal dialogs
Remove the delegate objects that are not used any longer.

Move wxGetAvailableDrives() to Objective-C code file dirdlg.mm to allow
for Cocoa implementation.
2020-07-14 20:10:46 +02:00
Stefan Csomor
dd0033d817 Removing unused obsolete code from wxFileDialog
We don't need workaround for macOS earlier than 10.6 any longer.
2020-07-14 19:49:21 +02:00
Vadim Zeitlin
5735e7227b Add checks for wxUSE_MENUBAR to wx/chkconf.h
Check that it's defined in the first place and also check that
wxUSE_MENUS is on if wxUSE_MENUBAR is.
2020-07-14 18:16:59 +02:00
Stefan Csomor
6833b0e934 adding combined macOS iOS version guards 2020-07-14 18:16:59 +02:00
Stefan Csomor
7812657cbf Implement minimal wxMenu support for iOS
A separate change later will add features using iOS 14 specific API and
iOS 13 (and earlier) fallback for them.
2020-07-14 18:16:59 +02:00
Stefan Csomor
68ee7ffa2a Add wxUSE_MENUBAR build option, off by default in wxiOS
Allow building without wxMenuBar (but with wxMenu), as this class
doesn't exist and can't be reasonably implemented under iOS (but
wxMenu can and should be, as it's widely used in iOS 14 UI).
2020-07-14 18:16:59 +02:00
Vadim Zeitlin
8535cde836 Remove apparently unnecessary m_hasExplicitFont
Just use wxWindow::m_hasFont instead.
2020-07-14 15:47:35 +02:00
Vadim Zeitlin
0d7ab26e7d Factor out wxGenericTreeCtrl::InitVisualAttributes()
No real changes, just avoid calling an event handler directly.
2020-07-14 15:46:05 +02:00
Vadim Zeitlin
1ec7ae9a6f Use wxBrush objects instead of pointers in wxGenericTreeCtrl
There is no need for double indirection, wxBrush object is already
pointer-like internally.

No real changes, just simplify/optimize the code a little.
2020-07-14 15:43:23 +02:00
Ian McInerney
b256aa6956 Replace wxEVT_GRID_HIDE_EDITOR usage with CallAfter
This simplifies the code by removing the need for a special event,
and also means the combox popup handler is no longer needed to reset
the inSetFocus flag for the closing handler.
2020-07-14 12:28:13 +01:00
Paul Cornett
5325ccfda6 Update generic wxTreeCtrl appearance when theme changes
See #18823
2020-07-13 20:26:59 -07:00
Vadim Zeitlin
e779450638 Merge branch 'tipwindow'
Miscellaneous wxTipWindow enhancements, including better high DPI
support.

See https://github.com/wxWidgets/wxWidgets/pull/1949
2020-07-12 22:31:08 +02:00
Vadim Zeitlin
32489c914c Merge branch 'vector-reverse-iter'
Fix wxVector reverse iterator base().

See https://github.com/wxWidgets/wxWidgets/pull/1948
2020-07-12 22:30:42 +02:00
tm
f6cc8ff52c Add GetOpenGLScaleFactor() to abstract OpenGL coordinates scaling
The fix for OpenGL coordinates when using high DPI in b134589cbb (Fix
OpenGL samples when using HiDPI displays, 2019-08-06) did fix it for GTK
3 and macOS, but broke it for MSW and other platforms not using pixel
scaling, as window coordinates are the same as OpenGL ones there, while
GetContentScaleFactor() can still return values > 1 even on these
platforms.

Provide new GetOpenGLScaleFactor() function abstracting this platform
difference and use it in all OpenGL samples to make them work correctly
in high DPI under all platforms.

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

Closes #17391.
2020-07-12 22:28:29 +02:00
Artur Wieczorek
ae1e93cbae Don't allow wxSpinCtrl range to include negative values if base != 10 (wxMSW)
In a native up-down control hexadecimal numbers are always unsigned (see
UDM_SETBASE message documentation) so we need to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.

See #18805.
2020-07-12 19:58:30 +02:00
Stefan Csomor
b2d4a9dedc adding data-transfer direction when getting native datatypes
we are publishing exactly what we have internally when data has to be get, and when setting, we might have more formats we can support
2020-07-12 17:53:10 +02:00
Vadim Zeitlin
01b0a50f8f Move wxTipWindow members used only by wxTipWindowView there
No real changes, just move m_textLines and m_heightLine from wxTipWindow
to wxTipWindowView as they were only used by the latter and so can just
as well be its members.

Also use this as an opportunity to replace wxArrayString with wxVector.
2020-07-11 19:59:40 +02:00
Vadim Zeitlin
c6d1a851da Make wxUSE_TIPWINDOW dependent on wxUSE_POPUPWIN
It doesn't seem to make sense to provide wxFrame-based implementation of
wxTipWindow, if anything we should use similar code to implement
wxPopupTransientWindow itself on the platforms not providing it.

So simplify wxTipWindow code by leaving only a single implementation,
using wxPopupTransientWindow. This should have arguably been done back
in 8962e1d938 (wxTipWindow is now a wxPopupTransientWindow instead of a
wxFrame., 2001-11-30) which introduced the use of wxPopupTransientWindow
in this code.
2020-07-11 19:59:40 +02:00
Vadim Zeitlin
b7057c336f Merge branch 'msw-dismiss-unfocused-popup'
Allow wxPopupTransientWindow to work without wxPU_CONTAINS_CONTROLS too
in wxMSW and don't use wxPU_CONTAINS_CONTROLS by default, notably
allowing wxTipWindow to be shown without stealing focus.

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

Closes #18636.
2020-07-11 19:56:32 +02:00
Vadim Zeitlin
5495389db5 Fix off-by-one bug in wxVector::reverse_iterator::base()
This is embarrassing, but the iterator returned by this method seems to
have always been wrong, ever since it was added back in 946954d3bf
(Added reverse iterator to wxVector<T>, 2008-09-16). Moreover, it was
also broken in its const_reverse_iterator counterpart where it was
copy-and-pasted in f7ef20685f (Add wxVector<>::const_reverse_iterator,
2013-05-08).

Finally fix this to return the correct value and add at least a simple
unit test check that this method behaves as expected.
2020-07-11 19:05:06 +02:00
Vadim Zeitlin
0918ab679b Merge branch 'dirdialog-multi-hidden'
Add wxDD_MULTIPLE and wxDD_SHOW_HIDDEN support to wxDirDialog.

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

Closes #18736.
2020-07-11 13:52:12 +02:00
Vadim Zeitlin
617db49fda Remove support for gcc < 4
We probably could drop support for some gcc 4.x versions too, but we
definitely don't need to support gcc 3.x any longer and not doing it
simplifies the code a bit, so just assume gcc >= 4.

Closes https://github.com/wxWidgets/wxWidgets/pull/1943
2020-07-11 13:51:58 +02:00
Vadim Zeitlin
a47fd95e45 Avoid overriding wxDirDialog::GetPath[s]() unnecessarily
Don't duplicate practically the same code in all ports, just add m_paths
itself to the base class. The only drawback of doing this is that it's
unused in the ports not (yet) using it, but this saves enough code in
the aggregate to be worth it.
2020-07-10 03:52:15 +02:00
Vadim Zeitlin
2b0323ebc8 Avoid using wxString::Empty()
This is confusingly similar to std::string::empty() which doesn't do the
same thing, so prefer using clear() instead.

And simply remove Empty() calls before the assignment, as they're
useless.

No real changes.
2020-07-10 03:43:23 +02:00
PB
83aa1a19a5 Implement MSW support for wxDD_MULTIPLE and wxDD_SHOW_HIDDEN 2020-07-10 03:32:49 +02:00
Ian McInerney
ade5030c56 Warn on incompatible wxDirDialog styles 2020-07-10 03:32:49 +02:00
Ian McInerney
7230acd110 Fix setting the title for the wxDirDialog on OSX
OSX 10.11+ doesn't actually display the title, so update documentation
to reference SetMessage instead. For pre-10.11 override the SetTitle
method to set the title of the NSOpenPanel instead of the window.

Also change so the directory is not updated unless it is provided.

Closes #15143.
2020-07-10 03:32:48 +02:00
Ian McInerney
61afcae0be Implement multiple selection support in wxOSX
Add support for wxDD_MULTIPLE style to wxDirDialog in wxOSX too.
2020-07-10 03:32:19 +02:00
Ian McInerney
79d73d4eb3 Add show hidden folders flag to wxDirDialog
Add wxDD_SHOW_HIDDEN similar to the existing wxFD_SHOW_HIDDEN.
2020-07-10 03:29:16 +02:00
Ian McInerney
f9e9b19c92 Add wxDD_MULTIPLE wxDirDialog style and implement it for GTK
Add wxDirDialog::GetPaths() similar to the existing member of
wxFileDialog with the same name and also taking, for consistency,
wxArrayString as the output parameter.
2020-07-10 03:24:42 +02:00
Vadim Zeitlin
41410610ef Don't force wxPU_CONTAINS_CONTROLS on wxPopupTransientWindow
Popups not using this style work too now (since the parent commit), so
this style should be used only if the popup actually requires focus and
not always, unconditionally.

Turn on this style explicitly in the sample which shows a popup window
with wxTextCtrl inside it (which requires focus to work).
2020-07-10 00:02:48 +02:00
Vadim Zeitlin
3bcbc8fe8e Implement dismissal for unfocused wxPopupTransientWindow
Popups not using wxPU_CONTAINS_CONTROLS were not automatically dismissed
at all any longer, as the only auto-dismissal mechanism related on
getting WM_ACTIVATE, which they never did, so implement a different
logic for dismissing them: do it on any change of focus and also any
mouse press (but not move and not key press neither).

This will allow not using wxPU_CONTAINS_CONTROLS for popups that don't
need focus, but still must disappear on their own.
2020-07-09 23:58:29 +02:00
Ian McInerney
8b7fdc5e5b Close the cell editor when the editors combobox is closed
Closes #16404
2020-07-09 18:15:24 +01:00
Danail Stoychev
5e7e89de16 Fix re-parenting TLWs in wxMSW
We need to set the new owner for the TLW, instead of using the new
parent as the actual parent, in the MSW sense, as this results in a
weird situation in which the TLW becomes a child (i.e. non-TLW) window.

Closes #18785.
2020-07-09 00:34:44 +02:00
PB
83a2a1e505 Refactor the natural string compare and sort algorithm
Add a new string fragment type for whitespace and punctuation which needs
to be assessed separately from letters and symbols.

Use wxUint64 instead of long for storing the value for numeric fragment.

Use collate instead of compare for non-numeric fragments.

Change names for the public comparison functions: wxWidgets provided function
is now named wxCmpGenericNatural() and for common public use is wxCmpNatural()
which calls a native function in wxMSW and wxCmpGenericNatural() elsewhere.

Try harder in wxCmpNaturalGeneric() if wxRegEx is unavailable: do not
just make a simple string comparison, but perform a case-insensitive
collation.

Make some other changes to simplify and possibly speed up the code.
2020-07-07 23:10:18 +02:00
Hugo Elias
371c4b1366 Add functions for sorting strings in natural sort order
Use StrCmpLogicalW() under MSW and generic implementation under the
other platforms.

See https://github.com/wxWidgets/wxWidgets/pull/780
2020-07-07 23:10:11 +02:00