View Full Version : Slider problem in Maxscript
newguy 03-22-2003, 04:59 AM Dear Friends,
I am trying to make a vertical slider with utility, but i am facing a problem, hope somebody can help me.
The maxscript as below
slider r_prism "Rotate" range:[0,360,0] orient:#vertical offset:[-30,400] ticks:10 height:200
i set the rollout as height 400, but i can't make the slider button or scale as height as 200.
So how can i do that i can have longer scale that i can move the slider button more (better viewing)?
Thanks,
|
|
LFShade
03-22-2003, 07:49 AM
If I understand you correctly, you want to create a slider that is greater than the default height. Unfortunately, this is not possible with the slider object in Maxscript. What you can do, though, is to use an ActiveX slider. It's a bit more tricky to grapple with, but it does offer a bit more flexibility than the Maxscript one. Here's an example of how to create an ActiveX slider in Maxscript using the one available in the Microsoft Common Controls library*:
activeXControl ax_slider "COMCTL.slider.1" pos:[8,8]
This will generate the slider control, but it will be horizontal by default, as well as being the wrong size. To fix that, you'll need to make some post-creation adjustments. Do this by adding an on open handler to the rollout:
on <rollout name> open do
(
<rollout name>.ax_slider.orientation = #sldVertical
<rollout name>.ax_slider.size = [40,200]
)
This gives you a nice, tall vertical slider (you can change the height by using a different value in the size parameter), but it has a default range of only 0 to 10 - possibly not what you want. You can add a couple more lines to the open handler to fix this:
on <rollout name> open do
(
<rollout name>.ax_slider.orientation = #sldVertical
<rollout name>.ax_slider.size = [40,200]
<rollout name>.ax_slider.max = 100
<rollout name>.ax_slider.tickFrequency = 10
)
Now you have a 200-unit tall vertical slider with a range of 0-100 with ticks displayed every 10 units. Of course, you can change any of this by playing with the values that you pass in to the various parameters. When you need to get/set the value of the slider, just use <rollout name>.ax_slider.value!
Hope this gives you an idea or three:thumbsup:
-RH
*you will need to have MSCOMCTL.OCX installed for this example to work; I believe it is part of the Windows installation, but if not it is available from many places - just search on Google and you'll find it.
LFShade
03-22-2003, 08:10 AM
Note that the example I give will actually work best in a rollout floater or dialog. For some reason the rollout on the utility panel is truncated in height in tests I have done, which can be worked around by adding other controls further down on the rollout. Just thought you should be aware of this :)
CGTalk Moderation
01-14-2006, 05:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.