2011-03-20 18:05:19 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/osx/fontdlg.h
|
|
|
|
// Purpose: wxFontDialog class using fonts window services (10.2+).
|
|
|
|
// Author: Ryan Norton
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2004-09-25
|
|
|
|
// Copyright: (c) Ryan Norton
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FONTDLG_H_
|
|
|
|
#define _WX_FONTDLG_H_
|
|
|
|
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Font dialog
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* support old notation
|
|
|
|
*/
|
|
|
|
#ifdef wxMAC_USE_EXPERIMENTAL_FONTDIALOG
|
|
|
|
#define wxOSX_USE_EXPERIMENTAL_FONTDIALOG wxMAC_USE_EXPERIMENTAL_FONTDIALOG
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef wxOSX_USE_EXPERIMENTAL_FONTDIALOG
|
|
|
|
#define wxOSX_USE_EXPERIMENTAL_FONTDIALOG 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if wxOSX_USE_EXPERIMENTAL_FONTDIALOG
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxFontDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxFontDialog();
|
2012-03-18 01:12:27 +00:00
|
|
|
wxFontDialog(wxWindow *parent);
|
2011-03-20 18:05:19 +00:00
|
|
|
wxFontDialog(wxWindow *parent, const wxFontData& data);
|
|
|
|
virtual ~wxFontDialog();
|
|
|
|
|
2012-03-18 01:12:27 +00:00
|
|
|
bool Create(wxWindow *parent);
|
2011-03-20 18:05:19 +00:00
|
|
|
bool Create(wxWindow *parent, const wxFontData& data);
|
|
|
|
|
|
|
|
int ShowModal();
|
|
|
|
wxFontData& GetFontData() { return m_fontData; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxFontData m_fontData;
|
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog);
|
2011-03-20 18:05:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern "C" int RunMixedFontDialog(wxFontDialog* dialog) ;
|
|
|
|
|
|
|
|
#else // wxOSX_USE_EXPERIMENTAL_FONTDIALOG
|
|
|
|
|
|
|
|
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Forward declarations
|
|
|
|
*/
|
|
|
|
|
|
|
|
class wxFontColourSwatchCtrl;
|
|
|
|
class wxFontPreviewCtrl;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxListBox;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxChoice;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxButton;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Control identifiers
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define wxID_FONTDIALOG_FACENAME 20001
|
|
|
|
#define wxID_FONTDIALOG_FONTSIZE 20002
|
|
|
|
#define wxID_FONTDIALOG_BOLD 20003
|
|
|
|
#define wxID_FONTDIALOG_ITALIC 20004
|
|
|
|
#define wxID_FONTDIALOG_UNDERLINED 20005
|
|
|
|
#define wxID_FONTDIALOG_COLOUR 20006
|
|
|
|
#define wxID_FONTDIALOG_PREVIEW 20007
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxFontDialog: public wxDialog
|
|
|
|
{
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxFontDialog);
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2011-03-20 18:05:19 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxFontDialog();
|
|
|
|
wxFontDialog(wxWindow *parent, const wxFontData& data);
|
|
|
|
virtual ~wxFontDialog();
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, const wxFontData& data);
|
|
|
|
|
|
|
|
int ShowModal();
|
|
|
|
wxFontData& GetFontData() { return m_fontData; }
|
|
|
|
bool IsShown() const;
|
|
|
|
void OnPanelClose();
|
|
|
|
void SetData(const wxFontData& data);
|
|
|
|
|
|
|
|
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
|
|
|
|
|
|
|
/// Creates the controls and sizers
|
|
|
|
void CreateControls();
|
|
|
|
|
|
|
|
/// Initialize font
|
|
|
|
void InitializeFont();
|
|
|
|
|
|
|
|
/// Set controls according to current font
|
|
|
|
void InitializeControls();
|
|
|
|
|
|
|
|
/// Respond to font change
|
|
|
|
void ChangeFont();
|
|
|
|
|
|
|
|
/// Respond to colour change
|
|
|
|
void OnColourChanged(wxCommandEvent& event);
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_LISTBOX event handler for wxID_FONTDIALOG_FACENAME
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnFontdialogFacenameSelected( wxCommandEvent& event );
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_SPINCTRL event handler for wxID_FONTDIALOG_FONTSIZE
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnFontdialogFontsizeUpdated( wxSpinEvent& event );
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_TEXT event handler for wxID_FONTDIALOG_FONTSIZE
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnFontdialogFontsizeTextUpdated( wxCommandEvent& event );
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_CHECKBOX event handler for wxID_FONTDIALOG_BOLD
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnFontdialogBoldClick( wxCommandEvent& event );
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_CHECKBOX event handler for wxID_FONTDIALOG_ITALIC
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnFontdialogItalicClick( wxCommandEvent& event );
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_CHECKBOX event handler for wxID_FONTDIALOG_UNDERLINED
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnFontdialogUnderlinedClick( wxCommandEvent& event );
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
/// wxEVT_BUTTON event handler for wxID_OK
|
2011-03-20 18:05:19 +00:00
|
|
|
void OnOkClick( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/// Should we show tooltips?
|
|
|
|
static bool ShowToolTips();
|
|
|
|
|
|
|
|
wxListBox* m_facenameCtrl;
|
|
|
|
wxSpinCtrl* m_sizeCtrl;
|
|
|
|
wxCheckBox* m_boldCtrl;
|
|
|
|
wxCheckBox* m_italicCtrl;
|
|
|
|
wxCheckBox* m_underlinedCtrl;
|
|
|
|
wxFontColourSwatchCtrl* m_colourCtrl;
|
|
|
|
wxFontPreviewCtrl* m_previewCtrl;
|
|
|
|
|
|
|
|
wxFont m_dialogFont;
|
|
|
|
bool m_suppressUpdates;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxWindow* m_dialogParent;
|
|
|
|
wxFontData m_fontData;
|
|
|
|
void* m_pEventHandlerRef;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_FONTDLG_H_
|