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

Labels on Preferences Tabs
Author: Message:
wincy
Junior Member
**


Posts: 67
Reputation: 4
34 / Male / Flag
Joined: Feb 2008
O.P. Labels on Preferences Tabs
Hello, i have this code:

<Control xsi:type="RadioControl" Id="RadSettings">
    <Position Top="8" Width="82" Left="10" Height="18"/>
    <Attributes><IsNewGroup>true</IsNewGroup></Attributes>
    <CustomLook>
        <FocusRect>
            <Left>2</Left><Top>0</Top><Right>2</Right><Bottom>0</Bottom>
        </FocusRect>
        <Base/>

        <Normal>
            <Unchecked>
                <Element xsi:type="ImageElement" Id="ImgGnral">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_off_color</Name></Image>
                    <Colorization Enable="true"><Color><BaseColor/></Color></Colorization>
                </Element>
                <Element xsi:type="TextElement" Id="TxtSettings1">
                    <Position Top="4" Left="9"/><Font><Size>9</Size></Font>
                </Element>
            </Unchecked>
            <Checked>
                <Element xsi:type="ImageElement" Id="ImgGnral2">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_bw</Name></Image>
                </Element>
                <Element xsi:type="ImageElement" Id="ImgGnral">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_color</Name></Image>
                    <Colorization Enable="true"><Color><BaseColor/></Color></Colorization>
                </Element>
                <Element xsi:type="TextElement" Id="TxtSettings2">
                    <Position Top="4" Left="8"/><Font><Size>9</Size><Bold>true</Bold></Font>
                </Element>
            </Checked>

        </Normal>
        <Hot>
            <Unchecked>
                <Element xsi:type="ImageElement" Id="ImgGnral">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_hover_color</Name></Image>
                    <Colorization Enable="true"><Color><BaseColor/></Color></Colorization>
                </Element>
                <Element xsi:type="TextElement" Id="TxtSettings3">
                    <Position Top="4" Left="9"/><Font><Size>9</Size></Font><Text>Settings</Text>
                </Element>
            </Unchecked>
            <Checked>
                <Element xsi:type="ImageElement" Id="ImgGnral2">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_bw</Name></Image>
                </Element>
                <Element xsi:type="ImageElement" Id="ImgGnral">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_color</Name></Image>
                    <Colorization Enable="true">
                    <Color><BaseColor><Transparency>180</Transparency></BaseColor></Color>
                    </Colorization>
                </Element>
                <Element xsi:type="TextElement" Id="TxtSettings4">
                    <Position Top="4" Left="8"/><Font><Size>9</Size><Bold>true</Bold></Font>
                </Element>
            </Checked>
        </Hot>

        <Pushed>
            <Unchecked>
                <Element xsi:type="ImageElement" Id="ImgGnral2">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_bw</Name></Image>
                    <Transparency>100</Transparency>
                </Element>
                <Element xsi:type="ImageElement" Id="ImgGnral">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_color</Name></Image>
                    <Colorization Enable="true"><Color><BaseColor/></Color></Colorization>
                </Element>
                <Element xsi:type="TextElement" Id="TxtSettings5">
                    <Position Top="4" Left="9"/><Font><Size>9</Size></Font>
                </Element>
            </Unchecked>
            <Checked>
                <Element xsi:type="ImageElement" Id="ImgGnral2">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_bw</Name></Image>
                    <Transparency>100</Transparency>
                </Element>
                <Element xsi:type="ImageElement" Id="ImgGnral">
                    <Position Top="0" Left="0"/>
                    <Image><Name>preferences_top_tabs_on_color</Name></Image>
                    <Colorization Enable="true"><Color><BaseColor/></Color></Colorization>
                </Element>
                <Element xsi:type="TextElement" Id="TxtSettings6">
                    <Position Top="4" Left="8"/><Font><Size>9</Size><Bold>true</Bold></Font>
                </Element>
            </Checked>
        </Pushed>
    </CustomLook>
</Control>


like in MP!L's Preferences Panel (Top Tabs).
Is there a way to give the same text to all TextElements instead of using
Wnd.Button_SetElementText("RadSettings", "TxtSettings1", "label")
Wnd.Button_SetElementText("RadSettings", "TxtSettings2", "label");
Wnd.Button_SetElementText("RadSettings", "TxtSettings3", "label");
Wnd.Button_SetElementText("RadSettings", "TxtSettings4", "label");...ecc

I'm not looking for a loop or "for(x in RadSettings...exx", i would like to make only one label for each tab. Is it possible?

Thanks in advance :)
05-28-2009 04:58 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Labels on Preferences Tabs
This?

JScript code:
var Tabs = {
    "RadSettings":  "Settings",
    "RdiOtherTab":  "Other tab"
    // Etc.
}
 
function LoadTabs(PlusWnd) {
    for(var i in Tabs) {
        for(var e = 1; e <= 4; e++) PlusWnd.Button_SetElementText(i,"TxtSettings" + e,Tabs[i]);
    }
}


It loops through the Tabs object. For each i in the Tabs object, it'll do four loops, setting text to the control with ID i, TxtSettings followed by the number e and the text as specified in the Tabs object. You need to pass a PlusWnd object to the LoadTabs function.

This post was edited on 05-28-2009 at 07:36 PM by SmokingCookie.
05-28-2009 07:35 PM
Profile PM Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: Labels on Preferences Tabs
quote:
Originally posted by SmokingCookie
I'm not looking for a loop or "for(x in RadSettings...exx"
quote:
Originally posted by SmokingCookie
It loops through the Tabs object
quote:
Originally posted by SmokingCookie
This?

So I guess this is not the solution he is looking for...
05-28-2009 08:04 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: RE: Labels on Preferences Tabs
quote:
Originally posted by foaly
So I guess this is not the solution he is looking for...

I guess ReadSettings is something different than Tabs...
05-28-2009 08:07 PM
Profile PM Find Quote Report
wincy
Junior Member
**


Posts: 67
Reputation: 4
34 / Male / Flag
Joined: Feb 2008
O.P. RE: Labels on Preferences Tabs
Here is what RadSettings is:
[Image: tabavw.jpg]

However i think i'm gonna use your code, SmokingCookie.
Thanks!
05-29-2009 12:21 PM
Profile E-Mail PM Find Quote Report
« 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