2002-05-12 15:35:33 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/fontdlg.h
|
|
|
|
// Purpose: common interface for different wxFontDialog classes
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 12.05.02
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1997-2002 wxWindows team
|
2003-03-17 05:34:04 -05:00
|
|
|
// Licence: wxWindows licence
|
2002-05-12 15:35:33 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_FONTDLG_H_BASE_
|
|
|
|
#define _WX_FONTDLG_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/defs.h" // for wxUSE_FONTDLG
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_FONTDLG
|
|
|
|
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/dialog.h" // the base class
|
|
|
|
#include "wx/cmndata.h" // wxFontData
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFontDialog interface
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxFontDialogBase : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// create the font dialog
|
|
|
|
wxFontDialogBase() { }
|
2002-05-12 18:26:01 -04:00
|
|
|
wxFontDialogBase(wxWindow *parent) { m_parent = parent; }
|
|
|
|
wxFontDialogBase(wxWindow *parent, const wxFontData& data)
|
|
|
|
{ m_parent = parent; InitFontData(&data); }
|
2002-05-12 15:35:33 -04:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent)
|
|
|
|
{ return DoCreate(parent); }
|
|
|
|
bool Create(wxWindow *parent, const wxFontData& data)
|
2002-05-12 18:26:01 -04:00
|
|
|
{ InitFontData(&data); return Create(parent); }
|
2002-05-12 15:35:33 -04:00
|
|
|
|
|
|
|
virtual ~wxFontDialogBase();
|
|
|
|
|
|
|
|
// retrieve the font data
|
|
|
|
const wxFontData& GetFontData() const { return m_fontData; }
|
|
|
|
wxFontData& GetFontData() { return m_fontData; }
|
|
|
|
|
|
|
|
// deprecated interface, for compatibility only, don't use
|
|
|
|
wxFontDialogBase(wxWindow *parent, const wxFontData *data)
|
2002-05-12 18:26:01 -04:00
|
|
|
{ m_parent = parent; InitFontData(data); }
|
2002-05-12 15:35:33 -04:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent, const wxFontData *data)
|
2002-05-12 18:26:01 -04:00
|
|
|
{ InitFontData(data); return Create(parent); }
|
2002-05-12 15:35:33 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return TRUE; }
|
|
|
|
|
2002-05-12 18:26:01 -04:00
|
|
|
void InitFontData(const wxFontData *data = NULL)
|
|
|
|
{ if ( data ) m_fontData = *data; }
|
|
|
|
|
2002-05-12 15:35:33 -04:00
|
|
|
wxFontData m_fontData;
|
2003-07-21 20:24:07 -04:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxFontDialogBase)
|
2002-05-12 15:35:33 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// platform-specific wxFontDialog implementation
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2003-07-11 17:43:57 -04:00
|
|
|
#if defined(__WXUNIVERSAL__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXCOCOA__) \
|
|
|
|
|| defined(__WXWINCE__)
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/generic/fontdlgg.h"
|
|
|
|
#define wxFontDialog wxGenericFontDialog
|
|
|
|
#define sm_classwxFontDialog sm_classwxGenericFontDialog
|
2001-07-04 14:27:43 -04:00
|
|
|
#elif defined(__WXMSW__)
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/msw/fontdlg.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXGTK__)
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/gtk/fontdlg.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/os2/fontdlg.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
2002-05-12 15:35:33 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// global public functions
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2002-01-23 07:06:33 -05:00
|
|
|
// get the font from user and return it, returns wxNullFont if the dialog was
|
|
|
|
// cancelled
|
2002-01-21 12:53:00 -05:00
|
|
|
wxFont WXDLLEXPORT
|
|
|
|
wxGetFontFromUser(wxWindow *parent = (wxWindow *)NULL,
|
|
|
|
const wxFont& fontInit = wxNullFont);
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_FONTDLG
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_FONTDLG_H_BASE_
|