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 previous message
slashupp is currently offline  slashupp
Messages: 231
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

 
Read Message
Read Message
Previous Topic: Creating sub menus without callback functions
Next Topic: [solved] MenuBar item spacing too low on the right side
Goto Forum:
  


Current Time: Thu Mar 28 22:34:51 CET 2024

Total time taken to generate the page: 0.02211 seconds