[Bf-committers] Menu code bug/weirdness

Ton Roosendaal bf-committers@blender.org
Sat, 21 Feb 2004 13:18:30 +0100


Hi,

Several issues here!

1. the bug in drawing collums (Todd provided fix, thanks!)

2. an option to alphabetize menu options; something I have to look at  
how to include in in API, but I can use the code Todd provided for it.

3. the current menubutton API doesn't provide control for what the  
desired default direction for a menu is. I will add that.

4. the flipping of items convention...
With the introduction of pulldowns in Blender, and the new toolbox, I  
stumbled on this issue. At first the items were not flipped when a menu  
flipped, which I found very confusing. Look for example at the "Add"  
menu in the top header, versus the "Add" in SpaceBar menu. Or when you  
browse for a new Material, check for the "ADD NEW" item.

Having the first item closest to the mouse position seems to me most  
logical. You memorize the order by moving the mouse a couple of items  
up or down. But apparently this only is valid for when menus have fixed  
items, and are not too long.

For very long listings, such all bones in an armature, the Blender  
pulldowns don't work well. We could adopt the OSX convention, where you  
can scroll inside of a pulldown, with an arrow icon in top and/or  
bottom to indicate you can scroll. That way the usage of a 'DataBrowse'  
can become optional (or obsolete) too.
Another feature we could bring back then, is the convention to draw a  
menu over the button, with the active item being at mouse position.  
This was in Blender before the 2.3 release, but not well implemented;  
it had nasty code that moved the mousepointer around when a menu  
couldn't fit, something I could not get working in OSX, causing menus  
not to work at all. (Moving mousepointers is generally considered very  
bad btw...)

Coincidentally, I had a long debate on this with Phase on IRC  
yesterday! :) He didn't like this flipping at all... but he could live  
with solutions as proposed here.

What's your thoughts?

-Ton-


On Saturday, Feb 21, 2004, at 04:13 Europe/Amsterdam, Chris Want wrote:

> Looks like I've been thwarted by my old nemesis, interface.c!
>
> I was adding some code that alphabetizes the bone
> parent menu (as requested by many), and having completed
> the task, I discovered that the rendering of the menu is
> quite screwy.
>
> Here's an example of a nicely alphabetized menu string
> (I have added some carriage returns for better readability):
>
> Parent%t| %x-1|ankleSolver.L%x50|ankleSolver.R%x55|
> foreArm.L%x10|foreArm.R%x25|gArm.L%x46|gArm.R%x2|
> gElbowPoint.L%x45|gFoot.L%x47|gFoot.R%x52|gKneePoint.L%x1|
> gKneePoint.R%x51|gLookat%x8|gPositioner%x0|gUpperArm.L%x9|
> gUpperArm.R%x24|heelNull.L%x41|heelNull.R%x44|rBall.L%x49|
> rBall.R%x54|rHand.L%x11|rHand.R%x26|rHead%x7|rIndexBase.L%x15|
> rIndexBase.R%x30|rIndexMid.L%x16|rIndexMid.R%x31|rIndexTip.L%x17|
> rIndexTip.R%x32|rLowerBack%x4|rMiddleBase.L%x12|
> rMiddleBase.R%x27|rMiddleMid.L%x13|rMiddleMid.R%x28|
> rMiddleTip.L%x14|rMiddleTip.R%x29|rNeck%x6|rRingBase.L%x18|
> rRingBase.R%x33|rRingMid.L%x19|rRingMid.R%x34|rRingTip.L%x20|
> rRingTip.R%x35|rThumbBase.L%x21|rThumbBase.R%x36|rThumbMid.L%x22|
> rThumbMid.R%x37|rThumbTip.L%x23|rThumbTip.R%x38|rToe.L%x48|
> rToe.R%x53|rUpperBack%x5|shin.L%x40|shin.R%x43|thigh.L%x39|
> thigh.R%x42
>
> That string renders like this:
>
> http://bebop.cns.ualberta.ca/~cwant/bad_menu_rendering.jpg
>
> It would appear to be *almost* in reverse order, but the
> location of the string 'rBall.L' (no, it's the ball of
> his foot) completely defies reason. The reason it's in
> *almost* reverse order is because the menu is near the bottom
> of the screen and is pointing upward from where it was
> activated: if I expose this menu near the top of the screen,
> it's pointing downward and is *almost* in forward order.
>
> Anyways, I wish there was a mode that made the menu code
> render it's entries exactly in the order they are in the menu
> string (regardless of where the menu is positioned on the screen).
>
> Chris
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton@blender.org  
http://www.blender.org