Start a new topic

Tutorial / SlickSliders the other Buttons ...

SlickSliders

yet another way to manage many buttons ...

Buttons are great, with Buttons you can do slick things. But when you need a lot of them your project can easily became intricate ...

Many Buttons are badly managable ... it is very easy to loose control over them.

And to find some errors based on some wrong code inside one specific Button can became a nightmare the more you have ...

So, how can we simplify this all? With a SliderBar instead of all your Buttons ...

A SliderBar is nothing more than multiple Buttons within your set SliderRange ...

So, when you need 10 Buttons in a Row or a Column, just create a SliderBar within the range of 1-10 ...


    That’s it? No, not completely ...

A Button react only on a press and a release event ...


    ok, so, we just use this in our Slider too ...

But the SliderCursor does not snap to my buttons position ...


    well, we just set the Cursor’s size to 0x0 ... and the Cursor is away ...

And how about some slick graphics for my buttons?


    Just design your complete Button-Row within your graphics application

    and use it as Slider Background ...

Ok, but when I now press the Slider, I can’t see where I press, no virtual Button Effect ...


    yes, you are right, so, we just make one inside the Slider's Press Event ...

    a few simple "line" commands will do it ...

Oh, and don’t forget to restore your Buttons to initial visual state when release your “Buttons”

But the Slider only returns a number ... how can I get e.g. a character out of this?

Yeah, that’s a problem ... really? No ...


    Numbers are even better than characters, because you can directly

    calculate on them for further purpose ...


Just trigger a Click Subroutine, where all the rest is handled ...

And there we go ...

Instead of 20 Buttons in a Row, you just can use one simple SliderBar to do all ...
Instead of a full blowen Keyboard, you can just use 4 Sliders, one for every Button-Row ...

Instead of a Grid of 20x20 aka 400 Buttons, just use 20 Sliders ...


Isn’t that slick? Attached a small example, how all works together ...

Have fun

Gerry

HMI
(37.2 KB)

2 people like this idea

to give you just a few ideas ... how to use ... where to use ...


    - Array Inputs

    - Coordinate Detections

    - More accurate Input Devices

    - JoyPads

    - Interactive Maps

    - Interactive Games

    - Remote Controls


just everywhere, where you have the need of many buttons ...


HMI

3 people like this

for whole keyboards ...

HMI

2 people like this

or something like a ColorPicker? I guess, it is a big difference if you need to manage 81 Buttons or only 9 Sliders ... 

not to forget, that your maximum number of Objects is limited for a single page ...

hmi

2 people like this