16#ifndef __albaGUIRangeSlider_H__
17#define __albaGUIRangeSlider_H__
31 albaGUIRangeSlider(wxWindow *parent, wxWindowID
id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
49 void SetRange(
double minR,
double maxR) {
double range[2] = {minR, maxR}; this->
SetRange(range); }
61 bool IsDragging()
const {
return this->m_SelectedTriangleWidget != -1 || this->m_SelectedRangeWidget != -1; }
93 int m_BorderWidgetRadius;
94 wxPoint m_TrianglePosition[3];
96 static wxPoint m_TriangleWidgetPoints[3];
97 static wxPoint m_TriangleWidgetCenter;
98 static int m_TriangleWidgetRadius;
100 wxPoint m_PrevMousePosition;
101 int m_SelectedTriangleWidget;
102 int m_SelectedRangeWidget;
103 wxString m_ValueString;
104 wxStaticText *m_RangeValueLabel;
106 DECLARE_EVENT_TABLE()
class name: albaGUIRangeSlider Class that handles a slider for visualising or changing range.
void Initialize()
Initialize the values for the slider.
bool IsDragging() const
Return true if one of the cursors are moving.
albaGUIRangeSlider(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
constructor
void SetValue(int i, double value)
Set the 'min', 'max' or 'mid' value according to 'i'.
void SetRange(double *range)
Set the range for the slider.
void DrawLabel(int x, int y, double val)
Draw a label according to the mouse position.
void EnableBoundaryHandles(bool enable)
Hide / show the circles on the boundary of the slider.
void OnRangeModified(wxCommandEvent &event)
Intercept slider events and forward to the listener.
void RedrawWidgets(wxDC &dc, bool eraseWidgets=false)
Redraw the widgets in the new position.
void SetListener(albaObserver *listener)
function for setting the listener of events coming from another object
albaObserver * m_Listener
void EnableCenterWidget(bool enable)
Enable/Disable the center cursor for the slider.
const double * GetRange() const
Get the range of the slider.
void SetRange(double minR, double maxR)
Set the range for the slider.
void OnMouse(wxMouseEvent &event)
Move the cursors on mouse event.
void OnPaint(wxPaintEvent &event)
Refresh the slider shape.
void SetNumberOfWidgets(int num)
Set the number of widgets for the slider.
double GetValue(int i) const
Get the 'min', 'max' or 'mid' value according to 'i'.
Interface implementing the Observer of the Subject/Observer design pattern.