forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


SNAP style for trackbar

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun May 08, 2005 4:45 pm    Post subject: SNAP style for trackbar Reply with quote

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
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon May 09, 2005 8:32 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon May 09, 2005 7:22 pm    Post subject: Reply with quote

True, but it would be nice if it snapped to the lines while your were
dragging it. Smile 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
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue May 10, 2005 7:30 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu May 12, 2005 8:01 pm    Post subject: Reply with quote

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.



TrackbarDemo.exe
 Description:

Download
 Filename:  TrackbarDemo.exe
 Filesize:  373.5 KB
 Downloaded:  1936 Time(s)


_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri May 13, 2005 8:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon May 16, 2005 9:17 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon May 16, 2005 8:44 pm    Post subject: Reply with quote

I'll attach the source for you to check it out. Smile
I also attached a screenshot of the object inspector when the trackbar
was selected.



obj_insp.png
 Description:
 Filesize:  12.33 KB
 Viewed:  2080 Time(s)

obj_insp.png



trackbar_src.zip
 Description:

Download
 Filename:  trackbar_src.zip
 Filesize:  1.48 KB
 Downloaded:  1762 Time(s)


_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue May 17, 2005 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group