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

Help with GetItemText
Author: Message:
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. Help with GetItemText
Hey.

I'm making an website for quotes for my IRC channel. The idea is, that people can send in quotes, but I do of course not want everything quoted on the site, so my idea is to combine it with MSG Plus! When people have added a quote on the website, it shall be accepted or declined in MSG Plus!

My idea is to make a list control where all quotes appears and when I press the accept/decline button a webpage should popup where I'll run some PHP codes to update the MySQL database.

What I want is, that when you have chosen a quote on the list control and pressed the accept/decline button, I want to get the ID for the quote.
At the moment the ID shall only popup in a toast for further development.

I can't figure out how to get the ID.

Here's my code:

code:
function initializeWin()
{
    var LstQuotes = MsgPlus.CreateWnd("LstQuotes.xml", "Win");

    for(i=1;i<=5;i++)
    {
        var item = LstQuotes.LstView_AddItem("ListView", i);
        LstQuotes.LstView_SetItemText("ListView", item, 1, "Quote no. " + i);
    }
}

function OnWinEvent_CtrlClicked(Wnd, CtrlId)
{
    switch(CtrlId)
    {   
        case "BtnAccept":
        {
            MsgPlus.DisplayToast("WoWForge Quotes", "Test: " + LstQuotes.LstView_GetItemText("ListView", "DON'T KNOW WHAT VALUE I HAVE TO GIVE THIS", 0));
            break;
        }
    }
}

You can check the red line with the bolded text. Well, the text says it all. I think, I've made it right, but I don't know what value I have to put there.

The necessary part of my XML document:
code:
        <Control xsi:type="ListViewControl" Id="ListView">
            <Position Top="1" Width="350" Left="2" Height="100">
                <Anchor Horizontal="LeftRightFixed" Vertical="TopBottomFixed"/>
            </Position>
            <Attributes>
                <AutoTip>false</AutoTip>
                <AlwaysShowSelection>false</AlwaysShowSelection>
            </Attributes>

            <ReportView>
                <SortColHeader>true</SortColHeader>
            </ReportView>

            <Columns>
                <Column>
                    <ColumnId>No</ColumnId>
                    <Label>#</Label>
                    <Width>5</Width>
                </Column>
                <Column>
                    <ColumnId>Quote</ColumnId>
                    <Label>Quote</Label>
                    <Width>98</Width>
                </Column>
            </Columns>
        </Control>

                <Control xsi:type="ButtonControl" Id="BtnAccept">
                <Position Left="2" Top="104" Width="172" Height="15"/>
            <Caption>Accepter</Caption>
            </Control>

              <Control xsi:type="ButtonControl" Id="BtnDecline">
                     <Position Left="180" Top="104" Width="172" Height="15"/>
            <Caption>Afvis</Caption>
             </Control>

I've attached a picture, so it's easier for you to see, what I'm talking about. By ID, I mean the number in the #-row. That's what I want.

Thanks in advance
Simon Støvring

.gif File Attachment: lstview_quotes.gif (11.15 KB)
This file has been downloaded 124 time(s).
07-15-2008 01:08 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help with GetItemText - by SnuZZer on 07-15-2008 at 01:08 PM
RE: Help with GetItemText - by Matti on 07-15-2008 at 01:42 PM
RE: Help with GetItemText - by SnuZZer on 07-15-2008 at 06:06 PM


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