trichview.support
Re: Change TextStyle on Paragraph |
Author |
Message |
Benedikt Weber |
Posted: 06/18/2002 15:39:15 Ok, I found a solution. I could be improved, if I could do an invisible selection, i.e. not showing the selection. Because many commands work on a selection, it would generally be helpful to be able to set the selection without visual effects for programmatically performing editing. int start= RichViewEdit1->CurItemNo; int end= start+1; // end is one past end, like in STL while (!RichViewEdit1->IsParaStart(start)) {--start;} while (end != RichViewEdit1->ItemCount && !RichViewEdit1->IsParaStart(end)) {++end;} RichViewEdit1->SetSelectionBounds(start,0,end-1,RichViewEdit1->GetOffsAfterI tem(end-1)); RichViewEdit1->ApplyTextStyle(textstyle); RichViewEdit1->Deselect(); Any improvements? Benedikt "Benedikt Weber" <[email protected]> wrote in message news:[email protected]... > > > You need to select this paragraph before applying the text style. > > This leads me to the next problem: How can I select a paragraph. When there > are different textstyles in a paragraph, I also have different items in the > sam paragraph. So selecting an item does not work. Somehow I have to find > all items belonging to a paragraph, and the apply a textStyle to them. > > Benedikt > > |
Powered by ABC Amber Outlook Express Converter