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.
Change various occurrences of wxBitmap to wxBitmapBundle to reflect the
changes of 9a5123afed (Use wxBitmapBundle in wxAuiToolBar and
wxAuiPaneInfo too, 2021-11-14).
Closes#22106.
Add a new build option wxUSE_WEBVIEW_EDGE_STATIC.
If it is set to 1 the WebView2 loader is static linked into the binary
and removes the runtime dependency on WebView2Loader.dll.
This method allows to exclude a top level window from screen captures.
Windows 7 or newer is required and any macOS version is supported.
Other platforms are not implemented and will return false.
The display example has been extended to demo this ability.
Closes#22066.
Replace wxBitmap with wxBitmapBundle in wxComboCtrl to make it show the
bitmap appropriate to the current DPI scaling.
Also add an event handler updating bitmaps on DPI change.
Closes#22032.
SetIncrement() was already available in wxSpinCtrlDouble and GTK version
of wxSpinCtrl, now implement support for it in wxMSW and wxOSX as well.
In fact, in wxMSW, implement it at wxSpinButton level, so that both this
class and wxSpinCtrl inheriting from it (in wxMSW only) support setting
custom increment now.
Also add support for it to XRC, show it in the sample and add a unit
test verifying that it works.
Closes#2597.
Because ConvertArrayToString() and ArrayStringToString() produce string
values it would more intuitive to just to return this string as a function
value instead of passing it through the parameter.
Because this function produces a string value it would more intuitive to
just to return this string as a function value instead of passing it
through the parameter.
These functions return the colour components as unsigned int and so
promote to this type in arithmetic expressions, unlike unsigned char
returned by the existing accessors without the "Get" prefix, which
promotes to (signed) int and results in gcc 12 -Warith-conversion
warnings when the result is then converted to unsigned, as it happened
in our own wxColour::GetRGB() and GetRGBA() functions and would probably
happen in a lot of code outside wx, which could also be updated to use
the new functions instead of inserting casts.
Allow creating wxBitmapBitmap from SVG image stored in an application
resource on the platforms where wxHAS_IMAGE_RESOURCES is defined.
On Windows, load the bundle from a resource with RT_RCDATA type and on
MacOS from a file with an extension "svg" placed in the "Resources"
subdirectory of the application bundle.
Closes#22061.
We often need the logical bitmap size when using it in size computations
involving window size, so add a function returning it directly to
wxBitmapBundle, similarly to wxBitmap::GetLogicalSize(), to avoid using
FromPhys() everywhere.
Also rename the existing wxBitmapBundle::GetPreferredSizeFor() to
GetPreferredBitmapSizeFor() to make it more clear that this is similar
to wxBitmap::GetSize() and so returns the size in physical units.
Closes#22056.
Add an event which can be handled by the application to determine the
splitter position when the splitter window itself is resized.
This can be used to e.g. preserve the splitter at the given proportion
of the window (and not just in the middle, as it would be already
possible by using gravity 0.5).
Closes#22035.
Extend the existing use of wxIcon in wxDataViewIconText,
wxDataViewCheckIconText, the corresponding renderers and
wxDataViewTreeCtrl to wxBitmapBundle.
As with the other classes, the existing setters have been preserved as
they remain almost entirely compatible with the existing code and the
return type of the existing getters was preserved, with new getters
being introduced for returning wxBitmapBundle only where they're really
required.
Update the sample to use wxBitmapBundle with its wxDataViewTreeCtrl.
This is just a convenient wrapper for GetBitmap() that will be useful in
the classes using wxIcon in their public API to preserve compatibility
after switching to using wxBitmapBundle instead of wxIcon internally.
Embed SVG data of the wx logo into the library itself to make it
available to all wx programs, including the samples. This is a bit
wasteful, but <12KiB is not really noticeable compared to the library
size.
This makes them available in wxIcon (and, less importantly, wxCursor)
too which is needed in order to use icons correctly in high DPI.
This is also more consistent with the other platforms, where wxIcon does
have these methods.
Document these methods in wxIcon now that they're available there under
all platforms and also document wxIcon::GetSize() which had been
available even before, but wasn't documented.
The new function has a more clear name than CreateScaled() it replaces
and uses a more useful parameter order, with the scale factor, which
must always be specified when using it, coming before, and not after,
the depth, which almost never needs to be specified and so can be left
at its default value in 99% of cases.
It seems better to round, rather than truncate, in ToPhys(), for the
same reasons as in wxBitmap::CreateScaled() (see parent commit), and
then ceil() mustn't be used in FromPhys() neither, as this would break
round-tripping via both functions.
So, finally, keep the behaviour simple and, hopefully, the least
surprising, by just rounding the result in both functions.
These functions have better names than the existing GetScaledXXX() ones,
so add them to be able to use them in the new code, even if we still
keep the old ones for compatibility.
This allows to retrieve the native CPU architecture name regardless of
the current process CPU architecture.
Common examples for CPU architecture differences are the following:
- Win32 process in x64 Windows (WoW)
- Win32 or x64 process on ARM64 Windows (WoW64)
- x86_64 process on ARM64 macOS (Rosetta 2)
Closes#22036.
Contrary to what the documentation stated, it was possible for the item
to be invalid, so update it to explain this and give an example of a
case in which this happens.
See #19182.
Provide these functions for consistency with the existing FromDIP() and
ToDIP().
We also can use ceil() (rather than round() used by wxSize operators) in
FromPhys() to ensure that we never truncate contents of a physical
bitmap, which allows to replace the existing wxStaticBitmap code with
just a call to this function.
This fixes the problem with wrong standard bitmaps size when using high
DPI for the main monitor with wxMSW, as GetScaledSize() used here since
31f2892200 (Avoid bitmap scaling in wxArtProvider::GetBitmapBundle(),
2021-12-17) was not the right function to use there.
Closes#19331.