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
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) 1997-2002 wxWidgets team
|
2004-05-23 16:53:33 -04: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
|
2011-01-07 00:26:57 -05:00
|
|
|
#include "wx/fontdata.h"
|
2002-05-12 15:35:33 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFontDialog interface
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxFontDialogBase : public wxDialog
|
2002-05-12 15:35:33 -04:00
|
|
|
{
|
|
|
|
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
|
|
|
|
|
|
|
// retrieve the font data
|
|
|
|
const wxFontData& GetFontData() const { return m_fontData; }
|
|
|
|
wxFontData& GetFontData() { return m_fontData; }
|
|
|
|
|
|
|
|
protected:
|
2004-09-14 08:08:28 -04:00
|
|
|
virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return true; }
|
2002-05-12 15:35:33 -04:00
|
|
|
|
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
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxFontDialogBase);
|
2002-05-12 15:35:33 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// platform-specific wxFontDialog implementation
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-06-11 11:53:10 -04:00
|
|
|
#if defined( __WXOSX_MAC__ )
|
2004-11-16 09:36:10 -05:00
|
|
|
//set to 1 to use native mac font and color dialogs
|
2006-10-09 18:56:48 -04:00
|
|
|
#define USE_NATIVE_FONT_DIALOG_FOR_MACOSX 1
|
2004-11-16 09:36:10 -05:00
|
|
|
#else
|
|
|
|
//not supported on these platforms, leave 0
|
|
|
|
#define USE_NATIVE_FONT_DIALOG_FOR_MACOSX 0
|
|
|
|
#endif
|
2004-09-28 10:28:22 -04:00
|
|
|
|
2004-06-23 11:01:33 -04:00
|
|
|
#if defined(__WXUNIVERSAL__) || \
|
|
|
|
defined(__WXMOTIF__) || \
|
|
|
|
defined(__WXCOCOA__) || \
|
|
|
|
defined(__WXWINCE__) || \
|
|
|
|
defined(__WXGPE__)
|
|
|
|
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/generic/fontdlgg.h"
|
|
|
|
#define wxFontDialog wxGenericFontDialog
|
2001-07-04 14:27:43 -04:00
|
|
|
#elif defined(__WXMSW__)
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/msw/fontdlg.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
2002-05-12 15:35:33 -04:00
|
|
|
#include "wx/gtk/fontdlg.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/fontdlg.h"
|
2004-09-26 11:59:57 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 15:17:41 -04:00
|
|
|
#include "wx/osx/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
|
2009-01-19 08:55:27 -05:00
|
|
|
WXDLLIMPEXP_CORE wxFont wxGetFontFromUser(wxWindow *parent = NULL,
|
2008-03-26 11:06:00 -04:00
|
|
|
const wxFont& fontInit = wxNullFont,
|
|
|
|
const wxString& caption = wxEmptyString);
|
2002-01-21 12:53:00 -05:00
|
|
|
|
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_
|