Component | +--Control | +--TabStrippublic class TabStrip
A control for creating tabbed dialogs or tabbed toolbar/taskbar type windows. This control provides one or more rows of tabs that the user can select, one at a time. After each selection, a notification is provided that allows for the changing of the UI. Two basic UI modes that are supported are the traditional tabs seen in property page scenarios and a button-style tab, as in the taskbar found in Windows 95 and Windows NT version 4.0.
Constructors
Name | Description |
---|---|
TabStrip() | Creates a TabStrip control. |
Methods
Name | Description |
---|---|
addOnDrawItem(DrawItemEventHandler value) | Adds an event handler for the OnDrawItem event notification. |
addOnSelectionChange(EventHandler value) | Adds an event handler for the OnSelectionChange event notification. |
addTab(Object item) | Adds a tab to the TabStrip. |
createHandle() | Topic under construction. |
getDisplayRect() | Returns the rectangle that represents the area of the tab control not taken up by the tabs, borders, or anything else owned by the tab. |
getDrawStyle() | Indicates whether the individual tabs are painted by Windows or by the end user. |
getItemSize() | Topic under construction. |
getMultiline() | Indicates whether there can be more than one row of tabs. |
getPadding() | Retrieves the amount of padding around the items in the individual tabs. |
getRowCount() | Retrieves the number of rows currently being displayed in the TabStrip. |
getSelectedIndex() | Retrieves the index of the currently selected tab in the strip, if there is one. |
getSizeMode() | Retrieves the size mode. |
getTabCount() | Retrieves the number of tabs in the strip. |
getTabRect(int index) | Retrieves the bounding rectangle for the given tab in the TabStrip. |
getTabs() | Retrieves an Object array containing all the items in the TabStrip. |
getTabStyle() | Indicates whether the tabs in the TabStrip look like regular tabs as seen in property sheet applications, or if they look like butttons, as seen in the Windows 95 taskbar. |
getTabText(int index) | Retrieves the text for the given tab. |
insertTab(int index, Object item) | Adds a tab to the TabStrip, but in a location you specify, as opposed to the end of the list. |
recreateHandle() | Ovveride this to guarantee that the tabs are re-created when appropriate. |
removeAll() | Removes all tabs from the TabStrip. |
removeOnDrawItem(DrawItemEventHandler value) | Removes the given handler for the OnDrawItem event. |
removeOnSelectionChange(EventHandler value) | Removes the given handler for the OnSelectionChange event. |
removeTab(int index) | Removes the tab at the given index of the TabStrip. |
setDisplayRectSize(int width, int height) | Sets the size of the tabstrip based on a desired size for the display rectangle. |
setDisplayRectSize(Point p) | Sets the size of the tabstrip based on a desired size for the display rectangle. |
setDrawStyle(int value) | Indicates whether the individual tabs are painted by Windows or by the end user. |
setItemSize(Point size) | Topic under construction. |
setMultiline(boolean value) | Indicates whether there can be more than one row of tabs. |
setPadding(Point value) | Sets the amount of padding around the items in the individual tabs. |
setSelectedIndex(int index) | Sets the tab at the supplied index as being the selected tab in the strip. |
setSizeMode(int value) | Sets the size mode. |
setTabs(Object[] value) | Sets all the tabs in the TabStrip at once by passing in an array with all their values. |
setTabStyle(int value) | Indicates whether the tabs in the TabStrip look like regular tabs as seen in property sheet applications, or if they look like butttons, as seen in the Windows 95 taskbar. |
setTabText(int index, String value) | Sets the text for the given tab. |
Creates a TabStrip control.
Adds an event handler for the OnDrawItem event notification. This event is called for list boxes whose listStyle property is set to DrawStyle.OwnerDrawFixed and contains a Graphics object in which the item should be painted. Duplicates adds are not filtered out.
Adds an event handler for the OnSelectionChange event notification. This event is sent whenever a new tab is selected. Duplicates are not filtered out.
Returns the index of where the item was inserted.
Adds a tab to the TabStrip. The code that adds the item calls toString() on it and inserts that value into the tab caption.
Topic under construction.
createHandle() in Control.
Returns the rectangle with the display area of the TabStrip.
Returns the rectangle that represents the area of the tab control not taken up by the tabs, borders, or anything else owned by the tab. This is typically the rectangle you want to use to place the individual children of the tab control.
Returns one of the following integer values:
Indicates whether the individual tabs are painted by Windows or by the end user. If the latter, an OnDrawItem event is fired whenever an item needs to be painted. All items must still be the same height.
Topic under construction.
Returns a boolean value indicating whether multiple rows are allowed.
Indicates whether there can be more than one row of tabs. By default (when this property is false), if there are more tabs than available display space, arrows are shown to let the user navigate between the extra tabs, but only one row is shown. If this property is set to true, then Windows spills extra tabs over onto second rows.
Returns a point whose width contains the horizontal padding and whose height contains the vertical padding.
Retrieves the amount of padding around the items in the individual tabs.
Returns the count of rows currently being used.
Retrieves the number of rows currently being displayed in the TabStrip. This is most commonly used when the Multline property is true and you want to know how many rows are being used to display the tabs.
Returns the currently selected tab.
Retrieves the index of the currently selected tab in the strip, if there is one. If the value is -1, there is currently no selection. If the value is 0 or greater, the value is the index of the currently selected tab.
Returns one of the following integer values:
Retrieves the size mode. By default, tabs are big enough to display their text, and any space on the right of the strip is left as such. However, you can also set it so that the tabs are stretched to fill out the right extent of the strip, if necessary, or you can set it so that all tabs have the same width.
Returns the number of valid tabs.
Retrieves the number of tabs in the strip.
Returns the rectangle that identifies the bounds for the tab.
Retrieves the bounding rectangle for the given tab in the TabStrip.
Returns an array of items in the TabStrip. The first item is the 0th element, and the last item in the TabStrip is last in the array.
Retrieves an Object array containing all the items in the TabStrip.
Returns one of the following integer values:
Indicates whether the tabs in the TabStrip look like regular tabs as seen in property sheet applications, or if they look like butttons, as seen in the Windows 95 taskbar.
Returns the text of the tab.
Retrieves the text for the given tab.
Adds a tab to the TabStrip, but in a location you specify, as opposed to the end of the list.
Ovveride this to guarantee that the tabs are re-created when appropriate.
Removes all tabs from the TabStrip. All values and data are discarded.
Removes the given handler for the OnDrawItem event. If there are duplicate entries, all handlers are removed.
Removes the given handler for the OnSelectionChange event. If there are duplicate entries, all handlers are removed.
Removes the tab at the given index of the TabStrip. The tab and its data are discarded.
Sets the size of the tabstrip based on a desired size for the display rectangle. Note that this is only guaranteed to be valid until tabs are added or removed. After that, the display size can change when the number of visible rows changes. [Note: zero tabs == zero rows]
Sets the size of the tabstrip based on a desired size for the display rectangle. Note that this is guaranteed to be valid only until tabs are added or removed. After that, the display size can change when the number of visible rows changes. [Note: zero tabs == zero rows]
Indicates whether the individual tabs are painted by Windows or by the end user. If the latter, an OnDrawItem event is fired whenever an item needs to be painted. All items must still be the same height.
Topic under construction.
Indicates whether there can be more than one row of tabs. By default (when this property is false), if there are more tabs than available display space, arrows are shown to let the user navigate between the extra tabs, but only one row is shown. If this property is set to true, then Windows spills extra tabs over onto second rows.
Sets the amount of padding around the items in the individual tabs. You can specify both horizontal and vertical padding.
Sets the tab at the supplied index as being the selected tab in the strip.
Sets the size mode. By default, tabs are big enough to display their text, and any space on the right of the strip is left as such. However, you can also set it so that the tabs are stretched to fill out the right extent of the strip, if necessary, or you can set it so that all tabs have the same width.
Sets all the tabs in the TabStrip at once by passing in an array with all their values. All old values in the TabStrip are discarded and lost.
Indicates whether the tabs in the TabStrip look like regular tabs as seen in property sheet applications, or if they look like butttons, as seen in the Windows 95 taskbar.
Sets the text for the given tab.