[MSEide-MSEgui-talk] treeItem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] treeItem

mohamed hamza
How to get a nod knowing it's number in the tree?

for example to add a new nod  to nod number n

Regards

Med





_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] treeItem

mse
Administrator
On 11/6/18 11:42 AM, mohamed hamza wrote:
> How to get a nod knowing it's number in the tree?
>
"
<thetreelistitem>[n]
"
or
"
<thetreelistitem>.items[n]
"

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] treeItem

mohamed hamza
Hi Martin,

In Fact I have a list of records from a sql result .
The way this file is designed is so each item is on a "level" of hierarchy. So the  first item is on level 0, all of its child items are on level 1, and so on.

For Example:

            Id       Depth       Level
  1. 100 1     (0)
  2. 105 1.1   (1)
  3. 587 1.2   (1)
  4. 486 1.3   (1)
  5. 505 1.3.1 (2)
  6. 872 1.4   (1)
  7. 900 2     (0)
  8. 236 2.1   (1)
  9. 814 2.1.1 (2)
 10. 35  3     (0)

My issue is figuring out how to populate this structure into a Tree based on "Level" properties of each listed record.

The examples ( MseUniverse ) are not based on level or parent properties of node.
Regards.

Med.

De : Martin Schreiber <[hidden email]>
Envoyé : mardi 6 novembre 2018 10:49
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] treeItem
 
On 11/6/18 11:42 AM, mohamed hamza wrote:
> How to get a nod knowing it's number in the tree?
>
"
<thetreelistitem>[n]
"
or
"
<thetreelistitem>.items[n]
"

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] treeItem

mse
Administrator
On Friday 09 November 2018 10:49:37 mohamed hamza wrote:

> My issue is figuring out how to populate this structure into a Tree
> based on "Level" properties of each listed record.
>
I would use a recursive <currentparenttreelistitem>.add(<nexttreelistitem>)
call, a new recursion if the next level is bigger, exit the current recursion
if the the next level is lower than the level of the current recursion.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] treeItem

mohamed hamza
Thank you for the code, I was still a bit lost  when the levels are equals?

Regards

Med

De : Martin Schreiber <[hidden email]>
Envoyé : vendredi 9 novembre 2018 10:03
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] treeItem
 
On Friday 09 November 2018 10:49:37 mohamed hamza wrote:

> My issue is figuring out how to populate this structure into a Tree
> based on "Level" properties of each listed record.
>
I would use a recursive <currentparenttreelistitem>.add(<nexttreelistitem>)
call, a new recursion if the next level is bigger, exit the current recursion
if the the next level is lower than the level of the current recursion.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] treeItem

mse
Administrator
On Saturday 10 November 2018 12:12:17 mohamed hamza wrote:
> Thank you for the code, I was still a bit lost  when the levels are equals?
>
Here:
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/db/tree3

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] treeItem

mohamed hamza
Many Thanks. Anyway I have nerver seen a computer scientist  doing, writing and probably testing  such algorithm in 20 minutes!!!

Bravo.

Med

De : Martin Schreiber <[hidden email]>
Envoyé : samedi 10 novembre 2018 12:36
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] treeItem
 
On Saturday 10 November 2018 12:12:17 mohamed hamza wrote:
> Thank you for the code, I was still a bit lost  when the levels are equals?
>
Here:
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/db/tree3

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk