Commit graph

21145 commits

Author SHA1 Message Date
Bill Su
74f88f9131 Add wxRadioButton group support to wxGenericValidator
Enable wxGenericValidator(int*) to work with wxRadioButton groups
when applied to the first element of the group.  The value will be
the index of the selected button within the group.

Closes #24264.
2024-01-30 01:52:59 +01:00
oneeyeman1
91de9867ee Add wxStandardPaths::GetSharedLibrariesDir()
This function returns the directory with the application's shared
libraries, which is different from the plugins directory under Mac.

Closes #24052.
2024-01-28 18:41:20 +01:00
Scott Talbert
fc35ad92bb Remove unnecessary empty destructors
These cause a problem for GCC 14 which detects that there are no
corresponding copy constructors and assignment operators and gives
-Wdeprecated-copy-dtor due to their presence, e.g.

/home/fedora/swt2c/wxWidgets/bld/bk-deps g++ -c -o test_allheaders_allheaders.o  -I/home/fedora/swt2c/wxWidgets/bld/lib/wx/include/gtk3-unicode-3.3 -I../../include -D_FILE_OFFSET_BITS=64 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/webp -I/usr/include/blkid -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/fribidi -I/usr/include/sysprof-6 -pthread -I/usr/include/libpng16 -DWITH_GZFILEOP  -D__WXGTK__      -I../../tests -DWXUSINGDLL -I../../tests/../samples -I../../3rdparty/catch/single_include -pthread -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -O2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/libxml2 -I/usr/include/sysprof-6 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webp -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0  -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -DPIC   ../../tests/allheaders.cpp
In file included from ../../include/wx/evtloop.h:13,
                 from ../../tests/testprec.h:5,
                 from ../../tests/allheaders.cpp:369:
