2006-10-08 10:05:17 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/richtext/richtextformatdlg.h
|
|
|
|
// Purpose: Formatting dialog for wxRichTextCtrl
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2006-10-01
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RICHTEXTFORMATDLG_H_
|
|
|
|
#define _WX_RICHTEXTFORMATDLG_H_
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Includes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_RICHTEXT
|
|
|
|
|
|
|
|
#include "wx/propdlg.h"
|
2006-10-09 10:37:53 -04:00
|
|
|
#include "wx/bookctrl.h"
|
2011-08-21 10:08:43 -04:00
|
|
|
#include "wx/withimages.h"
|
2014-08-28 04:28:08 -04:00
|
|
|
#include "wx/colourdata.h"
|
2006-10-09 10:37:53 -04:00
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
#if wxUSE_HTML
|
|
|
|
#include "wx/htmllbox.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/richtext/richtextbuffer.h"
|
|
|
|
#include "wx/richtext/richtextstyles.h"
|
2011-01-14 06:57:44 -05:00
|
|
|
#include "wx/richtext/richtextuicustomization.h"
|
2006-10-08 10:05:17 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFormattingDialog;
|
2011-01-14 07:08:03 -05:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxComboBox;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/*!
|
2006-10-19 10:04:13 -04:00
|
|
|
* Flags determining the pages and buttons to be created in the dialog
|
2006-10-08 10:05:17 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define wxRICHTEXT_FORMAT_STYLE_EDITOR 0x0001
|
|
|
|
#define wxRICHTEXT_FORMAT_FONT 0x0002
|
|
|
|
#define wxRICHTEXT_FORMAT_TABS 0x0004
|
|
|
|
#define wxRICHTEXT_FORMAT_BULLETS 0x0008
|
|
|
|
#define wxRICHTEXT_FORMAT_INDENTS_SPACING 0x0010
|
2006-10-19 10:04:13 -04:00
|
|
|
#define wxRICHTEXT_FORMAT_LIST_STYLE 0x0020
|
2011-01-14 06:57:44 -05:00
|
|
|
#define wxRICHTEXT_FORMAT_MARGINS 0x0040
|
|
|
|
#define wxRICHTEXT_FORMAT_SIZE 0x0080
|
|
|
|
#define wxRICHTEXT_FORMAT_BORDERS 0x0100
|
|
|
|
#define wxRICHTEXT_FORMAT_BACKGROUND 0x0200
|
2006-10-19 10:04:13 -04:00
|
|
|
|
2011-01-14 06:57:44 -05:00
|
|
|
#define wxRICHTEXT_FORMAT_HELP_BUTTON 0x1000
|
2006-10-08 10:05:17 -04:00
|
|
|
|
2006-10-26 02:32:47 -04:00
|
|
|
/*!
|
|
|
|
* Indices for bullet styles in list control
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum {
|
|
|
|
wxRICHTEXT_BULLETINDEX_NONE = 0,
|
|
|
|
wxRICHTEXT_BULLETINDEX_ARABIC,
|
|
|
|
wxRICHTEXT_BULLETINDEX_UPPER_CASE,
|
|
|
|
wxRICHTEXT_BULLETINDEX_LOWER_CASE,
|
|
|
|
wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN,
|
|
|
|
wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN,
|
|
|
|
wxRICHTEXT_BULLETINDEX_OUTLINE,
|
|
|
|
wxRICHTEXT_BULLETINDEX_SYMBOL,
|
|
|
|
wxRICHTEXT_BULLETINDEX_BITMAP,
|
|
|
|
wxRICHTEXT_BULLETINDEX_STANDARD
|
|
|
|
};
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
/*!
|
|
|
|
* Shorthand for common combinations of pages
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define wxRICHTEXT_FORMAT_PARAGRAPH (wxRICHTEXT_FORMAT_INDENTS_SPACING | wxRICHTEXT_FORMAT_BULLETS | wxRICHTEXT_FORMAT_TABS | wxRICHTEXT_FORMAT_FONT)
|
|
|
|
#define wxRICHTEXT_FORMAT_CHARACTER (wxRICHTEXT_FORMAT_FONT)
|
|
|
|
#define wxRICHTEXT_FORMAT_STYLE (wxRICHTEXT_FORMAT_PARAGRAPH | wxRICHTEXT_FORMAT_STYLE_EDITOR)
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Factory for formatting dialog
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialogFactory: public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxRichTextFormattingDialogFactory() {}
|
|
|
|
virtual ~wxRichTextFormattingDialogFactory() {}
|
|
|
|
|
2011-04-03 16:31:32 -04:00
|
|
|
// Overridables
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/// Create all pages, under the dialog's book control, also calling AddPage
|
|
|
|
virtual bool CreatePages(long pages, wxRichTextFormattingDialog* dialog);
|
|
|
|
|
|
|
|
/// Create a page, given a page identifier
|
|
|
|
virtual wxPanel* CreatePage(int page, wxString& title, wxRichTextFormattingDialog* dialog);
|
|
|
|
|
|
|
|
/// Enumerate all available page identifiers
|
|
|
|
virtual int GetPageId(int i) const;
|
|
|
|
|
|
|
|
/// Get the number of available page identifiers
|
|
|
|
virtual int GetPageIdCount() const;
|
|
|
|
|
|
|
|
/// Get the image index for the given page identifier
|
|
|
|
virtual int GetPageImage(int WXUNUSED(id)) const { return -1; }
|
|
|
|
|
|
|
|
/// Invoke help for the dialog
|
2011-01-14 06:57:44 -05:00
|
|
|
virtual bool ShowHelp(int page, wxRichTextFormattingDialog* dialog);
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create
|
|
|
|
virtual bool SetSheetStyle(wxRichTextFormattingDialog* dialog);
|
|
|
|
|
|
|
|
/// Create the main dialog buttons
|
|
|
|
virtual bool CreateButtons(wxRichTextFormattingDialog* dialog);
|
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Formatting dialog for a wxRichTextCtrl
|
|
|
|
*/
|
|
|
|
|
2011-08-21 10:08:43 -04:00
|
|
|
class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog,
|
|
|
|
public wxWithImages
|
2006-10-08 10:05:17 -04:00
|
|
|
{
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_CLASS(wxRichTextFormattingDialog);
|
2011-01-14 06:57:44 -05:00
|
|
|
DECLARE_HELP_PROVISION()
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
public:
|
2012-05-20 08:25:22 -04:00
|
|
|
enum { Option_AllowPixelFontSize = 0x0001 };
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
wxRichTextFormattingDialog() { Init(); }
|
|
|
|
|
2006-11-25 08:52:12 -05:00
|
|
|
wxRichTextFormattingDialog(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY,
|
2006-10-08 10:05:17 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_DIALOG_STYLE)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(flags, parent, title, id, pos, sz, style);
|
|
|
|
}
|
|
|
|
|
|
|
|
~wxRichTextFormattingDialog();
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
2006-11-25 08:52:12 -05:00
|
|
|
bool Create(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY,
|
2006-10-08 10:05:17 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_DIALOG_STYLE);
|
|
|
|
|
|
|
|
/// Get attributes from the given range
|
|
|
|
virtual bool GetStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range);
|
|
|
|
|
|
|
|
/// Set the attributes and optionally update the display
|
2010-10-04 04:37:31 -04:00
|
|
|
virtual bool SetStyle(const wxRichTextAttr& style, bool update = true);
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/// Set the style definition and optionally update the display
|
|
|
|
virtual bool SetStyleDefinition(const wxRichTextStyleDefinition& styleDef, wxRichTextStyleSheet* sheet, bool update = true);
|
|
|
|
|
|
|
|
/// Get the style definition, if any
|
|
|
|
virtual wxRichTextStyleDefinition* GetStyleDefinition() const { return m_styleDefinition; }
|
|
|
|
|
|
|
|
/// Get the style sheet, if any
|
|
|
|
virtual wxRichTextStyleSheet* GetStyleSheet() const { return m_styleSheet; }
|
|
|
|
|
|
|
|
/// Update the display
|
|
|
|
virtual bool UpdateDisplay();
|
|
|
|
|
|
|
|
/// Apply attributes to the given range
|
|
|
|
virtual bool ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE);
|
2012-05-20 08:25:22 -04:00
|
|
|
|
2011-01-14 06:57:44 -05:00
|
|
|
/// Apply attributes to the object being edited, if any
|
|
|
|
virtual bool ApplyStyle(wxRichTextCtrl* ctrl, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/// Gets and sets the attributes
|
2010-10-04 04:37:31 -04:00
|
|
|
const wxRichTextAttr& GetAttributes() const { return m_attributes; }
|
|
|
|
wxRichTextAttr& GetAttributes() { return m_attributes; }
|
|
|
|
void SetAttributes(const wxRichTextAttr& attr) { m_attributes = attr; }
|
2012-05-20 08:25:22 -04:00
|
|
|
|
|
|
|
/// Sets the dialog options, determining what the interface presents to the user.
|
|
|
|
/// Currently the only option is Option_AllowPixelFontSize.
|
|
|
|
void SetOptions(int options) { m_options = options; }
|
|
|
|
|
|
|
|
/// Gets the dialog options, determining what the interface presents to the user.
|
|
|
|
/// Currently the only option is Option_AllowPixelFontSize.
|
|
|
|
int GetOptions() const { return m_options; }
|
|
|
|
|
|
|
|
/// Returns @true if the given option is present.
|
|
|
|
bool HasOption(int option) const { return (m_options & option) != 0; }
|
|
|
|
|
2011-01-14 06:57:44 -05:00
|
|
|
/// If editing the attributes for a particular object, such as an image,
|
|
|
|
/// set the object so the code can initialize attributes such as size correctly.
|
|
|
|
wxRichTextObject* GetObject() const { return m_object; }
|
|
|
|
void SetObject(wxRichTextObject* obj) { m_object = obj; }
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/// Transfers the data and from to the window
|
2015-09-06 20:20:42 -04:00
|
|
|
virtual bool TransferDataToWindow() wxOVERRIDE;
|
|
|
|
virtual bool TransferDataFromWindow() wxOVERRIDE;
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
/// Apply the styles when a different tab is selected, so the previews are
|
|
|
|
/// up to date
|
2006-10-09 10:37:53 -04:00
|
|
|
void OnTabChanged(wxBookCtrlEvent& event);
|
2006-10-08 10:05:17 -04:00
|
|
|
|
2006-10-10 13:01:36 -04:00
|
|
|
/// Respond to help command
|
|
|
|
void OnHelp(wxCommandEvent& event);
|
2011-01-14 06:57:44 -05:00
|
|
|
void OnUpdateHelp(wxUpdateUIEvent& event);
|
2006-10-10 13:01:36 -04:00
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
/// Get/set formatting factory object
|
|
|
|
static void SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory);
|
|
|
|
static wxRichTextFormattingDialogFactory* GetFormattingDialogFactory() { return ms_FormattingDialogFactory; }
|
|
|
|
|
|
|
|
/// Helper for pages to get the top-level dialog
|
|
|
|
static wxRichTextFormattingDialog* GetDialog(wxWindow* win);
|
|
|
|
|
|
|
|
/// Helper for pages to get the attributes
|
2010-10-04 04:37:31 -04:00
|
|
|
static wxRichTextAttr* GetDialogAttributes(wxWindow* win);
|
2006-10-08 10:05:17 -04:00
|
|
|
|
2011-01-14 06:57:44 -05:00
|
|
|
/// Helper for pages to get the reset attributes
|
|
|
|
static wxRichTextAttr* GetDialogResetAttributes(wxWindow* win);
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
/// Helper for pages to get the style
|
|
|
|
static wxRichTextStyleDefinition* GetDialogStyleDefinition(wxWindow* win);
|
|
|
|
|
2006-10-19 10:04:13 -04:00
|
|
|
/// Should we show tooltips?
|
|
|
|
static bool ShowToolTips() { return sm_showToolTips; }
|
2006-10-20 03:48:31 -04:00
|
|
|
|
2006-10-19 10:04:13 -04:00
|
|
|
/// Determines whether tooltips will be shown
|
|
|
|
static void SetShowToolTips(bool show) { sm_showToolTips = show; }
|
2006-10-20 03:48:31 -04:00
|
|
|
|
2013-10-16 16:23:42 -04:00
|
|
|
/// Set the dimension into the value and units controls. Optionally pass units to
|
|
|
|
/// specify the ordering of units in the combobox.
|
|
|
|
static void SetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox, wxArrayInt* units = NULL);
|
2011-01-14 06:57:44 -05:00
|
|
|
|
2013-10-16 16:23:42 -04:00
|
|
|
/// Get the dimension from the value and units controls Optionally pass units to
|
|
|
|
/// specify the ordering of units in the combobox.
|
|
|
|
static void GetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox, wxArrayInt* units = NULL);
|
2012-05-20 08:25:22 -04:00
|
|
|
|
2013-10-16 16:23:42 -04:00
|
|
|
/// Convert from a string to a dimension integer.
|
|
|
|
static bool ConvertFromString(const wxString& str, int& ret, int unit);
|
2011-01-14 06:57:44 -05:00
|
|
|
|
2006-10-10 13:01:36 -04:00
|
|
|
/// Map book control page index to our page id
|
|
|
|
void AddPageId(int id) { m_pageIds.Add(id); }
|
2012-05-20 08:25:22 -04:00
|
|
|
|
2011-01-14 06:57:44 -05:00
|
|
|
/// Find a page by class
|
|
|
|
wxWindow* FindPage(wxClassInfo* info) const;
|
2006-10-10 13:01:36 -04:00
|
|
|
|
2014-08-28 04:28:08 -04:00
|
|
|
/// Whether to restore the last-selected page.
|
|
|
|
static bool GetRestoreLastPage() { return sm_restoreLastPage; }
|
2014-02-04 13:57:20 -05:00
|
|
|
static void SetRestoreLastPage(bool b) { sm_restoreLastPage = b; }
|
|
|
|
|
|
|
|
/// The page identifier of the last page selected (not the control id)
|
|
|
|
static int GetLastPage() { return sm_lastPage; }
|
|
|
|
static void SetLastPage(int lastPage) { sm_lastPage = lastPage; }
|
|
|
|
|
2014-08-28 04:28:08 -04:00
|
|
|
/// Sets the custom colour data for use by the colour dialog.
|
|
|
|
static void SetColourData(const wxColourData& colourData) { sm_colourData = colourData; }
|
|
|
|
|
|
|
|
/// Returns the custom colour data for use by the colour dialog.
|
|
|
|
static wxColourData GetColourData() { return sm_colourData; }
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
protected:
|
|
|
|
|
2010-10-04 04:37:31 -04:00
|
|
|
wxRichTextAttr m_attributes;
|
2006-10-08 10:05:17 -04:00
|
|
|
wxRichTextStyleDefinition* m_styleDefinition;
|
|
|
|
wxRichTextStyleSheet* m_styleSheet;
|
2011-01-14 06:57:44 -05:00
|
|
|
wxRichTextObject* m_object;
|
2006-10-10 13:01:36 -04:00
|
|
|
wxArrayInt m_pageIds; // mapping of book control indexes to page ids
|
2012-05-20 08:25:22 -04:00
|
|
|
int m_options; // UI options
|
2014-02-16 15:05:19 -05:00
|
|
|
bool m_ignoreUpdates;
|
2014-08-28 04:28:08 -04:00
|
|
|
static wxColourData sm_colourData;
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory;
|
2006-10-19 10:04:13 -04:00
|
|
|
static bool sm_showToolTips;
|
2006-10-08 10:05:17 -04:00
|
|
|
|
2014-02-04 13:57:20 -05:00
|
|
|
static bool sm_restoreLastPage;
|
|
|
|
static int sm_lastPage;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2006-10-08 10:05:17 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// helper class - wxRichTextFontPreviewCtrl
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_RICHTEXT wxRichTextFontPreviewCtrl : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
2007-11-14 09:42:31 -05:00
|
|
|
wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0);
|
2006-10-08 10:05:17 -04:00
|
|
|
|
2006-11-08 09:05:50 -05:00
|
|
|
void SetTextEffects(int effects) { m_textEffects = effects; }
|
|
|
|
int GetTextEffects() const { return m_textEffects; }
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
private:
|
2006-11-08 09:05:50 -05:00
|
|
|
int m_textEffects;
|
|
|
|
|
2006-10-08 10:05:17 -04:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2006-10-08 10:05:17 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A control for displaying a small preview of a colour or bitmap
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_RICHTEXT wxRichTextColourSwatchCtrl: public wxControl
|
|
|
|
{
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_CLASS(wxRichTextColourSwatchCtrl);
|
2006-10-08 10:05:17 -04:00
|
|
|
public:
|
|
|
|
wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
|
|
|
|
~wxRichTextColourSwatchCtrl();
|
|
|
|
|
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
|
|
|
|
|
|
|
void SetColour(const wxColour& colour) { m_colour = colour; SetBackgroundColour(m_colour); }
|
|
|
|
|
|
|
|
wxColour& GetColour() { return m_colour; }
|
|
|
|
|
2015-09-06 20:20:42 -04:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE { return GetSize(); }
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
wxColour m_colour;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2006-10-08 10:05:17 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxRichTextFontListBox class declaration
|
|
|
|
* A listbox to display fonts.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_RICHTEXT wxRichTextFontListBox: public wxHtmlListBox
|
|
|
|
{
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_CLASS(wxRichTextFontListBox);
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
wxRichTextFontListBox()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
wxRichTextFontListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0);
|
|
|
|
virtual ~wxRichTextFontListBox();
|
|
|
|
|
|
|
|
void Init()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0);
|
|
|
|
|
|
|
|
/// Creates a suitable HTML fragment for a font
|
|
|
|
wxString CreateHTML(const wxString& facename) const;
|
|
|
|
|
|
|
|
/// Get font name for index
|
|
|
|
wxString GetFaceName(size_t i) const ;
|
|
|
|
|
|
|
|
/// Set selection for string, returning the index.
|
|
|
|
int SetFaceNameSelection(const wxString& name);
|
|
|
|
|
|
|
|
/// Updates the font list
|
|
|
|
void UpdateFonts();
|
|
|
|
|
|
|
|
/// Does this face name exist?
|
|
|
|
bool HasFaceName(const wxString& faceName) const { return m_faceNames.Index(faceName) != wxNOT_FOUND; }
|
|
|
|
|
|
|
|
/// Returns the array of face names
|
|
|
|
const wxArrayString& GetFaceNames() const { return m_faceNames; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/// Returns the HTML for this item
|
2015-09-06 20:20:42 -04:00
|
|
|
virtual wxString OnGetItem(size_t n) const wxOVERRIDE;
|
2006-10-08 10:05:17 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
wxArrayString m_faceNames;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// wxUSE_RICHTEXT
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_RICHTEXTFORMATDLG_H_
|