# wxFontDialog Class Reference
[Common Dialogs]

`#include <wx/fontdlg.h>`

Inheritance diagram for wxFontDialog:
[legend]

## Detailed Description

This class represents the font chooser dialog.

##

Library: wxCore

Category: Common Dialogs

See also:
  overview_cmndlg_font, wxFontData, wxGetFontFromUser()

## Public Member Functions
| wxFontDialog ()
| Default ctor.
| wxFontDialog (wxWindow *parent)
| Constructor with parent window.
| wxFontDialog (wxWindow *parent, const wxFontData &data)
| Constructor.
bool | Create (wxWindow *parent)
| Creates the dialog if the wxFontDialog object had been initialized using the default constructor.
bool | Create (wxWindow *parent, const wxFontData &data)
| Creates the dialog if the wxFontDialog object had been initialized using the default constructor.
int | ShowModal ()
| Shows the dialog, returning `wxID_OK` if the user pressed Ok, and `wxID_CANCEL` otherwise.
const wxFontData & | GetFontData () const
| Returns the font data associated with the font dialog.
wxFontData & | GetFontData ()
| Returns the font data associated with the font dialog.

List of all members.

## Constructor & Destructor Documentation

wxFontDialog::wxFontDialog | ( |  | ) |

Default ctor.

Create() must be called before the dialog can be shown.

wxFontDialog::wxFontDialog | ( | wxWindow * | parent | ) |

Constructor with parent window.

wxFontDialog::wxFontDialog | ( | wxWindow * | parent,
|  | const wxFontData & | data |
| ) |  |  |

Constructor.

Pass a parent window, and the font data object to be used to initialize the dialog controls.

## Member Function Documentation

bool wxFontDialog::Create | ( | wxWindow * | parent,
|  | const wxFontData & | data |
| ) |  |  |

Creates the dialog if the wxFontDialog object had been initialized using the default constructor.

Returns:
  true on success and false if an error occurred.

bool wxFontDialog::Create | ( | wxWindow * | parent | ) |

Creates the dialog if the wxFontDialog object had been initialized using the default constructor.

Returns:
  true on success and false if an error occurred.

wxFontData& wxFontDialog::GetFontData | ( |  | ) |

Returns the font data associated with the font dialog.

const wxFontData& wxFontDialog::GetFontData | ( |  | ) | const

Returns the font data associated with the font dialog.

int wxFontDialog::ShowModal | ( |  | ) | `[virtual]`

Shows the dialog, returning `wxID_OK` if the user pressed Ok, and `wxID_CANCEL` otherwise.

If the user cancels the dialog (ShowModal returns `wxID_CANCEL`), no font will be created. If the user presses OK, a new wxFont will be created and stored in the font dialog's wxFontData structure.

See also:
  GetFontData()

Reimplemented from wxDialog.

|  | [ top ]