Shoutbox

SetControlText on a child window - 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: SetControlText on a child window (/showthread.php?tid=78976)

SetControlText on a child window by MeEtc on 11-12-2007 at 06:19 PM

I am having a hard time trying to get these child windows working with YASS. After some pain, i finally have the radio buttons working to change the page just fine, but I am unable to load the initial values into the text boxes. Can anyone provide some insight?

The trace command at the bottom does print the correct value in the debug window, so the data is there.

code:
function loadImgEditor(data, iid){
    var wnd = MsgPlus.CreateWnd('yass_gui_imgedit.xml', 'WndImageEdit', 1);
   
    wnd.Button_SetCheckState('RadGeneral', true);
    cwnd_General = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.General', 130, 60, true);
    cwnd_Background = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.Background', 130, 60, false);
    cwnd_DP = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.DP', 130, 60, false);
    cwnd_StatusImg = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.StatusImg', 130, 60, false);
    cwnd_StatusText = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.StatusText', 130, 60, false);
    cwnd_Nick = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.Nick', 130, 60, false);
    cwnd_PSM = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.PSM', 130, 60, false);
    cwnd_Time = MsgPlus.CreateChildWnd(wnd, 'yass_gui_imgedit.xml', 'WndimageEdit.Time', 130, 60, false);
   
    activechild = cwnd_General;
    loadwnd.close(0);
    wnd.Visible = true;
    cwnd_General.SetControlText('lblGenName', data[0]);
    Debug.Trace(data[0]);
}

RE: SetControlText on a child window by Matti on 11-12-2007 at 06:24 PM

Hmm, that's strange. Are you sure that "lblGenName" is a control in "WndimageEdit.General"?


RE: SetControlText on a child window by MeEtc on 11-12-2007 at 06:37 PM

Positive. I even tried using wnd (var for the parent window) too, and it doesn't work.

Here's the code for WndImageEdit.General

code:
    <Window Id="WndImageEdit.General" Version="1">
        <Position Width="200" Height="180" />
        <ChildTmpl/>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblGenName">
                <Position Width="40" Top="0" Left="0" />
                <Font><Bold>true</Bold></Font>
                <Caption>Name:</Caption>
            </Control>
            <Control xsi:type="EditControl" Id="txtGenName">
                <Position Width="60" Top="0" Left="80" />
            </Control>
            <Control xsi:type="StaticControl" Id="txtGenNameDesc">
                <Position Width="180" Top="15" Left="5" Height="25" />
                <Attributes><WrapText>true</WrapText></Attributes>
                <Caption>Specify a name for your image. Only used as an ID by you within the script itself.</Caption>
            </Control>
        </Controls>
    </Window>