Opened 5 years ago

Last modified 4 months ago

#2593 new enhancement

GUI - Slider control

Reported by: historic_bruno Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by elexis)

Example: Example of a slider, from wxWidgets Windows port Such a control would help in various parts of the UI that need numeric values chosen along a scale.

Unique attributes:

  • Current value of the slider (possibly re-use caption field like other controls, should be readable/writable)
  • Orientation (horizontal or vertical)
  • Minimum value of the slider (left or bottom)
  • Maximum value of the slider (right or top)
  • Width of the button in screen coordinates
  • Background area sprite
  • Draggable button sprite
  • Sprites for disable/pressed states
  • Slider for integer or float values

Advanced version with markers/intervals:

  • Automatic placement of markers in equal intervals
  • Custom placement of markers, labels and tooltips on mouseover
  • Marker sprite and size

For horizontal slider, left-right arrow keys should move it, for vertical slider, up-down arrow keys should move it.

Old reference document: GUI_-_Slider

Attachments (1)

wxwidgets-slider.png (838 bytes) - added by historic_bruno 5 years ago.
Example of a slider, from wxWidgets Windows port

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by historic_bruno

Attachment: wxwidgets-slider.png added

Example of a slider, from wxWidgets Windows port

comment:1 Changed 5 years ago by historic_bruno

Description: modified (diff)

comment:2 in reply to:  description Changed 3 years ago by Vladislav Belov

Replying to historic_bruno:

Example: Example of a slider, from wxWidgets Windows port Such a control would help in various parts of the UI that need numeric values chosen along a scale.

This control will be good for settings (f.e. audio volume) or game setup. It could implemented like scrollbar, but horizontally, with adding the textbox for editing, which could be hidden.

comment:3 Changed 3 years ago by Imarok

dupe of #4039?

comment:4 Changed 3 years ago by elexis

Description: modified (diff)

Added to the ticket description above:

The slider should be usable for both natural numbers / integers (f.e. observer limit, AI difficulty) and floats (f.e. volume control, game speed).

The slider should show the selected, min and max value somewhere (either in the toolip or below the markers).

comment:5 Changed 3 years ago by elexis

Description: modified (diff)

comment:6 Changed 3 years ago by elexis

Description: modified (diff)

To comfortably seek/jump to savestates in replays (#3261), we need markers with custom position, label and tooltip on mouseover (so it could show markers for savepoints and events like player defeat).

comment:7 Changed 2 years ago by elexis

Description: modified (diff)

In r19479:

Add sliders to the GUI. Use them for the sound/music volume controls.

Patch by vladislavbelov, based on a patch by dpiquet.

Fixes #4039. Differential Revision: ​https://code.wildfiregames.com/D325

comment:8 Changed 4 months ago by Imarok

In 22164:

[CSlider] On click move the slider-button to the mouse position

Reviewed By: vladislavbelov
Refs: #2593
Differential Revision: https://code.wildfiregames.com/D1622

Note: See TracTickets for help on using tickets.