Canola  0.8.D001
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
slider Class Reference

#include <slider.h>

Inheritance diagram for slider:
slider_power slider_program_mode slider_program_selector slider_rounding

List of all members.

Public Types

typedef sigc::signal< void > value_changed_signal_t

Public Member Functions

virtual ~slider ()
value_changed_signal_tvalue_changed_signal (void)
int get_value (void) const
void set_value (int n)

Protected Member Functions

 slider (const std::string &name, int npos, bool act_on_rel=false)

Private Types

typedef Glib::RefPtr< Gdk::Pixbuf > pixbuf_pointer

Private Member Functions

bool on_button_press (GdkEventButton *ep)
bool on_button_release (GdkEventButton *ep)
bool on_motion_notify (GdkEventMotion *ep)
void update_value (int x, int y)
 slider ()
 slider (const slider &rhs)
slideroperator= (const slider &rhs)

Private Attributes

int nvalues
int value
std::vector< pixbuf_pointervalue_images
Gtk::Image appearance
bool down
bool inside
int old_value
int frac
value_changed_signal_t value_changed_source
bool activate_on_release

Detailed Description

The slider class is used to represent a control that slides horizontally to assume one of several positions.

Definition at line 29 of file slider.h.


Member Typedef Documentation

typedef Glib::RefPtr<Gdk::Pixbuf> slider::pixbuf_pointer [private]

Definition at line 99 of file slider.h.

typedef sigc::signal<void> slider::value_changed_signal_t

Definition at line 38 of file slider.h.


Constructor & Destructor Documentation

slider::~slider ( ) [virtual]

The destructor.

Definition at line 26 of file slider.cc.

slider::slider ( const std::string &  name,
int  npos,
bool  act_on_rel = false 
) [protected]

The constructor. For use by derived classes only.

Parameters:
nameThe base name of the images used to display the slider.
nposThe number of positions (0..<n) the slider can assume.
act_on_relWhether the widget is activated on release (true), or always active.

Definition at line 39 of file slider.cc.

slider::slider ( ) [private]

The default constructor. Do not use.

slider::slider ( const slider rhs) [private]

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

int slider::get_value ( void  ) const

The get_value method may be used to obtain the current value of the widget.

Definition at line 150 of file slider.cc.

bool slider::on_button_press ( GdkEventButton *  ep) [private]

The on_button_press method is used to handle button click events generated by the user.

Definition at line 77 of file slider.cc.

bool slider::on_button_release ( GdkEventButton *  ep) [private]

The on_button_release method is used to handle button unclick events generated by the user.

Definition at line 88 of file slider.cc.

bool slider::on_motion_notify ( GdkEventMotion *  ep) [private]

The on_motion_notify method is used to handle motion events generated by the user.

Definition at line 103 of file slider.cc.

slider& slider::operator= ( const slider rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
void slider::set_value ( int  n)

The set_value method is used to set the value of the switch.

Parameters:
nThe new value of the widget (0..<nvalues). Out-of-range values will be clipped.

Definition at line 165 of file slider.cc.

void slider::update_value ( int  x,
int  y 
) [private]

The update_value method is used to take the position indivcated by an event, and determine whether or not the switch value has changed. If it has, the image will change, and a value_changed_source signal will be emitted.

Definition at line 113 of file slider.cc.

The value_changed_signal method is used to obtain access to the signal that will be emitted each time the user changes the switch value.

Note:
The set_value method will not cause this signal to be emitted.

Definition at line 158 of file slider.cc.


Member Data Documentation

The activate_on_release insta

Definition at line 177 of file slider.h.

Gtk::Image slider::appearance [private]

The appearance instance variable is used to remember the state of the image widget displaying the pixbuf that looks like the slider in it's present state.

Definition at line 112 of file slider.h.

bool slider::down [private]

The down instance variable is used to remember whether or not the user is currently clicking on this switch.

Definition at line 118 of file slider.h.

int slider::frac [private]

The frac instance variable is used to remember how wide each value setting is. This is the width of the images divided by the nvalues.

Definition at line 140 of file slider.h.

bool slider::inside [private]

The inside instance variable is used to remember whether the pointer is currently inside or outside the widget. Only meaningful when down is active.

Definition at line 125 of file slider.h.

int slider::nvalues [private]

The nvalues instance variable is used to remember the number of valid values.

assert(nvalues >= 2);

Definition at line 88 of file slider.h.

int slider::old_value [private]

The old_value instance variable is used to remember what the slider value was immediately before the slider was clicked. This value will be restored whenever the pointer goes outside the widget.

Definition at line 133 of file slider.h.

int slider::value [private]

The value instance variable is used to remember the current value of the slider.

assert(value >= 0); assert(value < nvalues);

Definition at line 97 of file slider.h.

The value_changed_source instance variable is used to remember

Definition at line 171 of file slider.h.

std::vector<pixbuf_pointer> slider::value_images [private]

The value_images instance variable is used to remember the pixbuf corresponding to each value.

Definition at line 105 of file slider.h.


The documentation for this class was generated from the following files: