RE: [DUG]: Treeview wierdness

1999-03-04 Thread Dennis Chuah


Aaron,

 Here's an annoying bug

 procedure MakeAnInvisibleTreeNode;
 begin
   Treeview.Items.BegniUpdate;
   TreeView.Items.Clear;
   TreeView.Items.endupdate;
   TreeView.Items.add(nil,'I''m invisible');
 end;

What if you move the Add into the begin/end update pair, as in:

   Treeview.Items.BegniUpdate;
   TreeView.Items.Clear;
   TreeView.Items.add(nil,'I''m invisible');
   TreeView.Items.endupdate;

Does calling Invalidate / update cause the node to be drawn?

-
Dennis Chuah, BE (Hons) [mailto:[EMAIL PROTECTED]]
Manager, Product Development
Contec Data Systems Ltd. [http://www.contecds.com]
tel: +64-3-3580060 ext-775 fax: +64-3-3588045




---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



Re: [DUG]: Treeview wierdness

1999-03-04 Thread Aaron Scott-Boddendijk

 procedure MakeAnInvisibleTreeNode;
 begin
   Treeview.Items.BegniUpdate;
   TreeView.Items.Clear;
   TreeView.Items.endupdate;
   TreeView.Items.add(nil,'I''m invisible');
 end;

What if you move the Add into the begin/end update pair, as in:


Whilst I haven't tried it this doesn't solve the problem since the program
flow is such that we may wish to see the tree empty between the clear
and the next repopulate. 

   Treeview.Items.BegniUpdate;
   TreeView.Items.Clear;
   TreeView.Items.add(nil,'I''m invisible');
   TreeView.Items.endupdate;

Does calling Invalidate / update cause the node to be drawn?


Tries, Repoaint, invalidate,  and refresh... nothing works... Tracing the
code shows that the problem seems to occur inside the wrapped MS
control as opposed to borlands wrapper itself...

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax

---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



RE: [DUG]: Treeview wierdness

1999-03-04 Thread Dennis Chuah


Aaron,

 Whilst I haven't tried it this doesn't solve the problem since the program
 flow is such that we may wish to see the tree empty between the clear
 and the next repopulate.

OK, what about this code:

SendMessage (Treeview.handle, TVM_DELETEITEM, 0, Longint(TVI_ROOT));

...

TreeView.Items.add(nil,'I''m invisible');

-
Dennis Chuah, BE (Hons) [mailto:[EMAIL PROTECTED]]
Manager, Product Development
Contec Data Systems Ltd. [http://www.contecds.com]
tel: +64-3-3580060 ext-775 fax: +64-3-3588045



---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



Re: [DUG]: Treeview wierdness

1999-03-04 Thread Aaron Scott-Boddendijk

OK, what about this code:
SendMessage (Treeview.handle, TVM_DELETEITEM, 0, Longint(TVI_ROOT));


Bummer is this confirms that borland won't be fixing the problem next
release... it's a treeview fault...

The sendmessage clears the tree alright but still causes the redraw as it empties
which we need to avoid - users don't like waiting quite that long...

if you imbed the send message in an beginupdate...endupdate... the redrawing
stops... same problem as initially... fastest clear we've found so far (that doesn't
exhibit the problems) is

tv.Items.BeginUpdate;
tv.Items.Clear;
tv.Items.Add(nil,' ');
tv.Items.EndUpdate;
tv.Items.Clear;

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax

---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz