kwave
18.07.70
|
#include <MouseMark.h>
Public Member Functions | |
MouseMark () | |
virtual | ~MouseMark () |
void | set (sample_index_t l, sample_index_t r) |
void | update (sample_index_t x) |
void | grep (sample_index_t x) |
sample_index_t | left () const |
sample_index_t | right () const |
sample_index_t | length () const |
Private Attributes | |
sample_index_t | m_initial |
sample_index_t | m_last |
Simple class that can be used whenever the user selects something with the mouse.
Definition at line 31 of file MouseMark.h.
Kwave::MouseMark::MouseMark | ( | ) |
|
virtual |
void Kwave::MouseMark::grep | ( | sample_index_t | x | ) |
Re-enters the selection process at a new position. The last position will be set to the left or the right margin, depending on which side is nearer.
Definition at line 55 of file MouseMark.cpp.
References m_initial, and m_last.
Referenced by Kwave::SignalView::mousePressEvent(), and Kwave::SelectionBorderItem::SelectionBorderItem().
sample_index_t Kwave::MouseMark::left | ( | ) | const |
Returns the left border of the selection.
Definition at line 43 of file MouseMark.cpp.
References m_initial, and m_last.
Referenced by length(), Kwave::SignalView::mousePressEvent(), Kwave::SelectionBorderItem::moveTo(), and Kwave::SelectionBorderItem::toolTip().
|
inline |
Returns the length of the selection
Definition at line 77 of file MouseMark.h.
References left(), and right().
Referenced by Kwave::SignalView::mousePressEvent(), and Kwave::SelectionBorderItem::moveTo().
sample_index_t Kwave::MouseMark::right | ( | ) | const |
Returns the right border of the selection.
Definition at line 49 of file MouseMark.cpp.
References m_initial, and m_last.
Referenced by length(), and Kwave::SelectionBorderItem::toolTip().
void Kwave::MouseMark::set | ( | sample_index_t | l, |
sample_index_t | r | ||
) |
Sets the selection to a new range.
l | start position |
r | end position |
Definition at line 36 of file MouseMark.cpp.
References m_initial, and m_last.
Referenced by Kwave::SignalView::mousePressEvent(), Kwave::SignalView::mouseReleaseEvent(), and Kwave::SelectionBorderItem::SelectionBorderItem().
void Kwave::MouseMark::update | ( | sample_index_t | x | ) |
Update the last known position of the mouse. This should be used for continuous update of the selection during mouse movement.
x | new last position |
Definition at line 67 of file MouseMark.cpp.
References m_last.
Referenced by Kwave::SelectionBorderItem::moveTo().
|
private |
|
private |