Commit graph

20843 commits

Author SHA1 Message Date
Vadim Zeitlin
d69ddb8656 Revert all recent wxUSE_DPI_AWARE_MANIFEST-related changes
This reverts 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23) and all the commits which tried to
fix the breakage caused by it.

While the original change had merit, it seems to be too difficult to fix
all our build systems to avoid embedding manifest when defining this in
the code, like samples/sample.rc does, so revert this change for now.

Maybe it can be reintroduced in the future after switching to some other
build system.
2023-08-25 00:03:47 +02:00
PB
10d09ec2b2 Remove outdated parts from build system
Remove support for unsupported MSVS versions earlier than 2015
and Windows versions earlier than 7 from CMake build as they are not
supported any longer.

Also update wxUSE_GRAPHICS_GDIPLUS and wxUSE_GRAPHICS_DIRECT2D comments
in wxMSW setup.h to remove mentions of unsupported Windows XP but do
mention that MinGW-w64 can use Direct2D.

Closes #23787.
2023-08-24 15:15:57 +02:00
Vadim Zeitlin
5d630caabd Make it enough to predefine only wxUSE_DPI_AWARE_MANIFEST
If this is predefined before including wx/msw/wx.rc, it clearly
indicates that wx manifest should be used, but this was _not_ the case
before as wxUSE_RC_MANIFEST could be predefined as 0 (which is the case
for MSVS, to avoid conflicting with the manifest embedded by it into the
executable by default).

Change this and do include the wx manifest if wxUSE_DPI_AWARE_MANIFEST
is defined.
2023-08-23 16:18:05 +02:00
Lauri Nurmi
3e4946fc31 Minor documentation syntax and orthography fixes
Closes #23759.
2023-08-22 19:20:33 +02:00
Maarten Bent
d847f3b039
Fix position of label window in wxStaticBox after DPI change
Fixes #23740
2023-08-05 21:54:01 +02:00
Vadim Zeitlin
f03ea82be8 Merge branch 'im/stringview' of https://github.com/imciner2/wxWidgets
Add std::string_view constructors to wxString.

Also improve C++17 standard headers detection for MSVS.

See #23711.
2023-07-24 18:16:39 +02:00
Ian McInerney
b8d3b37c9e Add new macro for standard library header inclusion
Newer standard library headers should only be included when the compiler
is targetting that standard, otherwise some compilers (like MSVC) will
warn that you are using a newer C++ include on an older version.
2023-07-24 16:54:14 +01:00
Vadim Zeitlin
0436cebd82 Fix recently broken assert for virtual wxGenericListCtrl
The changes of 8c1234ea66 (Improve assert checking line index validity
in wxGenericListCtrl, 2023-07-24) were wrong for virtual list controls
as the lines vector is not used for them, so restrict the assert to the
non-virtual case only.
2023-07-24 15:23:40 +02:00
Vadim Zeitlin
484c98ffb2 Avoid double quoting assert message conditions
wxFAIL_COND_MSG_AT() macro was already passed a quoted string, there is
no need to quote it again.
2023-07-24 14:03:34 +02:00
Vadim Zeitlin
8c1234ea66 Improve assert checking line index validity in wxGenericListCtrl
Don't just check that the index is not -1, but also that it's valid,
which can catch other problems.

Also replace the ASSERT with CHECK to avoid dereferencing invalid
pointer, it's better to crash when trying to dereference a NULL one.
2023-07-24 14:03:34 +02:00
Ian McInerney
3dfb2a5ac1 Add std::string_view constructors to wxString 2023-07-20 19:59:01 +01:00
Vadim Zeitlin
44e857c012 Explicitly disable some level 4 warnings in Windows SDK headers
Some level 4 warnings are somehow not disabled by switching to level 1,
so disable them explicitly.

Closes #23716.
2023-07-20 15:29:06 +02:00
Martin Corino
4d76a87015 Make wxSearchCtrl inherit from wxTextEntry in all ports
Previously it only inherited from wxTextEntryBase in the generic
implementation (used e.g. in wxMSW).

Update the code, documentation and add new unit tests checking that
wxSearchCtrl member functions inherited from wxTextEntry behave
correctly.

Closes #23686.

