On Sat, 27 Sep 2008 12:02:04 -0700, <timor.super@gm ail.comwrote:
You don't, not when you don't know that one event is necessarily going to
follow another. If the events can appear alone, then you can't make them
depend on each other.
You don't describe what this "thing" you are doing is. But it's bad
design to have some "thing" you do in response to user input like this be
something that can't be done repeatedly. For example, any good UI design
that uses both single clicks and double-clicks will always perform the
single-click action first, even for a double-click event, because
otherwise the UI winds up laggy at best, and confusing at worst.
So, hopefully your only concern here is one of performance, in which case
the answer is "don't worry about it". If it's somehow harmful to repeat
the action, then you should rethink your user-interface design.
Pete
[...]
The problem is that I have to do this thing if I only select the node,
or if i only click on the node ; so depending on what i'm doing :
>
- click on the node (that is already selected) =my treatment is
doing 1 time (only the mouse click event is fired)
- click on the node (that is not selected) =2 times (After select &
MouseClick)
- expand the node =3 times
>
How can I make my treatment only one time and that all the 3 things
are covered ?
The problem is that I have to do this thing if I only select the node,
or if i only click on the node ; so depending on what i'm doing :
>
- click on the node (that is already selected) =my treatment is
doing 1 time (only the mouse click event is fired)
- click on the node (that is not selected) =2 times (After select &
MouseClick)
- expand the node =3 times
>
How can I make my treatment only one time and that all the 3 things
are covered ?
follow another. If the events can appear alone, then you can't make them
depend on each other.
You don't describe what this "thing" you are doing is. But it's bad
design to have some "thing" you do in response to user input like this be
something that can't be done repeatedly. For example, any good UI design
that uses both single clicks and double-clicks will always perform the
single-click action first, even for a double-click event, because
otherwise the UI winds up laggy at best, and confusing at worst.
So, hopefully your only concern here is one of performance, in which case
the answer is "don't worry about it". If it's somehow harmful to repeat
the action, then you should rethink your user-interface design.
Pete
Comment