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 » Tray Menu alignement bug
Re: Tray Menu alignement bug [SOLVED] [message #30316 is a reply to message #30304] Fri, 24 December 2010 12:56 Go to previous messageGo to previous message
lucpolak is currently offline  lucpolak
Messages: 18
Registered: April 2008
Location: France
Promising Member
Hello,

I find the source of the problem.

In MenuItem.cpp, when the sub menu is pulled by the SubMenuItem::Pull() function, the point position is always set to the right top corner.

Next, the MenuBar::PopUp(MenuBar.cpp) function is called.

One of the solutions applied to this function is to check is we are in a sub menu and when we need to toogle the menu vertically, we reaffect the y position of base point to submenuitem RightBottom.

In facts, this portion of MenuBar::PopUp code :

if(p.y + sz.cy > r.bottom) { 
		if(p.y - r.top > r.bottom - p.y) {			
			int y0 = p.y + rsz.cy;
			szy = szcy;
			...


becomes

if(p.y + sz.cy > r.bottom) { 
		if(p.y - r.top > r.bottom - p.y) {
			if (parentmenu && parentmenu->GetActiveSubmenu() && parentmenu->submenuitem) 
				p.y = parentmenu->submenuitem->GetScreenRect().BottomRight().y + 2;
			int y0 = p.y + rsz.cy;
			szy = szcy;
			...


I Think that will be good to add this to the next release of Upp.

Thanks a lot and Merry Christmas for all.

Lucas
 
Read Message
Read Message
Read Message
Previous Topic: ToolButton: Label Patch!
Next Topic: private-ness of ToolButton::GetImage()
Goto Forum:
  


Current Time: Tue May 21 00:24:12 CEST 2024

Total time taken to generate the page: 0.01994 seconds