Shoutbox

[?] Interface Windows - Custom Look - 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: [?] Interface Windows - Custom Look (/showthread.php?tid=76673)

[?] Interface Windows - Custom Look by roflmao456 on 08-10-2007 at 04:04 AM

could anyone explain to me how to use custom look in interface windows?


RE: [?] Interface Windows - Custom Look by NanaFreak on 08-10-2007 at 06:23 AM

code:
<Control xsi:type="ButtonControl" Id="Btn">
<Position Top="5" Left="5" Width="50" Height="10"/>
<CustomLook>
<Normal>
<Element xsi:type="TextElement" Id="BtnNormText">
<Position Top="0" Left="0" Width="50" Height="10"/>
<Text>Norm</Text>
</Element>
</Normal>
<Hot>
<Element xsi:type="TextElement" Id="BtnHotText">
<Position Top="0" Left="0" Width="50" Height="10"/>
<Text>Hot</Text>
</Element>
</Hot>
<Pushed>
<Element xsi:type="TextElement" Id="BtnPushedText">
<Position Top="0" Left="0" Width="50" Height="10"/>
<Text>Pushed</Text>
</Element>
</Pushed>
</CustomLook>
</Control>


Note: this code is not tested, please say if it does not work and I will make sure it will work

This code is a button that when not hovered/pushed it will display the text "Norm" with no background. When Hovered over it will display "Hot" with no background and when pushed it will display the text "Pushed" with no background.

I hope this is what you were after...
RE: [?] Interface Windows - Custom Look by Spunky on 08-10-2007 at 02:21 PM

You could have a look at SS4 as it uses CustomLook on the side bar (which are all actually radio controls) or PSM+ which is the same code


RE: [?] Interface Windows - Custom Look by roflmao456 on 08-18-2007 at 09:17 PM

thanks, but i wonder if there is a "<Disabled>" tag? :P


RE: [?] Interface Windows - Custom Look by NanaFreak on 08-19-2007 at 01:15 AM

quote:
Originally posted by roflmao456
thanks, but i wonder if there is a "<Disabled>" tag? :P
yes there is, but is it not always needed... just look up the scripting doc =\
RE: [?] Interface Windows - Custom Look by roflmao456 on 08-19-2007 at 07:25 PM

ok,

i'm trying to change the image of an ImageElement inside the Normal, Hot, and Pushed tags using the

code:
Wnd.ImageElmt_SetImageFile("BtnImg1","Image2.png");
but it won't work. it will just show in the debug:

Invalid procedure [...]
RE: [?] Interface Windows - Custom Look by mynetx on 08-20-2007 at 11:41 AM

try this one:

code:
<Control xsi:type="ButtonControl" Id="btnYourButtonId">
    <Position Left="123" Top="123" Width="123" Height="123" />
    <Caption>Alternative Caption here</Caption>
    <CustomLook>
        <Normal>
            <Element xsi:type="ImageElement" Id="btnYourButtonIdNormal">
                <Position Top="0" Left="0" />
                <Image>
                    <Name>without-dot-png-your-image-file-normal</Name>
                </Image>
            </Element>
        </Normal>
        <Hot>
            <Element xsi:type="ImageElement" Id="btnYourButtonIdHot">
                <Position Top="0" Left="0" />
                <Image>
                    <Name>without-dot-png-your-image-file-hot</Name>
                </Image>
            </Element>
        </Hot>
        <Pushed>
            <Element xsi:type="ImageElement" Id="btnYourButtonIdPushed">
                <Position Top="0" Left="0" />
                <Image>
                    <Name>without-dot-png-your-image-file-pushed</Name>
                </Image>
            </Element>
        </Pushed>
    </CustomLook>
</Control>

Regards,
mynetx
RE: [?] Interface Windows - Custom Look by roflmao456 on 08-20-2007 at 02:32 PM

quote:
Originally posted by mynetx

actually the XML is working fine, it's just changing the element's images using script.
RE: [?] Interface Windows - Custom Look by mynetx on 08-20-2007 at 02:37 PM