Closes #23697.
2023-07-20 14:46:41 +02:00
Stefan Csomor
52a11a3a9d Remove obsolete wxOSX_USE_EXPERIMENTAL_FONTDIALOG build setting
Always turn native font dialog on and remove the never used old version.

Closes #23695.
2023-07-20 14:42:39 +02:00
Vadim Zeitlin
44b99195bc Merge branch 'msw-spin-appearance'
Fixes for wxSpinCtrl appearance in wxMSW.

See #23696.
2023-07-10 16:37:34 +02:00
Vadim Zeitlin
6bd2b6b4db Revert "Move Cygwin __USE_W32_SOCKETS definition to wxMSW-specific file"
This reverts commit 0f2b8a2065 as it broke
Cygwin build due to problems with fd_set definition.

Closes #23674.
2023-07-09 17:05:09 +02:00
Vadim Zeitlin
1dafca9e1d Remove "automatic" dark mode support
This commit reverts cb85871831 (Add MSWShouldUseAutoDarkMode() and use
it for wxSpinButton, 2022-12-07) as, contrary to the expectations of
this commit, other controls didn't use this function and even
wxSpinButton itself doesn't need it any more after the changes of the
parent commit, which were required because automatic support was not
flexible enough.
2023-07-08 23:00:43 +01:00
Vadim Zeitlin
79567c83f4 Fix wxSpinButton redrawing when using WS_EX_COMPOSITED
Explicitly redraw it ourselves instead of relying on DefWndProc() to do
it, as with 15e4f5b (Work around wxListCtrl repainting problems with
WS_EX_COMPOSITED, 2023-06-05) which did the same thing for wxListCtrl,
doing it seems to be enough to make the control draw correctly.

Closes #23656.
2023-07-08 23:00:10 +01:00
Vadim Zeitlin
83f5b6f3c6 Remove unnecessary wxSpinButton::MSWCommand()
This function did nothing, which was already exactly what the base class
version did too.
2023-07-08 20:13:44 +01:00
Martin Corino
548086b20c Derive wxFontDialog from wxFontDialogBase in wxOSX too
This notably ensures that wxFontDialog has const GetFontData() accessor
in this port too, as was already the case in the other ones.

Closes #23691.
2023-07-08 17:06:50 +02:00
Stefan Hansson
b84b45161a Implement wxRB_SINGLE support in wxGTK
Create hidden radio button in wxGTK when using wxRB_SINGLE, as
this lets us deactivate the shown button by activating the hidden one.
GTK does not allow deactivating radio buttons by calling them with
gtk_toggle_button_set_active( ..., FALSE), so we need to work around
it like this.

Also update the documentation to mention that this works in wxGTK now.

See #17022.

Closes #23652.

Closes #23677.
2023-07-03 20:14:32 +02:00
Vadim Zeitlin
c3bc4c16c5 Merge branch 'fix_no_intl_no_radiobtn' of https://github.com/matyalatte/wxWidgets
Fix compilation errors when wxUSE_INTL or wxUSE_RADIOBTN is off.

See #23663.
2023-07-03 20:05:49 +02:00
Vadim Zeitlin
1c16055713 Still enforce validity on focus loss in numeric validators
The changes of c269932c4e (Relax checks on character entry in numeric
validators, 2023-07-02) went a bit too far and not just relaxed the
checks but removed them entirely.

Correct this by ensuring we have a valid value after focus loss.

See #12968.
2023-07-02 19:13:41 +01:00
Vadim Zeitlin
f072544bd5 Assume sigaction::sa_handler always takes "int"
This is the standard and there doesn't seem to be any contemporary
systems where this is not the case. The configure check for it was
originally added in 101c20d554 (attempting to fix sa_handler signature
for IRIX, 2000-04-01), but IRIX is not supported/doesn't exist any
longer, so don't waste time on checking for this.

The real motivation for this change is that the test failed in CMake
builds, showing just

-- Performing Test wxTYPE_SA_HANDLER_IS_INT - Failed

in the log and then resulting in -fpermissive warnings when assigning
wxFatalSignalHandler to sa_handler and it's simpler to just remove the
check than to debug it.

See #23664.
2023-06-30 00:26:19 +01:00
Vadim Zeitlin
de0595108a Merge branch 'bmp-dataobj-fix'
Fix crash when using wxDataObjectComposite and other clipboard-related
cleanup.

