Add wxFontDialog::RestrictSelection() to disallow raster fonts

Under MSW it is possible to restrict the native font dialog to showing
only scalable fonts only, disallowing the raster fonts, so add a method
to wxFontDialog exposing this functionality in wxWidgets API.

Closes https://github.com/wxWidgets/wxWidgets/pull/1926

Closes #16988.
This commit is contained in:
Gilbert Pelletier
2020-07-03 23:28:10 +02:00
committed by Vadim Zeitlin
parent b35ef94a72
commit 76c7f723fc
4 changed files with 65 additions and 11 deletions

View File

@@ -64,6 +64,23 @@ public:
*/
bool GetEnableEffects() const;
/**
Returns the state of the flags restricting the selection.
Note that currently these flags are only effectively used in wxMSW.
@returns
- @c wxFONTRESTRICT_NONE If no restriction applies, or a combination of
the following flags:
- @c wxFONTRESTRICT_SCALABLE To show only scalable fonts - no raster fonts.
- @c wxFONTRESTRICT_FIXEDPITCH To show only monospaced fonts.
The default value is @c wxFONTRESTRICT_NONE.
@since 3.1.4
*/
int GetRestrictSelection() const;
/**
Gets the font that will be initially used by the font dialog. This
should have previously been set by the application.
@@ -77,6 +94,24 @@ public:
*/
bool GetShowHelp() const;
/**
Restricts the selection to a subset of the available fonts.
Note that currently these flags are only effectively used in wxMSW and
are ignored in the other ports.
Possible values are:
- @c wxFONTRESTRICT_NONE No restriction, show all fonts in the dialog.
- @c wxFONTRESTRICT_SCALABLE To show only scalable fonts - no raster fonts.
- @c wxFONTRESTRICT_FIXEDPITCH To show only monospaced fonts.
The default value is @c wxFONTRESTRICT_NONE.
@since 3.1.4
*/
void RestrictSelection(int flags);
/**
Under Windows, determines whether symbol fonts can be selected. Has no
effect on other platforms.