mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 567662: Eliminate pixel-level sizing on startup page
Change-Id: I36293ce452e4ed921c465252e5b6b99337490768
This commit is contained in:
parent
bc76b0a7c3
commit
13310b6cd7
1 changed files with 17 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 - 2017 QNX Software Systems and others.
|
* Copyright (c) 2007 - 2020 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
* Andy Jin - Added DSF debugging, bug 248593
|
* Andy Jin - Added DSF debugging, bug 248593
|
||||||
* John Dallaway - Execute run commands before resume, bug 525692
|
* John Dallaway - Execute run commands before resume, bug 525692
|
||||||
* John Dallaway - Eliminate deprecated API, bug 566462
|
* John Dallaway - Eliminate deprecated API, bug 566462
|
||||||
|
* John Dallaway - Eliminate pixel-level sizing, bug 567662
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||||
|
@ -32,6 +33,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
||||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
|
import org.eclipse.jface.layout.PixelConverter;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.custom.ScrolledComposite;
|
import org.eclipse.swt.custom.ScrolledComposite;
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
|
@ -60,6 +62,10 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
private static final String TAB_NAME = Messages.getString("GDBJtagStartupTab.tabName"); //$NON-NLS-1$
|
private static final String TAB_NAME = Messages.getString("GDBJtagStartupTab.tabName"); //$NON-NLS-1$
|
||||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.startuptab"; //$NON-NLS-1$
|
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.startuptab"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
private static final int TEXT_COMMAND_BOX_HEIGHT = 4; // 4 lines
|
||||||
|
private static final int TEXT_HEX_ADDRESS_WIDTH = 22; // 22 chars
|
||||||
|
private static final int TEXT_SHORT_INTEGER_WIDTH = 10; // 10 chars
|
||||||
|
|
||||||
Text initCommands;
|
Text initCommands;
|
||||||
Text delay;
|
Text delay;
|
||||||
Button doReset;
|
Button doReset;
|
||||||
|
@ -157,6 +163,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createInitGroup(Composite parent) {
|
public void createInitGroup(Composite parent) {
|
||||||
|
PixelConverter pc = new PixelConverter(parent);
|
||||||
Group group = new Group(parent, SWT.NONE);
|
Group group = new Group(parent, SWT.NONE);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
group.setLayout(layout);
|
group.setLayout(layout);
|
||||||
|
@ -182,7 +189,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
delay = new Text(comp, SWT.BORDER);
|
delay = new Text(comp, SWT.BORDER);
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
gd.horizontalSpan = 1;
|
gd.horizontalSpan = 1;
|
||||||
gd.widthHint = 60;
|
gd.widthHint = pc.convertWidthInCharsToPixels(TEXT_SHORT_INTEGER_WIDTH);
|
||||||
delay.setLayoutData(gd);
|
delay.setLayoutData(gd);
|
||||||
delay.addVerifyListener(new VerifyListener() {
|
delay.addVerifyListener(new VerifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -217,7 +224,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
|
|
||||||
initCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
|
initCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
|
||||||
gd = new GridData(GridData.FILL_BOTH);
|
gd = new GridData(GridData.FILL_BOTH);
|
||||||
gd.heightHint = 60;
|
gd.heightHint = pc.convertHeightInCharsToPixels(TEXT_COMMAND_BOX_HEIGHT);
|
||||||
initCommands.setLayoutData(gd);
|
initCommands.setLayoutData(gd);
|
||||||
initCommands.addModifyListener(new ModifyListener() {
|
initCommands.addModifyListener(new ModifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -229,6 +236,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createLoadGroup(Composite parent) {
|
private void createLoadGroup(Composite parent) {
|
||||||
|
PixelConverter pc = new PixelConverter(parent);
|
||||||
Group group = new Group(parent, SWT.NONE);
|
Group group = new Group(parent, SWT.NONE);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
group.setLayout(layout);
|
group.setLayout(layout);
|
||||||
|
@ -321,7 +329,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
imageOffset = new Text(comp, SWT.BORDER);
|
imageOffset = new Text(comp, SWT.BORDER);
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
gd.horizontalSpan = 1;
|
gd.horizontalSpan = 1;
|
||||||
gd.widthHint = 100;
|
gd.widthHint = pc.convertWidthInCharsToPixels(TEXT_HEX_ADDRESS_WIDTH);
|
||||||
imageOffset.setLayoutData(gd);
|
imageOffset.setLayoutData(gd);
|
||||||
imageOffset.addVerifyListener(new VerifyListener() {
|
imageOffset.addVerifyListener(new VerifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -409,7 +417,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
symbolsOffset = new Text(comp, SWT.BORDER);
|
symbolsOffset = new Text(comp, SWT.BORDER);
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
gd.horizontalSpan = 1;
|
gd.horizontalSpan = 1;
|
||||||
gd.widthHint = 100;
|
gd.widthHint = pc.convertWidthInCharsToPixels(TEXT_HEX_ADDRESS_WIDTH);
|
||||||
symbolsOffset.setLayoutData(gd);
|
symbolsOffset.setLayoutData(gd);
|
||||||
symbolsOffset.addVerifyListener(new VerifyListener() {
|
symbolsOffset.addVerifyListener(new VerifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -440,6 +448,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createRunGroup(Composite parent) {
|
public void createRunGroup(Composite parent) {
|
||||||
|
PixelConverter pc = new PixelConverter(parent);
|
||||||
Group group = new Group(parent, SWT.NONE);
|
Group group = new Group(parent, SWT.NONE);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
group.setLayout(layout);
|
group.setLayout(layout);
|
||||||
|
@ -465,7 +474,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
pcRegister = new Text(group, SWT.BORDER);
|
pcRegister = new Text(group, SWT.BORDER);
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
gd.horizontalSpan = 1;
|
gd.horizontalSpan = 1;
|
||||||
gd.widthHint = 100;
|
gd.widthHint = pc.convertWidthInCharsToPixels(TEXT_HEX_ADDRESS_WIDTH);
|
||||||
pcRegister.setLayoutData(gd);
|
pcRegister.setLayoutData(gd);
|
||||||
pcRegister.addVerifyListener(new VerifyListener() {
|
pcRegister.addVerifyListener(new VerifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -495,9 +504,8 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
});
|
});
|
||||||
|
|
||||||
stopAt = new Text(group, SWT.BORDER);
|
stopAt = new Text(group, SWT.BORDER);
|
||||||
gd = new GridData();
|
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
gd.horizontalSpan = 1;
|
gd.horizontalSpan = 1;
|
||||||
gd.widthHint = 100;
|
|
||||||
stopAt.setLayoutData(gd);
|
stopAt.setLayoutData(gd);
|
||||||
stopAt.addModifyListener(new ModifyListener() {
|
stopAt.addModifyListener(new ModifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -509,7 +517,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||||
runCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
|
runCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
|
||||||
gd = new GridData(GridData.FILL_BOTH);
|
gd = new GridData(GridData.FILL_BOTH);
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
gd.heightHint = 60;
|
gd.heightHint = pc.convertHeightInCharsToPixels(TEXT_COMMAND_BOX_HEIGHT);
|
||||||
runCommands.setLayoutData(gd);
|
runCommands.setLayoutData(gd);
|
||||||
runCommands.addModifyListener(new ModifyListener() {
|
runCommands.addModifyListener(new ModifyListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue