X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7f0d9d717d8c42daaefcad12eb9e83615a25da02..06d4c4d65aa052a7586dd42bf0d558c46699b564:/samples/richtext/richtext.cpp?ds=sidebyside diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 8f8270f243..bf3bb2ae97 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -312,6 +312,20 @@ void MyApp::CreateStyles() m_styleSheet->AddParagraphStyle(indentedPara); + wxRichTextParagraphStyleDefinition* indentedPara2 = new wxRichTextParagraphStyleDefinition(wxT("Red Bold Indented")); + wxRichTextAttr indentedAttr2; + indentedAttr2.SetFontFaceName(romanFont.GetFaceName()); + indentedAttr2.SetFontSize(12); + indentedAttr2.SetFontWeight(wxBOLD); + indentedAttr2.SetTextColour(*wxRED); + indentedAttr2.SetFontSize(12); + indentedAttr2.SetLeftIndent(100, 0); + // We want to affect indentation, font and text colour + indentedAttr2.SetFlags(wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_FONT|wxTEXT_ATTR_TEXT_COLOUR); + indentedPara2->SetStyle(indentedAttr2); + + m_styleSheet->AddParagraphStyle(indentedPara2); + wxRichTextParagraphStyleDefinition* flIndentedPara = new wxRichTextParagraphStyleDefinition(wxT("First Line Indented")); wxRichTextAttr flIndentedAttr; flIndentedAttr.SetFontFaceName(swissFont.GetFaceName()); @@ -475,12 +489,9 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos, wxFont boldFont = wxFont(12, wxROMAN, wxNORMAL, wxBOLD); wxFont italicFont = wxFont(12, wxROMAN, wxITALIC, wxNORMAL); - m_richTextCtrl = new wxRichTextCtrl(splitter, wxID_ANY, wxDefaultPosition, wxSize(200, 200), wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS); + m_richTextCtrl = new wxRichTextCtrl(splitter, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, 200), wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS); wxFont font(12, wxROMAN, wxNORMAL, wxNORMAL); -#ifdef __WXMAC__ - font.SetNoAntiAliasing(true); -#endif m_richTextCtrl->SetFont(font); wxRichTextStyleListBox* styleListBox = new wxRichTextStyleListBox(splitter, wxID_ANY);