Commit Graph

20012 Commits

Author SHA1 Message Date
Tobias Taschner
0a8bba971c macOS: Allow setting some fullscreen style options
When using the native fullscreen API by enabling EnableFullScrenView()
allow using hiding (or showing) menu and/or toolbar. An additional style
parameter has been added to EnableFullScrenView() to allow customizing
which style is applied when the user presses the fullscreen button
instead of a call to ShowFullScreen().

Closes #22180.
2022-03-17 23:50:32 +01:00
Vadim Zeitlin
9b2f55833e Add wxPreferencesPage::GetIcon() returning wxBitmapBundle
Allow returning a wxBitmapBundle rather than an individual wxBitmap.

Also make GetLargeIcon() non-pure even in wxOSX, as it now doesn't need
to be overridden if GetIcon() is -- but don't make GetIcon() pure
virtual neither to allow the existing code overriding GetLargeIcon() to
keep working.

This incidentally fixes the icons for the standard pages under macOS
broken by 388d322b68 (carry changes to toolbar over to prefs on osx,
2021-09-28), which replaced return statements with assignments,
resulting in the icon being set to the last value assigned to it instead
of the correct one -- this commit restores the previous control flow in
wxStockPreferencesPage::GetLargeIcon() (now called GetIcon()).

Closes #22187.
2022-03-17 23:49:18 +01:00
Maarten Bent
657be8b6dc Handle DPI change in wxSplitterWindow 2022-03-16 18:59:19 +01:00
Maarten Bent
23a3b74d3d Add a function to check if a DPI event is being processed 2022-03-10 19:59:30 +01:00
Vadim Zeitlin
2362010a48 Fix caching of files using wx headers with ccache
Avoid using, or even mentioning in the comments, __DATE__ and __TIME__
macros as doing this prevents ccache from caching the compilation
results by default (i.e. unless CCACHE_SLOPPINESS=time_macros is used).

As ccache simply scans for the given literal strings, using "##" token
pasting operator is enough to disable this pessimization. Of course,
this does mean that using ccache with the code actually using __TDATE__
or __TTIME__ is not going to work correctly, but there should be no
reason to do it any longer and these macros are not even documented, so
also mention that they shouldn't be used.

Finally do add __DATE__ to the only place in our own code where these
macros are used to ensure that it is not cached incorrectly.

Closes #22156.
2022-03-10 16:37:47 +01:00
Maarten Bent
1ecebd5c7c Handle DPI change in wxSplitterWindow
Adjust the minimum pane size to the new DPI.
Keep the sash in the same relative position.
2022-03-08 22:16:50 +01:00
Vadim Zeitlin
3fa634677c Merge branch 'headercol-bmp-bundle'
Use wxBitmapBundle in wxHeaderColumn.

See #22137.
2022-03-04 03:37:37 +01:00
Alexander Koshelev
33d8510d41 Use wxBitmapBundle in wxHeaderColumn 2022-03-04 03:37:20 +01:00
Vadim Zeitlin
31adb7d55b Merge branch 'bookctrl-bmp-bundle'
Use wxBitmapBundle in XRC handlers of wxBookCtrl-related controls and
refactor these handlers to avoid code duplication.

See #22151.
2022-02-27 22:45:25 +00:00
Vadim Zeitlin
6db5ad0410 Merge branch 'msw-button-best-size-margins'
Compute MSW button best size ourselves correctly.

See #22149.

Closes #22125.
2022-02-27 22:44:03 +00:00
Vadim Zeitlin
5fa9e9ada1 Inherit wxTreebookXmlHandler from wxBookCtrlXmlHandlerBase too
Use the same logic for creating the pages of this book control as for
all the other ones and keep only wxTreebook-specific "depth" and
"expanded" nodes handling in this class.
2022-02-27 22:42:01 +00:00
Vadim Zeitlin
2e27c12e56 Add virtual wxBookCtrlXmlHandlerBase::DoAddPage()
This will allow customizing the way pages are added to the book control
and will also be used in wxTreebookXmlHandler soon.
2022-02-27 22:42:01 +00:00
Vadim Zeitlin
d3c0d0c064 Move wxBookCtrlXmlHandlerBase::PageWithAttrs into the header
This struct is finally going to have to be declared in the header as it
will be needed by wxTreebookXmlHandler when it's modified to derive from
wxBookCtrlXmlHandlerBase too.

