|
NXWidgets
1.19
|
#include <clistbox.hxx>

Public Member Functions | |
| CListBox (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, CWidgetStyle *style=(CWidgetStyle *) NULL) | |
| virtual | ~CListBox (void) |
| virtual void | addOption (const CNxString &text, const uint32_t value) |
| virtual void | addOption (CListBoxDataItem *option) |
| virtual void | removeOption (const int index) |
| virtual void | removeAllOptions (void) |
| virtual void | addOption (const CNxString &text, const uint32_t value, const nxwidget_pixel_t normalTextColor, const nxwidget_pixel_t normalBackColor, const nxwidget_pixel_t selectedTextColor, const nxwidget_pixel_t selectedBackColor) |
| virtual void | selectOption (const int index) |
| virtual void | deselectOption (const int index) |
| virtual void | selectAllOptions (void) |
| virtual void | deselectAllOptions (void) |
| virtual const int | getSelectedIndex (void) const |
| virtual void | setSelectedIndex (const int index) |
| virtual const CListBoxDataItem * | getSelectedOption (void) const |
| virtual void | setAllowMultipleSelections (const bool allowMultipleSelections) |
| virtual const bool | allowsMultipleSelections (void) const |
| virtual void | resizeCanvas (void) |
| virtual const CListBoxDataItem * | getOption (const int index) |
| virtual void | sort (void) |
| virtual const int | getOptionCount (void) const |
| virtual const nxgl_coord_t | getOptionHeight (void) const |
| virtual void | setSortInsertedItems (const bool sortInsertedItems) |
| virtual void | handleListDataChangedEvent (const CListDataEventArgs &e) |
| virtual void | handleListDataSelectionChangedEvent (const CListDataEventArgs &e) |
| virtual void | getPreferredDimensions (CRect &rect) const |
| virtual bool | isDoubleClick (nxgl_coord_t x, nxgl_coord_t y) |
Public Member Functions inherited from NXWidgets::IListBox | |
| virtual | ~IListBox (void) |
Public Member Functions inherited from NXWidgets::CScrollingPanel | |
| CScrollingPanel (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, CWidgetStyle *style=(CWidgetStyle *) NULL) | |
| virtual void | scroll (int32_t dx, int32_t dy) |
| virtual void | jump (int32_t x, int32_t y) |
| bool | allowsVerticalScroll (void) const |
| bool | allowsHorizontalScroll (void) const |
| virtual const int32_t | getCanvasX (void) const |
| virtual const int32_t | getCanvasY (void) const |
| virtual const int32_t | getCanvasWidth (void) const |
| virtual const int32_t | getCanvasHeight (void) const |
| void | setAllowsVerticalScroll (bool allow) |
| void | setAllowsHorizontalScroll (bool allow) |
| void | setContentScrolled (bool scrolled) |
| bool | IsContentScrolled (void) |
| virtual void | setCanvasWidth (const int32_t width) |
| virtual void | setCanvasHeight (const int32_t height) |
Public Member Functions inherited from NXWidgets::CNxWidget | |
| CNxWidget (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, FAR const CWidgetStyle *style=(FAR const CWidgetStyle *) NULL) | |
| virtual | ~CNxWidget (void) |
| nxgl_coord_t | getX (void) const |
| nxgl_coord_t | getY (void) const |
| nxgl_coord_t | getRelativeX (void) const |
| nxgl_coord_t | getRelativeY (void) const |
| bool | hasFocus (void) const |
| bool | isDeleted (void) const |
| bool | isDrawingEnabled (void) const |
| bool | isHidden (void) const |
| bool | isEnabled (void) const |
| bool | isPermeable (void) const |
| bool | isDoubleClickable (void) const |
| bool | isBorderless (void) const |
| bool | isClicked (void) const |
| bool | isBeingDragged (void) const |
| nxgl_coord_t | getWidth (void) const |
| nxgl_coord_t | getHeight (void) const |
| void | getSize (struct nxgl_size_s &size) const |
| void | getPos (struct nxgl_point_s &pos) const |
| CRect | getBoundingBox (void) |
| void | getBorderSize (WidgetBorderSize &borderSize) |
| CNxWidget * | getParent (void) const |
| CNxWidget * | getFocusedWidget (void) |
| void | getClientRect (CRect &rect) const |
| void | getRect (CRect &rect) const |
| CNxFont * | getFont (void) const |
| nxgl_mxpixel_t | getBackgroundColor (void) const |
| nxgl_mxpixel_t | getSelectedBackgroundColor (void) const |
| nxgl_mxpixel_t | getShineEdgeColor (void) const |
| nxgl_mxpixel_t | getShadowEdgeColor (void) const |
| nxgl_mxpixel_t | getHighlightColor (void) const |
| nxgl_mxpixel_t | getDisabledTextColor (void) const |
| nxgl_mxpixel_t | getEnabledTextColor (void) const |
| nxgl_mxpixel_t | getSelectedTextColor (void) const |
| const CWidgetStyle * | getWidgetStyle () const |
| void | setBorderless (bool isBorderless) |
| void | setDraggable (bool isDraggable) |
| void | setPermeable (bool permeable) |
| void | setDoubleClickable (bool doubleClickable) |
| void | addWidgetEventHandler (CWidgetEventHandler *eventHandler) |
| void | removeWidgetEventHandler (CWidgetEventHandler *eventHandler) |
| int | nWidgetEventHandlers (void) const |
| void | setRaisesEvents (bool raises) |
| bool | raisesEvents (void) const |
| void | disableDrawing (void) |
| void | enableDrawing (void) |
| void | setBackgroundColor (nxgl_mxpixel_t color) |
| void | setSelectedBackgroundColor (nxgl_mxpixel_t color) |
| void | setShineEdgeColor (nxgl_mxpixel_t color) |
| void | setShadowEdgeColor (nxgl_mxpixel_t color) |
| void | setHighlightColor (nxgl_mxpixel_t color) |
| void | setDisabledTextColor (nxgl_mxpixel_t color) |
| void | setEnabledTextColor (nxgl_mxpixel_t color) |
| void | setSelectedTextColor (nxgl_mxpixel_t color) |
| virtual void | setFont (CNxFont *font) |
| void | redraw (void) |
| bool | enable (void) |
| bool | disable (void) |
| void | close (void) |
| bool | show (void) |
| bool | hide (void) |
| virtual bool | click (nxgl_coord_t x, nxgl_coord_t y) |
| bool | doubleClick (nxgl_coord_t x, nxgl_coord_t y) |
| bool | release (nxgl_coord_t x, nxgl_coord_t y) |
| bool | drag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) |
| bool | keyPress (nxwidget_char_t key) |
| bool | cursorControl (ECursorControl control) |
| bool | focus (void) |
| bool | blur (void) |
| bool | moveTo (nxgl_coord_t x, nxgl_coord_t y) |
| bool | resize (nxgl_coord_t width, nxgl_coord_t height) |
| bool | changeDimensions (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) |
| void | moveChildToDeleteQueue (CNxWidget *widget) |
| void | setFocusedWidget (CNxWidget *widget) |
| virtual bool | checkCollision (nxgl_coord_t x, nxgl_coord_t y) const |
| virtual bool | checkCollision (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) const |
| bool | checkCollision (CNxWidget *widget) const |
| void | addWidget (CNxWidget *widget) |
| void | insertWidget (CNxWidget *widget) |
| void | setParent (CNxWidget *parent) |
| void | destroy (void) |
| bool | remove (void) |
| bool | removeChild (CNxWidget *widget) |
| const CNxWidget * | getChild (int index) const |
| int | getChildCount (void) const |
| void | setBorderSize (const WidgetBorderSize &borderSize) |
Public Member Functions inherited from NXWidgets::IScrollable | |
| virtual | ~IScrollable (void) |
Public Member Functions inherited from NXWidgets::IListDataEventHandler | |
| virtual | ~IListDataEventHandler (void) |
Protected Member Functions | |
| virtual void | drawContents (CGraphicsPort *port) |
| virtual void | drawBorder (CGraphicsPort *port) |
| virtual void | onClick (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onDoubleClick (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | setOptionSelected (const int index, const bool selected) |
| CListBox (const CListBox &listBox) | |
Protected Member Functions inherited from NXWidgets::CScrollingPanel | |
| virtual void | onDrag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) |
| void | scrollChildren (int32_t dx, int32_t dy, bool do_redraw) |
| virtual | ~CScrollingPanel (void) |
| CScrollingPanel (const CScrollingPanel &scrollingPanel) | |
Protected Member Functions inherited from NXWidgets::CNxWidget | |
| void | useWidgetStyle (const CWidgetStyle *style) |
| void | drawChildren (void) |
| void | closeChild (CNxWidget *widget) |
| void | startDragging (nxgl_coord_t x, nxgl_coord_t y) |
| void | stopDragging (nxgl_coord_t x, nxgl_coord_t y) |
| CNxWidget (const CNxWidget &widget) | |
| virtual void | onPreRelease (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onRelease (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onReleaseOutside (nxgl_coord_t x, nxgl_coord_t y) |
| virtual void | onDragStart (void) |
| virtual void | onDragStop (void) |
| virtual void | onFocus (void) |
| virtual void | onBlur (void) |
| virtual void | onEnable (void) |
| virtual void | onDisable (void) |
| virtual void | onResize (nxgl_coord_t width, nxgl_coord_t height) |
Protected Attributes | |
| CListData | m_options |
| uint8_t | m_optionPadding |
| int | m_lastSelectedIndex |
Protected Attributes inherited from NXWidgets::CScrollingPanel | |
| CWidgetControl * | m_widgetControl |
| int32_t | m_canvasX |
| int32_t | m_canvasY |
| int32_t | m_canvasWidth |
| int32_t | m_canvasHeight |
| bool | m_allowVerticalScroll |
| bool | m_allowHorizontalScroll |
| bool | m_isContentScrolled |
Protected Attributes inherited from NXWidgets::CNxWidget | |
| CWidgetControl * | m_widgetControl |
| CRect | m_rect |
| nxgl_coord_t | m_grabPointX |
| nxgl_coord_t | m_grabPointY |
| nxgl_coord_t | m_newX |
| nxgl_coord_t | m_newY |
| CWidgetStyle | m_style |
| Flags | m_flags |
| CWidgetEventHandlerList * | m_widgetEventHandlers |
| struct timespec | m_lastClickTime |
| nxgl_coord_t | m_lastClickX |
| nxgl_coord_t | m_lastClickY |
| int | m_doubleClickBounds |
| CNxWidget * | m_parent |
| CNxWidget * | m_focusedChild |
| TNxArray< CNxWidget * > | m_children |
| WidgetBorderSize | m_borderSize |
Additional Inherited Members | |
Public Types inherited from NXWidgets::CNxWidget | |
| enum | WidgetFlagType { WIDGET_BORDERLESS = 0x0001, WIDGET_DRAGGABLE = 0x0002, WIDGET_PERMEABLE = 0x0004, WIDGET_DOUBLE_CLICKABLE = 0x0008, WIDGET_NO_RAISE_EVENTS = 0x0010 } |
Class providing a scrollable list of options. The CListBox can be set up to only allow one selection or multiple selections. Processes double-clicks and raises double-click events, so that a double-click on an option can be made to automatically select and close a window/etc. The options themselves have user-definable text and background colors for their selected and unselected states.
Definition at line 113 of file clistbox.hxx.
|
inlineprotected |
Copy constructor is protected to prevent usage.
Definition at line 175 of file clistbox.hxx.
| CListBox::CListBox | ( | CWidgetControl * | pWidgetControl, |
| nxgl_coord_t | x, | ||
| nxgl_coord_t | y, | ||
| nxgl_coord_t | width, | ||
| nxgl_coord_t | height, | ||
| CWidgetStyle * | style = (CWidgetStyle *)NULL |
||
| ) |
Constructor.
| pWidgetControl | The controlling widget for the display. |
| x | The x coordinate of the widget. |
| y | The y coordinate of the widget. |
| width | The width of the widget. |
| height | The height of the widget. |
| style | The style that the widget should use. If this is not specified, the widget will use the values stored in the global g_defaultWidgetStyle object. The widget will copy the properties of the style into its own internal style object. |
Definition at line 109 of file clistbox.cxx.
|
virtual |
Destructor.
Definition at line 130 of file clistbox.cxx.
|
virtual |
Add a new option to the widget using default colors.
| text | Text to show in the option. |
| value | The value of the option. |
Implements NXWidgets::IListBox.
Definition at line 143 of file clistbox.cxx.
|
virtual |
Add an option to the widget.
| option | The option to add. |
Implements NXWidgets::IListBox.
Definition at line 156 of file clistbox.cxx.
|
virtual |
Add a new option to the widget.
| text | Text to show in the option. |
| value | The value of the option. |
| normalTextColor | Color to draw the text with when not selected. |
| normalBackColor | Color to draw the background with when not selected. |
| selectedTextColor | Color to draw the text with when selected. |
| selectedBackColor | Color to draw the background with when selected. |
Implements NXWidgets::IListBox.
Definition at line 192 of file clistbox.cxx.
|
inlinevirtual |
Sets whether multiple selections are possible or not.
Implements NXWidgets::IListBox.
Definition at line 331 of file clistbox.hxx.
|
virtual |
Deselect all options. Redraws the widget and raises a value changed event.
Implements NXWidgets::IListBox.
Definition at line 243 of file clistbox.cxx.
|
virtual |
De-select an option by its index. Redraws the widget and raises a value changed event.
| index | The index of the option to select. |
Select an option by its index. Redraws the widget and raises a value changed event.
| index | The index of the option to select. |
Implements NXWidgets::IListBox.
Definition at line 222 of file clistbox.cxx.
|
protectedvirtual |
Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.
| port | The CGraphicsPort to draw to. |
Reimplemented from NXWidgets::CScrollingPanel.
Definition at line 582 of file clistbox.cxx.
|
protectedvirtual |
Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.
| port | The CGraphicsPort to draw to. |
Reimplemented from NXWidgets::CScrollingPanel.
Definition at line 446 of file clistbox.cxx.
|
inlinevirtual |
Get the specified option.
Implements NXWidgets::IListBox.
Definition at line 348 of file clistbox.hxx.
|
inlinevirtual |
Get the total number of options.
Implements NXWidgets::IListBox.
Definition at line 365 of file clistbox.hxx.
|
virtual |
Get the height of a single option.
Implements NXWidgets::IListBox.
Definition at line 330 of file clistbox.cxx.
|
virtual |
Insert the dimensions that this widget wants to have into the rect passed in as a parameter. All coordinates are relative to the widget's parent. Value is based on the length of the largest string in the set of options.
| rect | Reference to a rect to populate with data. |
Reimplemented from NXWidgets::CNxWidget.
Definition at line 371 of file clistbox.cxx.
|
virtual |
Get the selected index. Returns -1 if nothing is selected. If more than one option is selected, the index of the first selected option is returned.
Implements NXWidgets::IListBox.
Definition at line 256 of file clistbox.cxx.
|
virtual |
Get the selected option. Returns NULL if nothing is selected.
Implements NXWidgets::IListBox.
Definition at line 280 of file clistbox.cxx.
|
virtual |
Handles list data changed events.
| e | Event arguments. |
Implements NXWidgets::IListDataEventHandler.
Definition at line 341 of file clistbox.cxx.
|
virtual |
Handles list selection changed events.
| e | Event arguments. |
Implements NXWidgets::IListDataEventHandler.
Definition at line 356 of file clistbox.cxx.
|
virtual |
Check if the click is a double-click.
| x | X coordinate of the click. |
| y | Y coordinate of the click. |
Reimplemented from NXWidgets::CNxWidget.
Definition at line 416 of file clistbox.cxx.
|
protectedvirtual |
Determines which item was clicked and selects or deselects it as appropriate. Also starts the dragging system.
| x | The x coordinate of the click. |
| y | The y coordinate of the click. |
Reimplemented from NXWidgets::CScrollingPanel.
Definition at line 601 of file clistbox.cxx.
|
protectedvirtual |
Selects the clicked item and deselects all others.
| x | The x coordinate of the click. |
| y | The y coordinate of the click. |
Reimplemented from NXWidgets::CNxWidget.
Definition at line 640 of file clistbox.cxx.
|
virtual |
Remove all options from the widget.
Implements NXWidgets::IListBox.
Definition at line 176 of file clistbox.cxx.
|
virtual |
Remove an option from the widget by its index.
| index | The index of the option to remove. |
Implements NXWidgets::IListBox.
Definition at line 167 of file clistbox.cxx.
|
virtual |
Resize the scrolling canvas to encompass all options.
Definition at line 289 of file clistbox.cxx.
|
virtual |
Select all options. Does nothing if the listbox does not allow multiple selections. Redraws the widget and raises a value changed event.
Implements NXWidgets::IListBox.
Definition at line 233 of file clistbox.cxx.
|
virtual |
Select an option by its index. Redraws the widget and raises a value changed event.
| index | The index of the option to select. |
Implements NXWidgets::IListBox.
Definition at line 210 of file clistbox.cxx.
|
inlinevirtual |
Sets whether multiple selections are possible or not.
| allowMultipleSelections | True to allow multiple selections. |
Implements NXWidgets::IListBox.
Definition at line 320 of file clistbox.hxx.
|
protectedvirtual |
Select or deselect an option by its index. Does not deselect any other selected options. Set index to -1 to select nothing. Redraws the widget and raises a value changed event.
| index | The index of the option to select. |
| selected | True to select the option, false to deselect it. |
Definition at line 662 of file clistbox.cxx.
|
virtual |
Sets the selected index. Specify -1 to select nothing. Resets any other selected options to deselected. Redraws the widget and raises a value changed event.
| index | The selected index. |
Implements NXWidgets::IListBox.
Definition at line 269 of file clistbox.cxx.
|
inlinevirtual |
Sets whether or not items added to the list are automatically sorted on insert or not.
| sortInsertedItems | True to enable sort on insertion. |
Implements NXWidgets::IListBox.
Definition at line 384 of file clistbox.hxx.
|
virtual |
Sort the options alphabetically by the text of the options.
Implements NXWidgets::IListBox.
Definition at line 319 of file clistbox.cxx.
|
protected |
Index of the last option selected.
Definition at line 119 of file clistbox.hxx.
|
protected |
Padding between options.
Definition at line 118 of file clistbox.hxx.
|
protected |
Option storage.
Definition at line 117 of file clistbox.hxx.
1.8.13