1.1-rc3
Public Types | Public Member Functions | Protected Attributes | List of all members
Scrollwheel Class Reference

Scrollwheel widget. More...

Inheritance diagram for Scrollwheel:
Inheritance graph
[legend]

Public Types

using ItemArray = std::vector< std::string >
 Item array type. More...
 
- Public Types inherited from StaticGrid
enum  GridFlag { show_border = detail::bit(0) }
 Grid flags. More...
 
using GridFlags = egt::Flags< GridFlag >
 Grid flags. More...
 
using GridPoint = PointType< size_t, detail::Compatible::grid >
 Rows and column of the grid. More...
 
using GridSize = SizeType< size_t, detail::Compatible::grid >
 Rows and columns size of the grid. More...
 
- Public Types inherited from Frame
using ChildDrawCallback = std::function< void(Painter &painter, Widget *widget)>
 Helper type that defines the special draw child callback. More...
 
- Public Types inherited from Widget
enum  Flag : uint32_t {
  plane_window = detail::bit(0), window = detail::bit(1), frame = detail::bit(2), disabled = detail::bit(3),
  readonly = detail::bit(4), active = detail::bit(5), invisible = detail::bit(6), grab_mouse = detail::bit(7),
  no_clip = detail::bit(8), no_layout = detail::bit(9), no_autoresize = detail::bit(10), checked = detail::bit(11)
}
 Common flags used for various widget properties. More...
 
using Flags = egt::Flags< Widget::Flag >
 Widget flags. More...
 
using WalkCallback = std::function< bool(Widget *widget, int level)>
 Callback definition used by walk(). More...
 
using WidgetId = uint64_t
 Type used to identify a unique Widget ID. More...
 
- Public Types inherited from Object
using EventCallback = std::function< void(Event &event)>
 Event handler callback function. More...
 
using FilterFlags = FlagsBase< EventId >
 Event handler EventId filter. More...
 
using RegisterHandle = uint64_t
 Handle type. More...
 

Public Member Functions

 Scrollwheel (const ItemArray &items={}) noexcept
 
 Scrollwheel (const Rect &rect, int min, int max, int step) noexcept
 
 Scrollwheel (const Rect &rect, ItemArray items={}) noexcept
 
 Scrollwheel (Frame &parent, const ItemArray &items={}) noexcept
 
 Scrollwheel (Frame &parent, const Rect &rect, const ItemArray &items={}) noexcept
 
void add_item (const std::string &item)
 Add an item at the end of the array. More...
 
void clear_items ()
 Remove all the items. More...
 
void deserialize (const std::string &name, const std::string &value, const Serializer::Attributes &attrs) override
 Deserialize widget properties. More...
 
void image_down (const Image &image)
 Change the down button image. More...
 
void image_up (const Image &image)
 Change the up button image. More...
 
EGT_NODISCARD size_t item_count () const
 Return the number of items. More...
 
EGT_NODISCARD Orientation orient () const
 Get the Orientation. More...
 
void orient (Orientation orient)
 Set the Orientation. More...
 
bool remove_item (const std::string &item)
 Remove an item from the array. More...
 
EGT_NODISCARD bool reversed () const
 Get the boolean reversed state of the scrollwheel. More...
 
void reversed (bool enabled)
 Enable or disable the reversed mode. More...
 
EGT_NODISCARD size_t selected () const
 Get the index of the item selected. More...
 
void selected (size_t index)
 Set the index to select a specific item. More...
 
void serialize (Serializer &serializer) const override
 Serialize the widget to the specified serializer. More...
 
EGT_NODISCARD std::string value () const
 Returns a string of the item selected. More...
 
- Public Member Functions inherited from StaticGrid
 StaticGrid (const GridSize &size=GridSize(1, 1))
 
 StaticGrid (const Rect &rect, const GridSize &size=GridSize(1, 1))
 
 StaticGrid (Frame &parent, const GridSize &size=GridSize(1, 1))
 
 StaticGrid (Frame &parent, const Rect &rect, const GridSize &size=GridSize(1, 1))
 
template<class T >
void add (const std::shared_ptr< T > &widget)
 Utility wrapper around add() More...
 
virtual void add (const std::shared_ptr< Widget > &widget)
 Add a child widget. More...
 
void add (const std::shared_ptr< Widget > &widget) override
 Add a widget to the next empty cell. More...
 
virtual void add (const std::shared_ptr< Widget > &widget, const GridPoint &point)
 Add a widget to the grid into a specific cell. More...
 
virtual void add (const std::shared_ptr< Widget > &widget, size_t column, size_t row)
 Add a widget to the grid into a specific cell. More...
 
void add (Widget &widget)
 Add a child widget. More...
 
virtual void add (Widget &widget, const GridPoint &point)
 Add a widget to the grid into a specific cell. More...
 
virtual void add (Widget &widget, size_t column, size_t row)
 Add a widget to the grid into a specific cell. More...
 
EGT_NODISCARD bool column_priority () const
 Get the column priority status. More...
 
void column_priority (bool value)
 Set the column priority status. More...
 
Widgetget (const GridPoint &point)
 Get a widget at the specified row and column. More...
 
EGT_NODISCARD DefaultDim horizontal_space () const
 Get the horizontal space. More...
 
void horizontal_space (DefaultDim space)
 Set the horizontal space i.e. More...
 
EGT_NODISCARD int last_add_column () const
 Returns the last column used for an add() call. More...
 
EGT_NODISCARD int last_add_row () const
 Returns the last row used for an add() call. More...
 
void layout () override
 
EGT_NODISCARD size_t n_col () const
 Get the number of columns. More...
 
EGT_NODISCARD size_t n_row () const
 Get the number of rows. More...
 
void remove (Widget *widget) override
 Remove a child widget. More...
 
EGT_NODISCARD DefaultDim vertical_space () const
 Get the vertical space. More...
 
void vertical_space (DefaultDim space)
 Set the vertical space i.e. More...
 
- Public Member Functions inherited from Frame
 Frame (const Frame &)=delete
 
 Frame (const Rect &rect={}, const Flags &flags={}) noexcept
 
 Frame (Frame &&) noexcept=default
 
 Frame (Frame &parent, const Rect &rect, const Flags &flags={}) noexcept
 
 ~Frame () noexcept override
 
template<class T >
void add (const std::shared_ptr< T > &widget)
 Utility wrapper around add() More...
 
void add (Widget &widget)
 Add a child widget. More...
 
void add_damage (const Rect &rect)
 Add damage to the damage array. More...
 
virtual void begin_draw ()
 Cause the frame to draw itself and all of its children. More...
 
EGT_NODISCARD std::shared_ptr< Widgetchild_at (size_t index) const
 Get a child widget at a specific index. More...
 
EGT_NODISCARD size_t count_children () const
 Get the number of children widgets. More...
 
void damage () override
 Damage the rectangle of the entire Frame. More...
 
void damage (const Rect &rect) override
 This will merge the damaged area with any already existing damaged area that it overlaps with into a super rectangle. More...
 
virtual void damage_from_child (const Rect &rect)
 Special variation of damage() that is to be called explicitly by child widgets. More...
 
void draw (Painter &painter, const Rect &rect) override
 Draw the widget. More...
 
template<class T >
std::shared_ptr< T > find_child (const std::string &name)
 Find a child Widget in the entire tree by name. More...
 
Framefind_screen ()
 Starting from this Frame, find the Frame that has a Screen. More...
 
const EGT_NODISCARD Framefind_screen () const
 Starting from this Frame, find the Frame that has a Screen. More...
 
void handle (Event &event) override
 Handle an event. More...
 
virtual EGT_NODISCARD bool has_screen () const
 Does this Frame have a screen? More...
 
Widgethit_test (const DisplayPoint &point)
 Get the widget under the given DisplayPoint. More...
 
bool is_child (Widget *widget) const
 Returns true if the child exists. More...
 
Frameoperator= (const Frame &)=delete
 
Frameoperator= (Frame &&) noexcept=default
 
void paint_children_to_file ()
 Paint individual children to file. More...
 
void paint_to_file (const std::string &filename={}) override
 Save the entire frame surface to a file. More...
 
void remove_all ()
 Remove all child widgets. More...
 
void resize (const Size &size) override
 Resize the widget. More...
 
void show () override
 Show the Widget. More...
 
template<typename T , typename... Args>
std::shared_ptr< T > spawn (Args &&... args)
 Create a child widget of the specified type. More...
 
void special_child_draw (Painter &painter, Widget *widget)
 Special draw function that can be invoked when drawing each child. More...
 
EGT_NODISCARD ChildDrawCallback special_child_draw_callback () const
 Get the special child draw callback. More...
 
void special_child_draw_callback (ChildDrawCallback func)
 Set the special child draw callback. More...
 
virtual EGT_NODISCARD Point to_child (const Point &p) const
 Convert a point with an origin of the current frame to child origin. More...
 
EGT_NODISCARD Rect to_child (Rect rect) const
 
virtual Point to_panel (const Point &p)
 Convert a local point to the coordinate system of the current panel. More...
 
EGT_NODISCARD bool top_level () const override
 Return true if this is a top level frame, with no parent. More...
 
void walk (const WalkCallback &callback, int level=0) override
 Walk the Widget tree and call callback with each Widget. More...
 
virtual EGT_NODISCARD size_t zorder () const
 Get the zorder of the widget. More...
 
size_t zorder (const Widget *widget) const
 Get the zorder of the widget. More...
 
virtual void zorder_bottom ()
 Move the widget to the bottom. More...
 
void zorder_bottom (const Widget *widget)
 Move the specified widget zorder to the bottom of the current list of widgets with the same parent. More...
 
virtual void zorder_down ()
 Move this widgets zorder down relative to other widgets with the same parent. More...
 
void zorder_down (const Widget *widget)
 Move the specified widget zorder down relative to other widgets with the same parent. More...
 
virtual void zorder_top ()
 Move the widget to the top. More...
 
void zorder_top (const Widget *widget)
 Move the specified widget zorder to the top of the current list of widgets with the same parent. More...
 
virtual void zorder_up ()
 Move this widgets zorder up relative to other widgets with the same parent. More...
 
void zorder_up (const Widget *widget)
 Move the specified widget zorder up relative to other widgets with the same parent. More...
 
- Public Member Functions inherited from Widget
 Widget (const Rect &rect={}, const Widget::Flags &flags={}) noexcept
 
 Widget (const Widget &)=delete
 
 Widget (Frame &parent, const Rect &rect={}, const Widget::Flags &flags={}) noexcept
 
 Widget (Widget &&) noexcept=default
 
 ~Widget () noexcept override
 
EGT_NODISCARD bool active () const
 Get the active state. More...
 
void active (bool value)
 Set the active state. More...
 
AlignFlagsalign ()
 Get the alignment. More...
 
const EGT_NODISCARD AlignFlagsalign () const
 Get the alignment. More...
 
void align (const AlignFlags &a)
 Align the widget. More...
 
EGT_NODISCARD float alpha () const
 Get the alpha property. More...
 
void alpha (float alpha)
 Set the alpha property. More...
 
EGT_NODISCARD bool autoresize () const
 Return the autoresize state of the widget. More...
 
void autoresize (bool value)
 Set the autoresize state. More...
 
EGT_NODISCARD DefaultDim border () const
 Get the border width. More...
 
void border (DefaultDim border)
 Set the border width. More...
 
EGT_NODISCARD Theme::BorderFlags border_flags () const
 Get the border flags. More...
 
void border_flags (const Theme::BorderFlags &flags)
 Set the border flags. More...
 
EGT_NODISCARD float border_radius () const
 Get the border radius. More...
 
void border_radius (float radius)
 Set the border radius. More...
 
const EGT_NODISCARD Rectbox () const
 Bounding box for the Widget. More...
 
void box (const Rect &rect)
 Change the bounding box of the widget. More...
 
bool can_handle_event () const
 Returns true if the widget is capable of handling an event. More...
 
EGT_NODISCARD Point center () const
 Get the center point of the widget's box(). More...
 
EGT_NODISCARD bool checked () const
 Get the boolean checked state of the a widget. More...
 
virtual void checked (bool value)
 Set the checked state of the widget. More...
 
EGT_NODISCARD bool clip () const
 Return the clip state of the widget. More...
 
const EGT_NODISCARD Patterncolor (Palette::ColorId id) const
 Get a Widget color. More...
 
void color (Palette::ColorId id, const Pattern &color, Palette::GroupId group=Palette::GroupId::normal)
 Add a color to the widget's instance palette. More...
 
const EGT_NODISCARD Patterncolor (Palette::ColorId id, Palette::GroupId group) const
 Get a Widget color. More...
 
virtual EGT_NODISCARD Rect content_area () const
 Return the area that content is allowed to be positioned into. More...
 
void detach ()
 Detach this widget from its parent. More...
 
void disable ()
 Set the disabled state to true. More...
 
void disable_toggle ()
 Toggle the disabled state. More...
 
EGT_NODISCARD bool disabled () const
 Return the disabled state of the widget. More...
 
void disabled (bool value)
 Set the disabled state. More...
 
DisplayPoint display_origin ()
 Get the display origin of the Widget. More...
 
virtual Point display_to_local (const DisplayPoint &p)
 Convert a display point to a local point. More...
 
void draw_box (Painter &painter, Palette::ColorId bg, Palette::ColorId border) const
 Helper function to draw this widget's box using the appropriate theme. More...
 
void draw_circle (Painter &painter, Palette::ColorId bg, Palette::ColorId border) const
 Helper function to draw this widget's circle using the appropriate theme. More...
 
void enable ()
 Set the disabled state to false. More...
 
Theme::FillFlagsfill_flags ()
 Get a modifiable fill flags reference. More...
 
const EGT_NODISCARD Theme::FillFlagsfill_flags () const
 Get the fill flags. More...
 
void fill_flags (const Theme::FillFlags &flags)
 Set the fill flags. More...
 
EGT_NODISCARD bool focus () const
 Get the current focus state. More...
 
const EGT_NODISCARD Fontfont () const
 Get the widget Font. More...
 
void font (const Font &font)
 Set the widget Font. More...
 
EGT_NODISCARD bool frame () const
 Return the frame state of the widget. More...
 
EGT_NODISCARD bool grab_mouse () const
 Return the grab_mouse state of the widget. More...
 
void grab_mouse (bool value)
 Set the grab_mouse state. More...
 
EGT_NODISCARD DefaultDim height () const
 Height of the widget's box(). More...
 
void height (DefaultDim h)
 Change the height. More...
 
virtual void hide ()
 Hide the Widget. More...
 
EGT_NODISCARD DefaultDim horizontal_ratio () const
 Get the horizontal ratio relative to parent. More...
 
void horizontal_ratio (DefaultDim horizontal)
 Set the horizontal ratio relative to parent. More...
 
EGT_NODISCARD bool in_layout () const
 Indicate if the Widget is computing the layout or not. More...
 
DisplayPoint local_to_display (const Point &p)
 Convert a local point to a display point. More...
 
EGT_NODISCARD DefaultDim margin () const
 Get the margin width. More...
 
void margin (DefaultDim margin)
 Set the margin width. More...
 
virtual EGT_NODISCARD Size min_size_hint () const
 Get a minimum size hint for the Widget. More...
 
void min_size_hint (const Size &size)
 Set the minimum size hint for the Widget. More...
 
EGT_NODISCARD size_t moat () const
 Get the sum of the margin(), padding(), and border() around the content of the widget. More...
 
virtual void move (const Point &point)
 Move the Widget to a new position. More...
 
void move_to_center ()
 Move the widget to the center of its parent. More...
 
void move_to_center (const Point &point)
 Move the widget to the specified center point. More...
 
EGT_NODISCARD bool no_layout () const
 Return the no_layout state of the widget. More...
 
void no_layout (bool value)
 Set the no_layout state. More...
 
Widgetoperator= (const Widget &)=delete
 
Widgetoperator= (Widget &&) noexcept=default
 
EGT_NODISCARD DefaultDim padding () const
 Return the padding width. More...
 
void padding (DefaultDim padding)
 Set the padding width. More...
 
virtual void paint (Painter &painter)
 Paint the Widget using a Painter. More...
 
void palette (const Palette &palette)
 Set the widget instance Palette. More...
 
Frameparent ()
 Get a pointer to the parent Frame, or nullptr if none exists. More...
 
const EGT_NODISCARD Frameparent () const
 Get a pointer to the parent Frame, or nullptr if none exists. More...
 
