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
|
|
|
|
@wxheader{fontdlg.h}
|
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-03-10 15:24:38 +00:00
|
|
|
@see Overview(), wxFontData, wxGetFontFromUser()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxFontDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
Constructor. Pass a parent window, and optionally the
|
2008-03-08 13:52:38 +00:00
|
|
|
@ref overview_wxfontdata "font data" object to be used to initialize the dialog
|
2008-03-08 14:43:31 +00:00
|
|
|
controls. If the default constructor is used,
|
2008-03-08 13:52:38 +00:00
|
|
|
Create() must be called before the dialog can be
|
|
|
|
shown.
|
|
|
|
*/
|
|
|
|
wxFontDialog();
|
2008-03-08 14:43:31 +00:00
|
|
|
wxFontDialog(wxWindow* parent);
|
|
|
|
wxFontDialog(wxWindow* parent, const wxFontData& data);
|
2008-03-08 13:52:38 +00: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 14:43:31 +00:00
|
|
|
bool Create(wxWindow* parent, const wxFontData& data);
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the @ref overview_wxfontdata "font data" associated with the font
|
|
|
|
dialog.
|
|
|
|
*/
|
|
|
|
const wxFontData GetFontData();
|
2008-03-09 16:24:26 +00:00
|
|
|
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.
|
|
|
|
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 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2008-03-18 19:30:01 +00:00
|
|
|
/** @ingroup group_funcmacro_dialog */
|
|
|
|
//@{
|
|
|
|
|
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
|
|
|
//@}
|
|
|
|
|