I can't find any info about the event OnCheckProtection. What is it used for, when does it trigger and how do I get it to trigger?
I am trying to change the down state of a button based on if the cursor is on protected text. I tried to use the OnChangeCursorPos event, but it fails me, For example, if I select a word that is not protected, I click the button which adds protection. I then click on another word that is not protected. The OnChangeCursorPos fires where I do this:
WPRichText1.TextCursor.GetCharAttr;
btnLockUnlock.Down := afsProtected in WPRichText1.CurrAttr.Style;
but afsProtected in WPRichText1.CurrAttr.Style is still true until I move cursor/caret again. Simply clicking between protected and unprotected text works, it just doesn't seem to right after I added protection, as if unselecting of the word on the move is interfering somehow and pulls the wrong attribute. Or I should be doing something before doing the GetCharAttr in the event or after adding protection?
This is why I was looking into what OnCheckProtection does, but I cannot find any documentation on it.