|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <slider.hpp>
Public Types | |
| enum class | Orientation : uint8_t { Horizontal = 0 , Vertical } |
| Public Types inherited from fcn::Widget | |
| enum | BorderSide : uint8_t { BORDER_NONE = 0 , BORDER_LEFT = 1 << 0 , BORDER_TOP = 1 << 1 , BORDER_RIGHT = 1 << 2 , BORDER_BOTTOM = 1 << 3 , BORDER_ALL = BORDER_LEFT | BORDER_TOP | BORDER_RIGHT | BORDER_BOTTOM } |
| enum | BorderStyle : uint8_t { BORDER_STYLE_BEVEL = 0 , BORDER_STYLE_FLAT = 1 } |
| enum class | SelectionMode : uint8_t { None = 0 , Border = 1 , Background = 2 } |
Public Member Functions | |
| void | draw (Graphics *graphics) override |
| int | getMarkerLength () const |
| Orientation | getOrientation () const |
| double | getScaleEnd () const |
| double | getScaleStart () const |
| double | getStepLength () const |
| double | getValue () const |
| void | keyPressed (KeyEvent &keyEvent) override |
| void | mouseDragged (MouseEvent &mouseEvent) override |
| void | mousePressed (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedDown (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedLeft (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedRight (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedUp (MouseEvent &mouseEvent) override |
| Slider & | operator= (Slider &&)=delete |
| Slider & | operator= (Slider const &)=delete |
| void | setMarkerLength (int length) |
| void | setOrientation (Orientation orientation) |
| void | setScale (double scaleStart, double scaleEnd) |
| void | setScaleEnd (double scaleEnd) |
| void | setScaleStart (double scaleStart) |
| void | setStepLength (double length) |
| void | setValue (double value) |
| Slider (double scaleEnd=1.0) | |
| Slider (double scaleStart, double scaleEnd) | |
| Slider (Slider &&)=delete | |
| Slider (Slider const &)=delete | |
| Public Member Functions inherited from fcn::Widget | |
| virtual void | _draw (Graphics *graphics) |
| virtual FocusHandler * | _getFocusHandler () |
| virtual std::list< FocusListener * > const & | _getFocusListeners () |
| virtual FocusHandler * | _getInternalFocusHandler () |
| virtual std::list< KeyListener * > const & | _getKeyListeners () |
| virtual std::list< MouseListener * > const & | _getMouseListeners () |
| virtual void | _logic () |
| virtual void | _setFocusHandler (FocusHandler *focusHandler) |
| virtual void | _setParent (Widget *parent) |
| void | adaptLayout () |
| virtual void | adaptLayout (bool top) |
| void | addActionListener (ActionListener *actionListener) |
| void | addDeathListener (DeathListener *deathListener) |
| void | addDropTargetListener (DropTargetListener *listener) |
| void | addFocusListener (FocusListener *focusListener) |
| void | addKeyListener (KeyListener *keyListener) |
| void | addMouseListener (MouseListener *mouseListener) |
| void | addWidgetListener (WidgetListener *widgetListener) |
| virtual void | adjustSize () |
| bool | captureMouse () |
| bool | contains (int x, int y) const |
| virtual void | drawBorder (Graphics *graphics) |
| void | drawBorder (Graphics *graphics, unsigned int sides) const |
| virtual void | drawOutline (Graphics *graphics) |
| virtual void | drawSelectionFrame (Graphics *graphics) |
| void | expandContent () |
| virtual void | expandContent (bool recursion) |
| virtual void | focusNext () |
| virtual void | focusPrevious () |
| virtual void | fontChanged () |
| virtual void | getAbsolutePosition (int &x, int &y) const |
| std::string const & | getActionEventId () const |
| Color const & | getBackgroundColor () const |
| Color const & | getBaseColor () const |
| Color const & | getBorderColor () const |
| unsigned int | getBorderSides () const |
| unsigned int | getBorderSize () const |
| unsigned int | getBorderStyle () const |
| virtual Rectangle | getChildrenArea () |
| unsigned int | getChildrenCount () const |
| Rectangle const & | getDimension () const |
| Size const & | getFixedSize () const |
| Font * | getFont () const |
| Color const & | getForegroundColor () const |
| int | getHeight () const |
| std::string const & | getId () const |
| void | getLastPosition (int &x, int &y) const |
| int | getMarginBottom () const |
| int | getMarginLeft () const |
| int | getMarginRight () const |
| int | getMarginTop () const |
| Size const & | getMaxSize () const |
| Size const & | getMinSize () const |
| Color const & | getOutlineColor () const |
| unsigned int | getOutlineSize () const |
| unsigned int | getPaddingBottom () const |
| unsigned int | getPaddingLeft () const |
| unsigned int | getPaddingRight () const |
| unsigned int | getPaddingTop () const |
| virtual Widget * | getParent () const |
| Color const & | getSelectionColor () const |
| SelectionMode | getSelectionMode () const |
| virtual Widget * | getTop () const |
| unsigned int | getVisibleChildrenCount () const |
| Widget * | getWidgetAt (int x, int y) |
| virtual Widget * | getWidgetAt (int x, int y, Widget *exclude) |
| std::list< Widget * > | getWidgetsIn (Rectangle const &area) |
| virtual std::list< Widget * > | getWidgetsIn (Rectangle const &area, Widget *ignore) |
| int | getWidth () const |
| int | getX () const |
| int | getY () const |
| bool | hasMouseCapture () const |
| bool | isDescendantOf (Widget const *ancestor) const noexcept |
| bool | isEnabled () const |
| bool | isFixedSize () const |
| bool | isFocusable () const |
| virtual bool | isFocused () const |
| bool | isHorizontalExpand () const |
| bool | isInsideActiveMouseModal () const noexcept |
| bool | isLastPositionSet () const |
| virtual bool | isLayouted () |
| virtual bool | isModalFocusable () const |
| virtual bool | isModalFocused () const |
| virtual bool | isModalMouseInputFocusable () const |
| bool | isMouseInside (MouseEvent const &mouseEvent) const |
| bool | isSetVisible () const |
| bool | isTabInEnabled () const |
| bool | isTabOutEnabled () const |
| virtual bool | isUnderMouseModal () const |
| bool | isVerticalExpand () const |
| bool | isVisible () const |
| virtual void | logic () |
| virtual void | moveToBottom (Widget *widget) |
| virtual void | moveToTop (Widget *widget) |
| virtual void | onFocusChanged () |
| virtual void | onFocusGained () |
| virtual void | onFocusLost () |
| Widget & | operator= (Widget &&)=delete |
| Widget & | operator= (Widget const &)=delete |
| void | releaseMouse () |
| void | removeActionListener (ActionListener *actionListener) |
| void | removeDeathListener (DeathListener *deathListener) |
| void | removeDropTargetListener (DropTargetListener *listener) |
| void | removeFocusListener (FocusListener *focusListener) |
| void | removeKeyListener (KeyListener *keyListener) |
| void | removeMouseListener (MouseListener *mouseListener) |
| void | removeWidgetListener (WidgetListener *widgetListener) |
| virtual void | requestFocus () |
| virtual void | requestMoveToBottom () |
| virtual void | requestMoveToTop () |
| virtual void | resizeToContent (bool recursion=true) |
| void | setActionEventId (std::string const &actionEventId) |
| virtual void | setBackgroundColor (Color const &color) |
| virtual void | setBaseColor (Color const &color) |
| void | setBorderBottom (unsigned int size, unsigned int style) |
| virtual void | setBorderColor (Color const &color) |
| void | setBorderSides (unsigned int sides) |
| void | setBorderSize (unsigned int size) |
| void | setBorderStyle (unsigned int style) |
| void | setBorderTop (unsigned int size, unsigned int style) |
| virtual void | setDimension (Rectangle const &dimension) |
| void | setEnabled (bool enabled) |
| void | setFixedSize (Size const &size) |
| void | setFocusable (bool focusable) |
| virtual void | setFocused (bool focused) |
| virtual void | setFont (Font *font) |
| virtual void | setForegroundColor (Color const &color) |
| virtual void | setHeight (int height) |
| void | setHorizontalExpand (bool expand) |
| void | setId (std::string const &id) |
| void | setInternalFocusHandler (FocusHandler *internalFocusHandler) |
| void | setLastPosition (int x, int y) |
| void | setMargin (int margin) |
| void | setMarginBottom (int margin) |
| void | setMarginLeft (int margin) |
| void | setMarginRight (int margin) |
| void | setMarginTop (int margin) |
| void | setMaxSize (Size const &size) |
| void | setMinSize (Size const &size) |
| virtual void | setOutlineColor (Color const &color) |
| void | setOutlineSize (unsigned int size) |
| void | setPadding (unsigned int padding) |
| void | setPaddingBottom (unsigned int padding) |
| void | setPaddingLeft (unsigned int padding) |
| void | setPaddingRight (unsigned int padding) |
| void | setPaddingTop (unsigned int padding) |
| void | setPosition (int x, int y) |
| virtual void | setSelectionColor (Color const &color) |
| virtual void | setSelectionMode (SelectionMode mode) |
| virtual void | setSize (int width, int height) |
| void | setTabInEnabled (bool enabled) |
| void | setTabOutEnabled (bool enabled) |
| void | setVerticalExpand (bool expand) |
| void | setVisible (bool visible) |
| virtual void | setWidth (int width) |
| void | setX (int x) |
| void | setY (int y) |
| virtual void | showPart (Rectangle rectangle) |
| virtual void | showWidgetPart (Widget *widget, Rectangle area) |
| virtual void | textInput (TextInputEvent &event) |
| Widget () | |
| Widget (Widget &&)=delete | |
| Widget (Widget const &)=delete | |
| Public Member Functions inherited from fcn::MouseListener | |
| virtual void | mouseClicked (MouseEvent &mouseEvent) |
| virtual void | mouseEntered (MouseEvent &mouseEvent) |
| virtual void | mouseExited (MouseEvent &mouseEvent) |
| MouseListener (MouseListener &&)=default | |
| MouseListener (MouseListener const &)=default | |
| virtual void | mouseMoved (MouseEvent &mouseEvent) |
| virtual void | mouseReleased (MouseEvent &mouseEvent) |
| MouseListener & | operator= (MouseListener &&)=default |
| MouseListener & | operator= (MouseListener const &)=default |
| Public Member Functions inherited from fcn::KeyListener | |
| KeyListener (KeyListener &&)=default | |
| KeyListener (KeyListener const &)=default | |
| virtual void | keyReleased (KeyEvent &keyEvent) |
| KeyListener & | operator= (KeyListener &&)=default |
| KeyListener & | operator= (KeyListener const &)=default |
Protected Member Functions | |
| virtual void | drawMarker (Graphics *graphics) |
| virtual int | getMarkerPosition () const |
| virtual double | markerPositionToValue (int position) const |
| virtual int | valueToMarkerPosition (double value) const |
| Protected Member Functions inherited from fcn::Widget | |
| void | add (Widget *widget) |
| void | calculateSize () |
| void | distributeActionEvent () |
| void | distributeAncestorHiddenEvent (Widget *ancestor) |
| void | distributeAncestorMovedEvent (Widget *ancestor) |
| void | distributeAncestorShownEvent (Widget *ancestor) |
| void | distributeDragDrop (DragEvent &event) |
| bool | distributeDragEnter (DragEvent &event) |
| void | distributeDragHover (DragEvent &event) |
| void | distributeDragLeave (DragEvent &event) |
| void | distributeHiddenEvent () |
| void | distributeMovedEvent () |
| void | distributeResizedEvent () |
| void | distributeShownEvent () |
| virtual Widget * | findWidgetById (std::string const &id) |
| std::list< Widget * > const & | getChildren () const |
| virtual void | remove (Widget *widget) |
| virtual void | removeAllChildren () |
| void | resizeToChildren () |
| Protected Member Functions inherited from fcn::MouseListener | |
| MouseListener ()=default | |
| Protected Member Functions inherited from fcn::KeyListener | |
| KeyListener ()=default | |
Protected Attributes | |
| bool | mDragged {false} |
| int | mMarkerLength {10} |
| Orientation | mOrientation {Orientation::Horizontal} |
| double | mScaleEnd {1.0} |
| double | mScaleStart {0.0} |
| double | mStepLength {0.5} |
| double | mValue {0.0} |
| Protected Attributes inherited from fcn::Widget | |
| std::string | mActionEventId |
| std::list< ActionListener * > | mActionListeners |
| Color | mBackgroundColor {0xf9fafb} |
| Color | mBaseColor {0xe5e7eb} |
| Color | mBorderColor {0xd1d5db} |
| unsigned int | mBorderSides {BORDER_ALL} |
| unsigned int | mBorderSize {0} |
| unsigned int | mBorderStyle {BORDER_STYLE_FLAT} |
| std::list< Widget * > | mChildren |
| Font * | mCurrentFont {nullptr} |
| std::list< DeathListener * > | mDeathListeners |
| Rectangle | mDimension |
| std::list< DropTargetListener * > | mDropTargetListeners |
| bool | mEnabled {true} |
| Size | mFixedSize {-1, -1} |
| bool | mFixedSizeUsed {false} |
| bool | mFocusable {false} |
| bool | mFocused {false} |
| FocusHandler * | mFocusHandler {nullptr} |
| std::list< FocusListener * > | mFocusListeners |
| Color | mForegroundColor {0x1f2933} |
| bool | mHExpand {false} |
| std::string | mId |
| FocusHandler * | mInternalFocusHandler {nullptr} |
| std::list< KeyListener * > | mKeyListeners |
| int | mLastX {0} |
| int | mLastY {0} |
| int | mMarginBottom {0} |
| int | mMarginLeft {0} |
| int | mMarginRight {0} |
| int | mMarginTop {0} |
| Size | mMaxSize {std::numeric_limits<int>::max(), std::numeric_limits<int>::max()} |
| Size | mMinSize {0, 0} |
| std::list< MouseListener * > | mMouseListeners |
| Rectangle | mOffsetRect |
| Color | mOutlineColor {0x9ca3af} |
| unsigned int | mOutlineSize {0} |
| unsigned int | mPaddingBottom {0} |
| unsigned int | mPaddingLeft {0} |
| unsigned int | mPaddingRight {0} |
| unsigned int | mPaddingTop {0} |
| Widget * | mParent {nullptr} |
| Color | mSelectionColor {0x3b82f6} |
| SelectionMode | mSelectionMode {SelectionMode::None} |
| bool | mTabIn {true} |
| bool | mTabOut {true} |
| bool | mVExpand {false} |
| bool | mVisible {true} |
| std::list< WidgetListener * > | mWidgetListeners |
Additional Inherited Members | |
| Static Public Member Functions inherited from fcn::Widget | |
| static DeathListener * | _getGuiDeathListener () |
| static VisibilityEventHandler * | _getVisibilityEventHandler () |
| static void | _setGuiDeathListener (DeathListener *deathListener) |
| static void | _setVisibilityEventHandler (VisibilityEventHandler *visibilityEventHandler) |
| static Widget * | getMouseCapture () |
| static void | resetGlobalFont () |
| static void | setGlobalFont (Font *font) |
| static bool | widgetExists (Widget const *widget) |
| Static Protected Attributes inherited from fcn::Widget | |
| static DefaultFont | mDefaultFont |
| static Font * | mGlobalFont = nullptr |
| static DeathListener * | mGuiDeathListener = nullptr |
| static VisibilityEventHandler * | mVisibilityEventHandler = nullptr |
| static std::list< Widget * > | mWidgetInstances |
| static Widget * | sMouseCapture = nullptr |
A control for selecting a numeric value by sliding along a scale.
An implementation of a slider where a user can select different values by sliding between a start value and an end value of a scale. If the selected value is changed an action event will be sent to all action listeners of the slider.
Definition at line 31 of file slider.hpp.
|
strong |
Draw orientations for the slider.
A slider can be drawn vertically or horizontally.
Definition at line 39 of file slider.hpp.
|
explicit |
Constructor.
The default start value of the slider scale is zero.
| scaleEnd | The end value of the slider scale. |
Definition at line 18 of file slider.cpp.
References Slider().
Referenced by Slider().
| fcn::Slider::Slider | ( | double | scaleStart, |
| double | scaleEnd ) |
Constructor.
| scaleStart | The start value of the slider scale. |
| scaleEnd | The end value of the slider scale. |
Definition at line 22 of file slider.cpp.
References fcn::Widget::addKeyListener(), fcn::Widget::addMouseListener(), mScaleEnd, mScaleStart, fcn::Widget::setBackgroundColor(), fcn::Widget::setBaseColor(), fcn::Widget::setBorderSize(), fcn::Widget::setFocusable(), fcn::Widget::setForegroundColor(), setMarkerLength(), setOrientation(), setStepLength(), and setValue().
|
overridevirtual |
Draws the widget.
The call to draw is initiated by the widget's parent. The graphics object is set up so that all drawing is relative to the widget, i.e coordinate (0,0) is the top left corner of the widget. It is not possible to draw outside of a widget's dimension. If a widget has children, the parent's draw function will always be called before the children's draw functions are called.
| graphics | A graphics object to draw with. |
Implements fcn::Widget.
Definition at line 68 of file slider.cpp.
References fcn::Color::a, drawMarker(), fcn::Graphics::fillRectangle(), fcn::Widget::getBackgroundColor(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), and fcn::Graphics::setColor().
|
protectedvirtual |
Draws the marker.
| graphics | A graphics object to draw with. |
Definition at line 80 of file slider.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::drawRectangle(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getForegroundColor(), fcn::Widget::getHeight(), getMarkerLength(), getMarkerPosition(), getOrientation(), fcn::Widget::getWidth(), fcn::Widget::isFocused(), and fcn::Graphics::setColor().
Referenced by draw().
| int fcn::Slider::getMarkerLength | ( | ) | const |
Gets the length of the marker.
Definition at line 171 of file slider.cpp.
References mMarkerLength.
Referenced by drawMarker(), markerPositionToValue(), mouseDragged(), mousePressed(), and valueToMarkerPosition().
|
protectedvirtual |
Gets the marker position of the current selected value.
Definition at line 264 of file slider.cpp.
References getValue(), and valueToMarkerPosition().
Referenced by drawMarker().
| Slider::Orientation fcn::Slider::getOrientation | ( | ) | const |
Gets the orientation of the slider.
A slider can be drawn vertically or horizontally.
Definition at line 213 of file slider.cpp.
References mOrientation.
Referenced by drawMarker(), keyPressed(), markerPositionToValue(), mouseDragged(), mousePressed(), mouseWheelMovedDown(), mouseWheelMovedLeft(), mouseWheelMovedRight(), mouseWheelMovedUp(), and valueToMarkerPosition().
| double fcn::Slider::getScaleEnd | ( | ) | const |
Gets the end value of the scale.
Definition at line 57 of file slider.cpp.
References mScaleEnd.
Referenced by markerPositionToValue(), setValue(), and valueToMarkerPosition().
| double fcn::Slider::getScaleStart | ( | ) | const |
Gets the start value of the scale.
Definition at line 46 of file slider.cpp.
References mScaleStart.
Referenced by markerPositionToValue(), setValue(), and valueToMarkerPosition().
| double fcn::Slider::getStepLength | ( | ) | const |
Gets the step length.
The step length is used when the keys LEFT and RIGHT are pressed to step in the scale.
Definition at line 259 of file slider.cpp.
References mStepLength.
Referenced by keyPressed(), mouseWheelMovedDown(), mouseWheelMovedLeft(), mouseWheelMovedRight(), and mouseWheelMovedUp().
| double fcn::Slider::getValue | ( | ) | const |
Gets the current selected value.
Definition at line 166 of file slider.cpp.
References mValue.
Referenced by getMarkerPosition(), keyPressed(), mouseWheelMovedDown(), mouseWheelMovedLeft(), mouseWheelMovedRight(), and mouseWheelMovedUp().
|
overridevirtual |
Called if a key is pressed when the widget has keyboard focus.
If a key is held down the widget will generate multiple key presses.
| keyEvent | Describes the event. |
Reimplemented from fcn::KeyListener.
Definition at line 181 of file slider.cpp.
References fcn::InputEvent::consume(), fcn::Widget::distributeActionEvent(), fcn::KeyEvent::getKey(), getOrientation(), getStepLength(), getValue(), and setValue().
|
protectedvirtual |
Converts a marker position to a value in the scale.
| position | The position to convert. |
Definition at line 218 of file slider.cpp.
References fcn::Widget::getHeight(), getMarkerLength(), getOrientation(), getScaleEnd(), getScaleStart(), and fcn::Widget::getWidth().
Referenced by mouseDragged(), and mousePressed().
|
overridevirtual |
Called when the mouse has moved and the mouse has previously been pressed on the widget.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 138 of file slider.cpp.
References fcn::InputEvent::consume(), fcn::Widget::distributeActionEvent(), fcn::Widget::getHeight(), getMarkerLength(), getOrientation(), fcn::MouseEvent::getX(), fcn::MouseEvent::getY(), markerPositionToValue(), and setValue().
|
overridevirtual |
Called when a mouse button has been pressed down on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 124 of file slider.cpp.
References fcn::Widget::distributeActionEvent(), fcn::MouseEvent::getButton(), fcn::Widget::getHeight(), getMarkerLength(), getOrientation(), fcn::Widget::getWidth(), fcn::MouseEvent::getX(), fcn::MouseEvent::getY(), markerPositionToValue(), and setValue().
|
overridevirtual |
Called when the mouse wheel has moved down on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 279 of file slider.cpp.
References fcn::InputEvent::consume(), fcn::Widget::distributeActionEvent(), getOrientation(), getStepLength(), getValue(), and setValue().
|
overridevirtual |
Called when the mouse wheel has moved left on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 299 of file slider.cpp.
References fcn::InputEvent::consume(), fcn::Widget::distributeActionEvent(), getOrientation(), getStepLength(), getValue(), and setValue().
|
overridevirtual |
Called when the mouse wheel has moved right on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 289 of file slider.cpp.
References fcn::InputEvent::consume(), fcn::Widget::distributeActionEvent(), getOrientation(), getStepLength(), getValue(), and setValue().
|
overridevirtual |
Called when the mouse wheel has moved up on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 269 of file slider.cpp.
References fcn::InputEvent::consume(), fcn::Widget::distributeActionEvent(), getOrientation(), getStepLength(), getValue(), and setValue().
| void fcn::Slider::setMarkerLength | ( | int | length | ) |
Sets the length of the marker.
| length | The length for the marker. |
Definition at line 176 of file slider.cpp.
References mMarkerLength.
Referenced by Slider().
| void fcn::Slider::setOrientation | ( | Slider::Orientation | orientation | ) |
Sets the orientation of the slider.
A slider can be drawn vertically or horizontally.
| orientation | The orientation of the slider. |
Definition at line 208 of file slider.cpp.
References mOrientation.
Referenced by Slider().
| void fcn::Slider::setScale | ( | double | scaleStart, |
| double | scaleEnd ) |
Sets the scale of the slider.
| scaleStart | The start value of the scale. |
| scaleEnd | tThe end of value the scale. |
Definition at line 38 of file slider.cpp.
References mScaleEnd, mScaleStart, and mValue.
| void fcn::Slider::setScaleEnd | ( | double | scaleEnd | ) |
Sets the end value of the scale.
| scaleEnd | The end value of the scale. |
Definition at line 62 of file slider.cpp.
| void fcn::Slider::setScaleStart | ( | double | scaleStart | ) |
Sets the start value of the scale.
| scaleStart | The start value of the scale. |
Definition at line 51 of file slider.cpp.
References mScaleStart, and mValue.
| void fcn::Slider::setStepLength | ( | double | length | ) |
Sets the step length.
The step length is used when the keys LEFT and RIGHT are pressed to step in the scale.
| length | The step length. |
Definition at line 254 of file slider.cpp.
References mStepLength.
Referenced by Slider().
| void fcn::Slider::setValue | ( | double | value | ) |
Sets the current selected value.
| value | The current selected value. |
Definition at line 151 of file slider.cpp.
References getScaleEnd(), getScaleStart(), and mValue.
Referenced by keyPressed(), mouseDragged(), mousePressed(), mouseWheelMovedDown(), mouseWheelMovedLeft(), mouseWheelMovedRight(), mouseWheelMovedUp(), and Slider().
|
protectedvirtual |
Converts a value to a marker position.
| value | The value to convert. |
Definition at line 231 of file slider.cpp.
References fcn::Widget::getHeight(), getMarkerLength(), getOrientation(), getScaleEnd(), getScaleStart(), and fcn::Widget::getWidth().
Referenced by getMarkerPosition().
|
protected |
True if the slider is dragged, false otherwise.
Definition at line 237 of file slider.hpp.
|
protected |
Holds the length of the marker.
Definition at line 255 of file slider.hpp.
Referenced by getMarkerLength(), and setMarkerLength().
|
protected |
Holds the orientation of the slider.
A slider can be drawn vertically or horizontally.
Definition at line 272 of file slider.hpp.
Referenced by getOrientation(), and setOrientation().
|
protected |
Holds the end value of the scale.
Definition at line 265 of file slider.hpp.
Referenced by getScaleEnd(), setScale(), setScaleEnd(), and Slider().
|
protected |
Holds the start value of the scale.
Definition at line 260 of file slider.hpp.
Referenced by getScaleStart(), setScale(), setScaleStart(), and Slider().
|
protected |
Holds the step length.
The step length is used when the keys LEFT and RIGHT are pressed to step in the scale.
Definition at line 250 of file slider.hpp.
Referenced by getStepLength(), and setStepLength().
|
protected |
Holds the current selected value.
Definition at line 242 of file slider.hpp.
Referenced by getValue(), setScale(), setScaleEnd(), setScaleStart(), and setValue().