MQCheckListBox class

(new in Rev4.30)

MQCheckListBox class manages a check list box. It inherits a MQWidgetBase class

Please refer the inherited class about member functions declared in the inherited class.

Class
MQCheckListBox Constructor
~MQCheckListBox Destructor
Member functions
GetCurrentIndex Get a current index
SetCurrentIndex Set a current index
BeginUpdate Begin to update items
EndUpdate End to update items
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
GetItemChecked Get a check status of an item
SetItemChecked Set a check 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
HitTestItem Get an item at a apecified position
GetItemRect Get a position and a size of an item
Events
AddChangedEvent Add an event when a current index or a selection has been changed.

MQCheckListBox::MQCheckListBox();

MQCheckListBox::MQCheckListBox(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQCheckListBox::~MQCheckListBox();

This method is a destructor. It is defined as a virtual function.


int MQCheckListBox::GetCurrentIndex();

Return value
A current index

It returns an index of an active item.


void MQCheckListBox::SetCurrentIndex(int value);

value
A current index

It specifies an index of an active item.


void MQCheckListBox::BeginUpdate();

It declares to begin an updating of items.

You need to call EndUpdate() after calling this function and finishing to add or delete items.

It is not necessary to call this function. However, an addition of a deletion of many items becomes faster and the scrolled position is retained as possible by calling this function.


void MQCheckListBox::EndUpdate();

It declares to finish an updating of items.

It is necessary to call this fuction after calling BeginUpdate() and finishing to add or delete items.


int MQCheckListBox::AddItem(const std::wstring& text);

int MQCheckListBox::AddItem(const std::wstring& text, __int64 tag);

text
A string for an adding item
tag
An arbitrary value
Return value
An index of the added item

It adds a new item.

An item has a displayed string and an arbitrary value.


void MQCheckListBox::DeleteItem(int index);

index
An index of a deleting item

It deletes a specified index of an item.

Indices of items behind the deleted item will be moved up one by one.


void MQCheckListBox::ClearItems();

It deletes all items.


int MQCheckListBox::GetItemCount();

Return value
A number of items

It returns a number of items in the list.


std::wstring MQCheckListBox::GetItem(int index);

index
An index of an item
Return value
A string

It returns a string of the specified item.


void MQCheckListBox::SetItem(int index, const std::wstring& text);

index
An index of an item
text
A string

It sets a string of the specified item.


__int64 MQCheckListBox::GetItemTag(int index);

index
An index of an item
Return value
An arbitrary value

It returns an arbitrary value assigned to the specified item.


void MQCheckListBox::SetItemTag(int index, __int64 tag);

index
An index of an item
tag
An arbitrary value

It assigns an arbitrary value to the specified item.


bool MQCheckListBox::GetItemSelected(int index);

index
An index of an item
Return value
A selection status

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 MQCheckListBox::SetItemSelected(int index, bool selected);

index
An index of an item
selected
A selection status

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.


bool MQCheckListBox::GetItemChecked(int index);

index
An index of an item
Return value
A checked status

It returns a checked status of the specified item.


void MQCheckListBox::SetItemChecked(int index, bool checked);

index
An index of an item
checked
A checked status

It sets a checked status of the specified item.


std::wstring MQCheckListBox::GetItemHint(int index);

index
An index of an item
Return value
A hint string

It returns a hint string of the specified item.


void MQCheckListBox::SetItemHint(int index, const std::wstring& hint);

index
An index of an item
hint
A hint string

It sets a hint string of the specified item.


int MQCheckListBox::GetVisibleRow();

Return value
A number of visible rows

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 MQCheckListBox::SetVisibleRow(int value);

value
A number of visible rows

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 MQCheckListBox::GetLineHeightRate();

Return value
A rate of a line height

It returns a line height as a rate for a default height.


void MQCheckListBox::SetLineHeightRate(double value);

value
A rate of a line height

It soecifies a line height as a rate for a default height.


bool MQCheckListBox::GetVertScrollVisible();

Return value
A visibility of a vertical scroll bar

It returns whether a vertical scroll bar is displayed or not.


void MQCheckListBox::SetVertScrollVisible(bool value);

value
A visibility of a vertical scroll bar

It specifies whether a vertical scroll bar is displayed or not.


bool MQCheckListBox::GetMultiSelect();

Return value
Multi selection mode

It returns whether to enable to select multiple items nor not.


void MQCheckListBox::SetMultiSelect(bool value);

value
Multi selection mode

It specifies whether to enable to select multiple items nor not.


void MQCheckListBox::ClearSelection();

It deselects all items for multi selections.


void MQCheckListBox::MakeItemVisible(int index);

index
An index of an item

It adjusts a scroll position to show the specified item in the visible area.


int MQCheckListBox::HitTestItem(int x, int y);

x
X in a client coordinate
y
Y in a client coordinate
Return value
An index of an item

(new in Rev4.40)

It returns an index of an item at the specified position. If there is no item at the position, -1 is returned.


void MQCheckListBox::GetItemRect(int index, int& x, int& y, int& w, int& h);

index
An index of an item
x
X coordinate of left top corner
y
Y coordinate of left top corner
w
Width
h
Height

(new in Rev4.40)

It returns a position an a size of the specified item.


template<typename T> void MQCheckListBox::AddChangedEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

It adds events notified when a current index has been changed by user's operation.