NXWidgets: NXWidgets::CListDataItem Class Reference

NXWidgets 1.19

Public Member Functions | Protected Attributes | List of all members
NXWidgets::CListDataItem Class Reference

`#include <clistdataitem.hxx>`

Inheritance diagram for NXWidgets::CListDataItem:

## Public Member Functions
| CListDataItem (const CNxString &text, const uint32_t value)
virtual | ~CListDataItem (void)
const CNxString & | getText (void) const
const uint32_t | getValue (void) const
const bool | isSelected (void) const
void | setSelected (bool selected)
virtual int | compareTo (const CListDataItem *item) const

## Protected Attributes
CNxString | m_text
uint32_t | m_value
bool | m_isSelected

## Detailed Description

Class representing a data item within a list. Intended for use within the CListData class.

Definition at line 103 of file clistdataitem.hxx.

## Constructor & Destructor Documentation

## ◆ CListDataItem()

CListDataItem::CListDataItem | ( | const CNxString & | text,
|  | const uint32_t | value
| ) |  |

Constructor.

Parameters

  text | The text to display in the item.
  value | The value of the item.

Definition at line 98 of file clistdataitem.cxx.

## ◆ ~CListDataItem()

CListDataItem::~CListDataItem | ( | void |  | ) |
| virtual

Destructor.

Definition at line 109 of file clistdataitem.cxx.

## Member Function Documentation

## ◆ compareTo()

int CListDataItem::compareTo | ( | const CListDataItem * | item | ) | const
| virtual

Compare the item with another. Comparison is based on the text of the item. Returns 0 if the text in the two items is the same, a value less than 0 if this item is less than the argument, and a value greater than 0 if this item is greater than the argument.

Parameters

  item | An item to compare this object with.

Returns
  0 if the text in the two items is the same, a value less than 0 if this item is less than the argument, and a value greater than 0 if this item is greater than the argument.

Definition at line 125 of file clistdataitem.cxx.

## ◆ getText()

const CNxString& NXWidgets::CListDataItem::getText | ( | void |  | ) | const
| inline

Get the item's text.

Returns
  The item's text.

Definition at line 133 of file clistdataitem.hxx.

## ◆ getValue()

const uint32_t NXWidgets::CListDataItem::getValue | ( | void |  | ) | const
| inline

Get the item's value.

Returns
  The item's value.

Definition at line 144 of file clistdataitem.hxx.

## ◆ isSelected()

const bool NXWidgets::CListDataItem::isSelected | ( | void |  | ) | const
| inline

Get the item's selection state.

Returns
  True if the item is selected; false if not.

Definition at line 155 of file clistdataitem.hxx.

## ◆ setSelected()

void NXWidgets::CListDataItem::setSelected | ( | bool | selected | ) |
| inline

Set the item's selection state.

Parameters

  selected | True to select the item; false to deselect it.

Definition at line 166 of file clistdataitem.hxx.

## Member Data Documentation

## ◆ m_isSelected

bool NXWidgets::CListDataItem::m_isSelected
| protected

True if the option is selected.

Definition at line 108 of file clistdataitem.hxx.

## ◆ m_text

CNxString NXWidgets::CListDataItem::m_text
| protected

Text to display for option.

Definition at line 106 of file clistdataitem.hxx.

## ◆ m_value

uint32_t NXWidgets::CListDataItem::m_value
| protected

Option value.

Definition at line 107 of file clistdataitem.hxx.

The documentation for this class was generated from the following files:

- clistdataitem.hxx
- clistdataitem.cxx