Jump to content

Menü button ile butonun menü kısmına tıkladığımda butonun name'ni nasıl alabilirim.


pro_imaj

Recommended Posts

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;
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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