Re: A few more questions about sliders

From: Dmitry Karasik <dmitry_at_karasik.eu.org>
Date: Wed, 31 Dec 2008 23:17:56 +0100
To: tjg_at_gimmel.org

        Hi Tim!

 Tim> there a direct way to get the slider delta, or 2) is there is a way
 Tim> to store a persistent variable within onChange, I could always check
 Tim> the new value with the last known value. I am assuming all code
 Tim> (using VB) within an event is non-persistent.

There's no way to get the delta, and you're right that you can
compare the new value with the last recorded one. Within onChange
you can do something like $self-> {my_last_value} = $self-> value

 Tim> 2. To pick up with the last sentence, all variables are local to the
 Tim> event correct?

In the example above. no.

 Tim> 3. I need the labels(tick marks etc) on the my main slider to change
 Tim> depending on certain conditions (band). This means that min max
 Tim> change at runtime. When I do this all ticks and values disappear.
 Tim> Is this normal? Are the tick marks design time only? Do I need to
 Tim> call a repaint routine of some sort?

Yes, that is a sort of under-developed feature. You need to
call also $slider-> scheme(ss::Axis) (or whatever ss:: was
used). The reason for that is scheme() destroys content of
property ticks(), which may be set separately.

 Tim> 4. I have included a screenshot of my app, part of the text is cut
 Tim> off on the slider. The left side should be 7000 and the right is
 Tim> 7300. How is the border adjusted without affecting the slider
 Tim> itself?

Ughm. I'm afraid there isn't a good answer for this question.
Without changing Sliders.pm the best way is to manually
deal with ticks() property, to make extra space in the left
and in the right by adding some ticks that will allow the text
to display in full. F.ex. do smth like

$obj-> ticks(
{ value => $min, height => 0}, $obj-> ticks,
{ value => $max, height => 0})

and adjust min and max accordingly.

 Of course the right way would be to
have a property that would account for this problem. I'll try
to see if I can solve this elegantly.

 Tim> 5. Am I making a mistake using VB to build this app?

Don't know really. I think the best role for VB is to develop
a standalone dialog, save it in a fm file, but develop the
main application separately.

-- 
Sincerely,
	Dmitry Karasik
Received on Wed 31 Dec 2008 - 23:17:59 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET