MQComboBox class

(new in Rev4.00)

MQComboBox class manages a combo box. It inherits a MQWidgetBase class.

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

Class
MQComboBox Constructor
~MQComboBox 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
GetNumVisible Get a number of visibility items in a pull down menu
SetNumVisible Set a number of visibility items in a pull down menu
Events
AddChangedEvent Add an event when a current index has been changed.

MQComboBox::MQComboBox();

MQComboBox::MQComboBox(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQComboBox::~MQComboBox();

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


int MQComboBox::GetCurrentIndex();

Return value
A current index

It returns an index of an active item.


void MQComboBox::SetCurrentIndex(int value);

value
A current index

It specifies an index of an active item.


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

int MQComboBox::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 MQComboBox::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 MQComboBox::ClearItems();

It deletes all items.


int MQComboBox::GetItemCount();

Return value
A number of items

It returns a number of items in the combo box.


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

index
An index of an item
Return value
A string

It returns a string of the specified item.


void MQComboBox::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 MQComboBox::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 MQComboBox::SetItemTag(int index, __int64 tag);

index
An index of an item
tag
An arbitrary value

It assigns an arbitrary value to the specified item.


int MQComboBox::GetNumVisible();

Return value
A number of visible items in a pull down menu

It returns a number of visible items in a pull down menu when a combo box is clicked.


void MQComboBox::SetNumVisible(int value);

value
A number of visible items in a pull down menu

It specifies a number of visible items in a pull down menu when a combo box is clicked.


template<typename T> void MQComboBox::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.