MQSlider class

(new in Rev4.00)

MQSlider class manages a slider to adjust a value. It inherits a MQWidgetBase class.

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

Class
MQSlider Constructor
~MQSlider Destructor
Member functions
GetPosition Get a position value
SetPosition Set a position value
GetMin Get a minimum value
SetMin Set a minimum value
GetMax Get a maximum value
SetMax Set a maximum value
Events
AddChangedEvent Add an event after finishing to change a value
AddChangingEvent Add an event while changing a value

MQSlider::MQSlider();

MQSlider::MQSlider(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQSlider::~MQSlider();

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


int MQSlider::GetPosition();

Return value
A position value

It returns a current value.


void MQSlider::SetPosition(int value);

value
A position value

It specifies a current value.


int MQSlider::GetMin();

Return value
A minimum value

It returns a minimum value.


void MQSlider::SetMin(int value);

value
A minimum value

It specifies a minimum value.

If the minimum value is larger than the maximum value, the values are swapped and it ensures that the minimum value is always equal or lesser than the maximum value.


int MQSlider::GetMax();

Return value
A maximum value

It returns a maximum value.


void MQSlider::SetMax(int value);

value
A maximum value

It specifies a maximum value.

If the maximum value is lesser than the minimum value, the values are swapped and it ensures that the minimum value is always equal or lesser than the maximum value.


template<typename T> void MQSlider::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 value has been changed by user's operation.

An event by AddChangingEvent() is invoked when characters are modified by key input, and an event by AddChangedEvent() is invoked when Enter key is pressed or a focus removed by Tab key or a mouse operation.


template<typename T> void MQSlider::AddChangingEvent(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 value is changing by user's operation.

An event by AddChangingEvent() is invoked when characters are modified by key input, and an event by AddChangedEvent() is invoked when Enter key is pressed or a focus removed by Tab key or a mouse operation.