Commit Graph

18933 Commits

Author SHA1 Message Date
Vadim Zeitlin
4dd009136c Merge branch 'aui-auto-uninit'
Call wxAuiManager::UnInit() automatically.

Closes #14145.
2020-07-20 15:49:05 +02:00
Vadim Zeitlin
4552009805 Merge branch 'pr1312-no-unsafe-wxstring-conv'
Add a way to optionally disallow all implicit conversions between
wxString and "const char*".

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

See #18113.
2020-07-20 15:47:17 +02:00
Tomay
bbdd5b4984 Add wxWindow::DisableFocusFromKeyboard()
This allows to easily exclude a window from the TAB chain.

Closes https://github.com/wxWidgets/wxWidgets/pull/1516
2020-07-19 14:55:51 +02:00
Hans Mackowiak
f646532889 Call wxAuiManager::UnInit() if associated frame is destroyed
Don't require the application code to explicitly do it if the frame is
destroyed before the manager itself.
2020-07-18 17:47:34 +02:00
Arrigo Marchiori
05cce8d89d Add wxUSE_HTML check to wxHtmlListBox header
Avoid compilation errors if wx/htmllbox.h gets included when wxUSE_HTML
is off.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
3aaa31e703 use wxConvWhateverWorks for translation strings
Revert the introduction of wxGet-SetInlineEncoding()
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
464aeb8f84 avoid using wxNO_IMPLICIT_WXSTRING_ENCODING in utf-8-only builds 2020-07-17 17:52:16 +02:00
Arrigo Marchiori
57e136d9e1 Enforce consistency of encoding-related macros
Force wxNO_UNSAFE_WXSTRING_CONV on if wxNO_IMPLICIT_WXSTRING_ENCODING is
on, as the latter is even stronger than the former.
2020-07-17 17:52:16 +02:00
Vadim Zeitlin
f44121378e Apply implicit encoding check to wxDataFormat ctor in wxMSW too
This is similar to what had been already done in wxGTK.
2020-07-17 17:52:16 +02:00
Vadim Zeitlin
a2609429a3 Apply implicit encoding check to wxString::{starts,ends}_with() too
Don't provide the overloads taking "const char*" when compiling with
wxNO_IMPLICIT_WXSTRING_ENCODING is defined.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
860f6076b8 Explicit encoding for implicit conversion in wxGetTranslation() 2020-07-17 17:52:16 +02:00
Arrigo Marchiori
c86bcf962d Use wxASCII_STR() on string literals
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
65cbf40b7e Add wxNO_UNSAFE_WXSTRING_CONV2 macro
The macro disallows implicit conversions between wxString and const
char*
2020-07-17 17:34:38 +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