/** * Return the width of this element. * * @return the width of this element */ public int getWidth() { return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; }
/** * Return the width of this element. * * @return the width of this element */ public int getWidth() { return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; }
/** * Return the width of this element. * * @return the width of this element */ public int getWidth() { return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; }
public Point computeSize (int wHint, int hHint, boolean changed) { Point size = super.computeSize (wHint, hHint, changed); if (toolBar != null) { if (wHint == SWT.DEFAULT && toolBar.itemCount > 0) { Point tbSize = toolBar.computeSize (SWT.DEFAULT, SWT.DEFAULT); size.x = Math.max (tbSize.x, size.x); } } return size; }
public ProfilePreferenceTree(Composite parentComposite) { super(parentComposite, FormatterMessages.ModifyDialog_filter_label, FormatterMessages.ModifyDialog_filter_hint); // calculate rigth margin width ToolBar modifyAllToolbar= ModifyAll.createToolItem(parentComposite, fImages).getParent(); fRightMargin= modifyAllToolbar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x - 12; modifyAllToolbar.dispose(); }
@Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean changed) { boolean vertical = (getOrientation() & SWT.VERTICAL) != 0; int marginWidth = vertical | isPlain() ? 1 : simple ? 3 : 7; int marginHeight = !vertical | isPlain() ? 1 : simple ? 3 : 7; int width = 0; int height = 0; Point tsize = toolBarManager.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, changed); if (vertical) { width = tsize.x; height = tsize.y; } else { height = tsize.y; width = tsize.x; } if (vertical) { width += marginWidth; height += marginHeight + marginHeight; } else { width += marginWidth + marginWidth; height += marginHeight; } return new Point(width, height); }
void calculateChevronTrim() { ToolBar tb = new ToolBar( parent, SWT.FLAT ); ToolItem ti = new ToolItem( tb, SWT.PUSH ); // Image image = new Image (display, 1, 1); // ti.setImage (image); Point size = tb.computeSize( SWT.DEFAULT, SWT.DEFAULT ); size = parent.fixPoint( size.x, size.y ); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose(); ti.dispose(); // image.dispose (); }
private int computeDefaultTrimHeight() { int result; Shell shell = new Shell( getDisplay(), SWT.NONE ); try { ToolBar toolBar = new ToolBar( shell, SWT.NONE ); ToolItem toolItem = new ToolItem( toolBar, SWT.PUSH ); toolItem.setImage( JFaceResources.getImageRegistry().get( Dialog.DLG_IMG_MESSAGE_INFO ) ); int toolItemHeight = toolBar.computeSize( SWT.DEFAULT, SWT.DEFAULT ).y; result = Math.max( toolItemHeight, measureText( "Wg" ).y ); } finally { shell.dispose(); } return result; }
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
@Override protected void layout(Composite composite, boolean changed) { boolean vertical = (getOrientation() & SWT.VERTICAL) != 0; int marginWidth = vertical | isPlain() ? 1 : simple ? 4 : 7; int marginHeight = !vertical | isPlain() ? 1 : simple ? 4 : 7; Point tsize = toolBarManager.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, changed); Rectangle carea = composite.getClientArea(); int x = carea.x + (getLocation() == SideValue.LEFT ? 0 : marginWidth); int y = carea.y + marginHeight; if (vertical) { toolBarManager.getControl().setBounds(x, y, carea.width - marginWidth, tsize.y); } else { toolBarManager.getControl().setBounds(x, y, tsize.x, carea.height - marginHeight); } } }
tabAreaWidth -= chevron.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; chevron.setVisible(true);
tabAreaWidth -= chevron.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; chevron.setVisible(true);
tabAreaWidth -= chevron.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; chevron.setVisible(true);
CoolItem coolItem2 = new CoolItem (coolBar, 0); coolItem2.setControl (toolBar); Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); coolItem1.setSize(coolItem1.computeSize (size.x, size.y)); coolItem2.setSize(coolItem2.computeSize (size.x, size.y));
Point toolBarSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Point toolBarSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Point toolBarSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);