See #23659.
2023-06-30 00:20:12 +01:00
Vadim Zeitlin
0e14cf19d1 Merge branch 'border-fixes'
Various border-related fixes for wxMSW.

See #23644.
2023-06-30 00:19:00 +01:00
taler21
eae24cc3b2 Fix bitmap returned from wxAuiToolBarItem::GetDisabledBitmap()
Return the disabled bitmap and not the normal one.

This fixes a regression introduced in 9a5123afed (Use wxBitmapBundle in
wxAuiToolBar and wxAuiPaneInfo too, 2021-11-14).

Closes #23666.
2023-06-27 19:16:40 +02:00
matyalatte
4d8e3399cf fix compilation errors for wxFileDialog when wxUSE_RADIOBTN is off
fix compilation errors when wxUSE_RADIOBTN, wxUSE_RADIOBOX,
wxUSE_RICHTEXT, and wxUSE_PRINTING_ARCHITECTURE are off.
2023-06-23 02:50:37 +09:00
Vadim Zeitlin
89930c9e5e Deprecate old wxMSW-specific clipboard functions
Formally deprecate these functions that shouldn't be used since a couple
of decades already.
2023-06-20 21:13:45 +01:00
Vadim Zeitlin
8a95a93a1d Remove wxUSE_OLE_CLIPBOARD and always use OLE for wxClipboard
It doesn't make sense to keep the old and almost never used alternative
wxClipboard implementation which has known fatal bugs (such as casts of
wxDataObject that could be wxDataObjectComposite to wxBitmapDataObject,
see #23564) when wxUSE_OLE is never going to be disabled anyhow.

Note that this means wxSetClipboardData() function doesn't exist at all
any longer when previously it was available in the wxUSE_OLE==0 builds.
As the official builds always used wxUSE_OLE==1, this doesn't look like
a huge loss, but if needed, we could add it back later and reimplement
it in terms of wxClipboard::SetData().
2023-06-20 21:00:59 +01:00
Vadim Zeitlin
d5ef9d4387 Add wxGenericAboutDialog::GetCustomControlParent()
This function should be used to get the parent for the custom controls
instead of relying on them being reparented under it by the code added
in the last commit.

Change the type of m_contents to be wxWindow and not wxPanel as it
doesn't really matter, but wxPanel is not fully declared in this header
while wxWindow is.
2023-06-20 19:19:49 +02:00
Vadim Zeitlin
a249e21f65 Fix scrollbar creation for Mac windows not using standard peer
This avoids crash if wxVSCROLL or wxHSCROLL is used with wxGLCanvas
which calls wxWindow::Create() after calling DontCreatePeer() because
the Create() tries to use the not (yet) existent peer in
MacCreateScrollBars().

Avoid this problem by moving the call to MacCreateScrollBars() to
MacPostControlCreate(), which doesn't change anything for the windows
that do not call DontCreatePeer(), but ensures that the peer already
exists by the time MacPostControlCreate() is called for those that do.

Closes #23536.
2023-06-18 17:41:05 +02:00
Vadim Zeitlin
f88c9b7fb7 Make wxWindowMSW::TranslateBorder() non-virtual
It doesn't seem like it is meant to be overridden, so don't imply that
it should be possible to do it and make it non-virtual.

Also rename to DoTranslateBorder() to make it more clear that this is a
private function and not part of the public API.

Finally, improve its comment and never return wxBORDER_THEME from this
functions if themes support is off.
2023-06-16 16:22:40 +01:00
Vadim Zeitlin
4f54919bda Remove overridden wxWindowMSW::GetDefaultBorder()
It simply called the base class function, so just don't override it in
the first place.

No real changes.
2023-06-16 15:55:59 +01:00
Vadim Zeitlin
a89577e8a4 Deprecate useless wxWindow::GetDefaultBorderForControl()
This function was added back in a047aff270 (Added wxBORDER_THEME,
wxWindow::GetDefaultBorderForControl(), wxWindow::CanApplyThemeBorder(),
2007-08-07) but seems to have been made completely unnecessary by
dc797d8e1b (More border rationalisation. GetDefaultBorder is now mostly
defined in base class files., 2007-11-13) soon afterwards and never did
anything other than returning wxBORDER_THEME, with no explanation as to
when it might be useful to override it not to do it.

It also doesn't seem to be really used anywhere outside wxWidgets and
has never been documented, so make it non-virtual and deprecate it to
avoid confusion and simplify things.
2023-06-16 15:55:35 +01:00
Bill Su
7420ab1b26 wxMFCApp::PreTranslateMessage: Give msg to MFC before wxWidgets
because wxWidgets wxGUIEventLoop::PreProcessMessage() seems to
always report that it has consumed msg.

fix #23574
2023-06-11 01:56:21 -04:00
Richard Powell
6c35c708d5 Fix -Wdeprecated-copy warnings when building in C++20 mode
Avoid implicit copy constructor warnings by using
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN_DEF_COPY/wxDECLARE_NO_ASSIGN_DEF_COPY
instead of wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN.

Closes #23625.

Closes #23626.
2023-06-10 17:02:13 +02:00
Vadim Zeitlin
d80887f302 Merge branch 'listctrl-dark-win11'
Fixes for wxListCtrl drawing under Windows 11 in dark mode and drawing
when using WS_EX_COMPOSITED.

See #23608.
2023-06-05 15:32:58 +02:00
Vadim Zeitlin
4c8ec0ed5d Revert "Add wxWindow::MSWAfterReparent() virtual function"
This reverts commit cd637663c8 (Add wxWindow::MSWAfterReparent() virtual
function, 2022-10-16) and removes wxListCtrl::MSWAfterReparent() added
in ff629f3853 (Fix drawing wxListCtrl since enabling double buffering by
default, 2022-10-16) which is not used any more now.
2023-06-05 14:30:56 +01:00
Brian Nixon
567a66aac2 Remove dependency of wxUSE_SOCKETS on wxUSE_STOPWATCH
It isn't actually needed, so don't check for it in wx/chkconf.h and
remove the comment claiming that it is from various setup.h files.

Closes #23609.
2023-06-05 15:13:21 +02:00
Vadim Zeitlin
456449bcc1 Support wxWinVersion_11 in the private wxGetWinVersion() helper
This can be more convenient to use than public functions and it's just
better to support all Windows versions in this function too.
2023-06-05 00:55:53 +01:00
Vadim Zeitlin
5546733c12 Merge branch 'qt-dc-clip' of https://github.com/AliKet/wxWidgets
Fix wxDC and wxGCDC clipping in wxQt.

See #23600.
2023-06-05 01:47:15 +02:00
Vadim Zeitlin
4c94d5d1e5 Merge branch 'dark-statusbar'
Fixes for status bar and dialog grippers appearance in dark mode.

See #23602.
2023-06-03 22:20:32 +01:00
Vadim Zeitlin
e95073c24b Merge branch 'init-keyevent-repeat'
Ensure that wxKeyEvent::m_isRepeat is initialized.

See #23596.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
1a1790350f Merge branch 'htmllbox-fix-ub'
Fix undefined behaviour in wxHtmlListBox::OnDrawItem().

See #23595.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
a3e925df0a Merge branch 'mac-uilocale-script-fix'
Locale-related fixes for macOS and new calendar names localization
functions.

Closes #23209.

See #23556.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
946aa6bbc4 Remove redundant "const" from wxItemId conversion operator
This "const" is ignored and just results in a warning from MSVS 17.6.

Closes #23590.
2023-06-03 21:07:40 +02:00
Ian McInerney
5d0c4066d8 Add operators for boolean conversions to wxPGGlobalVars
The old API allowed for users to directly test the variable and find if
it was null, so recreate that API with the new system to preserve
compatibility.

Closes #23445.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
0e3f010eec Add wxUxThemeHandle::GetTrueSize() and GetDrawSize() helpers
These functions are more convenient to use and, arguably, more clear to
read than calls to ::GetThemePartSize(), so add these wrappers and
replace most of the uses of the Win32 function with them.

This shouldn't result in any real changes to behaviour.
2023-06-03 19:18:57 +01:00
Vadim Zeitlin
ef93da3160 Add wxUxThemeHandle::DrawBackground() wrapper and use it
This is sightly shorter/more convenient to use than providing all the
parameters to ::DrawThemeBackground() every time.

Similarly to ca5f244f15 (Add wxUxThemeHandle::GetColour() replacing
MSWGetThemeColour(), 2022-12-09), this is just a refactoring which
shouldn't result in any changes in behaviour.
2023-06-03 19:18:57 +01:00