.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2017 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.FontDialog:
==========================================================================================================================================
|phoenix_title| **wx.FontDialog**
==========================================================================================================================================
This class represents the font chooser dialog.
.. seealso:: :ref:`FontDialog Overview `, :ref:`wx.FontData`, `wx.GetFontFromUser`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
Inheritance diagram for class
FontDialog:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.FontDialog.__init__` Default constructor.
:meth:`~wx.FontDialog.Create` Creates the dialog if the :ref:`wx.FontDialog` object had been initialized using the default constructor.
:meth:`~wx.FontDialog.GetFontData` Returns the :ref:`font data ` associated with the font dialog.
:meth:`~wx.FontDialog.ShowModal` Shows the dialog, returning ``ID_OK`` if the user pressed Ok, and ``ID_CANCEL`` otherwise.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.FontDialog.FontData` See :meth:`~wx.FontDialog.GetFontData`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.FontDialog(Dialog)
**Possible constructors**::
FontDialog()
FontDialog(parent)
FontDialog(parent, data)
This class represents the font chooser dialog.
.. method:: __init__(self, *args, **kw)
|overload| Overloaded Implementations:
**~~~**
**__init__** `(self)`
Default constructor.
:meth:`Create` must be called before the dialog can be shown.
**~~~**
**__init__** `(self, parent)`
Constructor with parent window.
:param `parent`:
:type `parent`: wx.Window
**~~~**
**__init__** `(self, parent, data)`
Constructor.
Pass a parent window, and the :ref:`font data ` object to be used to initialize the dialog controls.
:param `parent`:
:type `parent`: wx.Window
:param `data`:
:type `data`: wx.FontData
**~~~**
.. method:: Create(self, *args, **kw)
Creates the dialog if the :ref:`wx.FontDialog` object had been initialized using the default constructor.
:returns:
``True`` on success and ``False`` if an error occurred.
|overload| Overloaded Implementations:
**~~~**
**Create** `(self, parent)`
:param `parent`:
:type `parent`: wx.Window
:rtype: `bool`
**~~~**
**Create** `(self, parent, data)`
:param `parent`:
:type `parent`: wx.Window
:param `data`:
:type `data`: wx.FontData
:rtype: `bool`
**~~~**
.. method:: GetFontData(self)
Returns the :ref:`font data ` associated with the font dialog.
:rtype: :ref:`wx.FontData`
.. method:: ShowModal(self)
Shows the dialog, returning ``ID_OK`` if the user pressed Ok, and ``ID_CANCEL`` otherwise.
If the user cancels the dialog (ShowModal returns ``ID_CANCEL`` ), no font will be created. If the user presses ``wx.OK``, a new :ref:`wx.Font` will be created and stored in the font dialog's :ref:`wx.FontData` structure.
:rtype: `int`
.. seealso:: :meth:`GetFontData`
.. attribute:: FontData
See :meth:`~wx.FontDialog.GetFontData`