Shoutbox

coding dynamic arrays - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: coding dynamic arrays (/showthread.php?tid=62639)

coding dynamic arrays by luisillo on 07-06-2006 at 01:53 AM

I'm working in a very nice script, when finished :P, I have almost everything done, but what I miss is a way for creating a window with an array of images(dynamically  loaded, from a given folder) where I can click on any of them , and get some information associated to that image.
I've been looking for something about in this forums and some others, but haven't found anything I can take profiit from.
I've read de MPLScriptingHelp and still don't know how to create that:

Does it have anyting to do with:

code:
<Element     xsi:type="ImageElement" Id="Img5">
            <Position Top="5" Left="86"/>
            <Image><Name>WHAT-SHOULD-BE-HERE???</Name></Image>
        </Element>


??

or must the images be loaded once the window is created?
after creating the window via:
code:
var wnd=MsgPlus.CreateWnd ('sth.xml','winId',0);


Any help or suggestion is welcome,
Thanks.
RE: coding dynamic arrays by Silentdragon on 07-06-2006 at 01:57 AM

wnd.ImageElmt_SetImageFile(ElementId,File);


RE: coding dynamic arrays by luisillo on 07-06-2006 at 02:40 AM

and what about adding all the images in a directory? I mean, not the code for setting the images,(it must be a simple for), what I'm looking for is actually the way of drawing their places in a grid, inside a window, I don't know if I get self explained, if not, please ask me.

Thanks you all


RE: coding dynamic arrays by Ash_ on 08-09-2006 at 04:21 AM

quote:
Originally posted by luisillo

code:
<Element     xsi:type="ImageElement" Id="Img5">
            <Position Top="5" Left="86"/>
            <Image><Name>WHAT-SHOULD-BE-HERE???</Name></Image>
        </Element>


make a directory in you scripts file ('C:\Program Files\Messenger Plus! Live\Scripts\CreateChildWnd' is the directory for the script im working on currently). so create a directory called 'Images' and save  your image in there (as png format i don't really know if any other formats work yet can anyone c/d that jpegs and stuff still load)

and then your code should be

code:
<Element     xsi:type="ImageElement" Id="Img5">
            <Position Top="5" Left="86"/>
            <Image><Name>name-of-image</Name></Image>
        </Element>


*note* don't put the file extension, i know it definately works on png files like this.
RE: coding dynamic arrays by Shondoit on 08-09-2006 at 10:59 AM

I believe he wants to dynamicly load all images in a directory, the best way is make a list with all filenames, and one imagebox, and load the image once a name is clicked in the list
If you want to make a gird, of all files, the best way I can think of is to create the XML in runtime and add all Imageboxes in your script, save the file, and the load the window