Skip to content

Commit d60d98e

Browse files
authored
Merge pull request #1823 from ISISComputingGroup/Ticket8826_Fixed_scaling_issue_with_buttons
Fixed scaling issues with script generator buttons
2 parents 1906c18 + ccdb15b commit d60d98e

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

base/uk.ac.stfc.isis.ibex.ui.scriptgenerator/src/uk/ac/stfc/isis/ibex/ui/scriptgenerator/views/Constants.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
* Constants used on the script generator page.
2929
*/
3030
final class Constants {
31-
protected static final String BUTTON_TITLE_SAVE = "Save Script";
32-
protected static final String BUTTON_TITLE_SAVE_AS = "Save Script As";
33-
protected static final String BUTTON_TITLE_LOAD = "Load Script";
31+
protected static final String BUTTON_TITLE_SAVE = "Save";
32+
protected static final String BUTTON_TITLE_SAVE_AS = "Save As";
33+
protected static final String BUTTON_TITLE_LOAD = "Load";
3434

35-
protected static final String BUTTON_TITLE_ADD_ROW_TO_END = "Add Row to End";
36-
protected static final String BUTTON_TITLE_INSERT_ROW_BELOW = "Insert Row Below";
37-
protected static final String BUTTON_TITLE_DELETE_ROWS = "Clear All Rows";
35+
protected static final String BUTTON_TITLE_ADD_ROW_TO_END = "Add to End";
36+
protected static final String BUTTON_TITLE_INSERT_ROW_BELOW = "Insert Below";
37+
protected static final String BUTTON_TITLE_DELETE_ROWS = "Clear All";
3838

3939
protected static final String CHECKBOX_TITLE_PARAM_TRANSFER = "Transfer Compatible Parameters";
4040
protected static final String CHECKBOX_TITLE_INVALID_PAUSE = "Invalid Actions are Paused on";

base/uk.ac.stfc.isis.ibex.ui.scriptgenerator/src/uk/ac/stfc/isis/ibex/ui/scriptgenerator/views/ScriptGeneratorView.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import org.eclipse.swt.widgets.TableColumn;
5252
import org.eclipse.swt.widgets.TableItem;
5353
import org.eclipse.swt.widgets.Text;
54+
import org.eclipse.swt.widgets.Group;
5455

5556
import uk.ac.stfc.isis.ibex.preferences.PreferenceSupplier;
5657
import uk.ac.stfc.isis.ibex.scriptgenerator.ScriptGeneratorProperties;
@@ -344,6 +345,7 @@ private Composite makeGrid(Composite parent, int columns, boolean equal, int mar
344345

345346
private void makeToggleParameterTransfer(Composite parent) {
346347
Composite actionsControlsGrp = makeGrid(parent, 1, true, 10);
348+
actionsControlsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
347349

348350
new IBEXButton(actionsControlsGrp, SWT.CHECK, event -> {
349351
boolean enabled = ((Button) event.widget).getSelection();
@@ -356,6 +358,7 @@ private void makeToggleParameterTransfer(Composite parent) {
356358

357359
private void makeToggleInvalidPauseSkip(Composite parent) {
358360
Composite actionsControlsGrp = makeGrid(parent, 1, true, 10);
361+
actionsControlsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
359362

360363
// Pause
361364
new IBEXButton(actionsControlsGrp, SWT.RADIO, event -> {
@@ -375,13 +378,16 @@ private void makeToggleInvalidPauseSkip(Composite parent) {
375378
}
376379

377380
/**
378-
* Creates a column containing three buttons for table row modifications.
381+
* Creates a row containing three buttons for table row modifications.
379382
*
380383
* @param parent the containing Composite
381384
*/
382385
private void makeTableRowControlButtons(Composite parent) {
383-
// Composite for laying out new/delete/duplicate action buttons
384-
Composite actionsControlsGrp = makeGrid(parent, 1, true, 10);
386+
// Group for laying out new/delete/duplicate action buttons
387+
Group actionsControlsGrp = new Group(parent, SWT.NONE);
388+
actionsControlsGrp.setText("Row Operations");
389+
actionsControlsGrp.setLayout(new GridLayout(3, false));
390+
actionsControlsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
385391

386392
// Make buttons for insert new/delete/duplicate actions
387393
btnAddAction = new IBEXButton(actionsControlsGrp, SWT.NONE, event -> {
@@ -407,13 +413,16 @@ private void makeTableRowControlButtons(Composite parent) {
407413
}
408414

409415
/**
410-
* Creates a column containing three buttons for save, save as, and load script.
416+
* Creates a row containing three buttons for save, save as, and load script.
411417
*
412418
* @param parent the containing Composite
413419
*/
414420
private void makeScriptSaveLoadButtons(Composite parent) {
415-
// Composite for generate buttons
416-
Composite generateButtonsGrp = makeGrid(parent, 1, true, 10);
421+
// Group for script operation buttons
422+
Group generateButtonsGrp = new Group(parent, SWT.NONE);
423+
generateButtonsGrp.setText("Script Operations");
424+
generateButtonsGrp.setLayout(new GridLayout(3, false));
425+
generateButtonsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
417426

418427
// Buttons to generate a script
419428
generateScriptButton = new IBEXButton(generateButtonsGrp, SWT.NONE, event -> {
@@ -449,8 +458,11 @@ private void makeDynamicScriptingControlButtons(Composite parent) {
449458
errorLabel.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
450459
errorLabel.setForeground(new Color(255, 0, 0));
451460

452-
// Composite for generate buttons
453-
Composite dynamicScriptingButtonsGrp = makeGrid(parent, 3, true, 10);
461+
// Group for dynamic scripting buttons
462+
Group dynamicScriptingButtonsGrp = new Group(parent, SWT.NONE);
463+
dynamicScriptingButtonsGrp.setText("Run Operations");
464+
dynamicScriptingButtonsGrp.setLayout(new GridLayout(3, false));
465+
dynamicScriptingButtonsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
454466

455467
// Button to run/pause/stop script in nicos
456468
runButton = new IBEXButton(dynamicScriptingButtonsGrp, SWT.NONE)

0 commit comments

Comments
 (0)