EGT_NODISCARD bool plane_window () const
 Return the plane_window state of the widget. More...
 
const EGT_NODISCARD Pointpoint () const
 Get the origin of the widget's box(). More...
 
void ratio (DefaultDim horizontal, DefaultDim vertical)
 Set the size ratio relative to parent. More...
 
void ratio (DefaultDim ratio)
 Set the size ratio relative to parent. More...
 
EGT_NODISCARD bool readonly () const
 Get the readonly state of the widget. More...
 
void readonly (bool value)
 Set the readonly state of the widget. More...
 
void readonly_toggle ()
 Toggle the readonly state. More...
 
void reset_palette ()
 Clear the widget instance palette. More...
 
void reset_theme ()
 Reset the Widget's Theme to the default Theme. More...
 
void resize_by_ratio (DefaultDim hratio, DefaultDim vratio)
 Scale the current size of the Widget given the ratio. More...
 
void resize_by_ratio (DefaultDim ratio)
 Scale the current size of the Widget given the ratio. More...
 
virtual void scale (float hscale, float vscale)
 Set the scale of the widget. More...
 
void scale (float scale)
 Set the scale of the widget. More...
 
virtual EGT_NODISCARD Screenscreen () const
 Get a pointer to the Screen instance, using using a parent as necessary. More...
 
const EGT_NODISCARD Sizesize () const
 Get the size of the widget's box(). More...
 
const EGT_NODISCARD Themetheme () const
 Get the Widget Theme. More...
 
void theme (const Theme &theme)
 Set the Widget's theme to a new theme. More...
 
EGT_NODISCARD Point to_parent (const Point &r) const
 Convert a point with a local origin to a parent origin. More...
 
EGT_NODISCARD Rect to_parent (const Rect &r) const
 Convert a point in a rect a local origin to a parent origin. More...
 
virtual EGT_NODISCARD std::string type () const
 Returns a string representation of the type of this widget. More...
 
const EGT_NODISCARD Rectuser_requested_box () const
 Get the box corresponding to the user requested one, not the actual one. More...
 
EGT_NODISCARD DefaultDim vertical_ratio () const
 Get the vertical ratio relative to parent. More...
 
void vertical_ratio (DefaultDim vertical)
 Set the vertical ratio relative to parent. More...
 
EGT_NODISCARD bool visible () const
 Get the visible state of the widget. More...
 
void visible (bool value)
 Set the visible state. More...
 
void visible_toggle ()
 Toggle the visibility state. More...
 
EGT_NODISCARD WidgetId widgetid () const
 Get the unique id of the widget. More...
 
EGT_NODISCARD DefaultDim width () const
 Width of the widget's box(). More...
 
void width (DefaultDim w)
 Change the width. More...
 
EGT_NODISCARD DefaultDim x () const
 X coordinate of the widget's box(). More...
 
void x (DefaultDim x)
 Set the X coordinate of the box. More...
 
EGT_NODISCARD DefaultDim xratio () const
 Get the X position ratio relative to parent. More...
 
void xratio (DefaultDim xratio)
 Set the X position ratio relative to parent. More...
 
EGT_NODISCARD DefaultDim y () const
 Y coordinate of the widget's box(). More...
 
void y (DefaultDim y)
 Set the Y coordinate of the box. More...
 
EGT_NODISCARD DefaultDim yratio () const
 Get the Y position ratio relative to parent. More...
 
void yratio (DefaultDim yratio)
 Set the Y position ratio relative to parent. More...
 
virtual EGT_NODISCARD size_t zorder () const
 Get the zorder of the widget. More...
 
virtual void zorder_bottom ()
 Move the widget to the bottom. More...
 
virtual void zorder_down ()
 Move this widgets zorder down relative to other widgets with the same parent. More...
 
virtual void zorder_top ()
 Move the widget to the top. More...
 
virtual void zorder_up ()
 Move this widgets zorder up relative to other widgets with the same parent. More...
 
- Public Member Functions inherited from Object
 Object () noexcept=default
 
 Object (const Object &)=delete
 
 Object (Object &&)=default
 
virtual ~Object () noexcept=default
 
void clear_handlers ()
 Clear all registered event handlers. More...
 
void invoke_handlers (Event &event)
 Invoke all handlers with the specified event. More...
 
