Implement different underline styles for wxTextCtrl

This commit is contained in:
Igor Korot
2019-06-15 07:48:53 +02:00
committed by Maarten Bent
parent 8e15849706
commit f99ae84d7c
8 changed files with 280 additions and 5 deletions

View File

@@ -1228,7 +1228,17 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_textrich->AppendText("This text should be cyan on blue\n");
m_textrich->SetDefaultStyle(wxTextAttr(*wxBLUE, *wxWHITE));
m_textrich->AppendText("And this should be in blue and the text you "
"type should be in blue as well");
"type should be in blue as well.\n");
m_textrich->SetDefaultStyle( wxTextAttr() );
m_textrich->AppendText("And there is a ");
wxTextAttr attr = m_textrich->GetDefaultStyle();
attr.SetFontUnderline( /*true, */wxTEXT_ATTR_UNDERLINE_WAVE, *wxRED );
m_textrich->SetDefaultStyle( attr );
m_textrich->AppendText("mispeled ");
attr.SetFontUnderline( /*false, */wxTEXT_ATTR_UNDERLINE_NONE );
m_textrich->SetDefaultStyle( attr );
m_textrich->AppendText("word");
m_textrich->SetDefaultStyle(wxTextAttr(*wxBLUE, *wxWHITE));
// lay out the controls