Also add GetImageId() function to the struct while moving it.
2022-02-27 22:42:00 +00:00
Vadim Zeitlin
1549aafdc9 Factor out common code from most wxBookCtrl-related XRC handlers
Add new wxBookCtrlXmlHandlerBase and inherit the XRC handlers of all the
wxBookCtrlBase-derived classes except for wxTreebookXmlHandler, which
will require special handling, from it to avoid duplicating the same
code in all of them.

This commit is best viewed with --color-moved git option.
2022-02-27 22:42:00 +00:00
Vadim Zeitlin
1d3149292c Don't declare wxPropertySheetDialogXmlHandler if !wxUSE_BOOKCTRL
This class is only implemented when wxUSE_BOOKCTRL==1 as its code uses
it, so it shouldn't be declared when wxUSE_BOOKCTRL==0 neither.

This fixes wxiOS build problem after the latest changes.
2022-02-27 22:40:52 +00:00
Alexander Koshelev
b70856089b XRC: use wxBitmapBundle in wxTreebook 2022-02-27 22:40:52 +00:00
Alexander Koshelev
93b4478992 XRC: use wxBitmapBundle in wxBookCtrl-related controls. 2022-02-27 22:40:52 +00:00
Alexander Koshelev
ca1eefdba2 Fix usage of wxWithImages::Images in wxTreebook 2022-02-27 22:40:52 +00:00
Jouk
6d0f5ec591 correction on the merged pull #22157 2022-02-25 08:12:44 +01:00
Jouk
9129254574 wxGTK1 build fixes after the recent changes
Update wxMenuItem to use wxBitmapBundle and wxSpinCtrl use
DoSetIncrement() in wxGTK1 just as it was done in wxGTK.

Closes #22157.
2022-02-25 00:24:47 +01:00
Vadim Zeitlin
73e23a4fd2 Revert "Improve calculating wxButton best size under wxMSW"
This reverts commit de10f054c4 and a bunch
of commits improving it done since then:

6f888df474 (Restore button size calculation when not using manifest in wxMSW, 2021-04-24)
de10f054c4 (Improve calculating wxButton best size under wxMSW, 2021-04-08)
6f888df474 (Restore button size calculation when not using manifest in wxMSW, 2021-04-24)
75d508b6e6 (Fix regression in sizes of buttons with bitmaps in wxMSW, 2021-07-08)
051418ac00 (Fix recent wxMSW buttons with bitmaps appearance regression, 2021-08-26)
fbc6462375 (Fix a gcc warning introduced by the previous commit, 2021-08-26)

The reason for reverting is that using BCM_GETIDEALSIZE doesn't seem to
have any advantages compared to using our old code, as it doesn't take
the margins into account neither and we still have to add them ourselves
and so it's simpler to just always do it without using this message.
2022-02-21 23:28:30 +00:00
Vadim Zeitlin
652d37ea61 Add "pressed" and "current" wxBitmapButton XRC properties
New names are consistent with the names of the preferred SetBitmapXXX()
functions.

Document them and show using one of them in the sample.
2022-02-20 18:06:09 +01:00
Vadim Zeitlin
34facd225a Add wxXmlResourceHandler::GetBitmapBundle(wxXmlNode) overload
Do it for consistency with the existing GetBitmap() overload and also
because this can be useful when we need to test for the bitmap bundle
presence before using it.

Also document both the new overload and the original one, which was
mistakenly left undocumented when it was added.
2022-02-20 18:06:09 +01:00
Vadim Zeitlin
f077169c86 Refactor wxBitmapButtonXmlHandler before using wxBitmapBundle
This replaces 4 calls to GetBitmap() with a single one.

Note that we now use SetBitmapPressed() and SetBitmapCurrent(), which
take wxBitmapBundle, instead of deprecated SetBitmapSelected() and
SetBitmapFocus(), which do not.

