slider.dox 3.71 KB
Newer Older
Ercan Ersoy's avatar
Ercan Ersoy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
/*
 SLIDER.DOX

 License CC0 PUBLIC DOMAIN

 To the extent possible under law, Mark J. Olesen has waived all copyright
 and related or neighboring rights to FDOSTUI Library. This work is published
 from: United States.
*/

/*! \file slider.hpp
\brief contains slider class
*/

/*! \class slider slider.hpp
\brief Allows user to select a value by moving a thumb within a defined
range of the slider.

The slider class is also the base class for other widgets such as
scrollbar.
*/

/*!
\enum slider::orientation
\brief indicator of the orientation of the widget. The defualt orientation
is \a HORIZONTAL.

\var slider::orienatation  slider::HORIZONTAL,
	horizontal orientation

\var slider::orienatation  slider::VERTICAL 
	vertical orinetation
*/


/*!
\fn slider::slider(
        int const                       i_pos_x,
        int const                       i_pos_y,
        unsigned int const              i_len_x,
        unsigned int const              i_len_y)
\brief constructor 
\param[in] i_pos_x x position to place widget
\param[in] i_pos_y y position to place widget
\param[in] i_len_x x length of widget
\param[in] i_len_y y length of widget
\returns none
*/
    
/*!
\fn virtual slider::~slider()
\brief destructor
\returns none
*/

/*!
\fn virtual void slider::draw() const
\brief draws the widget

This method should not be called directly. 
\see widget::draw for details.
*/

/*!
\fn virtual enum event_response slider::event_key(
        struct event_key const&         i_event)
\brief handle key event
\param[in] i_event key event to handle    
\returns response how event was handled
*/

/*!
\fn virtual enum event_response slider::event_mouse(
        struct event_mouse const&       i_event)
\brief handle mouse event
\param[in] i_event mouse event to handle
\returns response how event was handled
*/

/*!
\fn void slider::set_orientation(
        enum orientation const          i_orientation)
\brief sets the orientation

This does not redraw. In addition, it does not resize the
widget to fit the new data type.
*/

/*!
\var slider::m_orientation
	orientation of the slider
*/

/*!
\fn double slider::value2pct(
        double const                    i_value) const
\brief converts value to percentage 
\param[in] i_value value to convert
\returns percentage
*/

/*!
\fn int slider::value2screen(
        double const                    i_value,
        int const                       i_len) const
\brief converts value to screen units
\param[in] i_value value to convert
\param[in] i_len if horizontal, length in the x direction. Otherwise, length in the y direction.
\returns position
*/

/*!
\fn double slider::screen2value(
        int const                       i_pos,
        int const                       i_len) const
\brief convert position to value
\param[in] i_pos position to convert
\param[in] i_len i_len if horizontal, length in the x direction. Otherwise, length in the y direction.
\returns value

/*!
\fn void slider::draw(
        struct box const&               i_box) const
\brief draw the widget within teh bounding box boundries 
\param[in] i_box bounding box
*/

/*!
\fn enum event_response slider::event_mouse(
        struct event_mouse const&       i_event,
        struct box const&               i_box)
\brief test event according to a boundbox
\param[in] i_event mouse event
\param[in] i_box bounding box
\returns response 
*/

/*!
\fn enum event_response slider::event_key_horizontal(
        struct event_key const&         i_event)
\brief handle event for horizontal slider
\param[in] i_event keyboard event
\returns response
*/

/*!
\fn enum event_response slider::event_key_vertical(
        struct event_key const&         i_event)
\brief handle key even for vertical slider
\param[in] i_event keyboard event
\returns response
*/