pro_imaj Posted January 30, 2017 Posted January 30, 2017 Merhaba; Menü button ile butonun menü kısmına tıkladığımda butonun name'ni nasıl alabilirim. Quote
Sherzod Posted January 30, 2017 Posted January 30, 2017 Merhaba, 1. UniMainModule -> BrowserOptions -> [boDisableMouseRightClick = True] 2. UniButton1 -> ClientEvent -> ... function afterrender(sender, eOpts) { var me=sender; me.el.on('contextmenu', function(e) { ajaxRequest(me, '_contextmenu', ['x='+e.getXY()[0], 'y='+e.getXY()[1]]); }) } 3. procedure TMainForm.UniButton1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_contextmenu' then begin UniPopupMenu1.Popup(StrToInt(Params.Values['x']), StrToInt(Params.Values['y'])); end; end; Quote
pro_imaj Posted January 30, 2017 Author Posted January 30, 2017 Hello there; Thank you for the answer. I think it was messy when there was no deletion of the forum topic. (I arranged the old one) I added the MenuButton instead of the button, I want to know which button is clicked when I click on the menu. Quote
Sherzod Posted January 31, 2017 Posted January 31, 2017 Hi, I added the MenuButton instead of the button, I want to know which button is clicked when I click on the menu. Maybe you wanted this?!: UniMenuButton -> ClientEvents -> ExtEvents -> mousedown fn: function mousedown(sender, x, y, eOpts) { switch (eOpts) { case 0: // left button pressed break; case 1: // middle button pressed break; case 2: // right button pressed break; }; } Best regards. 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.