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