Is there a way to track TRVStyle changes?
Is there a way to track TRVStyle changes?
Hi Sergey,
Sorry for the several posts, I know you are in vacation, take your time
Is there a way to track changes of all the style templates, para styles, text styles and list styles in a TRVStyle object?
Currently all I can find is TCustomRichView.OnStyleTemplatesChange, but it doesn't seem to be enough.
Because I need know if I need to save the content of TRVStyle to INI, if none of the styles were changed obviously I don't need to perform the saving which takes time.
Thanks.
Sorry for the several posts, I know you are in vacation, take your time
Is there a way to track changes of all the style templates, para styles, text styles and list styles in a TRVStyle object?
Currently all I can find is TCustomRichView.OnStyleTemplatesChange, but it doesn't seem to be enough.
Because I need know if I need to save the content of TRVStyle to INI, if none of the styles were changed obviously I don't need to perform the saving which takes time.
Thanks.
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Is there a way to track TRVStyle changes?
Normally, while editing or inserting files, there is only one change: adding new styles.
Two events are called: TRichView.OnAddStyle or TRVAControlPanel.OnAddStyle (if you use RichViewActions)
Styles can also be replaced from RVF, cleared or deleted as unused. There are no special events, but it happens only on File|New and Open, so you can track these operations.
I do not remember if RichViewXML calls TRichView.OnAddStyle.
Two events are called: TRichView.OnAddStyle or TRVAControlPanel.OnAddStyle (if you use RichViewActions)
Styles can also be replaced from RVF, cleared or deleted as unused. There are no special events, but it happens only on File|New and Open, so you can track these operations.
I do not remember if RichViewXML calls TRichView.OnAddStyle.
Re: Is there a way to track TRVStyle changes?
So in other words, OnAddStyle is all I need?
I did a search, RichViewXML does NOT calls TRichView.OnAddStyle. Would you fix it? Thanks.Sergey Tkachenko wrote: ↑Tue Jul 12, 2022 1:49 pm I do not remember if RichViewXML calls TRichView.OnAddStyle.
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Is there a way to track TRVStyle changes?
Yes, but TRichView.OnAddStyle and TRVAControlPanel.OnAddStyle are called on different operations, so if you use RichViewActions, you need them both.
Ok, I'll change TRichViewXML. Please note that it will be called only if styles are merged, and not called when they are replaced.
Ok, I'll change TRichViewXML. Please note that it will be called only if styles are merged, and not called when they are replaced.
Re: Is there a way to track TRVStyle changes?
Thanks! But is there a way to also track when the styles are replaced/changed? Because obviously in that case the styles also need to be saved.Sergey Tkachenko wrote: ↑Wed Jul 13, 2022 3:39 pm Ok, I'll change TRichViewXML. Please note that it will be called only if styles are merged, and not called when they are replaced.
Re: Is there a way to track TRVStyle changes?
I also want to confirm - OnAddStyle can track all text-related and all style-related operations in a TRichViewEditor that might change content of the associated TRvStyle, correct?
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Is there a way to track TRVStyle changes?
Yes, except for:
- operations on new/open documents
- modifying style templates in dialogs (unlike all other editing operations, modified styletemplates are applied to existing styles instead of addition of new styles)
- operations on new/open documents
- modifying style templates in dialogs (unlike all other editing operations, modified styletemplates are applied to existing styles instead of addition of new styles)
Re: Is there a way to track TRVStyle changes?
I think I can modify the related dialog and track the style template changes for this scenario.Sergey Tkachenko wrote: ↑Thu Jul 14, 2022 10:44 am - modifying style templates in dialogs (unlike all other editing operations, modified styletemplates are applied to existing styles instead of addition of new styles)
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Is there a way to track TRVStyle changes?
I can add an event which will be called after applying new StyleTemplates.
Re: Is there a way to track TRVStyle changes?
That'll be great! Thanks!