GUI for setting numeric ranges in Delphi

From time to time I need a graphical interface to set the number ranges , but so far I have never found a single component that would do it beautifully.

I tried to do the following:

  • 2 TTrackbars: 1 for min, 1 for max

  • 2 TTackbars: 1 for min, 1 for range

  • 2 TSpinEdit controls for entering numbers manually

  • ttrackbar with range 1 TTrackbar control, with a small button to switch between min-mode and max-mode. In mini mode, I set selStart and in max mode I set selEnd (with ShowSelRange set to true).

Most options require more screen properties than you would like, and they are not intuitive.

Ideally, I would like something that works like a scroll bar in Sony ACID. You can click and drag 3 different points to min, max, or both:

Awesome mspaint drawing

Is there any free component to set the range or something similar can be done using the ready-made VCL components creatively?


Update

I modified TMkRangeSlider to suit my needs. Now it works like a charm. I sent the modified component and demo to the original author.

TMkRangeSlider 1.1

+7
user-interface delphi range
source share
2 answers

How about something like Range Slider, by Mikhail Kochiashvili . This is free source code software written for Delphi 5 and comes with a demo:

alt text

It will not move at the minimum and maximum values ​​at the same time, but since you have a source, you can probably add this function if you really need it.

+5
source share

Using the standard TScrollBox, it is technically possible to manually check your PageSize and Position properties by dragging the thumb (ScrollCode = scTrack in your OnScroll event) to simulate the type of user interface that you showed in the ACID screenshot, The problem is that 1) you don’t you can draw the owner’s TScrollBar to add drag lines, and 2) there is no direct way to determine how much of the thumb the mouse mouse holds (ends against the middle). If you don't come up with reliable enough calculations to figure out pixel offsets of the left and right edges of the thumb based on the current position and PageSize with respect to the common client rectangle, then you are probably best off just writing your own instead, and then you can force look and behave him anyway.

+1
source share

All Articles