Version: 3.2.5

#include <wx/fontdata.h>

+ Inheritance diagram for wxFontData:

Detailed Description

This class holds a variety of information related to font dialogs.

Library:  wxCore
Category:  Common Dialogs, Data Structures
See also
wxFontDialog Overview, wxFont, wxFontDialog

Public Member Functions

 wxFontData ()
 Constructor. More...
 
void EnableEffects (bool enable)
 Enables or disables "effects" under Windows or generic only. More...
 
bool GetAllowSymbols () const
 Under Windows, returns a flag determining whether symbol fonts can be selected. More...
 
wxFont GetChosenFont () const
 Gets the font chosen by the user if the user pressed OK (wxFontDialog::ShowModal() returned wxID_OK). More...
 
const wxColourGetColour () const
 Gets the colour associated with the font dialog. More...
 
bool GetEnableEffects () const
 Determines whether "effects" are enabled under Windows. More...
 
int GetRestrictSelection () const
 Returns the state of the flags restricting the selection. More...
 
wxFont GetInitialFont () const
 Gets the font that will be initially used by the font dialog. More...
 
bool GetShowHelp () const
 Returns true if the Help button will be shown (Windows only). More...
 
void RestrictSelection (int flags)
 Restricts the selection to a subset of the available fonts. More...
 
void SetAllowSymbols (bool allowSymbols)
 Under Windows, determines whether symbol fonts can be selected. More...
 
void SetChosenFont (const wxFont &font)
 Sets the font that will be returned to the user (for internal use only). More...
 
void SetColour (const wxColour &colour)
 Sets the colour that will be used for the font foreground colour. More...
 
void SetInitialFont (const wxFont &font)
 Sets the font that will be initially used by the font dialog. More...
 
void SetRange (int min, int max)
 Sets the valid range for the font point size (Windows only). More...
 
void SetShowHelp (bool showHelp)
 Determines whether the Help button will be displayed in the font dialog (Windows only). More...
 
wxFontDataoperator= (const wxFontData &data)
 Assignment operator for the font data. More...
 
- Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to NULL the internal reference data. More...
 
 wxObject (const wxObject &other)
 Copy ctor. More...
 
virtual ~wxObject ()
 Destructor. More...
 
virtual wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
 
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
 
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class. More...
 
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj. More...
 
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone. More...
 
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer. More...
 
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
 
void UnShare ()
 This is the same of AllocExclusive() but this method is public. More...
 
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined. More...
 
void * operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
 The new operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined. More...
 

Additional Inherited Members

- Protected Member Functions inherited from wxObject
void AllocExclusive ()
 Ensure that this object's data is not shared with any other object. More...
 
virtual wxObjectRefDataCreateRefData () const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
 
virtual wxObjectRefDataCloneRefData (const wxObjectRefData *data) const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
 
- Protected Attributes inherited from wxObject
wxObjectRefDatam_refData
 Pointer to an object which is the object's reference-counted data. More...
 

Constructor & Destructor Documentation

◆ wxFontData()

wxFontData::wxFontData ( )

Constructor.

Initializes fontColour to black, showHelp to false, allowSymbols to true, enableEffects to true, minSize to 0 and maxSize to 0.

Member Function Documentation

◆ EnableEffects()

void wxFontData::EnableEffects ( bool  enable)

Enables or disables "effects" under Windows or generic only.

This refers to the controls for manipulating colour, strikeout and underline properties.

The default value is true.

◆ GetAllowSymbols()

bool wxFontData::GetAllowSymbols ( ) const

Under Windows, returns a flag determining whether symbol fonts can be selected.

Has no effect on other platforms.

The default value is true.

◆ GetChosenFont()

wxFont wxFontData::GetChosenFont ( ) const

Gets the font chosen by the user if the user pressed OK (wxFontDialog::ShowModal() returned wxID_OK).

◆ GetColour()

const wxColour& wxFontData::GetColour ( ) const

Gets the colour associated with the font dialog.

The default value is black.

◆ GetEnableEffects()

bool wxFontData::GetEnableEffects ( ) const

Determines whether "effects" are enabled under Windows.

This refers to the controls for manipulating colour, strikeout and underline properties.

The default value is true.

◆ GetInitialFont()

wxFont wxFontData::GetInitialFont ( ) const

Gets the font that will be initially used by the font dialog.

This should have previously been set by the application.

◆ GetRestrictSelection()

int wxFontData::GetRestrictSelection ( ) const

Returns the state of the flags restricting the selection.

Note that currently these flags are only effectively used in wxMSW.

Returns
  • wxFONTRESTRICT_NONE If no restriction applies, or a combination of the following flags:
  • wxFONTRESTRICT_SCALABLE To show only scalable fonts - no raster fonts.
  • wxFONTRESTRICT_FIXEDPITCH To show only monospaced fonts.

The default value is wxFONTRESTRICT_NONE.

Since
3.1.4

◆ GetShowHelp()

bool wxFontData::GetShowHelp ( ) const

Returns true if the Help button will be shown (Windows only).

The default value is false.

◆ operator=()

wxFontData& wxFontData::operator= ( const wxFontData data)

Assignment operator for the font data.

◆ RestrictSelection()

void wxFontData::RestrictSelection ( int  flags)

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:

  • wxFONTRESTRICT_NONE No restriction, show all fonts in the dialog.
  • wxFONTRESTRICT_SCALABLE To show only scalable fonts - no raster fonts.
  • wxFONTRESTRICT_FIXEDPITCH To show only monospaced fonts.

The default value is wxFONTRESTRICT_NONE.

Since
3.1.4

◆ SetAllowSymbols()

void wxFontData::SetAllowSymbols ( bool  allowSymbols)

Under Windows, determines whether symbol fonts can be selected.

Has no effect on other platforms.

The default value is true.

◆ SetChosenFont()

void wxFontData::SetChosenFont ( const wxFont font)

Sets the font that will be returned to the user (for internal use only).

◆ SetColour()

void wxFontData::SetColour ( const wxColour colour)

Sets the colour that will be used for the font foreground colour.

The default colour is black.

◆ SetInitialFont()

void wxFontData::SetInitialFont ( const wxFont font)

Sets the font that will be initially used by the font dialog.

◆ SetRange()

void wxFontData::SetRange ( int  min,
int  max 
)

Sets the valid range for the font point size (Windows only).

The default is 0, 0 (unrestricted range).

◆ SetShowHelp()

void wxFontData::SetShowHelp ( bool  showHelp)

Determines whether the Help button will be displayed in the font dialog (Windows only).

The default value is false.