AppendRVFFromStream - No Bullets ?
AppendRVFFromStream - No Bullets ?
Hi,
i use
RichViewEdit1->AddBulletEx("", 0, Form1->ImageList3, -1);
RichViewEdit1->Reformat();
to add a bullet..
But when i try:
TMemoryStream *stream = new TMemoryStream();
RichViewEdit1->SaveRVFToStream(stream,false);
stream->Seek(0,0);
tabel->Cells[0][1]->VAlign = rvvaAbsMiddle;
tabel->Cells[0][1]->AppendRVFFromStream(stream,-1,Dummy1,Dummy2);
delete stream;
I get only the text, no bullets. Is in same application.
Please advise
Also would be great for me if i could trigger the SaveRVFToStream (event), because then i itinerate the bullets when they are about to be saved in a stream and replace them back with the text corespondents ( for smileys - when i find 0 index in ImageList3, means is )
Regards
P.S. Please also tell me how do i get the caret position in curent line, i am using RichViewEdit1->GetCurrentItemText(); to get the text i am typing.
(i need it to replace with a bullet smiley)
i use
RichViewEdit1->AddBulletEx("", 0, Form1->ImageList3, -1);
RichViewEdit1->Reformat();
to add a bullet..
But when i try:
TMemoryStream *stream = new TMemoryStream();
RichViewEdit1->SaveRVFToStream(stream,false);
stream->Seek(0,0);
tabel->Cells[0][1]->VAlign = rvvaAbsMiddle;
tabel->Cells[0][1]->AppendRVFFromStream(stream,-1,Dummy1,Dummy2);
delete stream;
I get only the text, no bullets. Is in same application.
Please advise
Also would be great for me if i could trigger the SaveRVFToStream (event), because then i itinerate the bullets when they are about to be saved in a stream and replace them back with the text corespondents ( for smileys - when i find 0 index in ImageList3, means is )
Regards
P.S. Please also tell me how do i get the caret position in curent line, i am using RichViewEdit1->GetCurrentItemText(); to get the text i am typing.
(i need it to replace with a bullet smiley)
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
When loading "bullets" or "hotspot" item from RVF, OnRVFImageListNeeded event occurs, where you need to specify the image list for this item.
For example,
As for executing some custom code before saving. Since you save to the file yourself, you can add this code yourself before SaveRVF(). If you need to do it before copying to the clipboard, use OnCopy event.
For example,
Code: Select all
void __fastcall TForm1::RichViewEdit1RVFImageListNeeded(TCustomRichView *Sender,
int ImageListTag, TCustomImageList *&il)
{
il = ImageList3;
}
Last edited by Sergey Tkachenko on Thu Jul 03, 2008 7:08 am, edited 1 time in total.
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Can you hint me what i am doing wrong with the VAlign here ?
OnKeyPress i did the emoticon replacement with align like this:
if (s[Offs-1]==':')
{
rve->SetSelectionBounds(ItemNo, Offs-1, ItemNo, Offs);
rve->InsertBullet(GetImageIndex(Key), Form1->ImageList3);
Key = 0;
((TRVBulletItemInfo*)(RichViewEdit1->GetCurrentItem()))->VAlign = rvvaAbsMiddle;
RichViewEdit1->Reformat();
}
and i get good align in RichViewEdit1 lik ein picture:
but when i append it from stream in table, i get bad align...
Code is:
TMemoryStream *stream = new TMemoryStream();
RichViewEdit1->SaveRVFToStream(stream,false);
stream->Seek(0,0);
tabel->Cells[0][1]->VAlign = rvvaAbsMiddle;
tabel->Cells[0][1]->AppendRVFFromStream(stream,-1,Dummy1,Dummy2);
tabel->Cells[0][1]->VAlign = rvvaAbsMiddle;
RichView1->AddItem("Spreadsheet", tabel);
RichView1->FormatTail();
And it looks like in this picture:
Thank you
OnKeyPress i did the emoticon replacement with align like this:
if (s[Offs-1]==':')
{
rve->SetSelectionBounds(ItemNo, Offs-1, ItemNo, Offs);
rve->InsertBullet(GetImageIndex(Key), Form1->ImageList3);
Key = 0;
((TRVBulletItemInfo*)(RichViewEdit1->GetCurrentItem()))->VAlign = rvvaAbsMiddle;
RichViewEdit1->Reformat();
}
and i get good align in RichViewEdit1 lik ein picture:
but when i append it from stream in table, i get bad align...
Code is:
TMemoryStream *stream = new TMemoryStream();
RichViewEdit1->SaveRVFToStream(stream,false);
stream->Seek(0,0);
tabel->Cells[0][1]->VAlign = rvvaAbsMiddle;
tabel->Cells[0][1]->AppendRVFFromStream(stream,-1,Dummy1,Dummy2);
tabel->Cells[0][1]->VAlign = rvvaAbsMiddle;
RichView1->AddItem("Spreadsheet", tabel);
RichView1->FormatTail();
And it looks like in this picture:
Thank you
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
TMemoryStream *stream = new TMemoryStream();
RichViewEdit1->SaveRVFToStream(stream,false);
stream->Seek(0,0);
int ItemCount = tabel->Cells[0][1]->ItemCount;
tabel->Cells[0][1]->AppendRVFFromStream(stream,-1,Dummy1,Dummy2);
for (int i =ItemCount; i<tabel->Cells[0][1]->ItemCount; i++)
if (tabel->Cells[0][1]->GetItemStyle(i)==rvsBullet)
((TRVBulletItemInfo*)(tabel->Cells[0][1]->GetItem(i)))->VAlign = rvvaAbsMiddle;
RichView1->AddItem("Spreadsheet", tabel);
RichView1->FormatTail();
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: