[Ohrrpgce] SVN: teeemcee/8248 Calc autosize menu size in init_menu_state, to fix a couple menu glitche

subversion at HamsterRepublic.com subversion at HamsterRepublic.com
Wed Dec 21 03:40:11 PST 2016


teeemcee
2016-12-21 03:40:11 -0800 (Wed, 21 Dec 2016)
1007
Calc autosize menu size in init_menu_state, to fix a couple menu glitches caused by r8241

The problem was that r8241 removed manual .spacing assignments, without which
usemenu can't calculate .size when .autosize=YES, resulting in .size=0 for one
tick, which causes .top to get set to .pt, which is bad if .pt doesn't start
as .first (e.g. slice detail editor remembered .pt).

This mess is caused by usemenu not having access to the data (MenuDef/
MenuOptions + standardmenu arguments) necessary to know .size itself.
And now we have a bunch of standardmenu-specific stuff in MenuState that ought
to be in MenuOptions instead, which usemenu really should be given.
As a simpler fix, I made MenuOptions an argument to init_menu_state instead,
to do the first-tick calculation. Only works when init_menu_state is actuallly
used.

And our menu code just keeps getting more difficult to understand; this
commit not excepted. I avoid looking at menus.bas if possible!

This also cleaned up editbitset slightly.
---
U   wip/common_menus.bas
U   wip/customsubs.rbas
U   wip/menus.bas
U   wip/menus.bi
U   wip/sliceedit.bas


More information about the Ohrrpgce mailing list