PopUp menu clashing with Addict spell suggestions

  • Hello

    I am using the DevEx Bars for the main menu and pop-ups.

    The pop-up is coded in the OnMouseDown event but it always stops the Spell Check suggestion menu from appearing.

    I have now changed it so the DevEx menu only appears if SetText >0 but this is obviously not how the user would expect it.

    How can I tell if the cursor is over a word with the squiggly line under it when the user right clicks?

    Thanks.

    Rob.

  • Glenn

    I am looking for a quick fix here and is there any way I can set a boolean in the OnPopUpCreateMenu event? (I have tried but any code prevents the Addict menu appearing).

    I could use this with a timer to determine if the standard popup should appear or the Addict spell suggestion one.

    Thanks.

    Rob.

  • I discussed it with the Addict Author and he through the AggressiveContextMenu property might help you - but when I checked out this property as far as I can see it doesn't apply to WPTools.

    So I'm waiting to here back from him again...

    • Offizieller Beitrag

    Hi,

    I would suggest to show the popupmenu in OnMouseDownWord:

    procedure TWPTBXForm.WPRichText1MouseDownWord(Sender: TObject;
    Button: TMouseButton; Shift: TShiftState; X, Y: Integer; par: TParagraph;
    posinpar, CPPos, len: Integer; var text: String; var CharAttr: Cardinal;
    var Abort: Boolean);
    begin
    TestPopup.Popup(...);
    end;

    This way the popup will only show if there is no spellcheck popup triggered before (Addict sets the 'Ignore' parameter to true)

    To better understand this please check the code in WPCtrMemo:
    function TWPCustomRtfEdit.DoMouseDownWord(par: TParagraph;

    Julian

  • Just a minor addition.

    The popupmenu should be triggered by a mouse UP event. Triggering the popup during mouse down could trigger an onclick event on 1 of the menu items when releasing the mouse button.

    It will require some additional work because a mouseupword event is not present in WpTools, but it will ensure 1 less bug report.

  • The thing is: When using the OnMouseDownWord-event one must always click on a word in the document. Clicking in a empty part of the document will not show the popup-menu. This is quite limiting especially when the document is still empty.
    Isn't it possible to check if the mouse is on a missspelled word (squiggly line) and then either show the popup for Addict or the dxPopup?

    Regards,
    Stef

  • Stef

    I've resigned myself to having to click on a correctly spelt word to get my popup to appear.

    A little messy and not expected by the user but that is the only way to get it to work.

    I make sure that there is always text in the RichText or else the popup will not appear. I am using the RichText for a notes field in a database and new records have a default entry of 'Notes' to achieve this.

  • That is not very satisfactory.
    It shoudl be possible to check if the mouse is on a missspelled word (squiggly line), as it is doing that now too.
    Only the popupmenu is in the way of that when it is called in the OnMouseDown-event.
    Maybe WPTools-support has an answer?

    • Offizieller Beitrag

    Hi,

    in the latest release the Spell popup was highly improved - please note that is is also triggered by the Windows key which is good for users who do not use the mouse.

    Any workarounds from pervious versions should not be required anymore.

    The popup should be assigned to property PopUpMenu. I how this is possible for DevExpress stuff, too.

    Julian