2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: fontdlg.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxFontDialog
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxFontDialog
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This class represents the font chooser dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{cmndlg}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2014-05-06 14:16:29 -04:00
|
|
|
@see @ref overview_cmndlg_font, wxFontData, wxGetFontFromUser()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxFontDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-09-25 15:15:28 -04:00
|
|
|
Default ctor.
|
|
|
|
Create() must be called before the dialog can be shown.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxFontDialog();
|
2008-09-25 15:15:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Constructor with parent window.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxFontDialog(wxWindow* parent);
|
2008-09-25 15:15:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Constructor.
|
2008-09-25 16:00:31 -04:00
|
|
|
Pass a parent window, and the @ref wxFontData "font data" object
|
2008-09-25 15:15:28 -04:00
|
|
|
to be used to initialize the dialog controls.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxFontDialog(wxWindow* parent, const wxFontData& data);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-25 15:15:28 -04:00
|
|
|
Creates the dialog if the wxFontDialog object had been initialized using
|
|
|
|
the default constructor.
|
|
|
|
|
|
|
|
@return @true on success and @false if an error occurred.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent);
|
2008-09-25 15:15:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the dialog if the wxFontDialog object had been initialized using
|
|
|
|
the default constructor.
|
|
|
|
|
|
|
|
@return @true on success and @false if an error occurred.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
bool Create(wxWindow* parent, const wxFontData& data);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2022-08-03 12:28:06 -04:00
|
|
|
///@{
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-09-25 16:00:31 -04:00
|
|
|
Returns the @ref wxFontData "font data" associated with the
|
2008-09-25 15:15:28 -04:00
|
|
|
font dialog.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-25 15:15:28 -04:00
|
|
|
const wxFontData& GetFontData() const;
|
|
|
|
wxFontData& GetFontData();
|
2022-08-03 12:28:06 -04:00
|
|
|
///@}
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Shows the dialog, returning @c wxID_OK if the user pressed Ok, and
|
2008-03-08 08:52:38 -05:00
|
|
|
@c wxID_CANCEL otherwise.
|
2008-09-25 15:15:28 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
If the user cancels the dialog (ShowModal returns @c 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.
|
2008-09-25 15:15:28 -04:00
|
|
|
|
|
|
|
@see GetFontData()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
int ShowModal();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_dialog */
|
2022-08-03 12:28:06 -04:00
|
|
|
///@{
|
2008-03-18 15:30:01 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Shows the font selection dialog and returns the font selected by user or
|
2008-03-18 15:30:01 -04:00
|
|
|
invalid font (use wxFont::IsOk() to test whether a font is valid) if the
|
|
|
|
dialog was cancelled.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
|
|
|
@param parent
|
2008-03-18 15:30:01 -04:00
|
|
|
The parent window for the font selection dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param fontInit
|
2008-03-09 08:33:59 -04:00
|
|
|
If given, this will be the font initially selected in the dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param caption
|
2008-03-09 08:33:59 -04:00
|
|
|
If given, this will be used for the dialog caption.
|
2008-03-18 15:30:01 -04:00
|
|
|
|
|
|
|
@header{wx/fontdlg.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFont wxGetFontFromUser(wxWindow* parent,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxFont& fontInit,
|
|
|
|
const wxString& caption = wxEmptyString);
|
|
|
|
|
2022-08-03 12:28:06 -04:00
|
|
|
///@}
|
2008-03-18 15:30:01 -04:00
|
|
|
|