Commit Graph

20168 Commits

Author SHA1 Message Date
Ronny Krüger
8ef6f9fa27 Add a 'revision' component to wxVersionInfo
Some versions consist of four parts with the last part being called the
revision or build number. wxVersionInfo is now able to save such a
fourth number.
2022-06-29 22:50:12 +02:00
Vadim Zeitlin
7e1cbe8f79 Merge branch 'bmpbndle-from-xpm'
Allow creating wxBitmapBundle from XPM and use it in wxRichToolTip.

See #22573.
2022-06-27 01:33:28 +02:00
Vadim Zeitlin
f7c65a7b44 Merge branch 'msw-dpi-resize'
Improve window resizing after DPI change in wxMSW.

See #22565.
2022-06-27 01:32:31 +02:00
Vadim Zeitlin
a70a6fe61d Add "RC1" to wxVERSION_STRING
Indicate that this is a release candidate and not the final 3.2.0 yet.
2022-06-26 23:27:38 +02:00
Vadim Zeitlin
74967df874 Take wxBitmapBundle, not just wxIcon, in wxRichToolTip::SetIcon()
Extend this function to allow passing it multi-resolution bitmaps too.
2022-06-26 21:52:30 +02:00
Vadim Zeitlin
f48a13514f Allow constructing wxBitmapBundle from XPM data for compatibility
Add another compatibility implicit constructor to allow the existing
code, directly passing XPM data to various functions that used to take
wxBitmap or wxIcon and now taking wxBitmapBundle, to work.

Closes #22566.
2022-06-26 20:52:13 +02:00
Vadim Zeitlin
f0ea00cd35 Let application determine TLW size after DPI change
Don't change the window size automatically if the application handled
wxEVT_DPI_CHANGED event to allow it to choose a better size than what is
suggested by MSW itself.

Closes #19152.
2022-06-24 02:49:34 +01:00
Vadim Zeitlin
d74a4ea30d Add wxCHECK_GLIBC_VERSION() and cleanup glibc version checks
Use this macro where possible and simplify the checks in a couple of
places where it isn't (because we're checking for an exact glibc
version).

No real changes.
2022-06-23 19:01:18 +02:00
Vadim Zeitlin
2a2308d5ed Update version to 3.2.0 and rebake and rerun autoconf
Update all make/project files to use 3.2.0.
2022-06-21 00:54:26 +02:00
Vadim Zeitlin
c639226543 Merge branch 'dvc-model-simplify'
Simplify defining classes inheriting from wxDataViewModel.

See #22553.

Closes #17755.
2022-06-20 00:42:54 +02:00
Vadim Zeitlin
8872a77d66 Merge branch 'splitter-invisible-sash'
Make wxINVERT logical function work in at least some circumstances with
wxGTK3/X11 and use this to make wxSplitterWindow and wxSashWindow
separator visible during resizing.

See #22546.

Closes #16890.
2022-06-20 00:38:55 +02:00
Vadim Zeitlin
171f9ab8f4 Make wxBitmap::HasAlpha() and UseAlpha() available in all ports
HasAlpha() was already available in most of them, now ensure that it's
present in all of them, especially as it has a reasonable default
implementation.

UseAlpha() was only present in wxMSW and wxOSX and still remains only
implemented there, but provide at least a stub for it elsewhere as well
to avoid problems such as that of #17393.

See #22545.

Closes #17397.
2022-06-20 00:38:09 +02:00
Vadim Zeitlin
237f0c640e Merge branch 'unix-default-locale-fixes'
Fix handling of wxLANGUAGE_DEFAULT and other improvements in Unix
wxUILocale implementation.

See #22538.

Closes #22526.
2022-06-20 00:33:55 +02:00
Vadim Zeitlin
fe88494966 Remove unnecessary TempLocaleSetter::m_localeId
We don't need to store this string, we don't need it after the ctor.

