xvWidgets
|
Base class for all Widgets. More...
#include <Widget.hpp>
Public Member Functions | |
virtual void | addChild (Widget &, bool readOnly=true) |
Add a child widget. | |
virtual void | render (const cv::Mat &) |
Display widget in input mode (with OK/Cancel buttons) | |
virtual void | paint (const cv::Mat &)=0 |
Display widget in output mode (without OK/Cancel buttons) | |
virtual bool | contains (const gui_point_t &) |
Check if point is inside the widget. | |
virtual void | onMouseDown (const gui_point_t &) |
The user clicked the left mouse button over the widget. | |
virtual void | onMouseMove (const gui_point_t &) |
The user moved the mouse pointer over the widget. | |
virtual void | onMouseUp (const gui_point_t &) |
The user released the left mouse button over the widget. | |
void | startDragging () |
Signal that the user started dragging the widget. | |
void | stopDragging () |
Signal that the user stopped dragging the widget. | |
bool | isDragging () |
Check if the user is dragging the widget. | |
virtual void | setMouseOver (bool mouseOver) |
Signal that the user placed the mouse pointer over the widget. | |
virtual bool | isMouseOver () |
Check if the mouse pointer is over the widget. | |
virtual bool | isReadOnly () |
Check if Widget is read-only. | |
virtual void | setPosition (gui_point_t position) |
Move the widget to a point in an image. | |
virtual gui_point_t | position () |
Get the current position. | |
bool | isMouseOverButton (gui_point_t mousePosition, gui_point_t buttonPosition) |
Check if the mouse pointer is over a button. | |
void | hide () |
Make it disappear from an Image. | |
Protected Attributes | |
std::list< Widget * > | m_children |
Other widgets inside the widget. | |
Widget * | m_parent = NULL |
Pointer to the parent image used to display the widget. | |
std::vector< gui_point_t > | m_contour |
The contours of area occupied by the widget. | |
bool | m_dragging = false |
bool | m_canceling = false |
bool | m_accepting = false |
bool | m_mouseOver = false |
bool | m_undefined = false |
bool | m_positioned = false |
bool | m_readonly = false |
gui_point_t | m_position |
Static Protected Attributes | |
static const int | LINE_THICKNESS |
The thickness of contour lines. | |
static const int | MARGIN |
Generic margin around widget. | |
static const int | BUTTON_RADIUS |
Used to define the size of buttons. | |
static const gui_point_t | OK_POSITION |
Offset of the OK button in relation to the widget position. | |
static const gui_point_t | CANCEL_POSITION |
Offset of the Cancel button in relation to the widget position. | |
static const cv::Scalar | FOREGROUND_COLOR |
Color used to draw main components of widget. | |
static const cv::Scalar | HIGHLIGHT_COLOR |
Color used to draw a few important components of the widget. | |
static const cv::Scalar | AFFIRMATIVE_COLOR |
Color associated with OK/accept action. | |
static const cv::Scalar | NEGATIVE_COLOR |
Color associated with Cancel/reject action. | |
Base class for all Widgets.
|
protected |
The user left clicked over ok and didn't release the mouse button
|
protected |
The user left clicked over cancel and didn't release the mouse button
|
protected |
The user is dragging the widget
|
protected |
The mouse pointer is over the widget
|
protected |
The position of the widget, usually the center point
|
protected |
Was the Widget positioned in a particular place, independently of being undefined
|
protected |
The widget can be made visible but the user can't interact with it
|
protected |
The member variable that stores a primitive datatype doesn't hold a defined value