Search in sources :

Example 1 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ActionSet method createGraffitiComposite.

protected Composite createGraffitiComposite() {
    Composite graffitiComp = new Composite(actionSettings, SWT.NONE);
    graffitiComp.setLayout(new FormLayout());
    graffitiTextLabel = new DisplayLabel(graffitiComp, SWT.NONE);
    graffitiTextLabel.setText(L10N.get("DE.GraffitiTextCaption", "Graffiti® Gestures") + ":");
    // TODO Why is this here rather than in its natural home in the
    //      overridden method in ActionPropertySet?
    transitionSourceLabelGraffiti = createTransitionSourceLabel(graffitiComp);
    transitionSourceNameGraffiti = createTransitionSourceName(graffitiComp);
    transitionDestinationLabelGraffiti = createTransitionDestinationLabel(graffitiComp);
    transitionDestinationNameGraffiti = createTransitionDestinationName(graffitiComp);
    // TODO: set desired width to something somewhat larger
    graffitiText = createGraffitiText(graffitiComp);
    graffitiIsCmd = new Button(graffitiComp, SWT.CHECK);
    graffitiIsCmd.setText(L10N.get("DE.IsCommand", "Is Command"));
    graffitiIsCmd.addSelectionListener(widgetActionChange);
    return graffitiComp;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel)

Example 2 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class DesignEditorView method layOutPalette.

protected void layOutPalette(int deviceTypes, Palette parent) {
    Object selectedAction = parent.clearButtons();
    String defaultActionToolTip = L10N.get("DEV.UseDefaultTransitionType", "Use default transition type");
    Button lastButton = parent.createPaletteButton(BASE_ACTION_ON_SRC_ICON, // first button!
    null, parent, ActionProperties.BASE_ACTION_ON_SOURCE, setCurrentNewActionType, defaultActionToolTip);
    if (DeviceType.Mouse.isMember(deviceTypes)) {
        lastButton = parent.createPaletteButton(MOUSE_ICON, lastButton, parent, ActionType.ButtonPress, setCurrentNewActionType, L10N.get("DEV.UseMouseTransitionType", "Use mouse transition"));
    }
    if (DeviceType.Keyboard.isMember(deviceTypes)) {
        lastButton = parent.createPaletteButton(KEYBOARD_ICON, lastButton, parent, ActionType.KeyPress, setCurrentNewActionType, L10N.get("DEV.UseKeyboardTransitionType", "Use keyboard transition"));
    }
    if (DeviceType.Touchscreen.isMember(deviceTypes)) {
        lastButton = parent.createPaletteButton(TOUCHSCREEN_ICON, lastButton, parent, ActionType.Tap, setCurrentNewActionType, L10N.get("DEV.UseTouchscreenTransitionType", "Use touchscreen transition"));
        lastButton = parent.createPaletteButton(GRAFFITI_ICON, lastButton, parent, ActionType.GraffitiStroke, setCurrentNewActionType, L10N.get("DEV.UseGraffitiTransitionType", "Use Graffiti® transition"));
    }
    if (DeviceType.Voice.isMember(deviceTypes)) {
        lastButton = parent.createPaletteButton(VOICE_ICON, lastButton, parent, ActionType.Voice, setCurrentNewActionType, L10N.get("DEV.UseVoiceTransitionType", "Use voice transition"));
    }
    setStatusMessage(defaultActionToolTip);
    parent.layout();
    if (selectedAction != null) {
        parent.selectPaletteButton(selectedAction);
    }
}
Also used : Button(org.eclipse.swt.widgets.Button)

Example 3 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ThreadProgressBar method addBelowBar.

@Override
protected void addBelowBar() {
    FormData data = new FormData();
    // at the top of the dialog box otherwise
    if (statusLabel != null) {
        data.top = new FormAttachment(statusLabel, 10, SWT.BOTTOM);
        data.bottom = new FormAttachment(statusLabel, 25, SWT.BOTTOM);
    } else {
        data.top = new FormAttachment(0, 10);
        data.bottom = new FormAttachment(0, 25);
    }
    data.left = new FormAttachment(0, 20);
    data.right = new FormAttachment(100, -20);
    bar.setLayoutData(data);
    // box, tying it to the given cancelable "process" object.
    if (cancelListener != null) {
        cancelButton = new Button(shell, SWT.PUSH);
        cancelButton.setText(L10N.get("B.Cancel", "Cancel"));
        cancelButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent evt) {
                // Called from the main UI thread
                cancelListener.cancel();
                cancelButton.setEnabled(false);
            }
        });
        data = new FormData();
        data.left = new FormAttachment(bar, 0, SWT.CENTER);
        data.top = new FormAttachment(bar, 5, SWT.BOTTOM);
        cancelButton.setLayoutData(data);
    }
}
Also used : FormData(org.eclipse.swt.layout.FormData) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 4 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class AboutView method addButtons.

protected void addButtons() {
    if (OSUtils.WINDOWS) {
        // Centered OK button for dismissing the dialog box, set as default button
        Button okButton = new Button(dialog, SWT.PUSH);
        okButton.setText(L10N.get("B.OK", "OK"));
        okButton.setFocus();
        dialog.setDefaultButton(okButton);
        //            boolean ignore = okButton.setFocus();
        GridData okLayout = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
        okLayout.horizontalSpan = 4;
        okButton.setLayoutData(okLayout);
        // Dismiss the dialog box when OK button selected
        okButton.addListener(SWT.Selection, new Listener() {

            public void handleEvent(Event evt) {
                dialog.close();
            }
        });
    }
}
Also used : Listener(org.eclipse.swt.widgets.Listener) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) Event(org.eclipse.swt.widgets.Event)

Example 5 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ActionChangePropertySet method createKeyComposite.

@Override
protected Composite createKeyComposite() {
    Composite c = super.createKeyComposite();
    keyboardChoice = new Button(actionComposite, SWT.RADIO);
    keyboardChoice.setData(new Integer(ActionSet.USE_KEYBOARD));
    keyboardChoice.addSelectionListener(getActionChoiceListener());
    keyboardChoice.setText(KEYBOARD_LABEL);
    c.setData(keyboardChoice);
    if (actionSettingsLayout.topControl == null) {
        setSelectedActionChoice(keyboardChoice, c, keyboardText);
    }
    return c;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button)

Aggregations

Button (org.eclipse.swt.widgets.Button)3370 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1988 GridData (org.eclipse.swt.layout.GridData)1806 Composite (org.eclipse.swt.widgets.Composite)1782 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1651 GridLayout (org.eclipse.swt.layout.GridLayout)1580 Label (org.eclipse.swt.widgets.Label)1570 Text (org.eclipse.swt.widgets.Text)1100 Group (org.eclipse.swt.widgets.Group)806 ModifyListener (org.eclipse.swt.events.ModifyListener)618 ModifyEvent (org.eclipse.swt.events.ModifyEvent)606 FormAttachment (org.eclipse.swt.layout.FormAttachment)556 FormData (org.eclipse.swt.layout.FormData)556 Shell (org.eclipse.swt.widgets.Shell)524 FormLayout (org.eclipse.swt.layout.FormLayout)499 Event (org.eclipse.swt.widgets.Event)499 SelectionListener (org.eclipse.swt.events.SelectionListener)492 Listener (org.eclipse.swt.widgets.Listener)474 Display (org.eclipse.swt.widgets.Display)424 ShellEvent (org.eclipse.swt.events.ShellEvent)350