Commit Graph

4384 Commits

Author SHA1 Message Date
Vadim Zeitlin
19d477aabf Consistently escape "@" in wxRichTextCtrl documentation
The first occurrence of it was escaped, but the second one in each line
was not, resulting in warnings about "unknown command @:".
2022-03-28 00:18:02 +02:00
Vadim Zeitlin
7a269df2bf Document all parameters of wxImage::Paste()
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.
2022-03-28 00:17:26 +02:00
Gerhard Gruber
9dc7248b1d Add conversion to signed/unsigned int to wxString
Add wxString::ToInt() and ToUInt() for convenience and consistency with
the existing ToLong() and ToULong().

Closes #22068.
2022-03-26 00:46:58 +01:00
Vadim Zeitlin
108108e54e Add wxArtProvider::Get[Native]DIPSizeHint()
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.
2022-03-24 21:35:26 +01:00
Vadim Zeitlin
506f292be2 Deprecate wxArtProvider::GetSizeHint(bool) overload
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.
2022-03-24 00:10:08 +01:00
Vadim Zeitlin
ca4131faac Document wxArtProvider::DoGetSizeHint()
This virtual function seems to be meant to be overridden in the derived
classes and so part of the public API and hence should be documented.
2022-03-24 00:02:53 +01:00
Vadim Zeitlin
83daf02f35 Update wxImageList documentation to mention high DPI concerns
First of all, document that this class is (informally) deprecated.

Also document that the various sizes are expressed in logical pixels.
2022-03-22 23:02:25 +01:00
Vadim Zeitlin
28605bfcfb Make wxDumpWindow() take const wxWindow pointer
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.
2022-03-19 22:56:06 +01:00
PB
dc770deab0 Fix typos and wording in docs and comments
Closes #22191.
2022-03-17 23:53:52 +01:00
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
Vadim Zeitlin
0d37f733b5 Mention that bug affecting wxLocale under macOS is fixed in 12.3
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.
2022-03-17 23:47:33 +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
9a3d3156ab Merge branch 'better-bitmap-resize'
Use "nearest" algorithm for resizing bitmaps.

See #22152.
2022-02-27 22:44:50 +00:00
Lauri Nurmi
1ad25bdd5c Demonstrate how to interrupt closing an application
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
2022-02-25 00:37:58 +01:00
Vadim Zeitlin
84cb293e71 Make wxBitmap::Rescale() less horrible for commonly used icons
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.
2022-02-23 00:04:02 +00: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
Alexander Koshelev
1278aae752 Use wxBitmapBundle in wxTaskBarIcon
Update the sample to use wxBitmapBundle too.

Closes #22138.
2022-02-19 21:44:27 +00: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
Blake-Madden
4c5f39426e Add example of using wxString::ToCDouble() to the documentation
Add an example showing the meaning of the return value.

Also, a couple other small edits.

Closes #22129.
2022-02-16 22:42:58 +00: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
Blake-Madden
ddf90dc3e0 Fix comment in example for banner window
Should say top edge, not left.

Closes #22122.
2022-02-11 18:48:03 +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
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
85853db83b Update wxAUI documentation after wxBitmapBundle transition
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.
2022-02-08 20:40:55 +01:00
Tobias Taschner
57ebad4f7d
Allow usage of static loader with wxWebViewEdge
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.
2022-02-07 22:49:33 +01:00
Tobias Taschner
0a7b3bb3cf Add wxTopLevelWindow::SetContentProtection()
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.
2022-02-06 15:59:22 +01:00
Alexander Koshelev
80bb72468c Use wxBitmapBundle in wxComboCtrl instead of wxBitmap
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.
2022-02-05 16:11:14 +01:00
oneeyeman1
995c6e6df5 Add wxSpinCtrl::SetIncrement() and implement it for all ports
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.
2022-02-04 02:16:06 +01:00
Blake-Madden
49c508c7a9 Fix typo in "By default" in the documentation
It was misspelt as "Bu default" in a couple of places.

Closes #22072.
2022-01-30 22:59:26 +01:00
Artur Wieczorek
7e4cd9f1c1 Get rid of unnecessary friend classes 2022-01-30 10:33:17 +01:00
Artur Wieczorek
bd784b3186 Refactor functions converting wxArrayString to string in wxArrayStringProperty::GenerateValueAsString()
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.
2022-01-29 20:32:09 +01:00
Artur Wieczorek
6d318ad0e2 Refactor wxMultiChoiceProperty::GenerateValueAsString()
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.
2022-01-29 00:12:27 +01:00
Artur Wieczorek
3c87cc1e49 Get rid of unused member variable 2022-01-28 23:55:12 +01:00
Vadim Zeitlin
4cff1fce29 Merge branch 'unsigned-arith-conv'
Avoid arithmetic conversion warnings from gcc 12.

See #22063, #22057.
2022-01-27 23:40:03 +01:00
Jeinzi
d94dc0cab5 Add missing parenthesis to an example in wxTextCtrl docs
Closes #22062.
2022-01-27 17:07:15 +01:00
Vadim Zeitlin
37a4bf8693 Add wxColour::Get{Red,Green,Blue,Alpha}() to avoid gcc 12 warnings
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.
2022-01-27 15:46:42 +01:00
PB
5ba37d867c Support creating wxBitmapBundle from SVG in application resource
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.
2022-01-27 14:39:35 +01:00
Alexander Koshelev
3f3561e2c6 Change inactive bitmap to in wxBitmapBundle wxAnimationCtrl 2022-01-27 14:29:25 +01:00
Alexander Koshelev
2b94729a33 Change wxBitmap to wxBitmapBundle in wxBannerWindow 2022-01-27 14:29:25 +01:00
Alexander Koshelev
85becc9362 Change wxBitmap to wxBitmapBundle in wxBitmapToggleButton 2022-01-27 14:29:25 +01:00
Alexander Koshelev
b2629a97e5 Add wxBitmapBundle::GetPreferredLogicalSizeFor()
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.
2022-01-27 14:29:25 +01:00
Vadim Zeitlin
311aa370de Merge branch 'dvc-bmpbundle'
Use wxBitmapBundle in wxDVC-related classes.

See #22051.
2022-01-27 14:10:29 +01:00
Gerhard Gruber
1533026945 Allow better control over splitter position on resize
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.
2022-01-27 14:00:51 +01:00
Vadim Zeitlin
4073f3b9bf Use wxBitmapBundle in wxDataViewCtrl-related classes
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.
2022-01-23 21:55:30 +01:00