Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ToolBar.computeSize()


                    coolItem.dispose();
                }
            } else {
                // If the toolbar item exists then adjust the size of the cool
                // item
                Point toolBarSize = toolBar.computeSize(SWT.DEFAULT,
                        SWT.DEFAULT);
                // Set the preffered size to the size of the toolbar plus trim
                Point preferredSize = coolItem.computeSize(toolBarSize.x,
                        toolBarSize.y);
                coolItem.setPreferredSize(preferredSize);
View Full Code Here


        Rectangle area = perspectiveCoolBar.getClientArea();
        int rows = rowHeight <= 0 ? 1 : (int) Math.max(1, Math
                .floor(area.height / rowHeight));
        if (rows == 1 || (toolbar.getStyle() & SWT.WRAP) == 0
                || currentLocation == TOP_LEFT) {
            Point p = toolbar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
            coolItem.setSize(coolItem.computeSize(p.x, p.y));
            return;
        }
        Point offset = coolItem.computeSize(0, 0);
        Point wrappedSize = toolbar.computeSize(area.width - offset.x,
View Full Code Here

            Point p = toolbar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
            coolItem.setSize(coolItem.computeSize(p.x, p.y));
            return;
        }
        Point offset = coolItem.computeSize(0, 0);
        Point wrappedSize = toolbar.computeSize(area.width - offset.x,
                SWT.DEFAULT);
        int h = rows * rowHeight;
        int w = wrappedSize.y <= h ? wrappedSize.x : wrappedSize.x + 1;
        coolItem.setSize(coolItem.computeSize(w, h));
    }
View Full Code Here

     */
    public Rectangle getLocationOfNextIcon() {
        ToolBar control = tbm.getControl();

        Rectangle result = control.getBounds();
        Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
        result.height = size.y;
        result.width = size.x;
       
        boolean horizontal = (control.getStyle() & SWT.VERTICAL) == 0;
        if (control.getItemCount() == 0) {
View Full Code Here

     */
    public Rectangle getLocationOfNextIcon() {
        ToolBar control = getToolBar();

        Rectangle result = control.getBounds();
        Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
        result.height = size.y;
        result.width = size.x;
       
        boolean horizontal = Geometry.isHorizontal(getSide());
        if (control.getItemCount() == 0) {
View Full Code Here

        item.setText(LayoutExample.getResourceString("Item", new String[] { "3" }));
        item = new ToolItem(toolBar, 0);
        item.setText(LayoutExample.getResourceString("Item", new String[] { "4" }));
        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));
        coolBar.setSize(coolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        children[i] = coolBar;
      } else if (control.equals("Group")) {
View Full Code Here

    }
    shell.addListener(SWT.Resize, new Listener() {
      @Override
      public void handleEvent(Event e) {
        Rectangle rect = shell.getClientArea();
        Point size = toolBar.computeSize(rect.width, SWT.DEFAULT);
        toolBar.setSize(size);
      }
    });
    Rectangle clientArea = shell.getClientArea();
    toolBar.setLocation(clientArea.x, clientArea.y);
View Full Code Here

                    coolItem.dispose();
                }
            } else {
                // If the toolbar item exists then adjust the size of the cool
                // item
                Point toolBarSize = toolBar.computeSize(SWT.DEFAULT,
                        SWT.DEFAULT);
                // Set the preffered size to the size of the toolbar plus trim
                Point preferredSize = coolItem.computeSize(toolBarSize.x,
                        toolBarSize.y);
                coolItem.setPreferredSize(preferredSize);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.