View Issue Details

IDProjectCategoryView StatusLast Update
0003962JEDI VCL00 JVCL Componentspublic2007-01-04 05:35
ReporterblackpageAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version3.20 
Target VersionFixed in Version 
Summary0003962: JvCheckTreeView - check/uncheck behavior
DescriptionJvCheckTreeView components doesn't uncheck nodes unless some (undocumented) features/options seem to have been set.

When a fresh/virgin JvCheckTreeView is dragged onto a form and the nodes' checkstates are being toggled (see example code) the nodes only toggle when they have not been manually checked before toggling.

Example code ...

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, JvExComCtrls, JvComCtrls, JvCheckTreeView,
  ImgList;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    tree: TJvCheckTreeView;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private { Private declarations }
  public { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// add nodes
procedure TForm1.Button1Click(Sender: TObject);
var
  i : Integer;
begin
  tree.Checkboxes := True;
  for i := 0 to 10 do
    tree.Items.AddChild(nil, 'Treenode number ' + IntToStr(i));
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  node : TTreeNode;
  b : Boolean;
begin
  node := tree.Items.GetFirstNode;
  while node <> nil do begin
    tree.Checked[node] := (not tree.Checked[node]);
    node := node.getNextSibling;
  end;
end;

end.

TagsNo tags attached.

Activities

obones

2006-10-18 08:25

administrator   ~0010371

Please use the daily snapshot, from here:

http://jvcl.sf.net/daily/

And then let us know if this is still here.

blackpage

2006-10-18 10:21

reporter   ~0010374

Thx, obones, for the quick suggestion!
Daily snapshot is downloaded as I type.

Here's what I've found out so far:
Partly the odd behaviour of the JvCheckTreeView component came from me not assigning an imagelist to it ("StateImages").

Secondly the component has setter/getter methods ("setChecked" and "getChecked") published. These methods do not operate as expected. The standard procedure to check/uncheck nodes does in fact work after an imagelist has been assigned to "StateImage" property.

Still though, the issue is yet leaving me a bit confused, as I got checkboxes even without the image-list assigned to the component. Further investigation in accordance and comparison to the daily snapshot version lies ahead.

Should assigning an imagelist really be mandatory for the component to function properly, I suggest to mention that rudimentarily in the apropriate section of the help files.

Other than that, and for the time being: Thanx for the support and your work, folks :)

blackpage

2006-10-19 01:28

reporter   ~0010376

'lo

The daily snapshot has no been tested too, and the odd effects are still there.

At the moment I'm not sure whether or not the component needs an imagelist or not to function properly or whether the style needs to be set or not or whatever. In other words: the JvCheckTreeView just acts totally unpredictable. That goes even so far, that the component would not uncheck its nodes, then get deleted from a form, replaced by a new JvCheckTreeView and this new one would in fact do check/uncheck nodes (at least for some time, it also starts to bail out flawfully sooner or later).

Due to that it has been replaced by a VirtualTreeview. Still, thanks for trying to help :)

obones

2007-01-04 05:34

administrator   ~0010532

Because you use a VirtualTreeview, I'm now closing the issue.
Should anyone else have any problem, please create another issue.

Issue History

Date Modified Username Field Change
2006-10-18 06:16 blackpage New Issue
2006-10-18 08:25 obones Note Added: 0010371
2006-10-18 08:25 obones Status new => feedback
2006-10-18 10:21 blackpage Note Added: 0010374
2006-10-19 01:28 blackpage Note Added: 0010376
2007-01-04 05:34 obones Status feedback => resolved
2007-01-04 05:34 obones Resolution open => won't fix
2007-01-04 05:34 obones Assigned To => obones
2007-01-04 05:34 obones Note Added: 0010532