CTabItem

Instances of this class represent a selectable user interface object that represent a page in a notebook widget.

<dl> <dt><b>Styles:</b></dt> <dd>SWT.CLOSE</dd> <dt><b>Events:</b></dt> <dd>(none)</dd> </dl> <p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>

@see <a href="http://www.eclipse.org/swt/snippets/#ctabfolder">CTabFolder, CTabItem snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

class CTabItem : Item {
CTabFolder parent;
int x;
int y;
int width;
int height;
Control control;
String toolTipText;
String shortenedText;
int shortenedTextWidth;
Font font;
Image disabledImage;
Rectangle closeRect;
int closeImageState;
bool showClose;
bool showing;
int TOP_MARGIN;
int BOTTOM_MARGIN;
int LEFT_MARGIN;
int RIGHT_MARGIN;
int INTERNAL_SPACING;
int FLAGS;
String ELLIPSIS;
}

Constructors

this
this(CTabFolder parent, int style)

Constructs a new instance of this class given its parent (which must be a <code>CTabFolder</code>) and a style value describing its behavior and appearance. The item is added to the end of the items maintained by its parent. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>

this
this(CTabFolder parent, int style, int index)

Constructs a new instance of this class given its parent (which must be a <code>CTabFolder</code>), a style value describing its behavior and appearance, and the index at which to place it in the items maintained by its parent. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>

Members

Functions

getBounds
Rectangle getBounds()

Returns a rectangle describing the receiver's size and location relative to its parent.

getControl
Control getControl()

Gets the control that is displayed in the content area of the tab item. * @return the control * @exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>

getDisabledImage
Image getDisabledImage()

Get the image displayed in the tab if the tab is disabled.

getFont
Font getFont()

Returns the font that the receiver will use to paint textual information.

getParent
CTabFolder getParent()

Returns the receiver's parent, which must be a <code>CTabFolder</code>.

getShowClose
bool getShowClose()

Returns <code>true</code> to indicate that the receiver's close button should be shown. Otherwise return <code>false</code>. The initial value is defined by the style (SWT.CLOSE) that was used to create the receiver.

getToolTipText
String getToolTipText()

Returns the receiver's tool tip text, or null if it has not been set.

isShowing
bool isShowing()

Returns <code>true</code> if the item will be rendered in the visible area of the CTabFolder. Returns false otherwise. * @return <code>true</code> if the item will be rendered in the visible area of the CTabFolder. Returns false otherwise. * @exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>

setControl
void setControl(Control control)

Sets the control that is used to fill the client area of the tab folder when the user selects the tab item.

setDisabledImage
void setDisabledImage(Image image)

Sets the image that is displayed if the tab item is disabled. Null will clear the image.

setFont
void setFont(Font font)

Sets the font that the receiver will use to paint textual information for this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.

setShowClose
void setShowClose(bool close)

Sets to <code>true</code> to indicate that the receiver's close button should be shown. If the parent (CTabFolder) was created with SWT.CLOSE style, changing this value has no effect.

setToolTipText
void setToolTipText(String string)

Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.

Inherited Members

From Item

getImage
Image getImage()

Returns the receiver's image if it has one, or null if it does not.

getText
String getText()

Returns the receiver's text, which will be an empty string if it has never been set.

setImage
void setImage(Image image)

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.

setText
void setText(String string)

Sets the receiver's text.

Meta