Implement different underline styles for wxTextCtrl
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user