X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47b378bd88260611387af8604a1c8f62355350ab..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/richtext/richtextformatdlg.cpp diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index 501b5b9127..3a7d7ee6c5 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -130,7 +130,7 @@ bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTe } /// Set the attributes and optionally update the display -bool wxRichTextFormattingDialog::SetStyle(const wxTextAttrEx& style, bool update) +bool wxRichTextFormattingDialog::SetStyle(const wxTextAttr& style, bool update) { m_attributes = style; if (update) @@ -347,7 +347,7 @@ bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog dialog->SetSheetInnerBorder(0); dialog->SetSheetOuterBorder(0); #else - wxUnusedVar(dialog); + wxUnusedVar(dialog); #endif // wxRICHTEXT_USE_TOOLBOOK return true; @@ -393,6 +393,17 @@ BEGIN_EVENT_TABLE(wxRichTextFontPreviewCtrl, wxWindow) EVT_PAINT(wxRichTextFontPreviewCtrl::OnPaint) END_EVENT_TABLE() +wxRichTextFontPreviewCtrl::wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& sz, long style) +{ + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + + wxWindow::Create(parent, id, pos, sz, style); + + SetBackgroundColour(*wxWHITE); + m_textEffects = 0; +} + void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -404,7 +415,7 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) { dc.SetFont(font); // Calculate vertical and horizontal centre - long w = 0, h = 0; + wxCoord w = 0, h = 0; wxString text(_("ABCDEFGabcdefg12345")); if (GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS) @@ -440,7 +451,7 @@ wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog(wxWindow* win) // Helper for pages to get the attributes -wxTextAttrEx* wxRichTextFormattingDialog::GetDialogAttributes(wxWindow* win) +wxTextAttr* wxRichTextFormattingDialog::GetDialogAttributes(wxWindow* win) { wxRichTextFormattingDialog* dialog = GetDialog(win); if (dialog) @@ -469,9 +480,13 @@ END_EVENT_TABLE() IMPLEMENT_CLASS(wxRichTextColourSwatchCtrl, wxControl) -wxRichTextColourSwatchCtrl::wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): - wxControl(parent, id, pos, size, style) +wxRichTextColourSwatchCtrl::wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) { + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + + wxControl::Create(parent, id, pos, size, style); + SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); SetBackgroundStyle(wxBG_STYLE_COLOUR); } @@ -495,7 +510,7 @@ void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) wxColourDialog *dialog = new wxColourDialog(parent, &data); // Crashes on wxMac (no m_peer) #ifndef __WXMAC__ - dialog->SetTitle(_("Background colour")); + dialog->SetTitle(_("Colour")); #endif if (dialog->ShowModal() == wxID_OK) { @@ -534,6 +549,9 @@ wxRichTextFontListBox::wxRichTextFontListBox(wxWindow* parent, wxWindowID id, co bool wxRichTextFontListBox::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) { + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + return wxHtmlListBox::Create(parent, id, pos, size, style); }