Jump to content

TuniCalendarPanel-onEventClick How to recognize mouse button


kkelchev

Recommended Posts

Hi to All

In Calendar panel, events have OnClick event and that is fine.
But there is no information about which mouse button has been pressed Left,Right or conceivably mouse wheel.


My question is how application to undarstand that (which mouse button) is pressed ?

Thanks
Kamen

Link to comment
Share on other sites

  • 2 years later...
On 7/31/2019 at 12:42 PM, kkelchev said:

In Calendar panel, events have OnClick event and that is fine.
But there is no information about which mouse button has been pressed Left,Right or conceivably mouse wheel.


My question is how application to undarstand that (which mouse button) is pressed ?

Hello,

Why do you need it, can you describe your case in more detail !?

Link to comment
Share on other sites

  • 2 weeks later...

1. UniCalendarPanel1 -> ClientEvents -> ExtEvents ->

function boxready(sender, width, height, eOpts)
{
    var calendar = sender;
    calendar.getEl().on('contextmenu', function(e, target, options) {
        var totalOffsetX = target.offsetLeft + 20;
        var totalOffsetY = target.offsetTop + 80;
        ajaxRequest(calendar, 'contextmenu', ['eventid='+target.getAttribute('data-eventid'), 'x='+totalOffsetX, 'y='+totalOffsetY]);
        e.preventDefault();
    }, calendar.getEl(), {
        delegate: '.x-calendar-event'
    });
}

2. 

procedure TMainForm.UniCalendarPanel1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = 'contextmenu' then
  begin
    //ShowMessage(Params.Values['eventid']);
    UniPopupMenu1.Popup(Params.Values['x'].ToInteger(), Params.Values['y'].ToInteger(), Sender);
  end;

end;

 

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