Invalid procedure seems to tell you that the method isn't valid for the given object, that is, Wnd is no correct Plus Window Object in the moment of execution.


RE: [?] Interface Windows - Custom Look by roflmao456 on 08-20-2007 at 02:44 PM

quote:
Originally posted by mynetx
Invalid procedure seems to tell you that the method isn't valid for the given object, that is, Wnd is no correct Plus Window Object in the moment of execution.
code:
var Wnd = MsgPlus.CreateWnd("windows.xml","test");

?
RE: [?] Interface Windows - Custom Look by matty on 08-20-2007 at 02:47 PM

Post the entire function where you are creating the window and trying to change the element.


RE: [?] Interface Windows - Custom Look by roflmao456 on 08-20-2007 at 02:49 PM

quote:
Originally posted by matty
Post the entire function where you are creating the window and trying to change the element.
code:
function set(){
var Wnd = MsgPlus.CreateWnd("windows.xml","test");
Wnd.ImageElmt_SetImageFile("testImg","crazyman");
}

testImg is defined
RE: [?] Interface Windows - Custom Look by mynetx on 08-20-2007 at 02:55 PM

then there is no XML Image Element using the ID "BtnImg1". Pay attention as XML is case-sensitive.


RE: [?] Interface Windows - Custom Look by roflmao456 on 08-20-2007 at 05:18 PM

quote:
Originally posted by mynetx
Pay attention as XML is case-sensitive.
* roflmao456 knows that.

do i have to instead put the button's ID instead of the image element id?

damn i spilled brisk on my keyboard
RE: [?] Interface Windows - Custom Look by mynetx on 08-21-2007 at 09:40 AM

Syntax
ImageElmt_SetImageFile(
    [string] ElementId,
    [string] File
);

Parameters
ElementId
[string] Unique identifier of the element.
File
[string] Path to the image's file to use. It can be a PNG, a JPG, a GIF or a BMP file. The path is relative to the script's "Images" sub-directory by default, to override this behavior, prefix the path with "\". Example: "\C:\directory\picture.png".


IMHO, strings must always be noted within " "  or ' '. Or am I wrong?! :P


RE: [?] Interface Windows - Custom Look by Spunky on 08-21-2007 at 01:58 PM

quote:
Originally posted by roflmao456
code:

function set(){
var Wnd = MsgPlus.CreateWnd("windows.xml","test");
Wnd.ImageElmt_SetImageFile("testImg","crazyman");
}

testImg is defined

testImg is defined as a variable? If thats what you mean, why are you using quotes? Or do you mean defined in the XML?

I think I actually tried to do what your doing with part of the interface for the tic-tac-toe script we made, but I don't think it was possible to change it via code
RE: [?] Interface Windows - Custom Look by roflmao456 on 08-21-2007 at 02:04 PM

quote:
Originally posted by mynetx
IMHO, strings must always be noted within " "  or ' '. Or am I wrong?!

both. but they could contain each other =\

"lool 'this is in single quote'"
'lool "this is in double quote"'

but i prefer "" :P


oops didn't read post correctly :(

yep.

quote:
Originally posted by SpunkyLoveMuff
Or do you mean defined in the XML?
yeah :)
RE: [?] Interface Windows - Custom Look by Matti on 08-21-2007 at 04:37 PM

code:
Wnd.ImageElmt_SetImageFile("testImg","crazyman");
Shouldn't it be something like:
code:
Wnd.ImageElmt_SetImageFile("testImg","crazyman.png");
However I doubt this whole thing can work, since I don't know if you can set an ImageElement which is part of a CustomLook structure... :-\
RE: [?] Interface Windows - Custom Look by roflmao456 on 08-21-2007 at 04:44 PM

quote:
Originally posted by Mattike
code:
Wnd.ImageElmt_SetImageFile("testImg","crazyman");
Shouldn't it be something like:
code:
Wnd.ImageElmt_SetImageFile("testImg","crazyman.png");
However I doubt this whole thing can work, since I don't know if you can set an ImageElement which is part of a CustomLook structure... :-\
i tried that too :P
doesn't work, it's ok if this imageelement thing doesn't work, i will just try something else =\