How to prevent cursor movement in field entry mode?

  • When I'm in field entry mode (ppAllExceptForEditFields), I really really really need to prevent the text cursor from repositioning itself to another edit field when the users clicks the mouse UNLESS the user clicks on an edit field itself (and then the cursor should move to that edit field as it does now).

    How can that be accomplished???

    Basically ignore mouse events if the mouse down position is not within an edit field.

    WPTools 5.20.5
    Delphi 7

  • Nevermind... I got the answer from your EditFields demo!

    Basically when I'm in edit field mode, I simply do this in the mouse move event:

    Code
    myIgnoreMouse := (WPRichText_Cmt.CodeInsideOf(X, Y, wpobjMergeField) = nil);

    And then in the mouse down event:

    Code
    if myIgnoreMouse then
        WPRichText_Cmt.IgnoreMouse;