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
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@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
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see Overview(), wxFontData, wxGetFontFromUser()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxFontDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Constructor. Pass a parent window, and optionally the
|
2008-03-08 08:52:38 -05:00
|
|
|
@ref overview_wxfontdata "font data" object to be used to initialize the dialog
|
2008-03-08 09:43:31 -05:00
|
|
|
controls. If the default constructor is used,
|
2008-03-08 08:52:38 -05:00
|
|
|
Create() must be called before the dialog can be
|
|
|
|
shown.
|
|
|
|
*/
|
|
|
|
wxFontDialog();
|
2008-03-08 09:43:31 -05:00
|
|
|
wxFontDialog(wxWindow* parent);
|
|
|
|
wxFontDialog(wxWindow* parent, const wxFontData& data);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Creates the dialog if it the wxFontDialog object had been initialized using the
|
|
|
|
default constructor. Returns @true on success and @false if an error
|
|
|
|
occurred.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent);
|
2008-03-08 09:43:31 -05:00
|
|
|
bool Create(wxWindow* parent, const wxFontData& data);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the @ref overview_wxfontdata "font data" associated with the font
|
|
|
|
dialog.
|
|
|
|
*/
|
|
|
|
const wxFontData GetFontData();
|
2008-03-09 12:24:26 -04:00
|
|
|
const wxFontData& GetFontData();
|
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.
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
int ShowModal();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2008-03-18 15:30:01 -04:00
|
|
|
/** @ingroup group_funcmacro_dialog */
|
|
|
|
//@{
|
|
|
|
|
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);
|
|
|
|
|
2008-03-18 15:30:01 -04:00
|
|
|
//@}
|
|
|
|
|