[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TreeView.Item.Reparent wont add the arrow


On Tue, 21 May 2024, 15:17 Gianluigi, <gradobag@xxxxxxxxxxx> wrote:

> Il 21/05/24 15:44, Bruce Steers ha scritto:
> >
> >
> > On Tue, 21 May 2024 at 14:18, Gianluigi <gradobag@xxxxxxxxxxx
> > <mailto:gradobag@xxxxxxxxxxx>> wrote:
> >
> >     Il 21/05/24 14:57, Bruce Steers ha scritto:
> >      > What DragNDrop example?
> >      > Does it use the Reparent method to move parents?
> >      >
> >      > BruceS
> >
> >     The example that is in Gambas's basic examples:
> >
> https://gitlab.com/gambas/gambas/-/tree/master/app/examples/Basic?ref_type=heads
> <
> https://gitlab.com/gambas/gambas/-/tree/master/app/examples/Basic?ref_type=heads
> >
> >     Does not use reparent, but I understood that you were asking for
> another
> >     way to do it
> >
> >
> > No i was asking if there was a way to make the arrow appear when using
> > Reparent.
> >
> > After some more tinkering i have found reparent does make an arrow
> > appear if one of the items already has children so at least one arrow is
> > already showing.
> >
> > But using Reparent when there are no arrows yet does not refresh to show
> > the arrows.
> >
> > I attach a simple example.
> >
> > it is a prefilled tree with 10 root items, no children.
> >
> > Drag n drop an item on to another and it puts it into the item you
> > dropped it on.
> >
> > At the bottom there is a check box that makes a reparent happen by
> > Add/Delete method not by Reparent.
> >
> > When you run the program and drag-drop an item If the checkbox is not
> > selected the arrow does not appear.
> >
> > But if you select the checkbox so add/remove method is used the arrow
> > does appear.
> > You can then de-select the checkbox so re-parent is used and arrows then
> > DO appear.
> >
> > The treeview updates it's layout somehow to show arrows and once updated
> > it works as expected. but Reparent does not seem to trigger this update.
> >
> > So i think , yes , it's a bug.
> >
> > BruceS
> >
>
> and if you add this?:
>
> ...
>    If Not CheckBox1.Value Then
>      TreeView1[Drag.Item].Reparent(TreeView1.Item.Key)
>      TreeView1.Item.ExpandAll
>    Else
> ...
>

Then it expands
Double clicking it expands it also.

Still does not show the arrow I'm asking about thought

Do you know why that it?

References:
TreeView.Item.Reparent wont add the arrowBruce Steers <bsteers4@xxxxxxxxx>
Re: TreeView.Item.Reparent wont add the arrowGianluigi <gradobag@xxxxxxxxxxx>
Re: TreeView.Item.Reparent wont add the arrowBruce Steers <bsteers4@xxxxxxxxx>
Re: TreeView.Item.Reparent wont add the arrowGianluigi <gradobag@xxxxxxxxxxx>
Re: TreeView.Item.Reparent wont add the arrowBruce Steers <bsteers4@xxxxxxxxx>
Re: TreeView.Item.Reparent wont add the arrowGianluigi <gradobag@xxxxxxxxxxx>