diff --git a/include/wx/richtext/richtextstylepage.h b/include/wx/richtext/richtextstylepage.h index 1cd3e48bbe..c3ebb2e9bb 100644 --- a/include/wx/richtext/richtextstylepage.h +++ b/include/wx/richtext/richtextstylepage.h @@ -56,6 +56,10 @@ public: /// Gets the attributes associated with the main formatting dialog wxRichTextAttr* GetAttributes(); + /// Determines whether the style name can be edited + bool GetNameIsEditable() const { return m_nameIsEditable; } + void SetNameIsEditable(bool editable) { m_nameIsEditable = editable; } + ////@begin wxRichTextStylePage event handler declarations /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEPAGE_NEXT_STYLE @@ -87,6 +91,8 @@ public: ID_RICHTEXTSTYLEPAGE_NEXT_STYLE = 10406 }; ////@end wxRichTextStylePage member variables + + bool m_nameIsEditable; }; #endif diff --git a/src/richtext/richtextstylepage.cpp b/src/richtext/richtextstylepage.cpp index 0c68ed0bc7..b28400b7cd 100644 --- a/src/richtext/richtextstylepage.cpp +++ b/src/richtext/richtextstylepage.cpp @@ -54,6 +54,8 @@ wxRichTextStylePage::wxRichTextStylePage( wxWindow* parent, wxWindowID id, const void wxRichTextStylePage::Init() { + m_nameIsEditable = false; + ////@begin wxRichTextStylePage member initialisation m_styleName = NULL; m_basedOn = NULL; @@ -156,6 +158,8 @@ bool wxRichTextStylePage::TransferDataFromWindow() bool wxRichTextStylePage::TransferDataToWindow() { + m_styleName->SetEditable(GetNameIsEditable()); + wxPanel::TransferDataToWindow(); wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this);