VASSlider help
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



VASSlider help Expand / Collapse
Author
Message
Posted 7/8/2009 9:47:19 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2009 11:01:30 AM
Posts: 11, Visits: 32
Hi everyone,

I'm trying to use something exactly like the VASSlider described in this post, but it's going to represent a price instead of a state. Ideally, the subject could move the slider around and the displayed value would transition from $0.00 on the low end to $20.00 on the high end. I've tried adding something like nRating inside the loop in the MoveCursor inline object, and that doesn't crash everything, but I don't know if it's showing the right value because I have no way to display it.

Help?
Post #3233
Posted 7/8/2009 9:49:49 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2009 11:01:30 AM
Posts: 11, Visits: 32
Jeez, I didn't even put my question there. I want to display the value of the slider before the subject makes their response. This way they know what price they are selecting before releasing the mouse button.
Post #3234
Posted 7/12/2009 7:21:05 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2009 11:01:30 AM
Posts: 11, Visits: 32
So I took a crack at it, and I think what I have would work if I could just get the text box to update in the middle of the loop in the 'MoveCursor' inline object. I reset the 'Rating' attribute, but it doesn't redraw the textbox. How can I redraw the textbox in a slide object?

  Post Attachments 
VASSlider.es (9 views, 21.64 KB)
Post #3248
Posted 7/13/2009 9:58:26 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2009 11:01:30 AM
Posts: 11, Visits: 32
So, I ended up fixing it myself. I copied the initialization of the textbox in the slide object to the part where I wanted it to refresh.

"Set VASSlide_SlideText = CSlideText(VASSlide.States.Item("Default").Objects(1))
VASSlide_SlideText.Text = "$" &_
c.GetAttrib("Rating")"

Hope that helps the next person with this problem.


  Post Attachments 
VASSlider.es (16 views, 21.72 KB)
Post #3249
Posted 7/13/2009 1:17:40 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2009 11:01:30 AM
Posts: 11, Visits: 32
So, I guess I'll keep chatting to myself here. I've got another question for people and if I solve it I'll post it here as well. I want to implement the VASSlider on a scale and I want to add tick marks. It seems like there should be an easy way to do this, right? Just draw a line on the slide through the desired pixel points and then add vertical hash marks at the appropriate locations. This actually doesn't work because the line I just made is not considered part of the slide. When the slide is redrawn to account for a change in the slider position the line disappears. You can insert some code to redraw it again, but this leads to an annoying flicker as the line gets cleared and drawn again, over and over. So, how can I draw a graphic on a slide using the built in tools on EPrime? This doesn't seem like it should be that hard, and I don't want to resort to drawing a long "_______________" and overlaying the "|" marks. I'd like to have some precision here.

Anyway, you folks let me know if you come up with something.
Post #3251
Posted 7/13/2009 2:10:51 PM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Forum Members
Last Login: 3/5/2010 1:35:19 PM
Posts: 641, Visits: 2,010
Any reason you have to draw the underlying scale & ticks dynamically? Otherwise you could just save an image of the scale with ticks, and load that image as a slide sub-object.

-- David McFarlane, Professional Faultfinder
Post #3252
Posted 7/13/2009 4:41:10 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2009 11:01:30 AM
Posts: 11, Visits: 32
Ok, I did that and it looks pretty good. I think I just wanted to use the convenient draw feature. Truth be told, the scale bar took 5 minutes to make so that was definitely the better choice. Thanks!


One final question (I hope), this one pertaining to the formatting of slide text. Can I do that from the properties window? I basically want the final script to read:
VASSlide_SlideText.Text = Format$(c.GetAttrib("Rating"),"Currency")

as opposed to

VASSlide_SlideText.Text = c.GetAttrib("Rating")

which is the default. I can manually do it after the script has been saved by EStudio, but is there a better way?
Post #3258
Posted 7/13/2009 4:53:12 PM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Forum Members
Last Login: 3/5/2010 1:35:19 PM
Posts: 641, Visits: 2,010
Yes. Use an attribute reference in your slide text sub-object. E.g., put [Rating] in your slide text sub-object, then in script before the slide do

c.SetAttrib "Rating", Format$(c.GetAttrib("Rating"), "Currency")


As a matter of general E-Prime programming style, I avoid setting object properties directly in script and instead do as much as I can through attribute references. And in particular, after you upgrade to EP2 you will no longer be able to do the sort of post-generation script fixup that you propose (see http://support.pstnet.com/forum/Topic696-12-1.aspx).

-- David McFarlane, Professional Faultfinder
Post #3259
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 2:05pm

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.078. 9 queries. Compression Disabled.
 
Privacy | Terms of Use | Terms and Conditions | Legal Trademarks | Authorized Use | Quality Policy
Copyright 2009 Psychology Software Tools, Inc. All Rights Reserved
Email: Info@pstnet.com | Telephone: 412.271.5040 | Fax: 412.271.7077