Custom Item Type, OnItemAction
Posted: Tue Feb 28, 2017 12:16 pm
According to this thread:
http://www.trichview.com/forums/viewtop ... tion#p2644
We were suggested to have a list to keep items and check item existence during OnItemAction.
I need to keep a list of items as well. I have some special items with tags that I need to keep track of, so I have handled OnItemAction, when action = rviaInserted, I will first check the tag if it is something i need to monitor, then will check from my list to confirm it is not existed then add. Those items can be graphicitem, tableitem or textitem so long it is tagged with the special identifier.
For textitem, when I call AddNLTag('whatever', CurTextStyleNo , -1, '[Special]'), OnItemAction will be triggered and that item will be kept in my list.
I have a few problems now:
1. when inserting text, i want it to follow current font style, so I will get from rve.CurTextStyleNo, but at the same time, I want this newly added text to be protected from modification, how can I do that?
2. I tried cut the text item in a table cell, I found the OnItemAction is triggered in the following sequence
- rviaMovingToUndoList
- rviaInserting
- rviaInserted
when I received OnItemAction with both rviaInserting and rviaInserted, i found the item's tag is same with the item that I have cut, any idea?
http://www.trichview.com/forums/viewtop ... tion#p2644
We were suggested to have a list to keep items and check item existence during OnItemAction.
I need to keep a list of items as well. I have some special items with tags that I need to keep track of, so I have handled OnItemAction, when action = rviaInserted, I will first check the tag if it is something i need to monitor, then will check from my list to confirm it is not existed then add. Those items can be graphicitem, tableitem or textitem so long it is tagged with the special identifier.
For textitem, when I call AddNLTag('whatever', CurTextStyleNo , -1, '[Special]'), OnItemAction will be triggered and that item will be kept in my list.
I have a few problems now:
1. when inserting text, i want it to follow current font style, so I will get from rve.CurTextStyleNo, but at the same time, I want this newly added text to be protected from modification, how can I do that?
2. I tried cut the text item in a table cell, I found the OnItemAction is triggered in the following sequence
- rviaMovingToUndoList
- rviaInserting
- rviaInserted
when I received OnItemAction with both rviaInserting and rviaInserted, i found the item's tag is same with the item that I have cut, any idea?