/// Get the paragraph by number
wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphAtLine(long paragraphNumber) const
{
/// Get the paragraph by number
wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphAtLine(long paragraphNumber) const
{
textObject->SetRange(wxRichTextRange(textObject->GetRange().GetStart(),
textObject->GetRange().GetEnd() + textLength));
textObject->SetRange(wxRichTextRange(textObject->GetRange().GetStart(),
textObject->GetRange().GetEnd() + textLength));
int spacePos = plainText.Find(wxT(' '), true);
if (spacePos != wxNOT_FOUND)
{
int spacePos = plainText.Find(wxT(' '), true);
if (spacePos != wxNOT_FOUND)
{
bool wxRichTextPlainText::DrawTabbedString(wxDC& dc,const wxRect& rect,wxString& str, wxCoord& x, wxCoord& y, bool selected)
{
wxArrayInt tab_array = GetAttributes().GetTabs();
bool wxRichTextPlainText::DrawTabbedString(wxDC& dc,const wxRect& rect,wxString& str, wxCoord& x, wxCoord& y, bool selected)
{
wxArrayInt tab_array = GetAttributes().GetTabs();
dc.SetMapMode(wxMM_LOMETRIC );
int num_tabs = tab_array.GetCount();
for( int i = 0; i < num_tabs; ++i){
dc.SetMapMode(wxMM_LOMETRIC );
int num_tabs = tab_array.GetCount();
for( int i = 0; i < num_tabs; ++i){
// break up the string at the Tab
wxString stringChunk = str.BeforeFirst(wxT('\t'));
str = str.AfterFirst(wxT('\t'));
// break up the string at the Tab
wxString stringChunk = str.BeforeFirst(wxT('\t'));
str = str.AfterFirst(wxT('\t'));
if(selected){
w = next_tab_pos - x;
wxRect selRect(x, rect.y, w, rect.GetHeight());
if(selected){
w = next_tab_pos - x;
wxRect selRect(x, rect.y, w, rect.GetHeight());
dc.GetTextExtent(str, & w, & h);
if(selected){
wxRect selRect(x, rect.y, w, rect.GetHeight());
dc.GetTextExtent(str, & w, & h);
if(selected){
wxRect selRect(x, rect.y, w, rect.GetHeight());
- if(tab_array.IsEmpty()){// create a default tab list at 10 mm each.
- for( int i = 0; i < 20; ++i){
+ if(tab_array.IsEmpty())
+ {
+ // create a default tab list at 10 mm each.
+ for( int i = 0; i < 20; ++i)
+ {
tab_array.Add(i*100);
}
}
int map_mode = dc.GetMapMode();
dc.SetMapMode(wxMM_LOMETRIC );
int num_tabs = tab_array.GetCount();
tab_array.Add(i*100);
}
}
int map_mode = dc.GetMapMode();
dc.SetMapMode(wxMM_LOMETRIC );
int num_tabs = tab_array.GetCount();
// break up the string at the Tab
wxString stringFragment = stringChunk.BeforeFirst(wxT('\t'));
stringChunk = stringChunk.AfterFirst(wxT('\t'));
// break up the string at the Tab
wxString stringFragment = stringChunk.BeforeFirst(wxT('\t'));
stringChunk = stringChunk.AfterFirst(wxT('\t'));
for( int i = 0; i < num_tabs && not_found; ++i){
next_tab_pos = tab_array.Item(i);
if( next_tab_pos > absolute_width){
for( int i = 0; i < num_tabs && not_found; ++i){
next_tab_pos = tab_array.Item(i);
if( next_tab_pos > absolute_width){
dc.GetTextExtent(stringChunk, & w, & h, & descent);
width += w;
size = wxSize(width, dc.GetCharHeight());
dc.GetTextExtent(stringChunk, & w, & h, & descent);
width += w;
size = wxSize(width, dc.GetCharHeight());
wxRichTextAttr wxRichTextAttr::Combine(const wxRichTextAttr& attr,
const wxRichTextAttr& attrDef,
const wxTextCtrlBase *text)
wxRichTextAttr wxRichTextAttr::Combine(const wxRichTextAttr& attr,
const wxRichTextAttr& attrDef,
const wxTextCtrlBase *text)
newAttr.SetRightIndent(attr.GetRightIndent());
else if (attrDef.HasRightIndent())
newAttr.SetRightIndent(attrDef.GetRightIndent());
newAttr.SetRightIndent(attr.GetRightIndent());
else if (attrDef.HasRightIndent())
newAttr.SetRightIndent(attrDef.GetRightIndent());
if (attr.HasParagraphSpacingAfter())
newAttr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter());
if (attr.HasParagraphSpacingAfter())
newAttr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter());
if (attr.HasParagraphSpacingBefore())
newAttr.SetParagraphSpacingBefore(attr.GetParagraphSpacingBefore());
if (attr.HasLineSpacing())
newAttr.SetLineSpacing(attr.GetLineSpacing());
if (attr.HasParagraphSpacingBefore())
newAttr.SetParagraphSpacingBefore(attr.GetParagraphSpacingBefore());
if (attr.HasLineSpacing())
newAttr.SetLineSpacing(attr.GetLineSpacing());
if (attr.HasBulletStyle())
newAttr.SetBulletStyle(attr.GetBulletStyle());
if (attr.HasBulletNumber())
newAttr.SetBulletNumber(attr.GetBulletNumber());
if (attr.HasBulletStyle())
newAttr.SetBulletStyle(attr.GetBulletStyle());
if (attr.HasBulletNumber())
newAttr.SetBulletNumber(attr.GetBulletNumber());
wxTextAttrEx wxTextAttrEx::CombineEx(const wxTextAttrEx& attr,
const wxTextAttrEx& attrDef,
const wxTextCtrlBase *text)
wxTextAttrEx wxTextAttrEx::CombineEx(const wxTextAttrEx& attr,
const wxTextAttrEx& attrDef,
const wxTextCtrlBase *text)
newAttr.SetRightIndent(attr.GetRightIndent());
else if (attrDef.HasRightIndent())
newAttr.SetRightIndent(attrDef.GetRightIndent());
newAttr.SetRightIndent(attr.GetRightIndent());
else if (attrDef.HasRightIndent())
newAttr.SetRightIndent(attrDef.GetRightIndent());
if (attr.HasParagraphSpacingAfter())
newAttr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter());
if (attr.HasParagraphSpacingAfter())
newAttr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter());
if (attr.HasParagraphSpacingBefore())
newAttr.SetParagraphSpacingBefore(attr.GetParagraphSpacingBefore());
if (attr.HasLineSpacing())
newAttr.SetLineSpacing(attr.GetLineSpacing());
if (attr.HasParagraphSpacingBefore())
newAttr.SetParagraphSpacingBefore(attr.GetParagraphSpacingBefore());
if (attr.HasLineSpacing())
newAttr.SetLineSpacing(attr.GetLineSpacing());
if (attr.HasBulletStyle())
newAttr.SetBulletStyle(attr.GetBulletStyle());
if (attr.HasBulletNumber())
newAttr.SetBulletNumber(attr.GetBulletNumber());
if (attr.HasBulletStyle())
newAttr.SetBulletStyle(attr.GetBulletStyle());
if (attr.HasBulletNumber())
newAttr.SetBulletNumber(attr.GetBulletNumber());