(new in Rev4.00)
MQListBox class manages a list box. It inherits a MQWidgetBase class
Please refer the inherited class about member functions declared in the inherited class.
Class | |
MQListBox | Constructor |
~MQListBox | Destructor |
Member functions | |
GetCurrentIndex | Get a current index |
SetCurrentIndex | Set a current index |
AddItem | Add an item |
DeleteItem | Delete an item |
ClearItems | Clear all items |
GetItemCount | Get a number of items |
GetItem | Get a text in an item |
SetItem | Set a text in an item |
GetItemTag | Get an arbitrary value in an item |
SetItemTag | Set an arbitrary value in an item |
GetItemSelected | Get a selection status of an item |
SetItemSelected | Set a selection status of an item |
GetItemHint | Get a hint string of an item |
SetItemHint | Set a hint string of an item |
GetVisibleRow | Get a number of visible rows |
SetVisibleRow | Set a number of visible rows |
GetLineHeightRate | Get a rate of a line height |
SetLineHeightRate | Set a rate of a line height |
GetVertScrollVisible | Get a visibility of a vertical scroll bar |
SetVertScrollVisible | Set a visibility of a vertical scroll bar |
GetMultiSelect | Get a multi selection |
SetMultiSelect | Set a multi selection |
ClearSelection | Clear all selections |
MakeItemVisible | Show an item in the visible area |
Events | |
AddChangedEvent | Add an event when a current index or a selection has been changed. |
MQListBox::MQListBox();
MQListBox::MQListBox(int id);
It is a constructor.
virtual MQListBox::~MQListBox();
This method is a destructor. It is defined as a virtual function.
int MQListBox::GetCurrentIndex();
It returns an index of an active item.
void MQListBox::SetCurrentIndex(int value);
It specifies an index of an active item.
int MQListBox::AddItem(const std::wstring& text);
int MQListBox::AddItem(const std::wstring& text, __int64 tag);
It adds a new item.
An item has a displayed string and an arbitrary value.
void MQListBox::DeleteItem(int index);
It deletes a specified index of an item.
Indices of items behind the deleted item will be moved up one by one.
void MQListBox::ClearItems();
It deletes all items.
int MQListBox::GetItemCount();
It returns a number of items in the list.
std::wstring MQListBox::GetItem(int index);
It returns a string of the specified item.
void MQListBox::SetItem(int index, const std::wstring& text);
It sets a string of the specified item.
__int64 MQListBox::GetItemTag(int index);
It returns an arbitrary value assigned to the specified item.
void MQListBox::SetItemTag(int index, __int64 tag);
It assigns an arbitrary value to the specified item.
bool MQListBox::GetItemSelected(int index);
It returns a selection status of the specified item.
It is necessary to enable a multi selection mode by SetMultiSelection() to get a selection status of an item.
void MQListBox::SetItemSelected(int index, bool selected);
It sets a selection status of the specified item.
It is necessary to enable a multi selection mode by SetMultiSelection() to get a selection status of an item.
std::wstring MQListBox::GetItemHint(int index);
It returns a hint string of the specified item.
void MQListBox::SetItemHint(int index, const std::wstring& hint);
It sets a hint string of the specified item.
int MQListBox::GetVisibleRow();
It returns a number of visible rows used for a size calculation.
The value does not necessarily match the number of rows that are actually displayed.
void MQListBox::SetVisibleRow(int value);
It specifies a number of visible rows used for a size calculation.
The value does not necessarily match the number of rows that are actually displayed.
double MQListBox::GetLineHeightRate();
It returns a line height as a rate for a default height.
void MQListBox::SetLineHeightRate(double value);
It soecifies a line height as a rate for a default height.
bool MQListBox::GetVertScrollVisible();
It returns whether a vertical scroll bar is displayed or not.
void MQListBox::SetVertScrollVisible(bool value);
It specifies whether a vertical scroll bar is displayed or not.
bool MQListBox::GetMultiSelect();
It returns whether to enable to select multiple items nor not.
void MQListBox::SetMultiSelect(bool value);
It specifies whether to enable to select multiple items nor not.
void MQListBox::ClearSelection();
It deselects all items for multi selections.
void MQListBox::MakeItemVisible(int index);
It adjusts a scroll position to show the specified item in the visible area.
template<typename T> void MQListBox::AddChangedEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)
It adds events notified when a current index has been changed by user's operation.