void invoke_handlers (EventId event)
 Invoke all handlers with the specified EventId. More...
 
const EGT_NODISCARD std::string & name () const
 Get the name of the Object. More...
 
void name (const std::string &name)
 Set the name of the Object. More...
 
RegisterHandle on_event (const EventCallback &handler, const FilterFlags &mask={})
 Add an event handler to be called when the widget generates an event. More...
 
Objectoperator= (const Object &)=delete
 
Objectoperator= (Object &&)=default
 
void remove_handler (RegisterHandle handle)
 Remove an event handler. More...
 

Public Attributes

Signal on_value_changed
 Event signal. More...
 
- Public Attributes inherited from Widget
Signal on_checked_changed
 Event signal. More...
 
Signal on_gain_focus
 Invoked when the widget gains focus. More...
 
Signal on_lost_focus
 Invoked when the widget loses focus. More...
 
Signal on_show
 Invoked when a widget is shown. More...
 
Signal on_hide
 Invoked when a widget is hidden. More...
 

Protected Attributes

ImageButton m_button_down
 Down button. More...
 
ImageButton m_button_up
 Up button. More...
 
ItemArray m_items
 Array of items. More...
 
Label m_label
 Label for the value. More...
 
Orientation m_orient {Orientation::vertical}
 Orientation of the Scrollwheel. More...
 
bool m_reversed {false}
 Reversed direction of up/down. More...
 
size_t m_selected {0}
 Currently selected index. More...
 
- Protected Attributes inherited from StaticGrid
CellArray m_cells
 Cell array of the grid. More...
 
bool m_column_priority {false}
 Column priority when expanding the grid automatically. More...
 
GridSize m_grid_size {}
 Grid size. More...
 
DefaultDim m_horizontal_space {}
 Space between rows. More...
 
int m_last_add_column {-1}
 Last added column. More...
 
int m_last_add_row {-1}
 Last added row. More...
 
DefaultDim m_vertical_space {}
 Space betwwen columns. More...
 
- Protected Attributes inherited from Frame
ChildrenArray m_children
 Array of child widgets in the order they were added. More...
 
Screen::DamageArray m_damage
 The damage array for this frame. More...
 
bool m_in_draw {false}
 Status for whether this frame is currently drawing. More...
 
ChildDrawCallback m_special_child_draw_callback
 Used internally for calling the special child draw function. More...
 
- Protected Attributes inherited from Widget
Rect m_box
 Bounding box. More...
 
bool m_in_layout {false}
 Status for whether this widget is currently performing layout. More...
 
Size m_min_size
 Minimum size of the widget when not an empty value. More...
 
Framem_parent {nullptr}
 Pointer to this widget's parent. More...
 
Rect m_user_requested_box
 Keep track of the box requested by the user. More...
 
WidgetId m_widgetid {0}
 Unique ID of this widget. More...
 
- Protected Attributes inherited from Object
detail::CopyOnWriteAllocate< CallbackArraym_callbacks
 Array of callbacks. More...
 
RegisterHandle m_handle_counter {0}
 Counter used to generate unique handles for each callback registration. More...
 
std::string m_name
 A user defined name for the Object. More...
 

Additional Inherited Members

- Protected Types inherited from StaticGrid
using CellArray = std::vector< std::vector< std::weak_ptr< Widget > >>
 Type for cell array. More...
 
- Protected Types inherited from Frame
using ChildrenArray = std::vector< std::shared_ptr< Widget > >
 Helper type for an array of children. More...
 
- Protected Types inherited from Object
using CallbackArray = std::vector< CallbackMeta >
 Helper type for an array of callbacks. More...
 
- Protected Member Functions inherited from StaticGrid
void reallocate (const GridSize &size)
 Reallocate the size of the grid keeping any existing cells intact. More...
 
void reposition ()
 Re-position all child widgets. More...
 
- Protected Member Functions inherited from Widget
const EGT_NODISCARD Palettedefault_palette () const
 Get a reference to the default palette. More...
 
Widget::Flagsflags ()
 Get a modifiable ref of the flags. More...
 
const EGT_NODISCARD Widget::Flagsflags () const
 Get a const ref of the flags. More...
 
