What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Library] SliderControl

[Library] SliderControl
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. [Library] SliderControl
SliderControl Library

This is just a small library that makes SliderControls easier to control (pun not intended), with the following features:
-Set the position of a SliderControl (SliderControl_SetPosition)
-Get the position of a SliderControl (SliderControl_GetPosition)
-Trigger a custom event when the SliderControl is moved (OnWindowIdEvent_SliderPositionChanged)

Steps needed to use this library:
-Extract the attached zip to your script's folder
-Register your control with SliderControl_Register (You only need this if you are going to use the SliderPositionChanged event)
-Register the MessageNotification event with the SliderControl message handler (Again, only needed for the event, see example usage for more info)
-That's all folks, you're now ready to use this library!

Example Usage:
code:
/*----------
Example Usage of SliderControl
  In this example the window is called SliderExample, and the SliderControl's Id is TestSlider.
----------*/

var SliderExample = MsgPlus.CreateWnd("Example.xml", "SliderExample");
/* This just registers a few details the library needs */
SliderControl_Register(SliderExample, "TestSlider");

/* This handles the messages for when the user moves your SliderControl */
/* If you already use MessageNotification for other messages, simply trigger the
SliderControl_MessageHandler function inside your existing MessageNotification, passing
all the same parameters, e.g:
function OnSliderExampleEvent_MessageNotification(PlusWnd, Message, wParam, lParam){
  //Your other message handling stuff here
  SliderControl_MessageHandler(PlusWnd, Message, wParam, lParam);
}
*/

var OnSliderExampleEvent_MessageNotification = SliderControl_MessageHandler;

/* This event is triggered when the Slider is moved by the user */
function OnSliderExampleEvent_SliderPositionChanged(PlusWnd, ControlId, Position){
  Debug.Trace(PlusWnd.WindowId + "->" + ControlId + " is now at position " + Position);
}
/* This function sets the position of the specified SliderControl (duh) */
SliderControl_SetPosition(SliderExample, "TestSlider", 50);
/* And this function gets the current position of the specified SliderControl */
var Position = SliderControl_GetPosition(SliderExample, "TestSlider");

Known problems:
-Doesn't work for vertically oriented SliderControls, working on it. FIXED

What'cha waiting for? DOWNLOAD

.zip File Attachment: _SliderControl.zip (1.02 KB)
This file has been downloaded 585 time(s).

This post was edited on 01-21-2007 at 02:55 PM by Eljay.
01-21-2007 02:42 PM
Profile PM Find Quote Report
plus
Banned


Posts: 127
Reputation: -10
Joined: Jan 2007
RE: [Library] SliderControl
yes, I really need this thanks :):):):):):):)

Great
01-21-2007 02:52 PM
Profile E-Mail PM Find Quote Report
effection
Full Member
***

Destroy The Runner

Posts: 135
Reputation: 4
– / Male / Flag
Joined: Sep 2006
RE: [Library] SliderControl
nice could come in useful :)
01-21-2007 11:46 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Library] SliderControl
Awesome looks good EllyJelly!
01-21-2007 11:56 PM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: [Library] SliderControl
Awesome! Works like a charm :)
01-22-2007 11:19 AM
Profile E-Mail PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
RE: [Library] SliderControl
I cant get it to work... :S, Copy pasted the code, and made my interface window like this..
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Window Id="SliderExample" Version="1">
        <Position ClientWidth="310" ClientArea="172" Width="310" Height="172"/>
        <DialogTmpl/>
        <Controls>
            <Control xsi:type="ScrollBarControl" Id="TestSlider">
                <Position Left="200" Top="5" Height="100" Width="10" />
            </Control>
        </Controls>
    </Window>
</Interfaces>

Also, having a <VerticalBar/> in there didnt help either.. Any ideas?
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-01-2008 12:23 AM
Profile E-Mail PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: [Library] SliderControl
quote:
Originally posted by bigbob85

<Control xsi:type="ScrollBarControl" Id="TestSlider">
  <Position Left="200" Top="5" Height="100" Width="10" />
</Control>


Should be a SliderControl, hence the name of the library. :P
02-01-2008 12:29 AM
Profile PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
RE: [Library] SliderControl
* bigbob85 feels dumb...

Any idea how to use scrollbars? :P
Neva mind, I have an idea, ill make a thread about it.

* bigbob85 feels even more stupid when he realises his thread is not related to what he intended.

This post was edited on 02-04-2008 at 02:13 PM by bigbob85.
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-01-2008 05:30 AM
Profile E-Mail PM Web Find Quote Report
tribbium
Junior Member
**


Posts: 34
Reputation: 3
– / Male / Flag
Joined: Jul 2008
RE: [Library] SliderControl
Hey, I've just implemented your code and it works great for the most part, but I had to rehash some of it to get it to work perfectly =P

Is there any reason the following condition wouldn't be detected properly?
code:
    if(typeof(GlobalScope[EventName]) == "function"){
      GlobalScope[EventName](PlusWnd, SliderControlArray[lParam], NewPosition);
    }

It returns that the type of this event is undefined =\. I replaced that bit and based on the code I threw together, I know that its there and works:

code:
eval (EventName + "(PlusWnd, SliderControlArray[lParam],NewPosition);")

Anyone know the reason this could be?
Are you and your friends trivia enthusiasts? Download Tribbium! http://www.msgpluslive.net/scripts/view/427-Tribb...ia-Gaming-System)/

Download questions for Tribbium here:
http://www.tribbium.tk
08-29-2009 08:22 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On