jMonkeyEngine-Contributions / Lemur

Lemur is a jMonkeyEngine-based UI toolkit.
http://jmonkeyengine-contributions.github.io/Lemur/
BSD 3-Clause "New" or "Revised" License
116 stars 32 forks source link

Added the mousePressed event to DefaultMouseListener #36

Closed Pesegato closed 8 years ago

Pesegato commented 8 years ago

Reason behind this feature: I want to manage a Button that reacts on some way when is "pressed", and on another way when is "clicked"

Pesegato commented 8 years ago

Whoops! Doesn't even compile :dizzy_face:

pspeed42 commented 8 years ago

But that's what mouseButtonEvent() is for. Just override that method and call the super method.

On Thu, Jun 16, 2016 at 5:38 AM, Pesegato notifications@github.com wrote:

Reason behind this feature: I want to manage a Button that reacts on some way when is "pressed", and on another way when is "clicked"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jMonkeyEngine-Contributions/Lemur/pull/36#issuecomment-226436978, or mute the thread https://github.com/notifications/unsubscribe/AGrfngiLe7BI6h2Uz3J3wDXYHwkOg-CFks5qMRmNgaJpZM4I3MhF .

pspeed42 commented 8 years ago

Also, even if I were to add such a method (and I'm not strongly motivated due to already stated reasons)... it would have to be protected because it's not part of the public interface.

On Thu, Jun 16, 2016 at 5:49 AM, Paul Speed pspeed42@gmail.com wrote:

But that's what mouseButtonEvent() is for. Just override that method and call the super method.

On Thu, Jun 16, 2016 at 5:38 AM, Pesegato notifications@github.com wrote:

Reason behind this feature: I want to manage a Button that reacts on some way when is "pressed", and on another way when is "clicked"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jMonkeyEngine-Contributions/Lemur/pull/36#issuecomment-226436978, or mute the thread https://github.com/notifications/unsubscribe/AGrfngiLe7BI6h2Uz3J3wDXYHwkOg-CFks5qMRmNgaJpZM4I3MhF .

Pesegato commented 8 years ago

I've tried that first, but somehow I either got the pressed OR the click, not both. The most elegant solution is by adding it on the API.

Yes I see that is not part of the interface. But hey, "Default*Listeners" are for convenience, right? They are allowed to add new public methods...

Pesegato commented 8 years ago

Nevermind, it worked as you said. Feel free to discard my PR is you want.