'OnSelectionChange' event name should be called 'OnItemClicked' instead

Started by Gal Shemesh, Wed 03/07/2024 13:41:23

Previous topic - Next topic

Gal Shemesh

The 'OnSelectionChange' event name doesn't describe its behavior correctly, as in general, a selection change event name describes a scenario where it should trigger an event the moment the selection is changed (using the arrow keys on the keyboard to navigating from one item to another from example). So this is quite misleading, as it actually triggered the moment you click and release the mouse button on a ceratin item. So the event works okay - it's just that its name is not accurate. Should be 'OnItemClicked'.

On the same time, I think that if there could be another property there for 'OnEnter' for example to selecting a list item using the keyboard could be a very nice add-on, as currently we have to doing so manually using the on_key event.
Gal Shemesh,
goldeng

Crimson Wizard

Quote from: Gal Shemesh on Wed 03/07/2024 13:41:23On the same time, I think that if there could be another property there for 'OnEnter' for example to selecting a list item using the keyboard could be a very nice add-on, as currently we have to doing so manually using the on_key event.

Having OnEnter event is by far not enough for handling keyboard input.
The problem with AGS controls is that they don't have a concept of a focused control, that is a control which currently is receiving an input.

Imagine having multiple list boxes on screen, which one should be reacting to key presses?

With TextBox this is handled in a dumb way, the first enabled TextBox found receives input. User has to enable/disable textboxes manually to achieve a wanted effect.

Only if we introduce a Focus concept, and make all Controls have a Focused property, then this will be possible.

Gal Shemesh

You're right. Haven't thought about multiple listboxes scenario. So yeah, a focus on the last accessed listbox should be implemented for such a case first. Well, so only the 'OnItemClicked' name change for now I guess. :)
Gal Shemesh,
goldeng

Snarky

Quote from: Crimson Wizard on Wed 03/07/2024 13:46:36With TextBox this is handled in a dumb way, the first enabled TextBox found receives input.

Are you sure about that? The way I remember it, every TextBox currently visible receives the input.

Crimson Wizard

Quote from: Snarky on Wed 03/07/2024 14:28:11Are you sure about that? The way I remember it, every TextBox currently visible receives the input.

Weird. So this is even dumber than I remembered.

SMF spam blocked by CleanTalk