CCombo was written to work around certain limitations in the native combo box. Specifically, on win32, the height of a CCombo can be set; attempts to set the height of a Combo are ignored. CCombo can be used anywhere that having the increased flexibility is more important than getting native L&F, but the decision should not be taken lightly. There is no strict requirement that CCombo look or behave the same as the native combo box.
Note that although this class is a subclass of Composite,
it does not make sense to add children to it, or set a layout on it.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Shell | |
| pack-priv Button | |
| pack-priv Color | |
| pack-priv Listener | |
| pack-priv Font | |
| pack-priv Color | |
| pack-priv boolean | |
| pack-priv List | |
| pack-priv Listener | |
| pack-priv static final String | |
| pack-priv Shell | |
| pack-priv Text | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv char | |
| public void | |
| public void | |
| public void | addModifyListener(ModifyListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will
be notified when the receiver's text is modified, by sending
it one of the messages defined in the |
| public void | addSelectionListener(SelectionListener
the listener which should be notified when the user changes the receiver's selection listener)Adds the listener to the collection of listeners who will
be notified when the user changes the receiver's selection, by sending
it one of the messages defined in the |
| public void | addVerifyListener(VerifyListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will
be notified when the receiver's text is verified, by sending
it one of the messages defined in the |
| pack-priv void | |
| pack-priv static int | |
| protected void | checkSubclass()
Checks that this class can be subclassed.
|
| public void | clearSelection()
Sets the selection in the receiver's text field to an empty selection starting just before the first character. |
| pack-priv void | |
| public Point | computeSize(int
the width hint (can be wHint, int SWT.DEFAULT)the height hint (can be hHint, boolean SWT.DEFAULT)true if the control's contents have changed, and false otherwiseOverrides org. |
| public void | |
| pack-priv void | |
| pack-priv void | |
| public void | |
| public void | deselect(int
the index of the item to deselect index)Deselects the item at the given zero-relative index in the receiver's list. |
| public void | |
| pack-priv void | |
| public int | |
| pack-priv String | |
| public Control[] | getChildren()
Returns a (possibly empty) array containing the receiver's children.
|
| public boolean | |
| public String | Returns: the item at the given indexthe index of the item to return index)Returns the item at the given, zero-relative index in the receiver's list. |
| public int | Returns: the number of itemsReturns the number of items contained in the receiver's list. |
| public int | Returns: the height of one itemReturns the height of the area which would be used to display one of the items in the receiver's list. |
| public String[] | Returns: the items in the receiver's listReturns an array of |
| public boolean | Returns: the receiver's list's visibility stateReturns |
| public Menu | getMenu()
Overrides org. |
| public Point | Returns: a point representing the selection start and endReturns a |
| public int | Returns: the index of the selected itemReturns the zero-relative index of the item which is currently selected in the receiver's list, or -1 if no item is selected. |
| public Shell | |
| public int | getStyle()
Overrides org. |
| public String | Returns: the receiver's textReturns a string containing a copy of the contents of the receiver's text field. |
| public int | |
| public int | Returns: the text limitReturns the maximum number of characters that the receiver's text field is capable of holding. |
| public int | Returns: the number of items that are visibleGets the number of items that are visible in the drop down portion of the receiver's list. |
| pack-priv void | |
| pack-priv void | |
| public int | |
| public int | |
| pack-priv void | |
| pack-priv void | |
| pack-priv boolean | |
| public boolean | isFocusControl()
Overrides org. true if the receiver has the user-interface
focus, and false otherwise.
|
| pack-priv boolean | |
| pack-priv void | |
| public void | |
| pack-priv void | |
| public void | redraw()
Overrides org. |
| public void | redraw(int
the x coordinate of the area to draw x, int the y coordinate of the area to draw y, int the width of the area to draw width, int the height of the area to draw height, boolean true if children should redraw, and false otherwiseOverrides org. |
| public void | remove(int
the index for the item index)Removes the item from the receiver's list at the given zero-relative index. |
| public void | remove(int
the start of the range start, int the end of the range end)Removes the items from the receiver's list which are between the given zero-relative start and end indices (inclusive). |
| public void | |
| public void | removeAll()
Removes all of the items from the receiver's list and clear the contents of receiver's text field. |
| public void | removeModifyListener(ModifyListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the receiver's text is modified. |
| public void | removeSelectionListener(SelectionListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection. |
| public void | removeVerifyListener(VerifyListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the control is verified. |
| public void | select(int
the index of the item to select index)Selects the item at the given zero-relative index in the receiver's list. |
| public void | setAlignment(int
the alignment style of LEFT, RIGHT or CENTER align)Set the horizontal alignment of the CCombo. |
| public void | setBackground(Color
the new color (or null) color)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
| public void | |
| public void | setEnabled(boolean
the new enabled state enabled)Overrides org. true,
and disables it otherwise.
|
| public boolean | setFocus()
Overrides org. |
| public void | setFont(Font
the new font (or null) font)Overrides org. |
| public void | setForeground(Color
the new color (or null) color)
Sets the receiver's foreground color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
| public void | |
| public void | |
| public void | setLayout(Layout
the receiver's new layout or null layout)Overrides org. |
| public void | setListVisible(boolean
the new visibility state visible)Marks the receiver's list as visible if the argument is |
| public void | setMenu(Menu
the new pop up menu menu)Overrides org. |
| public void | setSelection(Point
a point representing the new selection start and end selection)Sets the selection in the receiver's text field to the range specified by the argument whose x coordinate is the start of the selection and whose y coordinate is the end of the selection. |
| public void | |
| public void | setTextLimit(int
new text limit limit)Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument. |
| public void | setToolTipText(String
the new tool tip text (or null) string)
Sets the receiver's tool tip text to the argument, which
may be null indicating that the default tool tip for the
control will be shown.
|
| public void | setVisible(boolean
the new visibility state visible)Overrides org. true,
and marks it invisible otherwise.
|
| public void | setVisibleItemCount(int
the new number of items to be visible count)Sets the number of items that are visible in the drop down portion of the receiver's list. |
| pack-priv String | |
| pack-priv void | |
| public boolean | traverse(int
the type of traversal event)Overrides org. |