Project

General

Profile

Actions

Bug #1887

closed
JG KD

Click handler modifier regression ?

Bug #1887: Click handler modifier regression ?

Added by Jan Goyvaerts over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
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.

KD Updated by Koen Deforche over 13 years ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.1

KD Updated by Koen Deforche over 13 years ago Actions #2

  • 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);

            }
        });
    }
}

JG Updated by Jan Goyvaerts over 13 years ago Actions #3

It's running okay now ... don't know what I did differently from before. :-/

So, false alarm then. Sorry for that.

KD Updated by Koen Deforche almost 13 years ago Actions #4

  • Status changed from Feedback to Resolved

KD Updated by Koen Deforche almost 13 years ago Actions #5

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom