A wxPanel with a bank of sliders and text fields. More...
#include <wxSliderPanel.h>
Public Member Functions | |
wxSliderPanel () | |
Constructor - Default. | |
wxSliderPanel (wxWindow *parent, wxWindowID id=wxID_ANY, wxWindowID base_id=10100, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxVSCROLL|wxSUNKEN_BORDER|wxTAB_TRAVERSAL, const wxString &name=wxT("wxSliderPanel")) | |
Constructor. | |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, wxWindowID base_id=10100, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxVSCROLL|wxSUNKEN_BORDER|wxTAB_TRAVERSAL, const wxString &name=wxT("wxSliderPanel")) |
Creation. | |
~wxSliderPanel () | |
Destructor. | |
void | Init () |
Initialises member variables. | |
void | CreateControls () |
Creates the controls and sizers. | |
void | CreateSliders (const vcl_vector< double > &init_vals, const vcl_vector< double > &min_vals, const vcl_vector< double > &max_vals) |
Create new sliders with these bounds and initial values. | |
void | OnSliderTrack (wxScrollEvent &event) |
Event handler. | |
void | OnSliderChange (wxScrollEvent &event) |
Event handler. | |
void | OnChangeText (wxCommandEvent &event) |
Event handler. | |
void | OnEnterText (wxCommandEvent &event) |
Event handler. | |
int | GetWidgets (const wxEvent &event, wxSlider *&slider, wxTextCtrl *&text) |
Used by event handles to validate and lookup widgets. | |
const vcl_vector< double > & | data () const |
Return the vector of data. | |
void | update_data (vcl_vector< double > &data, bool send_messages=true) |
Update the data. | |
void | update_data (unsigned int i, double val, bool send_messages=true) |
Update the data. | |
unsigned int | size () const |
Return the number of sliders. | |
double | sp_to_val (unsigned int idx, int sp) const |
Convert a slider position to a double value. | |
int | val_to_sp (unsigned int idx, double val) const |
Convert a double value to a slider position. | |
void | attach (vgui_observer *) |
Attach the given observer to receive notify messages. | |
void | detach (vgui_observer *) |
Detach the given observer. | |
void | get_observers (vcl_vector< vgui_observer * > &) const |
Returns a list of all the observers for this observable. | |
virtual void | notify () const |
Broadcast an update to all observers of this class. | |
virtual void | notify (const vgui_message &) const |
Broadcast a message to all observers of this class. | |
Static Public Member Functions | |
static bool | ShowToolTips () |
Should we show tooltips?. | |
Static Public Attributes | |
static const char | update [] = "" |
These static memory address are used to identify vgui_message types. | |
static const char | enter [] = "" |
Private Attributes | |
wxWindowID | base_id_ |
vcl_vector< double > | vals_ |
vcl_vector< double > | min_vals_ |
vcl_vector< double > | max_vals_ |
bool | send_messages_ |
used to disable sending of message. |
A wxPanel with a bank of sliders and text fields.
This is useful for adjusting a point in N-D parameter space Each dimension has a min and max (for the slider)
Definition at line 22 of file wxSliderPanel.h.
wxSliderPanel::wxSliderPanel | ( | ) |
Constructor - Default.
Definition at line 42 of file wxSliderPanel.cxx.
wxSliderPanel::wxSliderPanel | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
wxWindowID | base_id = 10100 , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxVSCROLL|wxSUNKEN_BORDER|wxTAB_TRAVERSAL , |
||
const wxString & | name = wxT("wxSliderPanel") |
||
) |
Constructor.
Definition at line 50 of file wxSliderPanel.cxx.
wxSliderPanel::~wxSliderPanel | ( | ) |
Destructor.
Definition at line 80 of file wxSliderPanel.cxx.
void vgui_observable::attach | ( | vgui_observer * | o | ) | [inherited] |
Attach the given observer to receive notify messages.
Definition at line 27 of file vgui_observable.cxx.
bool wxSliderPanel::Create | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
wxWindowID | base_id = 10100 , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxVSCROLL|wxSUNKEN_BORDER|wxTAB_TRAVERSAL , |
||
const wxString & | name = wxT("wxSliderPanel") |
||
) |
void wxSliderPanel::CreateControls | ( | ) |
Creates the controls and sizers.
Create the controls.
Definition at line 105 of file wxSliderPanel.cxx.
void wxSliderPanel::CreateSliders | ( | const vcl_vector< double > & | init_vals, |
const vcl_vector< double > & | min_vals, | ||
const vcl_vector< double > & | max_vals | ||
) |
Create new sliders with these bounds and initial values.
Definition at line 139 of file wxSliderPanel.cxx.
const vcl_vector<double>& wxSliderPanel::data | ( | ) | const [inline] |
Return the vector of data.
Definition at line 74 of file wxSliderPanel.h.
void vgui_observable::detach | ( | vgui_observer * | o | ) | [inherited] |
Detach the given observer.
Definition at line 32 of file vgui_observable.cxx.
void vgui_observable::get_observers | ( | vcl_vector< vgui_observer * > & | o_list | ) | const [inherited] |
Returns a list of all the observers for this observable.
Definition at line 42 of file vgui_observable.cxx.
int wxSliderPanel::GetWidgets | ( | const wxEvent & | event, |
wxSlider *& | slider, | ||
wxTextCtrl *& | text | ||
) |
Used by event handles to validate and lookup widgets.
Definition at line 168 of file wxSliderPanel.cxx.
void wxSliderPanel::Init | ( | ) |
void vgui_observable::notify | ( | ) | const [virtual, inherited] |
Broadcast an update to all observers of this class.
Definition at line 49 of file vgui_observable.cxx.
void vgui_observable::notify | ( | const vgui_message & | m | ) | const [virtual, inherited] |
Broadcast a message to all observers of this class.
Definition at line 57 of file vgui_observable.cxx.
void wxSliderPanel::OnChangeText | ( | wxCommandEvent & | event | ) |
Event handler.
Handle Textbox value change (typing).
Definition at line 223 of file wxSliderPanel.cxx.
void wxSliderPanel::OnEnterText | ( | wxCommandEvent & | event | ) |
void wxSliderPanel::OnSliderChange | ( | wxScrollEvent & | event | ) |
Event handler.
Handle Slider Release (stop dragging).
Definition at line 201 of file wxSliderPanel.cxx.
void wxSliderPanel::OnSliderTrack | ( | wxScrollEvent & | event | ) |
bool wxSliderPanel::ShowToolTips | ( | ) | [static] |
Should we show tooltips?.
Definition at line 161 of file wxSliderPanel.cxx.
unsigned int wxSliderPanel::size | ( | ) | const [inline] |
Return the number of sliders.
Definition at line 84 of file wxSliderPanel.h.
double wxSliderPanel::sp_to_val | ( | unsigned int | idx, |
int | sp | ||
) | const |
Convert a slider position to a double value.
Convert slider position to a double value.
Definition at line 91 of file wxSliderPanel.cxx.
void wxSliderPanel::update_data | ( | vcl_vector< double > & | data, |
bool | send_messages = true |
||
) |
Update the data.
Definition at line 272 of file wxSliderPanel.cxx.
void wxSliderPanel::update_data | ( | unsigned int | i, |
double | val, | ||
bool | send_messages = true |
||
) |
int wxSliderPanel::val_to_sp | ( | unsigned int | idx, |
double | val | ||
) | const |
Convert a double value to a slider position.
Definition at line 97 of file wxSliderPanel.cxx.
wxWindowID wxSliderPanel::base_id_ [private] |
Definition at line 99 of file wxSliderPanel.h.
const char wxSliderPanel::enter = "" [static] |
Definition at line 96 of file wxSliderPanel.h.
vcl_vector<double> wxSliderPanel::max_vals_ [private] |
Definition at line 102 of file wxSliderPanel.h.
vcl_vector<double> wxSliderPanel::min_vals_ [private] |
Definition at line 101 of file wxSliderPanel.h.
bool wxSliderPanel::send_messages_ [private] |
used to disable sending of message.
Definition at line 105 of file wxSliderPanel.h.
const char wxSliderPanel::update = "" [static] |
These static memory address are used to identify vgui_message types.
For compilers that support precompilation, includes "wx/wx.h".
Event Table.
Definition at line 95 of file wxSliderPanel.h.
vcl_vector<double> wxSliderPanel::vals_ [private] |
Definition at line 100 of file wxSliderPanel.h.