connect two wxRichTextBuffers

Julian Smart julian at anthemion.co.uk
Thu May 22 06:01:14 PDT 2008


Karol Bielecki wrote:
> I try explain.
> (I tray bufor=bufor+bufor1)
>
> wxRichTextCtrl textctrl(...)
> wxRichTextBuffer *bufor=textctrl.GetBuffer();
>
> bufor->LoadFile(stream1,wxRICHTEXT_TYPE_XML);
>
> wxRichTextBuffer bufor2;
>
> bufor2.LoadFile(stream2,wxRICHTEXT_TYPE_XML);
>
> for (i=0;i<bufor2.GetChildCount();i++)
>         {
>             bufor->AppendChild(bufor2.GetChild(i)->Clone());
>         }
Ah, appending, sorry, I misunderstood. Yes, that would do it.
>
> Now textctrl need refresh
> when i tray
> textctrl.LayoutContent
> it not help so i do
> textctrl.AddParagraph("");
If you do:

textctrl.GetBuffer().Invalidate(wxRICHTEXT_ALL);
textctrl.Refresh();

it should lay the content out correctly, followed optionally by:

textctrl.Update();

if you need the control to be laid out correctly immediately after the 
refresh (e.g. for hit-testing purposes).

Regards,

Julian




More information about the wx-users mailing list