CoolBar

Instances of this class provide an area for dynamically positioning the items they contain. <p> The item children that may be added to instances of this class must be of type <code>CoolItem</code>. </p><p> Note that although this class is a subclass of <code>Composite</code>, it does not make sense to add <code>Control</code> children to it, or set a layout on it. </p><p> <dl> <dt><b>Styles:</b></dt> <dd>FLAT, HORIZONTAL, VERTICAL</dd> <dt><b>Events:</b></dt> <dd>(none)</dd> </dl> </p><p> Note: Only one of the styles HORIZONTAL and VERTICAL may be specified. </p><p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>

@see <a href="http://www.eclipse.org/swt/snippets/#coolbar">CoolBar snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

class CoolBar : Composite {}

Constructors

this
this(Composite parent, int style)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <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

Aliases

computeSize
alias computeSize = Composite.computeSize
Undocumented in source.
setCursor
alias setCursor = Composite.setCursor
Undocumented in source.

Functions

_setCursor
void _setCursor(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
checkSubclass
void checkSubclass()
Undocumented in source. Be warned that the author may not have intended to support it.
computeSize
Point computeSize(int wHint, int hHint, bool changed)
Undocumented in source. Be warned that the author may not have intended to support it.
createItem
void createItem(CoolItem item, int index)
Undocumented in source. Be warned that the author may not have intended to support it.
destroyItem
void destroyItem(CoolItem item)
Undocumented in source. Be warned that the author may not have intended to support it.
findItem
Point findItem(CoolItem item)
Undocumented in source. Be warned that the author may not have intended to support it.
fixEvent
void fixEvent(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
fixPoint
Point fixPoint(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
fixRectangle
Rectangle fixRectangle(int x, int y, int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
getGrabbedItem
CoolItem getGrabbedItem(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
getItem
CoolItem getItem(int index)

Returns the item that is currently displayed at the given, zero-relative index. Throws an exception if the index is out of range.

getItemCount
int getItemCount()

Returns the number of items contained in the receiver.

getItemOrder
int[] getItemOrder()

Returns an array of zero-relative ints that map the creation order of the receiver's items to the order in which they are currently being displayed. <p> Specifically, the indices of the returned array represent the current visual order of the items, and the contents of the array represent the creation order of the items. </p><p> Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver. </p>

getItemSizes
Point[] getItemSizes()

Returns an array of points whose x and y coordinates describe the widths and heights (respectively) of the items in the receiver in the order in which they are currently being displayed.

getItems
CoolItem[] getItems()

Returns an array of <code>CoolItem</code>s in the order in which they are currently being displayed. <p> Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver. </p>

getLocked
bool getLocked()

Returns whether or not the receiver is 'locked'. When a coolbar is locked, its items cannot be repositioned.

getWidth
int getWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
getWrapIndices
int[] getWrapIndices()

Returns an array of ints that describe the zero-relative indices of any item(s) in the receiver that will begin on a new row. The 0th visible item always begins the first row, therefore it does not count as a wrap index.

indexOf
int indexOf(CoolItem item)

Searches the receiver's items in the order they are currently being displayed, starting at the first item (index 0), until an item is found that is equal to the argument, and returns the index of that item. If no item is found, returns -1.

insertItemIntoRow
void insertItemIntoRow(CoolItem item, int rowIndex, int x_root)

Insert the item into the row. Adjust the x and width values appropriately.

internalRedraw
void internalRedraw(int x, int y, int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
layoutItems
int layoutItems()

Return the height of the bar after it has been properly laid out for the given width.

moveDown
void moveDown(CoolItem item, int x_root)
Undocumented in source. Be warned that the author may not have intended to support it.
moveLeft
void moveLeft(CoolItem item, int pixels)
Undocumented in source. Be warned that the author may not have intended to support it.
moveRight
void moveRight(CoolItem item, int pixels)
Undocumented in source. Be warned that the author may not have intended to support it.
moveUp
void moveUp(CoolItem item, int x_root)
Undocumented in source. Be warned that the author may not have intended to support it.
onDispose
void onDispose(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseDoubleClick
void onMouseDoubleClick(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseDown
void onMouseDown(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseExit
void onMouseExit()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseMove
void onMouseMove(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseUp
void onMouseUp(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
onPaint
void onPaint(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
onResize
void onResize()
Undocumented in source. Be warned that the author may not have intended to support it.
relayout
void relayout()
Undocumented in source. Be warned that the author may not have intended to support it.
removeControl
void removeControl(Control control)
Undocumented in source. Be warned that the author may not have intended to support it.
removeItemFromRow
void removeItemFromRow(CoolItem item, int rowIndex, bool disposed)

Remove the item from the row. Adjust the x and width values appropriately.

setCursor
void setCursor(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
setItemLayout
void setItemLayout(int[] itemOrder, int[] wrapIndices, Point[] sizes)

Sets the receiver's item order, wrap indices, and item sizes all at once. This method is typically used to restore the displayed state of the receiver to a previously stored state. <p> The item order is the order in which the items in the receiver should be displayed, given in terms of the zero-relative ordering of when the items were added. </p><p> The wrap indices are the indices of all item(s) in the receiver that will begin on a new row. The indices are given in the order specified by the item order. The 0th item always begins the first row, therefore it does not count as a wrap index. If wrap indices is null or empty, the items will be placed on one line. </p><p> The sizes are specified in an array of points whose x and y coordinates describe the new widths and heights (respectively) of the receiver's items in the order specified by the item order. </p>

setItemOrder
void setItemOrder(int[] itemOrder)
Undocumented in source. Be warned that the author may not have intended to support it.
setItemSizes
void setItemSizes(Point[] sizes)
Undocumented in source. Be warned that the author may not have intended to support it.
setLocked
void setLocked(bool locked)

Sets whether or not the receiver is 'locked'. When a coolbar is locked, its items cannot be repositioned.

setWrapIndices
void setWrapIndices(int[] indices)

Sets the indices of all item(s) in the receiver that will begin on a new row. The indices are given in the order in which they are currently being displayed. The 0th item always begins the first row, therefore it does not count as a wrap index. If indices is null or empty, the items will be placed on one line.

wrapItems
void wrapItems(int maxWidth)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

checkStyle
int checkStyle(int style)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

CLICK_DISTANCE
int CLICK_DISTANCE;
Undocumented in source.
DEFAULT_COOLBAR_HEIGHT
int DEFAULT_COOLBAR_HEIGHT;
Undocumented in source.
DEFAULT_COOLBAR_WIDTH
int DEFAULT_COOLBAR_WIDTH;
Undocumented in source.
ROW_SPACING
int ROW_SPACING;
cursor
Cursor cursor;
dragCursor
Cursor dragCursor;
Undocumented in source.

Variables

dragging
CoolItem dragging;
Undocumented in source.
hoverCursor
Cursor hoverCursor;
Undocumented in source.
inDispose
bool inDispose;
Undocumented in source.
isLocked
bool isLocked;
itemXOffset
int itemXOffset;
Undocumented in source.
items
CoolItem[][] items;
Undocumented in source.
mouseXOffset
int mouseXOffset;
Undocumented in source.
originalItems
CoolItem[] originalItems;
Undocumented in source.

Inherited Members

From Composite

computeSize
alias computeSize = Scrollable.computeSize
Undocumented in source.
fixStyle
alias fixStyle = Scrollable.fixStyle
Undocumented in source.
forceFocus
alias forceFocus = Scrollable.forceFocus
Undocumented in source.
gtk_button_press_event
alias gtk_button_press_event = Scrollable.gtk_button_press_event
Undocumented in source.
moveAbove
alias moveAbove = Scrollable.moveAbove
Undocumented in source.
moveBelow
alias moveBelow = Scrollable.moveBelow
Undocumented in source.
setBounds
alias setBounds = Scrollable.setBounds
Undocumented in source.
translateMnemonic
alias translateMnemonic = Scrollable.translateMnemonic
Undocumented in source.
translateTraversal
alias translateTraversal = Scrollable.translateTraversal
Undocumented in source.
embeddedHandle
size_t embeddedHandle;
Undocumented in source.
imHandle_
GtkIMContext* imHandle_;
Undocumented in source.
socketHandle
GtkWidget* socketHandle;
Undocumented in source.
layout_
Layout layout_;
Undocumented in source.
tabList
Control[] tabList;
Undocumented in source.
layoutCount
int layoutCount;
backgroundMode
int backgroundMode;
Undocumented in source.
NO_INPUT_METHOD
String NO_INPUT_METHOD;
Undocumented in source.
checkStyle
int checkStyle(int style)
Undocumented in source. Be warned that the author may not have intended to support it.
_getChildren
Control[] _getChildren()
Undocumented in source. Be warned that the author may not have intended to support it.
_getTabList
Control[] _getTabList()
Undocumented in source. Be warned that the author may not have intended to support it.
changed
void changed(Control[] changed)

Clears any data that has been cached by a Layout for all widgets that are in the parent hierarchy of the changed control up to and including the receiver. If an ancestor does not have a layout, it is skipped.

checkBuffered
void checkBuffered()
Undocumented in source. Be warned that the author may not have intended to support it.
checkSubclass
void checkSubclass()
Undocumented in source. Be warned that the author may not have intended to support it.
childStyle
GtkStyle* childStyle()
Undocumented in source. Be warned that the author may not have intended to support it.
computeSize
Point computeSize(int wHint, int hHint, bool changed)
Undocumented in source. Be warned that the author may not have intended to support it.
computeTabList
Control[] computeTabList()
Undocumented in source. Be warned that the author may not have intended to support it.
createHandle
void createHandle(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
createHandle
void createHandle(int index, bool fixed, bool scrolled)
Undocumented in source. Be warned that the author may not have intended to support it.
deregister
void deregister()
Undocumented in source. Be warned that the author may not have intended to support it.
drawBackground
void drawBackground(GC gc, int x, int y, int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
enableWidget
void enableWidget(bool enabled)
Undocumented in source. Be warned that the author may not have intended to support it.
findDeferredControl
Composite findDeferredControl()
Undocumented in source. Be warned that the author may not have intended to support it.
findMenus
Menu[] findMenus(Control control)
Undocumented in source. Be warned that the author may not have intended to support it.
fixChildren
void fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus)
Undocumented in source. Be warned that the author may not have intended to support it.
fixModal
void fixModal(GtkWidget* group, GtkWidget* modalGroup)
Undocumented in source. Be warned that the author may not have intended to support it.
fixStyle
void fixStyle()
Undocumented in source. Be warned that the author may not have intended to support it.
fixTabList
void fixTabList(Control control)
Undocumented in source. Be warned that the author may not have intended to support it.
fixZOrder
void fixZOrder()
Undocumented in source. Be warned that the author may not have intended to support it.
focusHandle
GtkWidget* focusHandle()
Undocumented in source. Be warned that the author may not have intended to support it.
forceFocus
bool forceFocus(GtkWidget* focusHandle)
Undocumented in source. Be warned that the author may not have intended to support it.
getBackgroundMode
int getBackgroundMode()

Returns the receiver's background drawing mode. This will be one of the following constants defined in class <code>SWT</code>: <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>, <code>INHERTIT_FORCE</code>.

getChildren
Control[] getChildren()

Returns a (possibly empty) array containing the receiver's children. Children are returned in the order that they are drawn. The topmost control appears at the beginning of the array. Subsequent controls draw beneath this control and appear later in the array. <p> Note: This is not the actual structure used by the receiver to maintain its list of children, so modifying the array will not affect the receiver. </p>

getChildrenCount
int getChildrenCount()
Undocumented in source. Be warned that the author may not have intended to support it.
getClientArea
Rectangle getClientArea()
Undocumented in source. Be warned that the author may not have intended to support it.
getClientWidth
int getClientWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
getLayout
Layout getLayout()

Returns layout which is associated with the receiver, or null if one has not been set.

getLayoutDeferred
bool getLayoutDeferred()

Returns <code>true</code> if the receiver has deferred the performing of layout, and <code>false</code> otherwise.

getTabList
Control[] getTabList()

Gets the (possibly empty) tabbing order for the control.

gtk_button_press_event
int gtk_button_press_event(GtkWidget* widget, GdkEventButton* event)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_expose_event
int gtk_expose_event(GtkWidget* widget, GdkEventExpose* eventPtr)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_key_press_event
int gtk_key_press_event(GtkWidget* widget, GdkEventKey* event)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_focus
int gtk_focus(GtkWidget* widget, ptrdiff_t directionType)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_focus_in_event
int gtk_focus_in_event(GtkWidget* widget, GdkEventFocus* event)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_focus_out_event
int gtk_focus_out_event(GtkWidget* widget, GdkEventFocus* event)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_map
int gtk_map(GtkWidget* widget)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_realize
int gtk_realize(GtkWidget* widget)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_scroll_child
int gtk_scroll_child(GtkWidget* widget, ptrdiff_t scrollType, ptrdiff_t horizontal)
Undocumented in source. Be warned that the author may not have intended to support it.
gtk_style_set
int gtk_style_set(GtkWidget* widget, ptrdiff_t previousStyle)
Undocumented in source. Be warned that the author may not have intended to support it.
hasBorder
bool hasBorder()
Undocumented in source. Be warned that the author may not have intended to support it.
hookEvents
void hookEvents()
Undocumented in source. Be warned that the author may not have intended to support it.
hooksKeys
bool hooksKeys()
Undocumented in source. Be warned that the author may not have intended to support it.
imHandle
GtkIMContext* imHandle()
Undocumented in source. Be warned that the author may not have intended to support it.
isLayoutDeferred
bool isLayoutDeferred()

Returns <code>true</code> if the receiver or any ancestor up to and including the receiver's nearest ancestor shell has deferred the performing of layouts. Otherwise, <code>false</code> is returned.

isTabGroup
bool isTabGroup()
Undocumented in source. Be warned that the author may not have intended to support it.
layout
void layout()

If the receiver has a layout, asks the layout to <em>lay out</em> (that is, set the size and location of) the receiver's children. If the receiver does not have a layout, do nothing. <p> This is equivalent to calling <code>layout(true)</code>. </p> <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

layout
void layout(bool changed)

If the receiver has a layout, asks the layout to <em>lay out</em> (that is, set the size and location of) the receiver's children. If the argument is <code>true</code> the layout must not rely on any information it has cached about the immediate children. If it is <code>false</code> the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the receiver does not have a layout, do nothing. <p> If a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. The layout will cascade down through all child widgets in the receiver's widget tree until a child is encountered that does not resize. Note that a layout due to a resize will not flush any cached information (same as <code>layout(false)</code>). </p> <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

layout
void layout(bool changed, bool all)

If the receiver has a layout, asks the layout to <em>lay out</em> (that is, set the size and location of) the receiver's children. If the changed argument is <code>true</code> the layout must not rely on any information it has cached about its children. If it is <code>false</code> the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the all argument is <code>true</code> the layout will cascade down through all child widgets in the receiver's widget tree, regardless of whether the child has changed size. The changed argument is applied to all layouts. If the all argument is <code>false</code>, the layout will <em>not</em> cascade down through all child widgets in the receiver's widget tree. However, if a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. Note that a layout due to a resize will not flush any cached information (same as <code>layout(false)</code>). </p> <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

layout
void layout(Control[] changed)

Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver. The layouts in the hierarchy must not rely on any information cached about the changed control or any of its ancestors. The layout may (potentially) optimize the work it is doing by assuming that none of the peers of the changed control have changed state since the last layout. If an ancestor does not have a layout, skip it. <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

markLayout
void markLayout(bool changed, bool all)
Undocumented in source. Be warned that the author may not have intended to support it.
moveAbove
void moveAbove(GtkWidget* child, GtkWidget* sibling)
Undocumented in source. Be warned that the author may not have intended to support it.
moveBelow
alias moveBelow = Scrollable.moveBelow
Undocumented in source.
moveBelow
void moveBelow(GtkWidget* child, GtkWidget* sibling)
Undocumented in source. Be warned that the author may not have intended to support it.
moveChildren
void moveChildren(int oldWidth)
Undocumented in source. Be warned that the author may not have intended to support it.
minimumSize
Point minimumSize(int wHint, int hHint, bool changed)
Undocumented in source. Be warned that the author may not have intended to support it.
parentingHandle
GtkWidget* parentingHandle()
Undocumented in source. Be warned that the author may not have intended to support it.
printWidget
void printWidget(GC gc, GdkDrawable* drawable, int depth, int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
redrawChildren
void redrawChildren()
Undocumented in source. Be warned that the author may not have intended to support it.
register
void register()
Undocumented in source. Be warned that the author may not have intended to support it.
releaseChildren
void releaseChildren(bool destroy)
Undocumented in source. Be warned that the author may not have intended to support it.
releaseHandle
void releaseHandle()
Undocumented in source. Be warned that the author may not have intended to support it.
releaseWidget
void releaseWidget()
Undocumented in source. Be warned that the author may not have intended to support it.
removeControl
void removeControl(Control control)
Undocumented in source. Be warned that the author may not have intended to support it.
resizeHandle
void resizeHandle(int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
setBackgroundMode
void setBackgroundMode(int mode)

Sets the background drawing mode to the argument which should be one of the following constants defined in class <code>SWT</code>: <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>, <code>INHERIT_FORCE</code>.

setBounds
int setBounds(int x, int y, int width, int height, bool move, bool resize)
Undocumented in source. Be warned that the author may not have intended to support it.
setFocus
bool setFocus()
Undocumented in source. Be warned that the author may not have intended to support it.
setLayout
void setLayout(Layout layout)

Sets the layout which is associated with the receiver to be the argument which may be null.

setLayoutDeferred
void setLayoutDeferred(bool defer)

If the argument is <code>true</code>, causes subsequent layout operations in the receiver or any of its children to be ignored. No layout of any kind can occur in the receiver or any of its children until the flag is set to false. Layout operations that occurred while the flag was <code>true</code> are remembered and when the flag is set to <code>false</code>, the layout operations are performed in an optimized manner. Nested calls to this method are stacked.

setScrollBarVisible
bool setScrollBarVisible(ScrollBar bar, bool visible)
Undocumented in source. Be warned that the author may not have intended to support it.
setTabGroupFocus
bool setTabGroupFocus(bool next)
Undocumented in source. Be warned that the author may not have intended to support it.
setTabItemFocus
bool setTabItemFocus(bool next)
Undocumented in source. Be warned that the author may not have intended to support it.
setTabList
void setTabList(Control[] tabList)

Sets the tabbing order for the specified controls to match the order that they occur in the argument list.

showWidget
void showWidget()
Undocumented in source. Be warned that the author may not have intended to support it.
translateMnemonic
bool translateMnemonic(Event event, Control control)
Undocumented in source. Be warned that the author may not have intended to support it.
traversalCode
int traversalCode(int key, GdkEventKey* event)
Undocumented in source. Be warned that the author may not have intended to support it.
translateTraversal
bool translateTraversal(GdkEventKey* keyEvent)
Undocumented in source. Be warned that the author may not have intended to support it.
updateBackgroundMode
void updateBackgroundMode()
Undocumented in source. Be warned that the author may not have intended to support it.
updateLayout
void updateLayout(bool all)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta