textobject and protected paragraph

  • Hi;

    I am inserting a type wpobjHorizontalLine text object, and I am protecting the whole paragraph so editing is posible on it (as Julian suggested me).

    But I see that, even if paragraph is protected, the object can be selected (by clicking) and then deleted.

    That, is not bad for me, if I also can delete the parent paragraph too. Otherwise, it will be an empty/protected paragraph into the text, and I think it is not so good.

    How can I tell WP to delete this paragraph too, when the object is deleted?.

    Thank you.

    Felipe

    • Offizieller Beitrag

    Hi,

    You can trap the VK_Delete key in OnKeyPressDown and check if you have a selected object. If that is a horizontal line you can delete the paragraph.

    YOu can check for a selected object using WP.selectedObject