.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 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 <fontdialog overview>`, :ref:`wx.FontData`, `wx.GetFontFromUser` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;"> <img id="toggleBlock-trigger" src="_static/images/closed.png"/> Inheritance diagram for class <strong>FontDialog</strong>: </div> <div id="toggleBlock-summary" style="display:block;"></div> <div id="toggleBlock-content" style="display:none;"> <p class="graphviz"> <center><img src="_static/images/inheritance/wx.FontDialog_inheritance.svg" alt="Inheritance diagram of FontDialog" usemap="#dummy" class="inheritance"/></center> <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script> <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.FontDialog.html" title="This class represents the font chooser dialog." alt="" coords="56,466,187,495"/> <area shape="rect" id="node2" href="wx.Dialog.html" title="A dialog box is a window with a title bar and sometimes a system menu, which can be moved around the screen." alt="" coords="72,389,171,418"/> <area shape="rect" id="node3" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow is a common base class for wx.Dialog and wx.Frame." alt="" coords="34,313,209,341"/> <area shape="rect" id="node4" href="wx.NonOwnedWindow.html" title="Common base class for all non-child windows." alt="" coords="26,236,217,265"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window is the base class for all windows and represents any visible object on screen." alt="" coords="66,159,177,188"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="55,82,188,111"/> <area shape="rect" id="node7" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="5,5,104,34"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="128,5,251,34"/> </map> </p> </div> | |appearance| Control Appearance =============================== | .. container:: control-appearance-figures .. figure:: _static/images/widgets/fullsize/wxmsw/wx.fontdialog.png :alt: wxMSW :figclass: appearance-figure **wxMSW** .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png :alt: wxMAC :figclass: appearance-figure **wxMAC** .. figure:: _static/images/widgets/fullsize/wxgtk/wx.fontdialog.png :alt: wxGTK :figclass: appearance-figure **wxGTK** | |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.GetClassDefaultAttributes` :meth:`~wx.FontDialog.GetFontData` Returns the :ref:`font data <wx.FontData>` 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() -> None FontDialog(parent : Window) -> None FontDialog(parent : Window, data : FontData) -> None This class represents the font chooser dialog. .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations:** :html:`<hr class="overloadsep" /><br />` **__init__** `(self)` Default constructor. :meth:`Create` must be called before the dialog can be shown. :rtype: `None` :html:`<hr class="overloadsep" /><br />` **__init__** `(self, parent : Window)` Constructor with parent window. :param `parent`: :type `parent`: wx.Window :rtype: `None` :html:`<hr class="overloadsep" /><br />` **__init__** `(self, parent : Window, data : FontData)` Constructor. Pass a parent window, and the :ref:`font data <wx.FontData>` object to be used to initialize the dialog controls. :param `parent`: :type `parent`: wx.Window :param `data`: :type `data`: wx.FontData :rtype: `None` :html:`<hr class="overloadsep" /><br />` .. 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:** :html:`<hr class="overloadsep" /><br />` **Create** `(self, parent : Window)` :param `parent`: :type `parent`: wx.Window :rtype: `bool` :html:`<hr class="overloadsep" /><br />` **Create** `(self, parent : Window, data : FontData)` :param `parent`: :type `parent`: wx.Window :param `data`: :type `data`: wx.FontData :rtype: `bool` :html:`<hr class="overloadsep" /><br />` .. staticmethod:: GetClassDefaultAttributes(variant: WindowVariant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: :ref:`wx.VisualAttributes` .. method:: GetFontData(self) Returns the :ref:`font data <wx.FontData>` 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`