trichview.com

trichview.support




Re: is there an item.onTextStyleChanged ?


Return to index


Author

Message

David Novo

Posted: 04/28/2004 18:09:53


Hi Sergey,


What we are trying to do is this:


We are trying to embed a delphi control in trichview. This is obviously

easy. In our case, the control actually represents a different,

non-visual, aspect of our program to the user.  Therefore the control

has text (representing the name and/or value of the non-visual part).

We are trying to keep the font of the text in the control the same as

what it should be. i.e. if the user selects several items that includes

the control, and changes the font on the selection, the font on the

control should change appropriately.


We have followed the example in the \demos\addins\chartItem to create a

new item. We have modified the print routine so our controlItem prints

properly. That works wonderfully.


When streaming out, we don't want to save the control (as happens in

default saveToRVF), because we want to keep the possibility of changing

the type of this control in future versions of our product. We want to

stream out the controlItem, without the control, and when we stream the

item back in, dynamically create the appropriate control.


So, we now want to store the style number, so that when we stream in

our new item, we can reapply that style to the control. Now, I am still

relatively new to trichview, but it seems that the styleNum property of

an item is overloaded for different purposes.  One is the item type

(i.e. text, component, bullet, table), and the other is a font style

number. It would be easier if these were two different properties, so

that a controlItem could have a font style, for instance.


What is the easiest way to do what we need with trichview. We want to

be able to create a descendant of the control item and remember what

font style it had. I ordered your software but have not received the

source yet. Is there a setStyle for the controlItem I can override to

store the style number, even though it seems I have to make my style

return -12345 or something. How do I let richview know that this style

is being used by my item.


I know this is complex so I really thank you for your help in this

matter.


-Dave



Sergey Tkachenko wrote:


> Currently no function/event is called on changing text style of item.

> Can you explain why it's needed?

> May be I'll add this functionality.

>

> > I would like to execute some code when an item changes text style.

> > Is there a way to trap this?  Preferably through an event, but if

> > need be we could override a setStyle-type method in our own

> > *ItemInfo descendent.





Powered by ABC Amber Outlook Express Converter