Forged Alliance Forever Forged Alliance Forever Forums 2013-12-10T14:50:47+02:00 /feed.php?f=45&t=5897 2013-12-10T14:50:47+02:00 2013-12-10T14:50:47+02:00 /viewtopic.php?t=5897&p=59313#p59313 <![CDATA[Re: Problem in ItemList]]> Fixed ! (thanks Domino)

In OnClick, added SetSelection.

PresetList.OnClick = function(self, row)
PresetList:SetSelection(row)
LOG('ONE CLICK > '..PresetList:GetSelection())
AddChatText('ONE CLICK > '..PresetList:GetSelection())
end

Statistics: Posted by Xinnony — 10 Dec 2013, 14:50


]]>
2013-12-10T13:55:10+02:00 2013-12-10T13:55:10+02:00 /viewtopic.php?t=5897&p=59309#p59309 <![CDATA[Problem in ItemList]]>
Code:
...
PresetList = ItemList(dialog2)
   PresetList:SetFont(UIUtil.bodyFont, 14)
   PresetList:ShowMouseoverItem(true)
   PresetList.Width:Set(210)
   PresetList.Height:Set(310)
   LayoutHelpers.AtLeftIn(PresetList, dialog2, 10)
   LayoutHelpers.AtTopIn(PresetList, dialog2, 38)
   UIUtil.CreateVertScrollbarFor2(PresetList)
   --
   LOAD_PresetProfils_For_InfoList()
   PresetList.OnClick = function(self)
      LOG('ONE CLICK > '..PresetList:GetSelection())
      AddChatText('ONE CLICK > '..PresetList:GetSelection())
   end
...

PresetList:GetSelection() return ALWAYS '-1' index, this is my problem.

Code:
function LOAD_PresetProfils_For_InfoList()
   PresetList:AddItem('item1')
   PresetList:AddItem('item2')
   PresetList:AddItem('item3')
   PresetList:AddItem('item4')
end

Statistics: Posted by Xinnony — 10 Dec 2013, 13:55


]]>