|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/22/2010 5:05:25 PM
Posts: 11,
Visits: 33
|
|
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?
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/22/2010 5:05:25 PM
Posts: 11,
Visits: 33
|
|
| 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.
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/22/2010 5:05:25 PM
Posts: 11,
Visits: 33
|
|
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?
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/22/2010 5:05:25 PM
Posts: 11,
Visits: 33
|
|
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.
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/22/2010 5:05:25 PM
Posts: 11,
Visits: 33
|
|
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.
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: Today @ 9:12:35 AM
Posts: 676,
Visits: 2,214
|
|
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
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/22/2010 5:05:25 PM
Posts: 11,
Visits: 33
|
|
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?
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: Today @ 9:12:35 AM
Posts: 676,
Visits: 2,214
|
|
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
|
|
|
|