Added a list style editor page to the formatting dialog.

Added a style organiser dialog, which can be used to browse
for and apply styles and can be limited to show one of
the three style types, or all three.
Added a font name cache since it's an expensive operation
that's used frequently by the rich text dialogs.
Added ability to switch off tooltips for new dialogs
(off by default). Improved the previews. Pressing tab or shift-tab
at the start of a list item now demotes or promotes the item.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-10-19 14:04:13 +00:00
parent 0c7e0a8771
commit dadd4f5523
20 changed files with 2892 additions and 259 deletions

View File

@@ -383,6 +383,7 @@ public:
m_richTextCtrl = NULL;
m_applyOnSelection = false;
m_styleType = wxRICHTEXT_STYLE_PARAGRAPH;
m_autoSetSelection = true;
}
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
@@ -414,9 +415,6 @@ public:
/// Apply the style
void ApplyStyle(int i);
/// React to selection
void OnSelect(wxCommandEvent& event);
/// Left click
void OnLeftDown(wxMouseEvent& event);
@@ -431,7 +429,8 @@ public:
/// Can we set the selection based on the editor caret position?
/// Need to override this if being used in a combobox popup
virtual bool CanAutoSetSelection() { return true; }
virtual bool CanAutoSetSelection() { return m_autoSetSelection; }
virtual void SetAutoSetSelection(bool autoSet) { m_autoSetSelection = autoSet; }
/// Set whether the style should be applied as soon as the item is selected (the default)
void SetApplyOnSelection(bool applyOnSel) { m_applyOnSelection = applyOnSel; }
@@ -454,6 +453,7 @@ private:
wxRichTextCtrl* m_richTextCtrl;
bool m_applyOnSelection; // if true, applies style on selection
wxRichTextStyleType m_styleType; // style type to display
bool m_autoSetSelection;
};
/*!
@@ -462,6 +462,8 @@ private:
* style types.
*/
#define wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR 0x1000
class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListCtrl: public wxControl
{
DECLARE_CLASS(wxRichTextStyleListCtrl)
@@ -493,6 +495,9 @@ public:
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0);
/// Updates the style list box
void UpdateStyles();
/// Associates the control with a style manager
void SetStyleSheet(wxRichTextStyleSheet* styleSheet);
wxRichTextStyleSheet* GetStyleSheet() const;
@@ -501,9 +506,6 @@ public:
void SetRichTextCtrl(wxRichTextCtrl* ctrl);
wxRichTextCtrl* GetRichTextCtrl() const;
/// Updates the style list box
void UpdateStyles();
/// Set/get the style type to display
void SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType);
wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const;