Jump to content

Recommended Posts

Posted

Hi.

 

I have a unipanel, with a custom button.

 

The action of the button, is popup a menu with some options.

 

When click the button on the panel header, the menu popup ok, but I can't control its position on the screen.

 

I'd like it to be shown at the same position of the button, but I don't know how.

 

I've tried with GetCursorPos and Mouse.CursorPos, but the menu is shown in a wrong place, never where I want.

 

Any idea?

 

Thanks.

 

Posted

Maybe you wanted like this?!:

 

related with: http://forums.unigui.com/index.php?/topic/6947-panel-header-icons-tools/

function beforeInit(sender, config)
{
    config.tools = [{
        type: 'gear',
        handler: function(e) {
            ajaxRequest(sender, "_gear", ["x="+e.browserEvent.clientX, "y="+e.browserEvent.clientY])
        }
    }, {
        type: 'pin'
    }];
}
procedure TMainForm.UniPanel1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
var
  x, y: Integer;
begin
  if EventName = '_gear' then
  begin
    x := StrToInt(Params.Values['x']);
    y := StrToInt(Params.Values['y']);
    UniPopupMenu1.Popup(x, y);
  end;
end;
  • 1 year later...
Posted

A management page of users.

But i need only the xy values of the cursor on the UniUrlFrame.

I don't need any parameters passed from ajax request

 

Also using build 1425

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