../../include/wx/event.h: In copy constructor ‘wxSetCursorEvent::wxSetCursorEvent(const wxSetCursorEvent&)’:
../../include/wx/event.h:1943:11: error: implicitly-declared ‘wxCursor::wxCursor(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
 1943 |           m_cursor(event.m_cursor)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../include/wx/cursor.h:51,
                 from ../../include/wx/event.h:21:
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
   37 |     virtual ~wxCursor();
      |             ^
../../include/wx/event.h: In member function ‘void wxSetCursorEvent::SetCursor(const wxCursor&)’:
../../include/wx/event.h:1949:57: error: implicitly-declared ‘wxCursor& wxCursor::operator=(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
 1949 |     void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
      |                                                         ^~~~~~
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
   37 |     virtual ~wxCursor();
      |             ^

Fixes #24248.

Closes #24255.
2024-01-28 18:16:07 +01:00
Vadim Zeitlin
50e35c71eb Fix using Alt under MSW when wxGrid has focus
Stop consuming all wxEVT_KEY_UP events in wxGrid as this broke the
standard keyboard handling: pressing and releasing "Alt" didn't give
focus to the menu bar when wxGrid had it.

This also seems completely unnecessary.

Closes #24246.

See #24247.
2024-01-28 18:09:10 +01:00
taler21
28ced1bc33 Make checks on character entry in numeric validators less relaxed
Restrict the input to not allow values that are greater than the
positive maximum or less than the negative minimum.
In many cases it is not necessary to allow invalid characters to be
entered. For example, if the specified range is 0 to 100.

See #24220.
2024-01-28 18:02:13 +01:00
Vadim Zeitlin
5bb2cb43d1 Restore wxAuiToolBar::RealizeHelper(bool) for compatibility
This function was replaced with a more useful function taking
wxOrientation and returning wxSize in bbba3b7cb9 (Make
wxAuiToolBar::RealizeHelper() return value actually useful, 2023-12-25)
but there is some existing code using the old RealizeHelper() from its
overridden Realize(), so restore it for compatibility, even if it's
quite useless now.

See #24023, #24164, #24244.
2024-01-28 17:32:32 +01:00
Vadim Zeitlin
cc9f9af400 Flush wxLogGui before showing a modal dialog
This ensures that any messages passed to wxLogError() or other functions
are shown before wxMessageBox() that could be referring to them instead
of it happening while the message box is shown (most ports, including
wxGTK) or only after it is dismissed (wxMSW).

See #24231.

Closes #24228.
2024-01-28 17:31:38 +01:00
ali kettab
9e61385878 Add wxRendererNative implementation for wxQt
Closes #24223.
2024-01-23 03:22:06 +01:00
Vadim Zeitlin
1b4dfc292a Merge branch 'vlistbox-current-accessors' of https://github.com/wsu-cb/wxWidgets
wxVListBox: add GetCurrent()/SetCurrent() accessors.

See #24204.
2024-01-22 21:41:28 +01:00
Vadim Zeitlin
2a74f6a644 Merge branch 'more-std-obj-array'
Make wxObjArray a bit more standard-like.

See #24233.
2024-01-21 01:48:41 +01:00
Lauri Nurmi
99bc43cefe Introduce minimal MSW ARM support
wxMSW could already be compiled for ARM with MSVC, but due to not
defining any ARCH_SUFFIX for ARM, makefile.vc used to place objectsi
and libraries to the same folder as x86 objects and libraries.

A completely different question is what kind of Windows runs on 32-bit
ARM, and whether one can run regular desktop apps on it.

This commit mimics what f69dbaa1 did for ARM64, and adapts it for ARM.

Closes #24222.
2024-01-21 01:48:16 +01:00
Vadim Zeitlin
ed89fc5f3b Make wxImageListBase DLL-exported to fix MSVS warnings
Without a DLL export declaration on this class MSVS complains about
using it as a base class for DLL-exported wxImageList, so do provide
this declaration, even if it's not normally necessary because there are
no member functions of this class in the shared library, just to avoid
the warning.

Closes #24232.
2024-01-21 01:42:54 +01:00
Vadim Zeitlin
6d0b1369aa Also add wxObjArray::swap() for consistency with the other arrays
As with the previous commit, make this kind of arrays a bit more
comfortable to use as long as we can't avoid using them completely.
2024-01-21 00:01:54 +01:00
Vadim Zeitlin
a5f02170c4 Add possibility to iterate over wxObjArray using range-for
While such arrays are deprecated, we still use some of them, e.g. in
wxAUI code, so make using them slightly less painful by allowing
iterating over them naturally.
2024-01-20 23:58:48 +01:00
Vadim Zeitlin
046eb38bf0 Use explicit scope in wxBaseObjectArray implementation
This doesn't change anything yet, but will when this class defines its
own begin() and end() in the next commit.
2024-01-20 23:53:09 +01:00
Vadim Zeitlin
f37401dde3 Merge branch 'webview-chromium'
Add Chromium-based wxWebView backend.

See #706.
2024-01-19 03:07:44 +01:00
ali kettab
152ec01122 Fix wxEVT_SET_CURSOR handling under wxQt
Really fix wxSetCursorEvent handling for wxAUI done in commit f608b34
(Send set cursor events whenever there is mouse movement) without
breaking the other controls, i.e. wxSplitterWindow, wxHeaderCtrl and
wxGrid.

Pass the mouse position by const reference to QtSendSetCursorEvent().

Closes #24217.
2024-01-19 02:56:45 +01:00
Randalphwa
38d8980283 Add optional wxXmlParseError to wxXmlDocument::Load()
If a pointer to the structure is passed in to Load(), it will be filled
in if a parsing error occurs.

Closes #24215.
2024-01-19 02:55:54 +01:00
Randalphwa
30b98c81b1 Replace #ifdef with #if in WXWIN_COMPATIBILITY_3_2 check
This matches the rest of the code base, allowing setup.h to have:

    #define WXWIN_COMPATIBILITY_3_2  0

See #24215.
2024-01-19 02:52:51 +01:00
Blake Madden
567f8c47af Add wxRibbonBar::GetPageById()
To find a page by ID currently you have to use a recursive FindWindow
(which would also look at the child Panel windows). This function allows
for finding a page by ID more elegantly.

Closes #24211.
2024-01-19 02:49:47 +01:00
Vadim Zeitlin
ee691af12d Merge branch 'qt-some-cleanups' of https://github.com/AliKet/wxWidgets
Some more wxQt fixes and cleanups.

See #24210.
2024-01-19 02:47:52 +01:00
Bill Su
a3951b6863 wxUniv: wxWindow: rename SetCurrent() to WXMakeCurrent()
avoid name conflicts between port-specific function and
wxVListBox::SetCurrent()
2024-01-17 00:52:01 -05:00
Vadim Zeitlin
fae1f35e08 Allow customizing CEF log file and log level
Add new wxWebViewConfigurationChromium class which corresponds to the
"native" configuration used in the other backends and contains (some)
fields of CefSettings in this one.
2024-01-17 01:16:06 +01:00
Vadim Zeitlin
ff59ef301b Merge branch 'master' into webview-chromium 2024-01-17 00:22:39 +01:00
Maarten Bent
ea5f585e89
Add system option to never use AutoSystemDpiAware
Add the option 'msw.native-dialogs-pmdpi' that will always show the native msw dialogs
as per monitor dpi aware, even when there are displays with different dpi.
2024-01-14 19:41:01 +01:00
Maarten Bent
9befda5c26
Only use AutoSystemDpiAware when displays have different DPI
So the native win32 dialogs, like font and colour picker, are not shown blurry unnecessary.

Fixes #24121
2024-01-14 19:41:00 +01:00
ali kettab
05ebdb7ebd Emphasize that wxQtSignalHandler is for wxWindow handlers only under wxQt
There is no change in behaviour because this has already been the case since its inception.
2024-01-14 14:23:41 +01:00
ali kettab
90d56e52a3 Fix creating wxMenuItem with nullptr parent under wxQt
This is documented and is already the case for the other ports.
2024-01-14 14:23:41 +01:00
Vadim Zeitlin
a2f7a933e8 Merge branch 'no-global-ops'
Don't define operators for wx types in global scope.

This results in much better error messages when the compiler gives an
error about failing to resolve a call to some operator in user code
because it doesn't list all the wx-defined operators as candidates. In
practice, this cuts down error messages from 500 (!) lines to 2 with
gcc.

See #24190.
2024-01-12 18:42:39 +01:00
Vadim Zeitlin
565775a2c8 Merge branch 'bitmap-create-log-size'
Add wxBitmap::CreateWithLogicalSize() and use it.

See #24199.
2024-01-12 18:37:20 +01:00
Vadim Zeitlin
d7cff61267 Merge branch 'default-xdg-config'
Use XDG-compliant location by default in wxFileConfig.

See #24195.
2024-01-12 18:31:58 +01:00
ali kettab
03ad7039d6 Don't expose implementation only class to public under wxQt
No real changes
2024-01-11 23:42:36 +01:00
Bill Su
89e78831f7 wxVListBox: add GetCurrent()/SetCurrent() accessors 2024-01-11 00:47:04 -05:00
Vadim Zeitlin
56d857152d Don't use comma operator in wxPoint operators
This was probably done unintentionally in 8ccbd7e95d (Implement
operator/=(int) and operator*=(int) for wxPoint and wxRealPoint.,
2024-01-04) and results in warnings from clang.
2024-01-11 00:49:32 +01:00
Vadim Zeitlin
afc635f845 Merge branch 'aui-repaint'
Fix some wxAUI repaint problems and switch to using live resize
everywhere by default.

See #24166.
2024-01-10 18:43:24 +01:00
Vadim Zeitlin
4f666c227a Merge branches 'aui-close-on-all-fix', 'aui-current-after-drag', 'aui-hint', 'aui-tbar-realize' and 'aui-book-rm-current'
Merge miscellaneous AUI fixes and improvements.

See #24159, #24160, #24161, #24164, #24184.
2024-01-10 18:39:41 +01:00
Vadim Zeitlin
9cc5e5d276 Add wxBitmap::CreateWithLogicalSize()
This function should be used instead of CreateWithDIPSize() in portable
code, the latter is currently often used to do what this function is
doing, but this only works correctly in wxOSX and wxGTK3 but not wxMSW.
2024-01-09 03:15:56 +01:00
Vadim Zeitlin
6586afb0a5 Use XDG-compliant location by default in wxFileConfig
Still use the traditional dot file if it already exists, but prefer
using the new location otherwise, i.e. for the new program installation.

Add wxCONFIG_USE_HOME to allow forcing the use of the old location if
really necessary.

Also use the new style as default "old style" of MigrateLocalFile() so
that calling it even when using XDG layout in wxStandardPaths still
works as expected.
2024-01-08 00:43:26 +01:00
Vadim Zeitlin
4fc2281286 Add wxLogCollector
This class is more convenient than wxLogBuffer that it uses and can be
used to collect all the logged messages in a string during its lifetime.
2024-01-07 22:43:55 +01:00
Vadim Zeitlin
2566a1abf5 Add wxLogFormatterNone
This trivial class allows to easily disable all log formatting,
including time stamping and level-dependent prefixes.
2024-01-07 22:31:52 +01:00
Vadim Zeitlin
30dd7e9095 Add wxLogBuffer::Clear()
This can be used to prevent the log buffer contents from being flushed
when replacing it with another logger, which is typically undesirable.
2024-01-07 22:12:52 +01:00
Vadim Zeitlin
b294a6b2bc Merge branch 'config-xdg'
Make it easier to use wxFileConfig in XDG-compliant way.

See #24180.
2024-01-07 16:13:15 +01:00
Vadim Zeitlin
cc8fbeed56 Merge branch 'xml-conv-simplify'
Simplify and modernize wxXmlDocument code.

See #24179.
2024-01-07 16:12:31 +01:00
Vadim Zeitlin
2349586e28 Hide operator<<() overloads for wxString and related classes
As not defining operator<<() overload taking wxScopedCharBuffer in the
global scope prevents it from being considered as an overload resolution
candidate (which is, of course, the whole point), it also prevents it
from being used for the classes convertible to it, such as wxCharBuffer,
so we need to define operator<<() overloaded for the latter explicitly
too.

We also need a new wxScopedCharTypeBufferStreamSupport helper in order
to define different operators inside different specializations of
wxScopedCharTypeBuffer<>.
2024-01-07 00:28:16 +01:00
Vadim Zeitlin
3b62433a3f Hide overloaded wxTimeSpan and wxDateSpan operator*()
Define them in these classes scope instead of at the global scope.
2024-01-06 23:06:02 +01:00
Vadim Zeitlin
3c151ac815 Hide overloaded operators on wxPoint2DInt and wxPoint2DDouble
Define all the arithmetic operators working with these objects inside
the corresponding classes and not at the global scope.
2024-01-06 23:06:02 +01:00
Vadim Zeitlin
a763de6940 Hide operator+() overloads for wxString::iterator and related
Don't define these operators in the global scope.
2024-01-06 23:06:02 +01:00
Vadim Zeitlin
09eff033d9 Hide operator<<() overloads used for wxVariant support too
Add new wxDECLARE_VARIANT_OBJECT_EXPORTED() macro defining these
operators as friend functions inside the class declaration and replace
all uses of DECLARE_VARIANT_OBJECT_EXPORTED() inside the core library
with the new macro to avoid defining any operator<<() overloads in the
global scope.

Also add wxIMPLEMENT_VARIANT_OBJECT() for consistency, even though it is
not really needed.
2024-01-06 23:06:02 +01:00
Vadim Zeitlin
7f56c7c068 Hide operator<<() and operator>>() overlods for wxLongLong_t
And wxULongLong_t.
2024-01-06 23:06:02 +01:00
Vadim Zeitlin
0122ce20c4 Hide operator<<() overloaded for wxBitmapBundle
Define it inside this class and not in the global scope.
2024-01-06 23:06:02 +01:00