RE: [AD] src/gui.c hotkey and hidden widgets patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Huh?  Why should a hidden widget get a hotkey?  This change would break a
> lot of code, most of it mine.  Why would you want a hidden widget to get a
> keystroke?  If you want it to get keystrokes, why do you have it hidden,
> where it can't do anything else, either?
>
> In my mind, hidden objects are disabled objects that are hidden
> rather than
> grayed out.  If this "hidden but active" functionality is
> something we need,
> we'd be better to create a D_HIDDENACTIVE flag rather than suddenly change
> the "meaning" of being hidden.

IMHO, I think this is misuse of the flags:

D_HIDDEN | D_DISABLED should be what you would use to get
this behavior. Having a simple well defined behavior for a flag
is cleaner (and easier to understand) that different meanings
depending on what other flags are set or not set.

D_HIDDEN | D_DISABLED       -> as if it was not there
D_DISABLED                  -> "grayed out"
D_HIDDEN                    -> invisible but active
0                           -> normal button

This implements the list of behaviors without adding a new flag,
which would be pretty much redundant without bringing anything more.
As an example of what would use this, is an interface where you can
"fullscreen" your game, and the buttons disappear (but still can be
accessed by hotkeys). It would be a wart to remove them and spawn
d_keyboard_procs, or have them in the first place.
Now, I appreciate the fact that some code can actually use the
current behavior, and that changing the behavior now is not that
easy, but I still consider it (rather) broken.

--
Lyrian



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/