heirarchical objects using Treeview?

heirarchical objects using Treeview?

Post by Randall Wheele » Mon, 18 Feb 2002 02:52:30



Hi, Im making a modeling program and using a treeview in BCB 4 to
manipulate the heirarchical aspect and Im having trouble getting my code to
determine when to use push and pop.I know how and when to use glPushMatrix()
and glPopMatrix() but my program doesnt.Can someone help or point the way.
Thanks Randy

(sorry about the line spacing)

glPushMatrix();

for(x=1;x<=mainform->tree->Items->Count-1;x++)

    {

    if(mainform->tree->Items->Item[x]->Selected==true)

      { glPushMatrix();

        level=mainform->tree->Items->Item[x]->Level;

        index=x;

     }

    else if(mainform->tree->Items->Item[x]->Level<=level)

glPushMatrix();

*** setmatrix and draw here ***

TTreeNode *nextsibling;

nextsibling=mainform->tree->Items->Item[x]->getNextSibling();

if(mainform->tree->Items->Item[x]->HasChildren==false&&nextsibling==NULL&&in
dex<=x)

   glPopMatrix();

else

if(nextsibling!=NULL&&mainform->tree->Items->Item[x]->HasChildren==false&&ne
xtsibling->Level <=level)

   glPopMatrix();

Quote:} //next x

glPopMatrix();

//end

 glPushMatrix();
 for(x=1;x<=mainform->tree->Items->Count-1;x++)
      {
         if(mainform->tree->Items->Item[x]->Selected==true)
      { glPushMatrix();
        level=mainform->tree->Items->Item[x]->Level;
        index=x;
      }
    else if(mainform->tree->Items->Item[x]->Level<=level)
            glPushMatrix();

 *** setmatric and draw here ***

 TTreeNode *nextsibling;
 nextsibling=mainform->tree->Items->Item[x]->getNextSibling();

if(mainform->tree->Items->Item[x]->HasChildren==false&&nextsibling==NULL&&in
dex<=x)
    glPopMatrix();

 else

if(nextsibling!=NULL&&mainform->tree->Items->Item[x]->HasChildren==false&&ne
xtsibling->Level<=level)
   glPopMatrix();

 }
glPopMatrix();

 
 
 

1. HOWTO: Prevent flicker in TreeView control when changing the .Image property of a Node object

Hello everybody.

I have a treeview control. I fill it with the appropriate nodes and set the
appropriate images as I add the nodes.

If I change a node's .Image property. the treeview often flickers. This is
quite annoying, as it does not do it with the Policy Editor (in the
treeview window there) - you know, the checkboxes on and off states do not
cause it to flicker, and I've seen many apps that have treeviews that
change images for nodes and do not flicker (at all).

It must be something in the treeview in commoncontrol in VB?

How can I prevent the flicker. It is very irritating. Is there a way to
direct the treeview drawing to an offscreen DC and then bitblt it to the
treeview screen DC?

Thanks for your help.

2. ANNOUNCE: RenderDotC 3.1

3. Using TreeView to list the directories

4. CD 8 forMac--Constant crashing doing routine text operations.

5. Using objects to modify other objects

6. Dimensions Dementia

7. Modeling 3D Objects Using Polygons

8. Where to get Lightwave in the UK

9. how to project a slide on an object using povray

10. Problem using Chris Colefax's object exploder

11. Using images as POV-Ray objects?

12. Using objects as lightsources

13. using DXF objects with raycasting/texture mapping engines - how