/** * Creates this window's widgetry in a new top-level shell. * <p> * The default implementation of this framework method creates this window's * shell (by calling <code>createShell</code>), and its controls (by * calling <code>createContents</code>), then initializes this window's * shell bounds (by calling <code>initializeBounds</code>). * </p> */ public void create() { shell = createShell(); contents = createContents(shell); //initialize the bounds of the shell to that appropriate for the // contents initializeBounds(); }
/** * Creates this window's widgetry in a new top-level shell. * <p> * The default implementation of this framework method creates this window's * shell (by calling <code>createShell</code>), and its controls (by * calling <code>createContents</code>), then initializes this window's * shell bounds (by calling <code>initializeBounds</code>). * </p> */ public void create() { shell = createShell(); contents = createContents(shell); //initialize the bounds of the shell to that appropriate for the // contents initializeBounds(); }
public void handleEvent( Event event ) { if( TextSizeUtil.isTemporaryResize() ) { temporaryResize = true; } else if( temporaryResize ) { shell.removeListener( SWT.Resize, this ); initializeBounds(); } else { shell.removeListener( SWT.Resize, this ); } } } );
protected void initializeBounds() { Shell shell = getShell(); if (shell != null) { if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) { // make the default button the right-most button Button defaultButton = shell.getDefaultButton(); if (defaultButton != null && isContained(buttonBar, defaultButton)) { defaultButton.moveBelow(null); ((Composite) buttonBar).layout(); } } } super.initializeBounds(); }
/** * {@inheritDoc} * <p> * The implementation in {@link #Dialog} also moves the * {@link Shell#getDefaultButton() default button} in the * {@link #createButtonBar(Composite) button bar} to the right * if that's required by the * {@link Display#getDismissalAlignment() platform convention}. * </p> */ @Override protected void initializeBounds() { Shell shell = getShell(); if (shell != null) { if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) { // make the default button the right-most button Button defaultButton = shell.getDefaultButton(); if (defaultButton != null && isContained(buttonBar, defaultButton)) { defaultButton.moveBelow(null); defaultButton.getParent().layout(); } } } super.initializeBounds(); }
/** * {@inheritDoc} * <p> * The implementation in {@link #Dialog} also moves the * {@link Shell#getDefaultButton() default button} in the * {@link #createButtonBar(Composite) button bar} to the right * if that's required by the * {@link Display#getDismissalAlignment() platform convention}. * </p> */ @Override protected void initializeBounds() { // UI guidelines: // https://developer.gnome.org/hig/stable/dialogs.html.en#primary-buttons // https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/WindowDialogs.html#//apple_ref/doc/uid/20000957-CH43-SW5 // https://msdn.microsoft.com/en-us/library/windows/desktop/dn742499(v=vs.85).aspx#win_dialog_box_image25 Shell shell = getShell(); if (shell != null) { if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) { // make the default button the right-most button Button defaultButton = shell.getDefaultButton(); if (defaultButton != null && isContained(buttonBar, defaultButton)) { defaultButton.moveBelow(null); defaultButton.getParent().layout(); } } } super.initializeBounds(); }
protected void initializeBounds() { super.initializeBounds(); getShell().setBackground(bgColor); getShell().addListener(SWT.MouseDown, this); Rectangle r = GUI.shell.getBounds(); getShell().setLocation(r.x + 160, r.y + 160); getShell().addListener(SWT.Deactivate, this); }