On 11/21/2016 09:42 PM, Krzysztof wrote:
> Hi Martin,
> How to get selected childs from ttreelistedititem? For example this code:
> procedure TfrmViewTree.PrintSelected(const sender: TObject);
> begin
> writeln(length(ttreeitemedit1.selecteditems),'|',Length(FLibraryNode.getselectednodes()));
> end;
> ttreeitemedit1.selecteditems return <>0 but FLibraryNode.getselectednodes()
> is 0. They have the same meanings right?

No, ttreeitemedit.selecteditems returns the items of the selected cells
of the grid. ttreelistitem.getselectednodes returns nodes where
tlistitem.selected = true (tlistitem.state ns_selected is set).

In order to set the selected state by GUI set
ttreeitemedit.itemlist.options no_checkbox and set tlistitem.state
ns_checkbox for nodes which should show a checkbox, see attachment with
[ns_checkbox,ns_showchildchecked] and ttreeitemedit.itemlist.options
ttreelistitem.getcheckednodes() returns an array of the checked nodes.

Another option is to set ttreeitemedit.itemlist.options
no_cellitemselect which updates ns_selected by the cell selection state.

mseide-msegui-talk mailing list

Reply via email to