Also change the default value of an argument of wxString reference type
to be a wxString, not a const char*.
2022-06-19 22:00:54 +02:00
Vadim Zeitlin
db588c53f2 Rename TempDefautLocaleSetter to TempLocaleSetter
Now that this class can be used to switch to any locale, having
"Default" in its name is not really appropriate any more.
2022-06-19 21:56:41 +02:00
Ulrich Telle
e0e34fcb1f
Make TempDefaultLocaleSetter configurable
If `locale_t` support is not available, it is necessary to be able to temporarily set a specific locale, not only the default user locale.
2022-06-19 12:44:56 +02:00
Vadim Zeitlin
37c7e2e96c Create helper TempDefautLocaleSetter class
Extract the existing code for temporarily changing the global locale
into a reusable class.

No real changes.
2022-06-19 02:58:47 +02:00
Vadim Zeitlin
04d6353b18 Formally deprecate wxDataViewModel::GetColumn{Count,Type}()
While there is no real harm in keeping them, it still seems better to
tell people that they're not needed.

Don't put them inside WXWIN_COMPATIBILITY_3_0 for now, however:
considering how late in 3.2 development this deprecation comes, it seems
better to wait until after it and then use WXWIN_COMPATIBILITY_3_2
instead.
2022-06-18 19:21:26 +02:00
Vadim Zeitlin
dbd211dbc2 Don't require overriding wxDataViewModel::GetColumn{Count,Type}()
Neither of these methods was actually ever used after the changes of the
last two commits (and they hadn't been used when not using wxGTK even
before), so don't force the user-defined model classes to override them.

Also stop using them, as the stub versions don't return correct values
any longer.

Still keep the virtual functions in the base class for compatibility
however as it doesn't cost us much and avoids breaking the existing code
using "override".
2022-06-18 19:19:16 +02:00
Vadim Zeitlin
5783b22d3d Add wxCOMPOSITION_DIFF composition mode
This is implemented in Cairo and CoreGraphics renderers only, but this
is still useful as these renderers are used on the platforms where wxDC
wxINVERT logical function is not supported and this composition mode can
partially replace it.
2022-06-17 01:32:07 +01:00
Vadim Zeitlin
49bbb00850 Merge branch 'mac-filedlg'
Fix transferring data from custom wxFileDialog controls and some
simplifications in wxOSX wxFileDialog code.

See #22544.
2022-06-17 01:12:50 +02:00
Vadim Zeitlin
a0ea9ba631 Fix data transfer to wxFileDialogCustomizeHook in non-wxMSW ports
Calling TransferDataFromCustomControls() in custom panel destructor
suffered from two fatal flaws:

1. It happened whether the dialog was accepted or cancelled, while
   we're only supposed to call this function when it's accepted.
2. It was done too late, when the customization hook itself could
   have been already destroyed, as it only has to live until ShowModal()
   returns but doesn't have (and typically doesn't) survive wxFileDialog
   itself.

Fix this by adding TransferDataFromExtraControl() and calling it
explicitly when, and only if, the dialog is accepted.

This fixes accessing invalid stack memory (thanks ASAN!) under GTK and
Mac and allows to remove the ugly workaround from wxMSW code, which can
now also just call TransferDataFromExtraControl().
2022-06-16 21:56:03 +02:00
Artur Wieczorek
a49a2e7390 Fix expression with different enum types
Arithmetic conversions on operands of different enumeration types
are deprecated in C++20 so we need to explicitly cast the operand
to the compatible type.

Closes  #22505.
2022-06-16 14:54:57 +02:00
Vadim Zeitlin
dd5162ee1d Merge branch 'menu-bitmaps'
Fix changing menu bitmaps from wxEVT_MENU_OPEN and provide
wxMenuItem::GetBitmapBundle() in addition to GetBitmap().

See #22532.
2022-06-16 13:03:01 +01:00
Vadim Zeitlin
f0ec9974a5 Remove the now unnecessary calls to SetupBitmaps()
After the changes of the previous commit, calling SetupBitmaps()
preemptively is not necessary any more, as it's called in any case just
before showing the menu, so remove the calls to it to simplify the code
and even make it slightly faster (at the cost of slowing it down before
opening the menu, but this needs to be done in any case to avoid
reintroducing the problem fixed by the parent commit).
2022-06-16 01:09:43 +01:00
Vadim Zeitlin
5f8b900078 Add wxMenuItem::GetBitmapBundle()
This is needed to e.g. allow cloning a wxMenuItem fully without losing
any of its data.
2022-06-16 01:09:43 +01:00
Vadim Zeitlin
c0dbe808a6 Move SetBitmap() and GetBitmap() to wxMenuItemBase
Ensure that all derived classes have these functions and let them to
avoid defining them if they can just use the default implementation,
which was the case for most ports.

