GuiTreeViewCtrl "insertItem" unexpected behavior

Scripting questions, discussions, etc
4 posts Page 1 of 1
xetra11
Posts: 12
Joined: Mon Jul 11, 2016 8:39 pm
by xetra11 » Thu Jul 14, 2016 10:15 am
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!
Johxz
Posts: 411
Joined: Sat Feb 07, 2015 11:37 pm
by Johxz » Sat Jul 16, 2016 6:51 am
Hey hi @
User avatar
xetra11
;)

Sorry for the late reply I don't see your post

I forgot this issue :shock: or not sure maybe is not an issue :? :? Issue #1248 right now not remember the workaround :( I think from here GUI Editor - Tutorial Advanced you can learn how to use "insertItem".
JeffR
Steering Committee
Steering Committee
Posts: 757
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon Jul 18, 2016 5:26 pm
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.
JeffR
Steering Committee
Steering Committee
Posts: 757
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon Jul 18, 2016 5:27 pm
JeffR wrote: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.
4 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests