X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..507a6cd69a2097a415b81745b014b286ba3d451b:/src/richtext/richtextformatdlg.cpp diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index 768ef405b0..976eeef4bf 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -80,6 +80,8 @@ bool wxRichTextFormattingDialog::sm_showToolTips = false; +IMPLEMENT_CLASS(wxRichTextDialogPage, wxPanel) + IMPLEMENT_CLASS(wxRichTextFormattingDialog, wxPropertySheetDialog) BEGIN_EVENT_TABLE(wxRichTextFormattingDialog, wxPropertySheetDialog) @@ -94,15 +96,14 @@ wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::ms_FormattingDial void wxRichTextFormattingDialog::Init() { - m_imageList = NULL; m_styleDefinition = NULL; m_styleSheet = NULL; m_object = NULL; + m_options = 0; } wxRichTextFormattingDialog::~wxRichTextFormattingDialog() { - delete m_imageList; delete m_styleDefinition; } @@ -110,6 +111,9 @@ bool wxRichTextFormattingDialog::Create(long flags, wxWindow* parent, const wxSt const wxPoint& pos, const wxSize& sz, long style) { SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY); +#ifdef __WXMAC__ + SetWindowVariant(wxWINDOW_VARIANT_SMALL); +#endif int resizeBorder = wxRESIZE_BORDER; @@ -143,13 +147,11 @@ bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTe } // Apply attributes to the object being edited, if any -bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* WXUNUSED(ctrl), int flags) +bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* ctrl, int flags) { if (GetObject()) { - wxRichTextParagraphLayoutBox* parentContainer = GetObject()->GetParentContainer(); - if (parentContainer) - parentContainer->SetStyle(GetObject(), m_attributes, flags); + ctrl->SetStyle(GetObject(), m_attributes, flags); return true; } else @@ -553,7 +555,7 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog(wxWindow* win) { wxWindow* p = win->GetParent(); - while (p && !p->IsKindOf(CLASSINFO(wxRichTextFormattingDialog))) + while (p && !wxDynamicCast(p, wxRichTextFormattingDialog)) p = p->GetParent(); wxRichTextFormattingDialog* dialog = wxDynamicCast(p, wxRichTextFormattingDialog); return dialog; @@ -709,7 +711,7 @@ void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) if (event.LeftDown()) { wxWindow* parent = GetParent(); - while (parent != NULL && !parent->IsKindOf(CLASSINFO(wxDialog)) && !parent->IsKindOf(CLASSINFO(wxFrame))) + while (parent != NULL && !wxDynamicCast(parent, wxDialog) && !wxDynamicCast(parent, wxFrame)) parent = parent->GetParent(); wxColourData data;