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
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Library] SliderControl - by Eljay on 01-21-2007 at 02:42 PM
RE: [Library] SliderControl - by plus on 01-21-2007 at 02:52 PM
RE: [Library] SliderControl - by effection on 01-21-2007 at 11:46 PM
RE: [Library] SliderControl - by matty on 01-21-2007 at 11:56 PM
RE: [Library] SliderControl - by vikke on 01-22-2007 at 11:19 AM
RE: [Library] SliderControl - by bigbob85 on 02-01-2008 at 12:23 AM
RE: [Library] SliderControl - by Eljay on 02-01-2008 at 12:29 AM
RE: [Library] SliderControl - by bigbob85 on 02-01-2008 at 05:30 AM
RE: [Library] SliderControl - by tribbium on 08-29-2009 at 08:22 AM


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