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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.