LM_ScrollBar - anyone know how to use it?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Stan
Posts: 220
Joined: Sun Apr 19, 2009 3:22 pm

LM_ScrollBar - anyone know how to use it?

Post by Stan »

Version 9.2 added a new LM.GUI class - LM_ScrollBar. Does it mean that we can now create scrollable dialog elements?
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

not sure about the scroll bar but here is the setup for sliders

The first parameter: length of slider
The second parameter: horizontal = false - vertical = true
The third parameter: no ticks = false - show ticks = true
The last is the usual Constant message

d.slider = LM.GUI.Slider(250, false, false, cw_basic_tool_bar.SLIDER)
d.slider:SetRange(0, 100)
l:AddChild(d.slider)

Regards
Chris.
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

Here is the basic scroll bar setup

self.scrollbara = LM.GUI.ScrollBar(200, false, cw_slider_test.SCROLLBAR) -- Length of scroll bar
self.scrollbara:SetRange(0, 200) -- initial range
layout:AddChild(self.scrollbara)

Regards
Chris.
Stan
Posts: 220
Joined: Sun Apr 19, 2009 3:22 pm

Re: LM_ScrollBar - anyone know how to use it?

Post by Stan »

Yeah, but what can be scrolled with it, and how?
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

Stan wrote:Yeah, but what can be scrolled with it, and how?
Just about anything that is animatable.

How? you need to have a look at some code if you are new to scripting there is plenty about.

Regards
Chris.
Stan
Posts: 220
Joined: Sun Apr 19, 2009 3:22 pm

Re: LM_ScrollBar - anyone know how to use it?

Post by Stan »

If so, then what is the point of having LM_Slider class and LM_ScrollBar class together?

I think that scroll bars aren't suppose to be used for controlling animatable things, they are for scrolling GUI elements. Take a look at this scrollable element in the InsertText GUI:

Image

See, the scroll bars are controlling the position of the rectangular element inside the GUI window. And that element itself contains other elements inside - static texts, sliders, text controls.
Last edited by Stan on Fri Feb 01, 2013 11:40 pm, edited 2 times in total.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

Sorry I should have said animatable or controlable.

Regards
Chris.
Stan
Posts: 220
Joined: Sun Apr 19, 2009 3:22 pm

Re: LM_ScrollBar - anyone know how to use it?

Post by Stan »

videodv wrote:Sorry I should have said animatable or controlable.
Maybe you know where to find an example? InsertText tool is hardcoded.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

Stan wrote:Maybe you know where to find an example? InsertText tool is hardcoded.
Just have alook at the scripts that came with the programe it will get you started.

Regards
Chris.
Stan
Posts: 220
Joined: Sun Apr 19, 2009 3:22 pm

Re: LM_ScrollBar - anyone know how to use it?

Post by Stan »

videodv wrote: Just have alook at the scripts that came with the programe it will get you started.
Man, which one? Tell me, which of them is written in Lua and uses LM_ScrollBar? If such a script exists, I'd be more than happy to take a look.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

Stan wrote: Man, which one? Tell me, which of them is written in Lua and uses LM_ScrollBar? If such a script exists, I'd be more than happy to take a look.
They are all written in lua but none of them have sliders or scroll bar examples you have to program them in yourself at this time(see script insert above)

Are you new to scripting ASP? If so and you need a simple example I will upload one for you to get you started.

Regards
Chris.
Stan
Posts: 220
Joined: Sun Apr 19, 2009 3:22 pm

Re: LM_ScrollBar - anyone know how to use it?

Post by Stan »

videodv wrote: They are all written in lua but none of them have sliders or scroll bar
There are sliders and scroll bars in the InsertText tool, but they are not created with Lua.
I'm not new to scripting and I don't need a simple example, thanks.

Here is my question: Is it possible to make a scrollable gui container with Lua, and if it is, then how?
If you don't know the answer, please don't say anything.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
videodv
Posts: 69
Joined: Tue Feb 08, 2011 10:17 am

Re: LM_ScrollBar - anyone know how to use it?

Post by videodv »

Just trying to be helpful

Bye
Post Reply