We also search for the parameter node only once instead of doing it
twice in a row if it was found, so the new code is slightly more
efficient.
2022-02-20 18:06:09 +01:00
Vadim Zeitlin
5fcea04d71 Take wxBitmapBundle in wxMenuItem::SetBitmap() in all ports
Update the remaining ports to take wxBitmapBundle rather than wxBitmap
as well to make their API consistent with the tier 1 ports -- even if
there is no actual support for choosing the resolution-appropriate
bitmap in them yet.
2022-02-20 18:06:09 +01:00
Alexander Koshelev
1278aae752 Use wxBitmapBundle in wxTaskBarIcon
Update the sample to use wxBitmapBundle too.

Closes #22138.
2022-02-19 21:44:27 +00:00
Vadim Zeitlin
6efd3b4438 Fix -Wnoexcept from gcc 10.3 in STL build
Add more wxNOEXCEPT to hash-related classes to avoid warnings like

.../c++/bits/hashtable_policy.h: In instantiation of ‘std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = wxStringHash]’:
include/wx/clntdata.h:33:22:   recursively required from ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = wxString; _Tp = int (*)(void*, void*); _Hash = wxStringHash; _Pred = wxStringEqual; _Alloc = std::allocator<std::pair<const wxString, int (*)(void*, void*)> >]’
include/wx/clntdata.h:33:22:   required from here
.../c++/bits/hashtable_policy.h:1112:40: error: noexcept-expression evaluates to ‘false’ because of a call to ‘wxStringHash::wxStringHash()’ [-Werror=noexcept]
 1112 |       _Hashtable_ebo_helper() noexcept(noexcept(_Tp())) : _Tp() { }
      |                                        ^~~~~~~~~~~~~~~
In file included from include/wx/clntdata.h:16,
                 from include/wx/event.h:17,
                 from include/wx/evtloop.h:14,
                 from tests/testprec.h:5,
                 from tests/allheaders.cpp:410:
include/wx/hashmap.h:568:5: note: but ‘wxStringHash::wxStringHash()’ does not throw; perhaps it should be declared ‘noexcept’
  568 |     wxStringHash() {}
      |     ^~~~~~~~~~~~

that started to be given my MinGW x86-64 10.3.9 (although they were not
given by 10.2.1 version of the same compiler).

But adding wxNOEXCEPT here is more consistent with the changes of
7d74df9a03 (Add wxNOEXCEPT to the hash structs operator() declarations,
2020-08-30) and makes sense anyhow.
2022-02-18 17:02:10 +01:00
Mehmet Soyturk
8aa5c55f61 Change wxRichTextParagraph::m_cachedLines data type to vector
Now wxRichTextParagraph::m_cachedLines is stored as a wxVector instead
of a wxList.

See #2523, closes #2577.
2022-02-17 01:20:01 +01:00
Paul Cornett
b62a1f8f1a wxOverlay implementation for Wayland 2022-02-13 09:03:36 -08:00
Vadim Zeitlin
0401fe21f7 Inherit scaling factor in wxBitmap ctor taking wxDC in wxGTK
This is the documented behaviour and not doing it breaks wxAuiTabCtrl
redrawing in high DPI, as it uses this ctor for double buffering.
2022-02-13 01:10:19 +01:00
Vadim Zeitlin
c08c539d18 Merge branch 'ak_wizard' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxWizard.

See #22124.
2022-02-13 00:30:26 +01:00
Vadim Zeitlin
9dc34611c7 Merge branch 'ak_htmllistbox' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxHtmlWindow.

See #22123.
2022-02-13 00:29:39 +01:00
Vadim Zeitlin
f0e6a8b15a Merge branch 'bitmap-scale-fixes'
Really fix setting wxBitmap scale factor in wxMSW and rename
wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize().

See #22118.
2022-02-13 00:27:24 +01:00
Vadim Zeitlin
4436a126dc Merge branch 'tbar-hidpi'
Fix toolbar resizing when moving to a lower DPI screen.

See #22117.
2022-02-11 18:46:49 +01:00
Vadim Zeitlin
00bd8c5576 Fix high DPI support for MDI windows
High DPI support didn't work for wxMDIParentFrame (and everything
inside it) because it was only enabled when InheritAttributes() from
wxNonOwnedWindow was called and this was only done in wxTopLevelWindow
but not in this class.

