Added support for tabs in wxRichTextCtrl (Ashish More)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-06-28 10:57:20 +00:00
parent b02396e86f
commit 7f0d9d717d
7 changed files with 201 additions and 84 deletions

View File

@@ -475,7 +475,7 @@ 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);
m_richTextCtrl = new wxRichTextCtrl(splitter, wxID_ANY, wxDefaultPosition, wxSize(200, 200), wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS);
wxFont font(12, wxROMAN, wxNORMAL, wxNORMAL);
#ifdef __WXMAC__
@@ -603,6 +603,19 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
r.EndLineSpacing();
r.EndAlignment();
wxArrayInt tabs;
tabs.Add(400);
tabs.Add(600);
tabs.Add(800);
tabs.Add(1000);
wxTextAttrEx attr;
attr.SetFlags(wxTEXT_ATTR_TABS);
attr.SetTabs(tabs);
r.SetDefaultStyle(attr);
r.Newline();
r.WriteText(wxT("This line contains tabs:\tFirst tab\tSecond tab\tThird tab"));
r.Newline();
r.WriteText(wxT("Other notable features of wxRichTextCtrl include:"));