Jump to content

Recommended Posts

Posted

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;
Posted
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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...