EGT_NODISCARD Rect local_box () const
 Get the local box which is the same size as box(), but with the origin zeroed. More...
 
EGT_NODISCARD bool parent_in_layout ()
 Indicate if our parent is computing the layout. More...
 
void parent_layout ()
 Call our parent to do a layout. More...
 
virtual void set_parent (Frame *parent)
 Set this widget's parent. More...
 

Detailed Description

Scrollwheel widget.

Manages a list of selectable items. Only the one selected is shown. Navigation through the list is done with the top and bottom arrows.

Member Typedef Documentation

◆ ItemArray

using ItemArray = std::vector<std::string>

Item array type.

Constructor & Destructor Documentation

◆ Scrollwheel() [1/5]

Scrollwheel ( const ItemArray items = {})
explicitnoexcept
Parameters
[in]itemsArray of items to build the list.

◆ Scrollwheel() [2/5]

Scrollwheel ( const Rect rect,
ItemArray  items = {} 
)
explicitnoexcept
Parameters
[in]rectInitial rectangle of the widget.
[in]itemsArray of items to build the list.

◆ Scrollwheel() [3/5]

Scrollwheel ( Frame parent,
const ItemArray items = {} 
)
explicitnoexcept
Parameters
[in]parentThe parent Frame.
[in]itemsArray of items to build the list.

◆ Scrollwheel() [4/5]

Scrollwheel ( Frame parent,
const Rect rect,
const ItemArray items = {} 
)
explicitnoexcept
Parameters
[in]parentThe parent Frame.
[in]rectInitial rectangle of the widget.
[in]itemsArray of items to build the list.

◆ Scrollwheel() [5/5]

Scrollwheel ( const Rect rect,
int  min,
int  max,
int  step 
)
explicitnoexcept
Parameters
[in]minThe range minimum value.
[in]maxThe range maximum value.
[in]stepThe value of step to create a list from the minimum value to the maximum one.
[in]rectInitial rectangle of the widget.

Member Function Documentation

◆ add_item()

void add_item ( const std::string &  item)

Add an item at the end of the array.

◆ clear_items()

void clear_items ( )

Remove all the items.

◆ deserialize()

void deserialize ( const std::string &  name,
const std::string &  value,
const Serializer::Attributes attrs 
)
overridevirtual

Deserialize widget properties.

Reimplemented from StaticGrid.

◆ image_down()

void image_down ( const Image image)

Change the down button image.

◆ image_up()

void image_up ( const Image image)

Change the up button image.

◆ item_count()

EGT_NODISCARD size_t item_count ( ) const
inline

Return the number of items.

◆ orient() [1/2]

EGT_NODISCARD Orientation orient ( ) const
inline

Get the Orientation.

◆ orient() [2/2]

void orient ( Orientation  orient)

Set the Orientation.

◆ remove_item()

bool remove_item ( const std::string &  item)

Remove an item from the array.

◆ reversed() [1/2]

EGT_NODISCARD bool reversed ( ) const
inline

Get the boolean reversed state of the scrollwheel.

◆ reversed() [2/2]

void reversed ( bool  enabled)

Enable or disable the reversed mode.

When enabled the behavior of the up and down button is swapped.

◆ selected() [1/2]

EGT_NODISCARD size_t selected ( ) const

Get the index of the item selected.

◆ selected() [2/2]

void selected ( size_t  index)

Set the index to select a specific item.

◆ serialize()

void serialize ( Serializer serializer) const
overridevirtual

Serialize the widget to the specified serializer.

Reimplemented from StaticGrid.

◆ value()

EGT_NODISCARD std::string value ( ) const

Returns a string of the item selected.

Member Data Documentation

◆ m_button_down

ImageButton m_button_down
protected

Down button.

◆ m_button_up

ImageButton m_button_up
protected

Up button.

◆ m_items

ItemArray m_items
protected

Array of items.

◆ m_label

Label m_label
protected

Label for the value.

◆ m_orient

Orientation m_orient {Orientation::vertical}
protected

Orientation of the Scrollwheel.

◆ m_reversed

bool m_reversed {false}
protected

Reversed direction of up/down.

◆ m_selected

size_t m_selected {0}
protected

Currently selected index.

◆ on_value_changed

Signal on_value_changed

Event signal.

Invoked when the value changes.