MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onRenderCell

Method onRenderCell

Engine/source/gui/controls/guiTreeViewCtrl.cpp:3659–3940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3657//-----------------------------------------------------------------------------
3658
3659void GuiTreeViewCtrl::onRenderCell(Point2I offset, Point2I cell, bool, bool )
3660{
3661 if( !mVisibleItems.size() )
3662 return;
3663
3664 // Do some sanity checking and data retrieval.
3665 AssertFatal(cell.y < mVisibleItems.size(), "GuiTreeViewCtrl::onRenderCell: invalid cell");
3666 Item * item = mVisibleItems[cell.y];
3667
3668 // If there's no object, deal with it.
3669 if(item->isInspectorData())
3670 if(!item->getObject())
3671 return;
3672
3673 RectI drawRect( offset, mCellSize );
3674 GFXDrawUtil *drawer = GFX->getDrawUtil();
3675 drawer->clearBitmapModulation();
3676
3677 FrameAllocatorMarker txtBuff;
3678
3679 // Ok, we have the item. There are a few possibilities at this point:
3680 // - We need to draw inheritance lines and a treeview-chosen icon
3681 // OR
3682 // - We have to draw an item-dependent icon
3683 // - If we're mouseover, we have to highlight it.
3684 //
3685 // - We have to draw the text for the item
3686 // - Taking into account various mouseover states
3687 // - Taking into account the value (set or not)
3688 // - If it's an inspector data, we have to do some custom rendering
3689 // - ADDED: If it is being renamed, we also have custom rendering.
3690
3691 // Ok, first draw the tab and icon.
3692
3693 // Do we draw the tree lines?
3694 if( mFlags.test(ShowTreeLines) )
3695 {
3696 drawRect.point.x += ( mTabSize * item->mTabLevel );
3697 Item* parent = item->mParent;
3698 for ( S32 i = item->mTabLevel; ( parent && i > 0 ); i-- )
3699 {
3700 drawRect.point.x -= mTabSize;
3701 if ( parent->mNext )
3702 drawer->drawBitmapSR( mProfile->mBitmap, drawRect.point, mProfile->mBitmapArrayRects[BmpLine] );
3703
3704 parent = parent->mParent;
3705 }
3706 }
3707
3708 // Now, the icon...
3709 drawRect.point.x = offset.x + mTabSize * item->mTabLevel;
3710
3711 // First, draw the rollover glow, if it's an inner node.
3712 if ( item->isParent() && item->mState.test( Item::MouseOverBmp ) )
3713 drawer->drawBitmapSR( mProfile->mBitmap, drawRect.point, mProfile->mBitmapArrayRects[BmpGlow] );
3714
3715 // Now, do we draw a treeview-selected item or an item dependent one?
3716 S32 newOffset = 0; // This is stored so we can render glow, then update render pos.

Callers

nothing calls this directly

Calls 15

_isRootLevelItemFunction · 0.85
getWidthFunction · 0.85
isInspectorDataMethod · 0.80
getDrawUtilMethod · 0.80
clearBitmapModulationMethod · 0.80
drawBitmapSRMethod · 0.80
isParentMethod · 0.80
getBitmapResourceMethod · 0.80
isLockedMethod · 0.80
drawBitmapMethod · 0.80
isHiddenMethod · 0.80
hasIconNoRecurseMethod · 0.80

Tested by

no test coverage detected