What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Cannot CreateChildWnd

Pages: (2): « First « 1 [ 2 ] Last »
Cannot CreateChildWnd
Author: Message:
mathieumg
Full Member
***


Posts: 181
Reputation: 2
34 / Male / Flag
Joined: May 2004
O.P. RE: Cannot CreateChildWnd
Script

code:
var WndManageFiles = null;
var WndAddFile = null;

WndManageFiles = MsgPlus.CreateWnd("GUI.xml", "WndManageFiles");
WndAddFile = MsgPlus.CreateChildWnd(WndManageFiles, "GUI.xml", "WndTest", 100, 40, true);


XML

code:
<Window Id="WndTest" Version="1">
<Attributes>
<Caption>Example</Caption>
</Attributes>

<TitleBar>
<Title>
<Text>Example</Text>
</Title>
</TitleBar>

<Position Width="180" Height="75"/>
<DialogTmpl/>
</Window>

Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-26-2006 01:37 AM
Profile E-Mail PM Web Find Quote Report
mickael9
Full Member
***


Posts: 117
Reputation: 3
32 / Male / Flag
Joined: Jul 2005
RE: Cannot CreateChildWnd
Where is the WndManageFiles window ? :p
06-26-2006 01:42 AM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Cannot CreateChildWnd
quote:
Originally posted by mathieumg
Script

code:
...

XML

code:
...


The point of the CreateChildWnd is to create One window then create another inside of it instead of having to use the SetParent API. Now what you need to do is first create your WndManageFiles which has the <DialogTmpl /> Template then you create your WndText window which has the <ChildTmpl />.


To show you a bit easier

XML
code:
    <Window Id="WndPref" Version="1">
        <Attributes>
            <Caption>Screenshot Sender</Caption>
            <SetForeground>True</SetForeground>
        </Attributes>
        <TitleBar>
            <Title><Text>Preferences</Text></Title>
        </TitleBar>
        <Position Width="350" Height="250"/>       
        <Elements>
            <Element xsi:type="ImageElement" Id="imgSidebar">
                <Position Top="121" Left="30" />
                <Image><Name>preferences-side-messenger</Name></Image>
            </Element>
            <Element xsi:type="FigureElement" Id="mnuFiller">
                <Position Top="102" Left="0" Width="96" Height="150"/>
                <Figure><Rectangle/></Figure>
                <Fill>
                    <LinearGradient Angle="0">
                        <Color1><BaseColor><Transparency>100</Transparency></BaseColor></Color1>
                        <Color2><BaseColor><Transparency>0</Transparency></BaseColor></Color2>
                    </LinearGradient>
                </Fill>
            </Element>
            <Element xsi:type="LineElement" Id="LnVerticalLine">
                <Position Top="0" Left="96" Width="0" Height="210">
                    <Anchor Horizontal="LeftRightFixed"/>
                </Position>
                <Size>1</Size>
                <Color><Red>195</Red><Green>195</Green><Blue>195</Blue></Color>
            </Element>               
        </Elements>
        <DialogTmpl>
            <BottomBar Style="Plain">
                <LeftControls>
                    <Control xsi:type="ButtonControl" Id="BtnAbout">
                        <Position Left="0" Top="0" Width="50"/>
                        <Caption>About...</Caption>
                    </Control>
                </LeftControls>
                <RightControls>
                    <Control xsi:type="ButtonControl" Id="BtnOk">
                        <Position Left="0" Top="0" Width="50"/>
                        <Caption>OK</Caption>
                    </Control>
                    <Control xsi:type="ButtonControl" Id="BtnCancel">
                        <Position Left="0" Top="0" Width="50"/>
                        <Caption>Close</Caption>
                    </Control>
                    <Control xsi:type="ButtonControl" Id="BtnApply">
                        <Position Left="0" Top="0" Width="50"/>
                        <Caption>Apply</Caption>
                    </Control>
                </RightControls>
            </BottomBar>
        </DialogTmpl>
       
        <Controls>
        </Controls>
    </Window>


    <Window Id="WndOverlay" Version="1">
        <ChildTmpl/>
        <Position Width="243" Height="193"/>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblVersion3">
                <Position Top="5" Width="100" Left="5" Height="15" />
                <Caption>Overlay Text</Caption>
                <Color><GlobalColor>green</GlobalColor></Color>
                <Font><Bold>true</Bold><Size>12</Size></Font>
            </Control>
            <Control xsi:type="StaticControl" Id="lblTitle">
                <Position Top="25" Width="100" Left="15" Height="15" />
                <Caption>To be later incorporated</Caption>
            </Control>
        </Controls>
    </Window>


Script

code:
    function OnEvent_MenuClicked(sMenuId, nLocation, ChatWnd){
        if(sMenuId == "preferences"){
            if (WndPref){
                Interop.Call('user32', 'SetForegroundWindow', WndPref.Handle);
            }else{
                WndPref = LoadChildWindows(MsgPlus.CreateWnd("ss4_gui.xml", "WndPref"));
            }
       
        }
        }

    function LoadChildWindows(Wnd){
    /*
        Load Child Windows
    */
        WndGeneral = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndGeneral", 153, 40, true);

        WndCurrentWnd = WndGeneral;
   
    /*
        Click Default General Button
    */
        Wnd.SendControlMessage('RadGeneral', 256 , 32, 0);
        Wnd.SendControlMessage('RadGeneral', 257 , 32, 0);
       
        return Wnd;
    }


I hope this makes a bit more sense on how to do it.

This post was edited on 06-26-2006 at 01:49 AM by matty.
06-26-2006 01:44 AM
Profile E-Mail PM Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
34 / Male / Flag
Joined: May 2004
O.P. RE: Cannot CreateChildWnd
quote:
Originally posted by mathieumg
Is there something that must be done differently in the .xml file?


In the first post of the thread :p

Will test now.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-26-2006 01:50 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Cannot CreateChildWnd
Here is an example of how to do it.

.plsc File Attachment: CreateChildWnd.plsc (2.01 KB)
This file has been downloaded 220 time(s).
06-26-2006 02:22 AM
Profile E-Mail PM Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
34 / Male / Flag
Joined: May 2004
O.P. RE: Cannot CreateChildWnd
Thank you for the demonstration! I guess it will help the people that use the forums search function too (are there any? :p)

I think I misunderstood what a WindowChild actually was ^^ Still good to know though If I ever need it.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-26-2006 02:39 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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