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