wxRectTracker
|
wxRectTracker control More...
#include <RectTracker.h>
Public Member Functions | |
void | Disable () |
Disable the Tracker. | |
void | Enable () |
Enable the Tracker. | |
int | GetHandlerMask () const |
Get the list of handlers to be displayed (See RT_MASK enum) | |
wxRect | GetMaxRect () const |
Get the coordinates of the area the tracker should not go beyond. | |
wxRect | GetTrackerRect () |
Get current position of the tracker. | |
wxRect | GetTrackerRect () const |
Get the current position of the tracker, without taking in account any scroll area ; deprecated with wxEvtHandlet, do not use. | |
wxRect | GetUnscrolledRect () const |
Get the current size and position of the tracker. | |
void | Hide () |
Hide the Tracker. | |
int | HitTest (int x, int y) const |
Returns true if the provided coordinates are in the tracker. (Parent coo.) | |
bool | IsEnabled () const |
Get the Status. | |
bool | IsShown () const |
Get Appearance Status. | |
virtual void | OnDraw (wxDC *) |
Callback on Draw event. | |
void | SetHandlerMask (int iMask=RT_MASK_ALL) |
Set which handlers will be displayed (See RT_MASK enum) | |
void | SetMaxRect (const wxRect &maxRect) |
Set the maximum boundaries of the available space the tracker. | |
void | SetTrackerRect (const wxRect &rect) |
Set a new position for the tracker. | |
virtual void | SetUnscrolledRect (const wxRect &rect) |
Set a new position for the tracker ; deprecated with wxEvtHandlet, do not use. | |
void | Update () |
Update the tracker position and size (usefull for initialisation) | |
wxRectTracker (wxWindow *wnd, wxFrame *frame=NULL) | |
wxRectTracker constructor | |
virtual | ~wxRectTracker () |
Protected Member Functions | |
virtual void | AdjustTrackerRect (wxRect &curRect, int handler) |
Adjust the behaviour of the tracker. | |
void | AdjustTrackerRectMax (wxRect &curRect, int handler) |
Example of AdjustTrackerRect function. | |
virtual void | DrawRect (wxDC &dc, int x, int y, int w, int h) |
virtual void | DrawRect (wxDC &dc, wxRect rect) |
virtual void | DrawTracker (wxDC &dc, int x, int y, int w, int h) |
virtual void | DrawTracker (wxDC &dc, const wxRect &rect) |
virtual void | OnKey (wxKeyEvent &event) |
virtual void | OnMouseLeftDown (wxMouseEvent &event) |
virtual void | OnMouseLeftUp (wxMouseEvent &event) |
virtual void | OnMouseMotion (wxMouseEvent &event) |
virtual void | OnPaint (wxPaintEvent &event) |
Protected Attributes | |
wxRect | m_curRect |
Coordinates of the previous calculated tracker. | |
wxCursor * | m_cursorMove |
Coordinates of the current tracker. | |
wxFrame * | m_frame |
m_frame : the frame containing the widget | |
int | m_iHandlerMask |
Width of drawn handler. | |
int | m_iHandlerWidth |
wxPoint | m_leftClick |
Current state of the control (See RT_STATE) | |
wxRect | m_maxRect |
maxRect : the tracker should not go beyond this rect (Parent Coo) | |
wxPoint | m_prevMove |
Coordinates of the last left clic. | |
wxRect | m_prevRect |
Coordinates of the previous move. | |
wxRect | m_Rect |
Coordinates of the current tracker. | |
int | m_state |
Mask describing which handlers will be drawn. | |
wxWindow * | m_wnd |
m_wnd : the window containing the widget |
wxRectTracker control
This control aims at providing same functionnalies as the MFC CRectTracker. It is basically a selection rectangle with dragging capabilites, to set its size and position.
This control is a wxEvtHandler to not disturb Event chain and fix background issues You must register it vist PushEventHandler and RemoveEventHandler
Well nothing much to be said about this... or maybe :
To use this control, you have just to create it on the wxWindow you want ; it will register itself. Delete it to unregister it.
Definition at line 84 of file RectTracker.h.
wxRectTracker::wxRectTracker | ( | wxWindow * | wnd, |
wxFrame * | frame = NULL |
||
) |
wxRectTracker constructor
wnd | is the wxWindow accepting this widget |
frame | is the frame containing this widget for debugging purpose (will display its position in the statusbar) |
Definition at line 19 of file RectTracker.cpp.
wxRectTracker::~wxRectTracker | ( | ) | [virtual] |
Definition at line 30 of file RectTracker.cpp.
void wxRectTracker::AdjustTrackerRect | ( | wxRect & | curRect, |
int | handler | ||
) | [protected, virtual] |
Adjust the behaviour of the tracker.
This virtual function allow you to specify special behaviour of the tracker as maintaining a constant ratio, keeping into a special area,...
curRect | [in, out] the asked position |
handler | [in] the handler used to ask this new position |
You get the new coordinates the user ask in curRect, with the handler he used. You can now process this information, and decide a new position that you indicated as output in curRect (that is why this is not a const wxRect &).
Reimplemented in wxRectTrackerRatio.
Definition at line 496 of file RectTracker.cpp.
void wxRectTracker::AdjustTrackerRectMax | ( | wxRect & | curRect, |
int | handler | ||
) | [protected] |
Example of AdjustTrackerRect function.
Definition at line 463 of file RectTracker.cpp.
void wxRectTracker::Disable | ( | ) |
Disable the Tracker.
Definition at line 571 of file RectTracker.cpp.
void wxRectTracker::DrawRect | ( | wxDC & | dc, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) | [protected, virtual] |
Reimplemented in wxRectTrackerRatio.
Definition at line 66 of file RectTracker.cpp.
void wxRectTracker::DrawRect | ( | wxDC & | dc, |
wxRect | rect | ||
) | [protected, virtual] |
Definition at line 94 of file RectTracker.cpp.
void wxRectTracker::DrawTracker | ( | wxDC & | dc, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) | [protected, virtual] |
Reimplemented in wxRectTrackerRatio.
Definition at line 100 of file RectTracker.cpp.
void wxRectTracker::DrawTracker | ( | wxDC & | dc, |
const wxRect & | rect | ||
) | [protected, virtual] |
Definition at line 115 of file RectTracker.cpp.
void wxRectTracker::Enable | ( | ) |
Enable the Tracker.
Definition at line 565 of file RectTracker.cpp.
int wxRectTracker::GetHandlerMask | ( | ) | const [inline] |
Get the list of handlers to be displayed (See RT_MASK enum)
Reimplemented in wxLineTracker.
Definition at line 108 of file RectTracker.h.
wxRect wxRectTracker::GetMaxRect | ( | ) | const [inline] |
Get the coordinates of the area the tracker should not go beyond.
Definition at line 104 of file RectTracker.h.
wxRect wxRectTracker::GetTrackerRect | ( | ) | [inline] |
Get current position of the tracker.
Definition at line 123 of file RectTracker.h.
wxRect wxRectTracker::GetTrackerRect | ( | ) | const [inline] |
Get the current position of the tracker, without taking in account any scroll area ; deprecated with wxEvtHandlet, do not use.
Definition at line 138 of file RectTracker.h.
wxRect wxRectTracker::GetUnscrolledRect | ( | ) | const |
Get the current size and position of the tracker.
If the tracker is on a wxScrolledWindow component, this is the absolute position (as if the control was not scrolled)
Deprecated with wxEvtHandler ; will be soon removed, use GetRect / SetRect instead.
Definition at line 524 of file RectTracker.cpp.
void wxRectTracker::Hide | ( | ) |
Hide the Tracker.
Definition at line 589 of file RectTracker.cpp.
int wxRectTracker::HitTest | ( | int | x, |
int | y | ||
) | const |
Returns true if the provided coordinates are in the tracker. (Parent coo.)
Reimplemented in wxLineTracker.
Definition at line 395 of file RectTracker.cpp.
bool wxRectTracker::IsEnabled | ( | ) | const [inline] |
Get the Status.
Definition at line 116 of file RectTracker.h.
bool wxRectTracker::IsShown | ( | ) | const |
Get Appearance Status.
Definition at line 584 of file RectTracker.cpp.
void wxRectTracker::OnDraw | ( | wxDC * | dc | ) | [virtual] |
Callback on Draw event.
Definition at line 58 of file RectTracker.cpp.
void wxRectTracker::OnKey | ( | wxKeyEvent & | event | ) | [protected, virtual] |
Reimplemented in wxLineTracker.
Definition at line 121 of file RectTracker.cpp.
void wxRectTracker::OnMouseLeftDown | ( | wxMouseEvent & | event | ) | [protected, virtual] |
Reimplemented in wxLineTracker.
Definition at line 354 of file RectTracker.cpp.
void wxRectTracker::OnMouseLeftUp | ( | wxMouseEvent & | event | ) | [protected, virtual] |
Reimplemented in wxLineTracker.
Definition at line 377 of file RectTracker.cpp.
void wxRectTracker::OnMouseMotion | ( | wxMouseEvent & | event | ) | [protected, virtual] |
Reimplemented in wxLineTracker.
Definition at line 177 of file RectTracker.cpp.
void wxRectTracker::OnPaint | ( | wxPaintEvent & | event | ) | [protected, virtual] |
Reimplemented in wxLineTracker.
Definition at line 47 of file RectTracker.cpp.
void wxRectTracker::SetHandlerMask | ( | int | iMask = RT_MASK_ALL | ) | [inline] |
Set which handlers will be displayed (See RT_MASK enum)
Reimplemented in wxLineTracker.
Definition at line 110 of file RectTracker.h.
void wxRectTracker::SetMaxRect | ( | const wxRect & | maxRect | ) |
Set the maximum boundaries of the available space the tracker.
Definition at line 501 of file RectTracker.cpp.
void wxRectTracker::SetTrackerRect | ( | const wxRect & | rect | ) | [inline] |
Set a new position for the tracker.
Definition at line 125 of file RectTracker.h.
void wxRectTracker::SetUnscrolledRect | ( | const wxRect & | rect | ) | [virtual] |
Set a new position for the tracker ; deprecated with wxEvtHandlet, do not use.
Definition at line 529 of file RectTracker.cpp.
void wxRectTracker::Update | ( | ) |
Update the tracker position and size (usefull for initialisation)
Reimplemented in wxLineTracker.
Definition at line 509 of file RectTracker.cpp.
wxRect wxRectTracker::m_curRect [protected] |
Coordinates of the previous calculated tracker.
Definition at line 185 of file RectTracker.h.
wxCursor* wxRectTracker::m_cursorMove [protected] |
Coordinates of the current tracker.
Definition at line 187 of file RectTracker.h.
wxFrame* wxRectTracker::m_frame [protected] |
m_frame : the frame containing the widget
Definition at line 196 of file RectTracker.h.
int wxRectTracker::m_iHandlerMask [protected] |
Width of drawn handler.
Definition at line 179 of file RectTracker.h.
int wxRectTracker::m_iHandlerWidth [protected] |
Definition at line 178 of file RectTracker.h.
wxPoint wxRectTracker::m_leftClick [protected] |
Current state of the control (See RT_STATE)
Definition at line 182 of file RectTracker.h.
wxRect wxRectTracker::m_maxRect [protected] |
maxRect : the tracker should not go beyond this rect (Parent Coo)
Definition at line 190 of file RectTracker.h.
wxPoint wxRectTracker::m_prevMove [protected] |
Coordinates of the last left clic.
Definition at line 183 of file RectTracker.h.
wxRect wxRectTracker::m_prevRect [protected] |
Coordinates of the previous move.
Definition at line 184 of file RectTracker.h.
wxRect wxRectTracker::m_Rect [protected] |
Coordinates of the current tracker.
Definition at line 186 of file RectTracker.h.
int wxRectTracker::m_state [protected] |
Mask describing which handlers will be drawn.
Definition at line 180 of file RectTracker.h.
wxWindow* wxRectTracker::m_wnd [protected] |
m_wnd : the window containing the widget
Definition at line 193 of file RectTracker.h.