Actions
Bug #1887
closedClick handler modifier regression ?
Start date:
04/30/2013
Due date:
% Done:
0%
Estimated time:
Description
The regular WInteractiveWidget.click() handler only seems to support the modifiers: Shift and Alt-Shift. The others seem to be disabled. Nothing happens.
To my recollection this used to work for the versions before.
It seems to work with custom signals though.
Updated by Koen Deforche over 11 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
- Target version set to 3.3.1
Updated by Koen Deforche over 11 years ago
- Status changed from InProgress to Feedback
Hey Jan,
I can't reproduce this. The following code behaves as expected. Perhaps there is another thing interfering with this?
package eu.webtoolkit.jwt.examples.hello;
import eu.webtoolkit.jwt.KeyboardModifier;
import eu.webtoolkit.jwt.Side;
import eu.webtoolkit.jwt.Signal1;
import eu.webtoolkit.jwt.WApplication;
import eu.webtoolkit.jwt.WBreak;
import eu.webtoolkit.jwt.WEnvironment;
import eu.webtoolkit.jwt.WLineEdit;
import eu.webtoolkit.jwt.WMouseEvent;
import eu.webtoolkit.jwt.WPushButton;
import eu.webtoolkit.jwt.WText;
/*
* A simple hello world application class which demonstrates how to react
* to events, read input, and give feed-back.
*/
public class HelloApplication extends WApplication {
public HelloApplication(WEnvironment env) {
super(env);
setTitle("Hello world");
getRoot().addWidget(new WText("Your name, please ? "));
final WLineEdit nameEdit = new WLineEdit(getRoot());
nameEdit.setFocus();
WPushButton button = new WPushButton("Greet me.", getRoot());
button.setMargin(5, Side.Left);
getRoot().addWidget(new WBreak());
final WText greeting = new WText(getRoot());
button.clicked().addListener(this, new Signal1.Listener<WMouseEvent>() {
@Override
public void trigger(WMouseEvent event) {
String mod = "";
if (event.getModifiers().contains(KeyboardModifier.AltModifier))
mod += " Alt";
if (event.getModifiers().contains(KeyboardModifier.ShiftModifier))
mod += " Shift";
if (event.getModifiers().contains(KeyboardModifier.ControlModifier))
mod += " Ctrl";
greeting.setText("Hello there, " + nameEdit.getText() + mod);
}
});
}
}
Updated by Jan Goyvaerts over 11 years ago
It's running okay now ... don't know what I did differently from before. :-/
So, false alarm then. Sorry for that.
Updated by Koen Deforche about 11 years ago
- Status changed from Feedback to Resolved
Updated by Koen Deforche about 11 years ago
- Status changed from Resolved to Closed
Actions