View previous topic :: View next topic |
Author |
Message |
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun May 08, 2005 4:45 pm Post subject: SNAP style for trackbar |
|
|
I would like to see a SNAP style for the trackbar element -- this would allow
the slider to 'snap' to the marks, instead of going pixel by pixel.
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon May 09, 2005 8:32 am Post subject: |
|
|
You can do this in the trackbar CLICK event:
Code: | :trackbar1click
dialog set,trackbar1,@prod(@div(@sum(@dlgtext(trackbar1),10),20),20)
goto loop |
The tick interval is 20 in the above example.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon May 09, 2005 7:22 pm Post subject: |
|
|
True, but it would be nice if it snapped to the lines while your were
dragging it. I don't know how possible it is for you to just add it in,
or how much work it would be, but if it's not much, I think it would
be a welcomed feature by everyone.
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue May 10, 2005 7:30 am Post subject: |
|
|
It's not a native feature of the trackbar control, as far as I am aware.
I think the issue occurs because VDS implements the control with a range of 0 to 100, so the resolution is 1. If it had a maximum value of 10 then I guess it would snap to each of the 10 valid positions.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu May 12, 2005 8:01 pm Post subject: |
|
|
You're right Jules -- would it be possible to control the range of the trackbar?
I've attached a simple demo of what I'm talking about built in Delphi 6 Personal.
Description: |
|
Download |
Filename: |
TrackbarDemo.exe |
Filesize: |
373.5 KB |
Downloaded: |
1995 Time(s) |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri May 13, 2005 8:45 am Post subject: |
|
|
It's possible, of course, but only by changing the definition of the trackbar to - I guess - something resembling the spin edit. So it would no longer be compatible with VDS 5. If it had been me who added the trackbar to VDS, that is probably how I would have done it. It seems to me a whole lot more useful to have it return the values you want, instead of returning the values 0 to 100 and forcing you to convert them.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon May 16, 2005 9:17 am Post subject: |
|
|
How did you do this, FF? I can't find a property that makes the slider move in increments of more than 1.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon May 16, 2005 8:44 pm Post subject: |
|
|
I'll attach the source for you to check it out.
I also attached a screenshot of the object inspector when the trackbar
was selected.
Description: |
|
Filesize: |
12.33 KB |
Viewed: |
2144 Time(s) |
|
Description: |
|
Download |
Filename: |
trackbar_src.zip |
Filesize: |
1.48 KB |
Downloaded: |
1820 Time(s) |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue May 17, 2005 7:56 am Post subject: |
|
|
Ah. I see. The increment was still 1. The maximum was 5. I was looking for a property that would let the trackbar have, say, a range of 0 to 100 and a step size of 5 or 10.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
|