delphi - Adding functionality to a firemonkey Treeviewitem checkbox // Limit on Firemonkey style Events? -
i utilize next method add together functionality checkbox of treeviewitem.
function tform.createtvobj:ttreeviewitem; var mycheckbox:tcheckbox; begin seek result:=ttreeviewitem.create(nil); result.parent:=treeview; result.stylelookup:='treeviewitemstyle'; mycheckbox:= result.findstyleresource('check') tcheckbox; //the functionality: mycheckbox.onchange:= checkboxchange; except on e:exception begin showmessage('error'+chr(13)+chr(13)+e.message); end; end; end;
now have next problem: it works limited number of items. if add together much items, the checkboxchange fires first 9-12 items.
is there limit? if start checking them top first 12 work. if click on lastly item first, first 3 don't work...
you'll find check box's onchange event hooked internally tree view.
you need hook treeview's oncheckchange instead. if you're using xe2 sender listboxitem has been changed.
in versions of xe3 treeview , you'll need find other way find item changed (i.e. recurse tree elements , compare state original data).
qc showing has been fixed in recent update haven't have chance test http://qc.embarcadero.com/wc/qcmain.aspx?d=109138
delphi firemonkey delphi-xe3
No comments:
Post a Comment