Hi Sergey,
How could I create custom items and store my custom data
within it? I know I must derive class from TCustomRVItemInfo.
(TRVNonTextItemInfo in my case because I want invisible items)
I saw SaveRVF method, but what about loading?
Simply I need to do emoticons (not same-sized) and I cannot
store them in ImageList's. I plan to insert invisible item with emoticon
name in document, and replace it with bullet when loading.
Btw. I need it also to store files/streams inside RVF.
best regards
Piotr
Creating custom items
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks, but it dont cover my problem I need to save pictures body
also (for external images), and explicitly for emoticons (and files).
I'm writing chat program and these data would go through sockets.
//edit:
I tried to use controls and stream them to RVF but
streaming custom items is bandwidth cheaper. I don't
need all control's properties in RVF.
also (for external images), and explicitly for emoticons (and files).
I'm writing chat program and these data would go through sockets.
//edit:
I tried to use controls and stream them to RVF but
streaming custom items is bandwidth cheaper. I don't
need all control's properties in RVF.
Hi Sergey,
I tried to figure out creating custom types myself from RVItem.pas.
(Help says that "Detailed description of classes for item types is beyond
the scope of this help file."). I check out two methods to override:
SaveRVF and ReadRVFLine but there are many more methods.
Could you write some simple how-to showing creation of custom items?
I made sending messages with formatted text and pictures already,
now only things I need are custom items.
Thanks in advance.
I tried to figure out creating custom types myself from RVItem.pas.
(Help says that "Detailed description of classes for item types is beyond
the scope of this help file."). I check out two methods to override:
SaveRVF and ReadRVFLine but there are many more methods.
Could you write some simple how-to showing creation of custom items?
I made sending messages with formatted text and pictures already,
now only things I need are custom items.
Thanks in advance.
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Look in Demos\Addins\ for examples of custom item types.
The most interesting is LabelItem (other two make higher level modification - they only modify drawing/printing methods of existing types). LabelItem is inherited from a basic class for non-text items: TRVRectItemInfo.
Let's see which methods it overrides.
First, Paint and Print. They are absolutely necessary.
Next, GetBoolValue and GetBoolValueEx. They return values of some boolean item properties.
Next, Assign method.
Next, methods for exporting in different formats: SaveRTF, SaveToHTML, AsText.
Next, methods related to the text style associated with this item. I think you do not need it for your items, so ignore MarkStylesInUse, UpdateStyles, ApplyStyleConversion, GetAssociatedTextStyleNo, SetAssociatedTextStyleNo.
Next, RVF-related methods. SaveRVF saves item to RVF, including the item header and all subsequent lines. Search the help file index for "RVF Specification".
When reading RVF, the item header line is read not by the item, but by the RVF reading procedure itself. The end of the item header line may contain additional information, but I do not recommend to use it - use subsequent lines to store additional information.
RVF info is read line by line, ReadRVFLine is called for each line, index of the read line is specified in LineNo parameter. The item info may contain one block of binary data. It it exists, it is counted as one line and it must be the last line. More info is in the help file, "RVF Specification".
There are many other methods which may be overriden, but they are not necessary.
The most interesting is LabelItem (other two make higher level modification - they only modify drawing/printing methods of existing types). LabelItem is inherited from a basic class for non-text items: TRVRectItemInfo.
Let's see which methods it overrides.
First, Paint and Print. They are absolutely necessary.
Next, GetBoolValue and GetBoolValueEx. They return values of some boolean item properties.
Next, Assign method.
Next, methods for exporting in different formats: SaveRTF, SaveToHTML, AsText.
Next, methods related to the text style associated with this item. I think you do not need it for your items, so ignore MarkStylesInUse, UpdateStyles, ApplyStyleConversion, GetAssociatedTextStyleNo, SetAssociatedTextStyleNo.
Next, RVF-related methods. SaveRVF saves item to RVF, including the item header and all subsequent lines. Search the help file index for "RVF Specification".
When reading RVF, the item header line is read not by the item, but by the RVF reading procedure itself. The end of the item header line may contain additional information, but I do not recommend to use it - use subsequent lines to store additional information.
RVF info is read line by line, ReadRVFLine is called for each line, index of the read line is specified in LineNo parameter. The item info may contain one block of binary data. It it exists, it is counted as one line and it must be the last line. More info is in the help file, "RVF Specification".
There are many other methods which may be overriden, but they are not necessary.