View Single Post
07/23/14, 06:07 AM   #3
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by merlight View Post
I think paging will be the way to go. That way you create say 50 rows from a template, which you can write in xml with checkbox and labels already in it. You can put any data you want in the row control, similar to how inventory rows have control.data={bagId=1, slotIndex=2, etc}. There were ingame scripts from Aug 2013 on XeNTaX forum, where loot window was paged, and it did pretty much exactly what I described - OnInitialize created a fixed number of rows from a template, and on EVENT_LOOT_UPDATED and when switching pages, updated data in those rows.

Later you can even make a search filter, e.g. events containing "TRADE" in their name

edit: can we even publish snippets from ingame scripts? It's so awkward to always tell people "there is something somewhere ..."
Controls have a data property? That makes this a whole lot easier.
I know that as "Tag" property from WinForms and WPF. It is the second best solution for such a problem.

What is the way to get the "parent" XML Element of a control?
I would perfer to just drop the Event's ID as data in the Row. The event handler would get the Checkboxes Reference. Then I would go up on step to get the Row it is contained in and use the ID from that.

Edit:
I think I found it. Something liek thsi event handler code?
Lua Code:
  1. local function eventHandler(sender)
  2.     local senderParent = sender.GetParent()
  3.     local EventID = senderParent.data
  4.  
  5.     --Appropirate code that can now work with the EventID of the dynamicalyl created control
  6. end

Last edited by zgrssd : 07/23/14 at 06:10 AM.
  Reply With Quote