Recent

Author Topic: show checkbox in virtualstringtree  (Read 4706 times)

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
show checkbox in virtualstringtree
« on: August 20, 2018, 02:37:33 pm »
Hi

how can i show checkbox in virtualstringtree?

i read this example but my app crashed?

i changed some properties of VST.

can anybody help me?

balazsszekely

  • Guest
Re: show checkbox in virtualstringtree
« Reply #1 on: August 20, 2018, 02:39:54 pm »
Set the CheckType property of each node to ctTriStateCheckBox.

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: show checkbox in virtualstringtree
« Reply #2 on: August 20, 2018, 02:52:37 pm »
how can i do that?

i use this code :
Code: Pascal  [Select][+][-]
  1. .
  2. .
  3. .
  4. ParentNode := VST.GetFirstChild(nil);
  5. T_Node := VST.AddChild(ParentNode);
  6. VST.Expanded[ParentNode] := True;
  7. LMyNode:=VST.GetNodeData(T_Node);
  8. LMyNode^.Col1 := FieldS[15].Text;
  9. LMyNode^.Col2 := FieldS[14].Text;
  10. .
  11. .
  12. .
  13.  

if possible ,i want show checkbox only for level 3
« Last Edit: August 20, 2018, 02:58:35 pm by majid.ebru »

balazsszekely

  • Guest
Re: show checkbox in virtualstringtree
« Reply #3 on: August 20, 2018, 02:57:42 pm »
@majid.ebru
Quote
how can i do that?
When you init the nodes. For example:
Code: Pascal  [Select][+][-]
  1.  
  2. var
  3.   Node: PVirtualNode
  4. begin
  5.   Node := VST.AddChild(nil); //add a root node to tree
  6.   Node^.CheckType := ctTriStateCheckBox;
  7. end;

If you wish to find the checkstate of a node:
Code: Pascal  [Select][+][-]
  1. if (VST.CheckState[Node] = csCheckedNormal) then
  2. begin
  3. end;




majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: show checkbox in virtualstringtree
« Reply #4 on: August 21, 2018, 07:49:36 am »
when i use your code
i have error access denied

balazsszekely

  • Guest
Re: show checkbox in virtualstringtree
« Reply #5 on: August 21, 2018, 09:23:59 am »
Quote
when i use your code
i have error access denied
Please attach a small demo project where the tree is already populated. Also specify the nodes where you wish to have checkbox support(node level or some other criteria).

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: show checkbox in virtualstringtree
« Reply #6 on: August 21, 2018, 04:22:43 pm »
hi

  i clear many of Function and Procedure!?!?

 i add child to tree in unit_DM_Element  line 4132

 i compress project to 3 part


thank you
« Last Edit: August 21, 2018, 05:06:26 pm by majid.ebru »

balazsszekely

  • Guest
Re: show checkbox in virtualstringtree
« Reply #7 on: August 21, 2018, 04:48:02 pm »
You're application is not working(sigsegv) and I don't have time to debug it. Please add a simple demo(no dependencies, no sql, etc...) otherwise I cannot help you.

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: show checkbox in virtualstringtree
« Reply #8 on: August 21, 2018, 04:51:56 pm »
thank you

 

TinyPortal © 2005-2018