trichview.com

trichview.support




Re: Change TextStyle on Paragraph


Return to index


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" <weber@ggaweb.ch> wrote in message

news:3d0f32ff$1@support.torry.net...

>

> > 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