Also move m_bitmap to the base class from the derived ones.

No real changes.
2022-06-16 01:09:43 +01:00
Vadim Zeitlin
7f3baa9abf Rename wxMenuItem::m_bmpChecked to m_bitmap in wxMSW and wxUniv
These two ports were the only ones to use something other than m_bitmap
for wxBitmapBundle storing the item bitmap, rename it for consistency
with the other ports and to allow moving this field into the base class
in the upcoming commit.

No real changes.
2022-06-14 18:27:07 +01:00
Vadim Zeitlin
124e3116b5 Fix calling TransferDataFromCustomControls() with common dialogs
When using common dialogs, because IFileDialog-based implementation is
not available either at compile- or run-time, this function needs to be
called while the extra controls still exist, i.e. before ShowModal()
returns, so do it from CDN_FILEOK handler.

Move the code that called it previously into the new MSWOnFileOK() for
consistency with the other callbacks.

Closes #22521.
2022-06-11 23:39:03 +01:00
Adrian Lopez
f59ae865db Fix TAB navigation in wxSimplebook
Derive wxSimplebook from wxNavigationEnabled<>: this is needed for at
least wxGTK and shouldn't do any harm even for the platforms where TAB
navigation worked even without it, such as wxMSW.

Closes #22517.
2022-06-11 15:19:31 +02:00
Vadim Zeitlin
45d81c75ff Make wxBMPHandler::DoLoadDib() a free function
This function doesn't have to be a member, so remove it from the header.

No real changes yet, but this will make it simpler to change it in the
upcoming commits.
2022-06-08 19:27:11 +01:00
Vadim Zeitlin
a3a6d5d388 Restore __LP64__ checks in Xcode config header
This is still necessary when targeting 32-bit ARM platforms.
2022-06-08 16:58:58 +02:00
Vadim Zeitlin
6211d53c62 Remove Cocoa type declarations from wx/defs.h
We don't need to declare CGFloat and NSInteger in our own headers when
we can just use double instead of the former in our public headers and
the latter wasn't used in them at all.

Note that this requires including CoreGraphics/CoreGraphics.h from the
private wxOSX headers as several of them do use CGFloat, which wouldn't
be defined otherwise.
2022-06-07 01:51:43 +02:00
Vadim Zeitlin
ddd6b34cf3 Drop support for 32-bit wxOSX/Cocoa build
wxOSX doesn't build in 32 bits since quite some time and it doesn't seem
worth fixing this, so just ensure that we give a clear build error in
this case instead of multiple and less clear errors further down the
build process.

Also remove the now unnecessary checks for __LP64__ from wxOSX code.
2022-06-07 00:46:59 +02:00
Vadim Zeitlin
4b83ed83ec Merge branch 'tbar-bitmap-size'
Improve handling toolbar tools bitmap size.

See #22488.
2022-06-05 14:43:29 +02:00
Vadim Zeitlin
35e982a67f Merge branch 'grid-dragmove'
Improve UI of dragging the wxGrid columns/rows to move them.

See #22457.
2022-06-05 13:39:35 +01:00
Vadim Zeitlin
56e4bb8bb4 Merge branch 'custom-file-dialog-controls'
Implement support for custom file dialog controls in new style MSW
dialogs.

See #22476.

