mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
fix for bug 234921
This commit is contained in:
parent
2c178d6c68
commit
ac107ff7ab
2 changed files with 0 additions and 67 deletions
|
@ -1,56 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - Initial implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.xlc.ui;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.swt.graphics.FontMetrics;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
public class PixelConverter {
|
||||
|
||||
private FontMetrics fFontMetrics;
|
||||
|
||||
public PixelConverter( Control control ) {
|
||||
GC gc = new GC( control );
|
||||
gc.setFont( control.getFont() );
|
||||
fFontMetrics = gc.getFontMetrics();
|
||||
gc.dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
|
||||
*/
|
||||
public int convertHeightInCharsToPixels( int chars ) {
|
||||
return Dialog.convertHeightInCharsToPixels( fFontMetrics, chars );
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int)
|
||||
*/
|
||||
public int convertHorizontalDLUsToPixels( int dlus ) {
|
||||
return Dialog.convertHorizontalDLUsToPixels( fFontMetrics, dlus );
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int)
|
||||
*/
|
||||
public int convertVerticalDLUsToPixels( int dlus ) {
|
||||
return Dialog.convertVerticalDLUsToPixels( fFontMetrics, dlus );
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
|
||||
*/
|
||||
public int convertWidthInCharsToPixels( int chars ) {
|
||||
return Dialog.convertWidthInCharsToPixels( fFontMetrics, chars );
|
||||
}
|
||||
}
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.managedbuilder.xlc.ui.wizards;
|
|||
import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage;
|
||||
import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
|
||||
import org.eclipse.cdt.managedbuilder.xlc.ui.Messages;
|
||||
import org.eclipse.cdt.managedbuilder.xlc.ui.PixelConverter;
|
||||
import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin;
|
||||
import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
|
@ -113,17 +112,9 @@ public class XLCSettingsWizardPage extends MBSCustomPage {
|
|||
fComposite.setLayout(layout);
|
||||
fComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
|
||||
|
||||
// set the layout data for the first column, which contains labels
|
||||
GridData labelGridData = new GridData();
|
||||
PixelConverter pixelConverter= new PixelConverter(parent);
|
||||
|
||||
// create the first label
|
||||
Label label1 = new Label(fComposite, SWT.NONE);
|
||||
label1.setText(Messages.XLCSettingsWizardPage_1);
|
||||
labelGridData.widthHint = pixelConverter.convertWidthInCharsToPixels(label1.getText().length() + 2);
|
||||
label1.setLayoutData(labelGridData);
|
||||
label1.setVisible(true);
|
||||
|
||||
// create the text box for the path
|
||||
|
@ -167,13 +158,11 @@ public class XLCSettingsWizardPage extends MBSCustomPage {
|
|||
// create the second label
|
||||
Label label2 = new Label(fComposite, SWT.NONE);
|
||||
label2.setText(Messages.XLCSettingsWizardPage_3);
|
||||
label2.setLayoutData(labelGridData);
|
||||
|
||||
label2.setVisible(true);
|
||||
|
||||
// create the version dropdown
|
||||
GridData comboData = new GridData();
|
||||
comboData.horizontalSpan = 2;
|
||||
comboData.grabExcessHorizontalSpace = true;
|
||||
comboData.horizontalAlignment = SWT.FILL;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue