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
Tray Menu alignement bug [message #30304] Thu, 23 December 2010 12:18 Go to next message
lucpolak is currently offline  lucpolak
Messages: 18
Registered: April 2008
Location: France
Promising Member
Hello, i'm new on this forum and i have a problem with Bar Menus.

I've developed a application which has a tray menu dynamically refreshed. The problem appears when the sub menu has a lot of items.

For exemple, with few elements, the menu is ok :

http://www.harsze.com/menu_ok.jpg

The element "CIR 2009" is correctly aligned at the right border of parent menu ("Activité administrative")

But if there are a lot of elements, the sub menu is aligned with the bottom side, the menu display is bad :

http://www.harsze.com/menu_ko.jpg

the element Zedental should be aligned right to TMA and not "Projets clients".

Thanks à lot for your answers!

Lucas
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 next 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
Re: Tray Menu alignement bug [SOLVED] [message #30364 is a reply to message #30316] Sun, 26 December 2010 11:29 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, patch applied.

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


Current Time: Thu Apr 18 19:44:49 CEST 2024

Total time taken to generate the page: 0.01957 seconds