eduardosuruagy Posted September 13, 2025 Posted September 13, 2025 I don't want to let the user right-click on the HTMLMemo, if he clicks I want to be able to open a custom UniPoupUpMenu, with other functionalities Quote
eduardosuruagy Posted September 14, 2025 Author Posted September 14, 2025 5 hours ago, emin said: Você pode usar esses recursos It's already like this, but with just the HTMLMemo component it doesn't work. Quote
Sherzod Posted September 14, 2025 Posted September 14, 2025 18 hours ago, eduardosuruagy said: I don't want to let the user right-click on the HTMLMemo, if he clicks I want to be able to open a custom UniPoupUpMenu, with other functionalities One possible solution: 1. procedure TMainForm.UniFormCreate(Sender: TObject); begin UniHTMLMemo1.JSInterface.JSAddListener( 'initialize', 'function(me){me.getEditorBody().oncontextmenu = function(e){e.preventDefault(); ajaxRequest(me, "contextmenu", {x: e.x, y: e.y + me.getToolbar().getHeight()})}}' ); end; 2. procedure TMainForm.UniHTMLMemo1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'contextmenu' then UniPopupMenu1.Popup(Params.Values['x'].ToInteger() + 5, Params.Values['y'].ToInteger() + 5, Sender); end; Quote
eduardosuruagy Posted September 15, 2025 Author Posted September 15, 2025 On 9/14/2025 at 12:23 PM, Sherzod said: Thank you very much!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.