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;
}
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);
}
}
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);
}
}
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();
}
});
}
}
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;
}
Aggregations