A Simple TimeSlider

First, let me apologise for what I’m about to do, which is seemingly bombard the forum with a load of posts.
I’ve a series of sliders and updates to previous postings which I have neglected to post over the past few months and if I don’t get them out of the way, they’ll never get posted.

I can hear some of you are already muttering, Good! :wink:

Full usage notes are in the code:

Tested: Windows 10/11 | Python 3.11.6 |
wxPython 4.2.2 | wxWidgets 3.2.3

          Linux Mint 21 | Python 3.10.12 |
          wxPython 4.2.1 gtk3 | wxWidgets 3.2.3

A slider/gauge representing time in ISO 8601 timestamp format i.e hh:mm:ss.SSS

TimeSlider allows you to define a horizontal or vertical slider that operates between a time of 0 and 24:00:00.000
The slider may also be Inverted i.e. upside down if vertical or reversed if horizontal i.e. Right to Left
You may also use it to create a progress timer or a reverse countdown between a time of 0 and 24:00:00.000
It works in seconds for input and output, so a time slider of one hour would have a maximum value of
60 seconds x 60 minutes i.e. 3,600 seconds (60*60)
one minute - 60
ten minutes - 600 etc
Internally it works in Milliseconds.

Setting a value follows the same rule, setting 3 minutes 45 seconds ((3*60) + 45) i.e. 225
-Ticks are the same, set the time period in seconds between each tick e.g. 10 minutes - 600

  • Ticks, if selected, are presented at the bottom of the slider if it is horizontal or on the right, if vertical
    UNLESS the slider label is aligned at the bottom or right respectively in which case the ticks
    are presented at the top or the left, to avoid clashing with the label

Time formats:

The following variations are selectable via the format parameter:
hh:mm:ss %H:%M:%S
hh:mm.ss.SSS %H:%M:%S.%f
hh:mm %H:%M
mmm:ss %M:%S
mmm:ss.SSS %M:%S.%f
sssss %S
sssss.SSS %S.%f

The default is %H:%M:%S

timeslider.zip (14.5 KB)