Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Menus&Toolbars » MenuBar.Execute seems to ignore owner - Bug?
MenuBar.Execute seems to ignore owner - Bug? [message #45544] Sun, 29 November 2015 07:36 Go to next message
slashupp is currently offline  slashupp
Messages: 207
Registered: July 2009
Experienced Member
debian 64b

Trying to get menu to popup in center of a control in my window, using Execute(Ctrl*owner, Point p),
no matter what I do it interprets the point as absolute (screen) coordinates.

edit:
I came up with this to find the absolute coord's of myctrl:
Rect myctrl::get_abs_tree_rect()
{
	Ctrl *p=GetParent();
	Rect w, r=GetRect();
	while (p) { w=p->GetRect(); r.left+=w.left; r.top+=w.top; p=p->GetParent(); } //top parent (p==nullptr) should have absolute coord's?
	return r;
}

seems to work ...

[Updated on: Sun, 29 November 2015 09:58]

Report message to a moderator

Re: MenuBar.Execute seems to ignore owner - Bug? [message #45549 is a reply to message #45544] Sun, 29 November 2015 20:46 Go to previous message
mirek is currently offline  mirek
Messages: 12571
Registered: November 2005
Ultimate Member
GetScreenView / GetScreenRect....
Previous Topic: Creating sub menus without callback functions
Next Topic: [solved] MenuBar item spacing too low on the right side
Goto Forum:
  


Current Time: Tue Jul 07 02:18:01 CEST 2020

Total time taken to generate the page: 0.01269 seconds