Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 327513
Collapse All | Expand All

(-)src/org/eclipse/swt/widgets/TabFolder.java (-2 / +20 lines)
Lines 47-55 Link Here
47
public class TabFolder extends Composite {
47
public class TabFolder extends Composite {
48
48
49
  private static final TabItem[] EMPTY_TAB_ITEMS = new TabItem[ 0 ];
49
  private static final TabItem[] EMPTY_TAB_ITEMS = new TabItem[ 0 ];
50
  private static final int TAB_BAR_HEIGHT = 23;
50
51
51
  private final ItemHolder itemHolder = new ItemHolder( TabItem.class );
52
  private final ItemHolder itemHolder = new ItemHolder( TabItem.class );
52
  private int selectionIndex = -1;
53
  private int selectionIndex = -1;
54
  private boolean onBottom;
53
55
54
  /**
56
  /**
55
   * Constructs a new instance of this class given its parent
57
   * Constructs a new instance of this class given its parent
Lines 81-86 Link Here
81
   */
83
   */
82
  public TabFolder( final Composite parent, final int style ) {
84
  public TabFolder( final Composite parent, final int style ) {
83
    super( parent, checkStyle( style ) );
85
    super( parent, checkStyle( style ) );
86
    onBottom = ( super.getStyle() & SWT.BOTTOM ) != 0;
84
  }
87
  }
85
88
86
  void initState() {
89
  void initState() {
Lines 385-395 Link Here
385
    int width = bounds.width;
388
    int width = bounds.width;
386
    int height = bounds.height;
389
    int height = bounds.height;
387
    int border = 1;
390
    int border = 1;
388
    int hTabBar = 23;
391
    int hTabBar = onBottom ? 0 : TAB_BAR_HEIGHT;
389
    return new Rectangle( border,
392
    return new Rectangle( border,
390
                          hTabBar + border,
393
                          hTabBar + border,
391
                          width - border * 2,
394
                          width - border * 2,
392
                          height - ( hTabBar + border * 2 ) );
395
                          height - ( TAB_BAR_HEIGHT + border * 2 ) );
396
  }
397
398
  public Rectangle computeTrim( final int x,
399
                                final int y,
400
                                final int width,
401
                                final int height )
402
  {
403
    checkWidget();
404
    int border = 1;
405
    int hTabBar = onBottom ? 0 : TAB_BAR_HEIGHT;
406
    int trimX = x - border;
407
    int trimWidth = width + 2 * border;
408
    int trimY = y - border - hTabBar;
409
    int trimHeight = height + 2 * border + TAB_BAR_HEIGHT;
410
    return new Rectangle( trimX, trimY, trimWidth, trimHeight );
393
  }
411
  }
394
412
395
  public Point computeSize( final int wHint,
413
  public Point computeSize( final int wHint,
(-)src/org/eclipse/swt/internal/widgets/tabfolderkit/TabFolderLCA.java (-4 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2002, 2008 Innoopract Informationssysteme GmbH.
2
 * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Innoopract Informationssysteme GmbH - initial API and implementation
9
 *     Innoopract Informationssysteme GmbH - initial API and implementation
10
 *     EclipseSource - ongoing development
10
 ******************************************************************************/
11
 ******************************************************************************/
11
12
12
package org.eclipse.swt.internal.widgets.tabfolderkit;
13
package org.eclipse.swt.internal.widgets.tabfolderkit;
Lines 40-46 Link Here
40
    writer.set( "hideFocus", true );
41
    writer.set( "hideFocus", true );
41
    if( ( tabFolder.getStyle() & SWT.BOTTOM ) != 0 ) {
42
    if( ( tabFolder.getStyle() & SWT.BOTTOM ) != 0 ) {
42
      writer.set( "placeBarOnTop", false );
43
      writer.set( "placeBarOnTop", false );
43
    }    
44
    }
44
    ControlLCAUtil.writeStyleFlags( tabFolder );
45
    ControlLCAUtil.writeStyleFlags( tabFolder );
45
    writer.addListener( "keypress",
46
    writer.addListener( "keypress",
46
                        "org.eclipse.swt.TabUtil.onTabFolderKeyPress" );
47
                        "org.eclipse.swt.TabUtil.onTabFolderKeyPress" );
Lines 61-70 Link Here
61
  public Rectangle adjustCoordinates( final Widget widget,
62
  public Rectangle adjustCoordinates( final Widget widget,
62
                                      final Rectangle newBounds )
63
                                      final Rectangle newBounds )
63
  {
64
  {
65
    Control control = ( Control )widget;
66
    TabFolder tabFolder = ( TabFolder )control.getParent();
67
    boolean onBottom = ( tabFolder.getStyle() & SWT.BOTTOM ) != 0;
64
    int border = 1;
68
    int border = 1;
65
    int hTabBar = 23;
69
    int hTabBar = onBottom ? 0 : 23;
66
    return new Rectangle( newBounds.x - border - 10,
70
    return new Rectangle( newBounds.x - border - 10,
67
                          newBounds.y - hTabBar - border -10,
71
                          newBounds.y - hTabBar - border - 10,
68
                          newBounds.width,
72
                          newBounds.width,
69
                          newBounds.height );
73
                          newBounds.height );
70
  }
74
  }

Return to bug 327513