This function returns wxBitmap by object, not by (const) reference since
wxBitmapBundle-related changes.
Also change signature of the other methods taking wxBitmapBundle instead
of wxBitmap now.
And some other minor improvements.
Closes#22306.
This ctor was previously present only in wxMSW, make it available in all
ports to allow the same code to compile everywhere.
In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX
it is used to assign the appropriate scale factor for the new bitmap.
Enable previously wxMSW-only unit test checking for this.
Previously this ctor was only available in wxMSW and wxOSX, which was
especially strange as the equivalent Create() overload, taking wxDC, was
already available in all ports.
Recognize strings returned by setlocale() when using MSVC under MSW too,
if only because it was possible to construct wxLocale using them in the
previous versions and so doing this avoids breaking the existing code.
Also don't assert in FromTag(), even if the input is incorrect, as it is
potentially user-defined (e.g. can come from environment variables under
Unix).
Closes#22247, #22252.
This simple function allows to simplify the code by avoid to test for
CanonicalRef before using either it or CanonicalName in multiple places.
No real changes.
See #22252.
Add new OSX specific OSXEnableNewLineReplacement(bool enable) function
to control if new lines should be replaced with spaces (which is still
done by default) in a single-line wxTextCtrl.
Closes#22245.
Don't say that passing wxNullFont to it is allowed because it isn't
neither in wxGTK nor in wxOSX and also remove the part about destroying
the previous font because we hadn't had to destroy the fonts explicitly
since 25 years.
Still document that setting an invalid font works in wxMSW, but explain
that doing this is not a good idea.
Fix a few problems:
- Don't indent lists, as this makes them appear as code.
- Prefer using inline `...` to @code ... @endcode.
- Escape '<' and '>' characters.
Many improvements and fixes to wxUILocale:
- Add wxUILocale method for retrieving wxLocaleIdent identifier,
localized names, layout direction.
- Add wxLocaleIdent attributes, getter, and setter for
platform-dependent tags under Windows: extension, sort order.
- Modify method wxLocaleIdent::FromTag to support not only BCP 47-like
tags, but also platform-dependent syntax.
- Modify method wxLocaleIdent::GetTag to allow specifying the tag type.
- Update internat sample to better show using wxUILocale.
- Update German and French message catalogs for internat sample (German
fully translated, French msgIds only).
- Introduced wxUILocaleImplStdC under Windows, because locale "en-US" is
not equivalent to the C locale.
- Adjust wxLocale class to restore previous wxUILocale in the
destructor.
- Implement wxLocale::GetInfo method through wxUILocale methods.
- Removed LCID dependency in wxLocale.
- Move the implementation of some static wxUILocale methods from
intl.cpp to uilocale.cpp.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
Closes#2615.
There doesn't seem to be any way to use backslashes with @c: with a
single backslash, it's interpreted as a command, but a double backslash
appears in the output. So use `\b` instead of @c \b and also use `...`
elsewhere for consistency.
Also fix wxRE_NEWLINE description formatting.
As long as one parameter of a function is documented, all the other ones
should be documented too, as otherwise Doxygen complains about it not
being the case.
Also add "wxWindow* win = NULL" argument to the existing functions to
convert from DIPs using the given window instead of the default DPI
scaling factor.
Closes#22022.
This was confusing and completely unnecessary as the version with the
non-default value of the bool argument was just equivalent to calling
GetNativeSizeHint() directly, so why even bother having it.
There is no reason not to allow calling this function with const window,
so do allow it, notably to make it possible to use it with "this" from
const wxWindow methods.
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.
Apple seems to have fixed the bug with SVG display (notably affecting
menu items check marks) in the latest macOS version, so update the
documentation to say that only the versions between 11.0 and 12.2 are
affected.
Add a menu item to the dialogs sample for simulating having unsaved
documents in the application. Then demonstrate how to do something
when the user attempts to close the application, e.g. show a dialog,
and possibly cancel closing.
This code was originally written for debugging some issue related to
closing an application, but besides that it serves as an example of a
very common pattern a lot of real world applications need in some form.
Mention the example in samples/dialogs in wxCloseEvent documentation
Make the results look somewhat better by using wxIMAGE_QUALITY_NEAREST
which preserves sharp horizontal and vertical edges in the images which
are common in the icons, with which this function is often used, instead
of blurring them as wxIMAGE_QUALITY_HIGH does.
This is also much (factor of ~40) faster, which shouldn't hurt neither.
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.
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.