altagur Posted November 23, 2013 Posted November 23, 2013 I am use popup menu for grid on frame on panel on form How calculate position for popup method call? What class have properties Parent, Left,Top? Why with Unypopup menu opens system browser popup menu? For example: grid1 on frame1 on panel1 on panel2 on form1 procedure TFrame1.Grid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var F: TUniForm; X0,Y0: Integer;begin MainMenu.Popup(X+Left+Parent.left+Parent.Parent.Left+Parent.Parent.Parent.Left, etc ); end;end; Recursive procedure? function TAnyHtmlFrame.FindParentForm(var X:Integer; var Y: Integer): TUniForm;var Ct: TObject;begin //x := 0; y := 0; Result := nil; Ct := Self; while (C<>nil) do begin if Ct is TUniCOntrol then begin Inc(x, TUniCOntrol(Ct).Left); Inc(y, TUniCOntrol(Ct).Top); C := TUniControl(Ct).Parent; end else if Ct is TUniFrame then begin Inc(x, TUniFrame(Ct).Left); Inc(y, TUniFrame(Ct).Top); C := TUniFrame(Ct).Parent; end else if Ct is TUniForm then begin Inc(x, TUniForm(Ct).Left); Inc(y, TUniForm(Ct).Top); Ct := TUniForm(Ct).Parent; end end;end; Is it possible do normal property PopupMenu for Unigui Controls and do whis internally? Why i must for all controls write OnMouse Down and call .Popup and calculate position? Why with TUniPopup menu opens system browser popup by right mouse down? TUniXPopupMenu work properly before TUniPopupMenu This popup menu is very very useful for interface. But in current situation too difficult to use it Thanks for reply Nik Gurov (altagur) Quote
Administrators Farshad Mohajeri Posted November 23, 2013 Administrators Posted November 23, 2013 Please add a Feature Request. Quote
altagur Posted November 23, 2013 Author Posted November 23, 2013 Thanks for response dear Farshad. Quote
delagoutte Posted September 22, 2017 Posted September 22, 2017 I have same problem with a Tunicontainerpanel. the X and Y value arenot the global position but the postion of clik in Tunicontainer panel. Is there an issue ? Quote
Sherzod Posted September 22, 2017 Posted September 22, 2017 Hi, This is normal behavior, To correctly show UniPopupMenu for example, specify relative object: procedure TMainForm.UniContainerPanel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin UniPopupMenu1.Popup(X, Y, Sender); end; 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.