[Bf-committers] Menu code bug/weirdness

Chris Want bf-committers@blender.org
Fri, 20 Feb 2004 20:13:16 -0700


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