Fix this by removing the need to call InheritAttributes() at all and
just initializing m_perMonitorDPIaware when the window is created
automatically, to ensure that it can't be forgotten.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>

Closes #22116.
2022-02-11 18:45:48 +01:00
Vadim Zeitlin
74424cbeb2 Rename wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize()
The new name, recently introduced in 94716fd801 (Add
wxBitmap::CreateWithLogicalSize(), 2022-01-22), was perhaps more clear,
but also misleading and confusing because the postcondition

	CreateWithLogicalSize(size, 2).GetLogicalSize() == size

was not satisfied under MSW, so rename it once again, and hopefully
finally, because the new name is consistent with GetDIPSize() returning
the same size.

Also try to improve the documentation a bit more.
2022-02-11 17:30:57 +00:00
Alexander Koshelev
429b5561ff Use wxBitmapBundle in wxWizard 2022-02-11 18:04:56 +03:00
Alexander Koshelev
7a2a1e9074 Use wxBitmapBundle in wxHtmlWindow 2022-02-11 16:16:45 +03:00
Paul Cornett
2356dda034 Export IsX11/IsWayland symbols needed by wxMediaCtrl library 2022-02-10 11:16:36 -08:00
Paul Cornett
94868c6f41 Add functions for determining if GDK3 backend is X11 or Wayland 2022-02-10 10:15:08 -08:00
Vadim Zeitlin
6ec36a900c Separate the requested and effective size of toolbar bitmaps
Add wxToolBarBase::DoSetToolBitmapSize() which does everything that
SetToolBitmapSize() used to do and make SetToolBitmapSize() itself also
remember the size passed to it in a new field, so that we could check
that we don't decrease the bitmap size below the size requested by the
application, while still being able to decrease it if necessary due to a
DPI change.

This allows SetToolBitmapSize() to continue working as before, i.e.
scale the bitmaps up if necessary without ever scaling them down, but
also allows them to resize in both directions when DPI changes.

Closes #22105.
2022-02-10 00:12:14 +00:00
Vadim Zeitlin
cde6f96ea8 Move wxToolBarBase::Get- and SetToolBitmapSize() out of line
No real changes, just don't define these functions inline, they're not
called often enough to make it worth it.
2022-02-10 00:11:27 +00:00
Tobias Taschner
61d6929808 MSW: Fix multi monitor and dpi wxTLW::RestoreToGeometry()
If a window was placed on a monitor with a different DPI than the
main display call SetWindowPlacement() a second time to apply
the window size correctly.

Closes #22108.
2022-02-08 21:13:47 +01:00
Vadim Zeitlin
bd058106a3 Merge branch 'imaglist-mask'
Fixes for using mask and alpha in wxMSW wxImageList.

See #22101.
2022-02-08 20:52:20 +01:00
Lauri Nurmi
8380f92988 Use [[fallthrough]] for all MSVC versions accepting it
Since VS 2015 Update 3, the C++ standard targeted by the compiler can be
detected through _MSVC_LANG. This macro is like __cplusplus, but reflects the
actual standard understood by the compiler, unlike __cplusplus which by default
is left to an ancient value for compatibility.

Closes #22099.
2022-02-08 20:51:18 +01:00
Vadim Zeitlin
25fec4aca9 Merge branch 'webview_edge_static' of https://github.com/TcT2k/wxWidgets
Allow usage of static loader with wxWebViewEdge.

See #22083.
2022-02-08 20:49:35 +01:00
Vadim Zeitlin
e90ab5f550 Merge branch 'ak_bmpcbox'
Change wxBitmap to wxBitmapBundle in wxBitmapComboBox.

Closes #22033.
2022-02-08 20:48:46 +01:00
Alexander Koshelev
72e25c49fa Generic: change wxBitmap to wxBitmapBundle in wxBitmapComboBox 2022-02-08 20:48:36 +01:00
Alexander Koshelev
5e0591b297 GTK: change wxBitmap to wxBitmapBundle in wxBitmapComboBox 2022-02-08 20:48:36 +01:00
Alexander Koshelev
d57bc78eea wxBitmapComboBox: store bitmaps in wxVector 2022-02-08 20:48:36 +01:00