Jump to content

GuiTreeViewCtrl "insertItem" unexpected behavior


xetra11

Recommended Posts

The code: http://hastebin.com/fivudaraje.coffee


When trying to run this script - the program crashes. When I ommit the inserting to the 9th child element it works fine. That tells me - that adding new subitem only works on the last created child to the root node. Is that expected behavior and I just missed to realise it? But how can I add a subitem to, let say, the 5th root element or the 9th like in the example?


Please give me a hint what I'm missing here!



greets Charlie!

Link to comment
Share on other sites

Can you modify line 4013 in guiTreeViewCtrl.cpp so it looks like:

 

if (parent->mNext && mProfile->mBitmapArrayRects.size() - 1 >= BmpLine)

 

and give it another shot?


Looks like when there's a valid item listed in mNext(so we go from a subItem to the next parent's child item) it's not properly vouching that the little line icon exists in the gui profile, so we get a crash.


Lemme know if that corrected it for you.

Link to comment
Share on other sites

Can you modify line 4013 in guiTreeViewCtrl.cpp so it looks like:

 

if (parent->mNext && mProfile->mBitmapArrayRects.size() - 1 >= BmpLine)

 

Making the whole block look like:

 

// Do we draw the tree lines?
   if( mFlags.test(ShowTreeLines) )
   {
      drawRect.point.x += ( mTabSize * item->mTabLevel );
      Item* parent = item->mParent;
      for ( S32 i = item->mTabLevel; ( parent && i > 0 ); i-- )
      {
         drawRect.point.x -= mTabSize;
         if (parent->mNext && mProfile->mBitmapArrayRects.size() - 1 >= BmpLine)
            drawer->drawBitmapSR( mProfile->mTextureObject, drawRect.point, mProfile->mBitmapArrayRects[bmpLine] );
 
         parent = parent->mParent;
      }
   }

 

and give it another shot?


Looks like when there's a valid item listed in mNext(so we go from a subItem to the next parent's child item) it's not properly vouching that the little line icon exists in the gui profile, so we get a crash.


Lemme know if that corrected it for you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...