Hi Sergey,
RV 1.9.0.1. If text has a Style with Protection rvprDoNotAutoSwitch, OnCurTextStyleChanged() event does not fire when getting into or out of such text. Bug?
And while we're on this subject, there isn't any "dedicated" event that would fire when moving into a block of text that has some List Style, is there? Something similar to the above Text or the similar OnCurParaStyleChanged() events? If there isn't any, what event would you recommend: OnCaretMove()?
And what about detecting when the user gets into a table or "touches" one on the right or left side? I can see that RVActionTest enables/disables the "Delete Table" button when this happens, and furthermore, does the same to other table-related buttons when I actually "step into" a Cell, but I don't see any relevant events, and can't seem to figure out how RVActionTest does it. Could you please point me in the right direction?
Just to clarify: I do have the Actions source code, and I am not using Actions in my project.
Thank you,
Michel
No OnCurTextStyleChanged() if rvprDoNotAutoSwitch
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
OnCurTextStyleChanged occurs when, well, the current text style (CurTextStyleNo property) is changed. No change - no event. And I think that user interface is not supposed to be changed in this case.
Yes, use OnCaretMove. For example, see Demos\Delphi\Assorted\ListStyles\Bullets\
For tables, GetCurrentItemEx (see Demos\Delphi\Editors\Editor 1\, items are disabled/enabled when the Table menu is shown).
RichViewActions use different approach. They update their state (Enabled and Checked properties) periodically when the application is idle (the Delphi's action system calls UpdateTarget of all actions)
Yes, use OnCaretMove. For example, see Demos\Delphi\Assorted\ListStyles\Bullets\
For tables, GetCurrentItemEx (see Demos\Delphi\Editors\Editor 1\, items are disabled/enabled when the Table menu is shown).
RichViewActions use different approach. They update their state (Enabled and Checked properties) periodically when the application is idle (the Delphi's action system calls UpdateTarget of all actions)
I think I wasn't clear enough when I stated the problem I'm observing. Here's an example:If text has a Style with Protection rvprDoNotAutoSwitch, OnCurTextStyleChanged() event does not fire when getting into or out of such text.
OnCurTextStyleChanged occurs when, well, the current text style (CurTextStyleNo property) is changed. No change - no event.
Text With Style 0 Text With Some Other Style That Also Happens To Be Protected With rvprDoNotAutoSwitch
Moving the carret between the two blocks of text above does not trigger the event. Note that the second block can have a very different style (Bold/Italic/etc., - in my specific case it is also a Hyperlink).
And regardless, even if the text was visually of the same style, but a part of it had some protection, that would make that protected part have a different style (CurTextStyleNo), no?
Hope I'm making more sense now.
As to my other questions: Cool, got it, thanks!
Thank you,
Michel
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
It is by design. Current text style (CurTextStyleNo property) is a text style which will be applied to the typed/pasted text. This event happens when value of this property is changed. And it is expected that, if you have editing UI, it shows attributes of this property. When the caret is moved to the protected text, CurTextStyleNo is not changed, event is not happen, UI is not changed.