Closes #14770.
2022-06-05 13:13:28 +01:00
Vadim Zeitlin
72f851f6f4 Remove the size parameter of wxBitmapBundle::GetConsensusSizeFor()
It doesn't seem to be useful and wasn't really specified in 2 out of 3
existing calls to this function and was probably wrongly specified in
the remaining one, so just remove it for now, it can always be added
later if we decide what exactly should it do.
2022-06-05 03:23:41 +02:00
Vadim Zeitlin
907e4ea862 Add wxBitmapBundle::GetConsensusSizeFor(double) and test it
Add an overload of the existing function which can be easily tested in
the unit tests and add a trivial new test for it.
2022-06-05 03:06:10 +02:00
Vadim Zeitlin
34fa234f48 Merge branch 'bmpbndl-scaling'
Improve wxBitmapBundle scaling logic by limiting it to integer scaling
factors and ensure it's consistent for files and MSW resources.

See #22481.
2022-06-04 18:36:50 +01:00
Lauri Nurmi
83c6edcc32 Always call wxSecureZeroMemory() to wipe memory in wxSecretValue
Replaces a call to MSW native ::SecureZeroMemory(), and calls to plain
memset().
2022-06-04 15:14:09 +03:00
Vadim Zeitlin
c18486e81f Add support for custom comboboxes in wxFileDialogCustomize
Allow using simple (i.e. not editable) comboboxes, known as wxChoice in
wx API, in the dialog too.

Demonstrate their use in the dialogs sample.
2022-06-04 00:50:54 +01:00
Vadim Zeitlin
07d7dd19f8 Add support for custom radio button controls in wxFileDialog
Update the dialogs sample to show using them too.
2022-06-03 01:35:31 +01:00
Vadim Zeitlin
44b6ce4826 Implement sending events for generic custom wxFileDialog controls
Forward the events from the actual wxControls used in the generic
implementation of wxFileDialogCustomize to wxFileDialogCustomControl so
that they could be handled by the application code binding to them.
2022-06-03 01:35:31 +01:00
Vadim Zeitlin
ae16657426 Add generic implementation of wxFileDialogCustomize API
Add implementation of the new file dialog customization API in terms of
the old one for the non-MSW ports (or even wxMSW if IFileDialog can't be
used for whatever reasons).

Just map wxFileDialogFoo to the corresponding wxFoo.
2022-06-03 01:35:31 +01:00
Vadim Zeitlin
fdcaeb050f Move GetExtraControlSize() hack from wxFileDialogBase to MSW code
The hack with creating a dummy dialog just to get the size of the extra
controls is only used in wxMSW, so move it to MSW-specific file from the
common code.

To allow doing this there, add CreateExtraControlWithParent() helper,
which is still not really used anywhere else than in wxMSW, but at least
doesn't do anything particularly ugly and doesn't really penalize the
common code for wxMSW sins.

No real changes.
2022-06-03 01:35:31 +01:00
Vadim Zeitlin
751a73a2ca Add optional label to wxFileDialogCustomize::AddTextCtrl()
Creating a text with a label is a common operation and can be
implemented to look slightly better than AddStaticText() followed by
AddTextCtrl() without a label when using IFileDialog.
2022-06-03 01:35:30 +01:00
Vadim Zeitlin
095c4dfc94 Add event generation to MSW IFileDialog-based implementation
Inherit wxFileDialogCustomControl from wxEvtHandler to allow Bind()ing
to events on it and use this to handle wxEVT_BUTTON and wxEVT_CHECKBOX
in the sample.

And inherit from IFileDialogControlEvents in wxMSW code to actually
generate these events when they happen.
2022-06-03 01:35:30 +01:00
Vadim Zeitlin
359ab98cb2 Start adding new API for wxFileDialog customization
wxFileDialog::SetCustomizeHook() can be implemented in terms of
IFileDialogCustomize in wxMSW, which means that it can be used with the
new style dialogs shown by IFileDialog, unlike SetExtraControlCreator(),
which could only be supported when using older style common dialogs.

Add support for a few different controls and wxMSW implementation, more
controls, generic implementation and the documentation will be updated
later.

Also update the sample to show the new API in action and allow toggling
between using it and the old API for testing.
2022-06-03 01:35:30 +01:00
Vadim Zeitlin
0caddb4472 Document important COM implementation macro limitation
These macros can't be used with multiple inheritance, as they don't do
anything to cast the pointer to the correct type in this case.
2022-06-03 01:35:30 +01:00