Hi,
There are RVGetSelection and RVSetSelection in RVLinear for selecting a range in RichView by SelStart and SelLength like TRichEdit.
These two functions both require a TCustomRichView (Edited: TCustomRichViewEdit -> TCustomRichView). Is there another method for selecting a range in TRVData?
Thank you
Select a range in RVData!
Select a range in RVData!
Last edited by mamouri on Fri Nov 24, 2006 9:05 pm, edited 1 time in total.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry. I was mistyped. I mean TCustomRichView not TCustomRichViewEdit.
In fact I want select part of cell of a table not a whole TCustomRichView. RVGetSelection and RVSetSelection both work with TCustomRichView and not TCustomRVData or TFormattedRVData or TRVCellData.
It's possible to save content of the cell into a stream, copy it into new built-in trichviewedit and select any part required, change the style and save it again into stream and load stream into the cell. But I want to know is there faster method for doing so? I mean is there a function to select part of document in TRVData or TRVEData (RVData for RichViewEdit)?
I hope I was clear
Thank you
In fact I want select part of cell of a table not a whole TCustomRichView. RVGetSelection and RVSetSelection both work with TCustomRichView and not TCustomRVData or TFormattedRVData or TRVCellData.
It's possible to save content of the cell into a stream, copy it into new built-in trichviewedit and select any part required, change the style and save it again into stream and load stream into the cell. But I want to know is there faster method for doing so? I mean is there a function to select part of document in TRVData or TRVEData (RVData for RichViewEdit)?
I hope I was clear
Thank you
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Once again, RVGetSelection and RVSetSelection work for all TCustomRVDatas inside the given TCustomRichViewEdit, so special functions for TCustomRVData are not necessary.
For example, you can select some items in cell of table, then call RVGetSelection for RichView containing this table, and the selection will be stored. When you call RVSetSelection, this selection will be restored.
For these functions, it's not important if the selection is in the main document or in table cell.
But if you want to apply new text style to the selection, you really need to do it in TRichViewEdit, because TRichView and cells do not have methods for applying text style.
It's simple to change the style of some specific text items in TRichView or cell, but it's not simple to change style of part of text item, it requires using many undocumented methods, for example see here: http://www.trichview.com/forums/viewtopic.php?t=57
For example, you can select some items in cell of table, then call RVGetSelection for RichView containing this table, and the selection will be stored. When you call RVSetSelection, this selection will be restored.
For these functions, it's not important if the selection is in the main document or in table cell.
But if you want to apply new text style to the selection, you really need to do it in TRichViewEdit, because TRichView and cells do not have methods for applying text style.
It's simple to change the style of some specific text items in TRichView or cell, but it's not simple to change style of part of text item, it requires using many undocumented methods, for example see here: http://www.trichview.com/forums/viewtopic.php?t=57
Actually I don't get position of selected part using RVGetSelection function. I have a database that store start position and length of a part in text that must change it's style. So here is what I'm doing:
I think this is not very easy in trichview. if it's not possible to accomplish this I can copy the content into temp trichviewedit and do all required Formatting and then copy temp richviewedit content into the new added row.
Code: Select all
while not tblStory.Eof do begin
Add New Row to RichViewEdit
Add Text of story to the NEW ADDED ROW
while not tblFormats.Eof do begin
Read SelStart and SelLength
Select it in the NEW ADDED ROW
change it's style
end;
end;
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: