| 3969 | //----------------------------------------------------------------------------- |
| 3970 | |
| 3971 | void GuiTreeViewCtrl::onRenderCell(Point2I offset, Point2I cell, bool, bool ) |
| 3972 | { |
| 3973 | if( !mVisibleItems.size() ) |
| 3974 | return; |
| 3975 | |
| 3976 | // Do some sanity checking and data retrieval. |
| 3977 | AssertFatal(cell.y < mVisibleItems.size(), "GuiTreeViewCtrl::onRenderCell: invalid cell"); |
| 3978 | Item * item = mVisibleItems[cell.y]; |
| 3979 | |
| 3980 | // If there's no object, deal with it. |
| 3981 | if(item->isInspectorData()) |
| 3982 | if(!item->getObject()) |
| 3983 | return; |
| 3984 | |
| 3985 | RectI drawRect( offset, mCellSize ); |
| 3986 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 3987 | drawer->clearBitmapModulation(); |
| 3988 | |
| 3989 | FrameAllocatorMarker txtBuff; |
| 3990 | |
| 3991 | // Ok, we have the item. There are a few possibilities at this point: |
| 3992 | // - We need to draw inheritance lines and a treeview-chosen icon |
| 3993 | // OR |
| 3994 | // - We have to draw an item-dependent icon |
| 3995 | // - If we're mouseover, we have to highlight it. |
| 3996 | // |
| 3997 | // - We have to draw the text for the item |
| 3998 | // - Taking into account various mouseover states |
| 3999 | // - Taking into account the value (set or not) |
| 4000 | // - If it's an inspector data, we have to do some custom rendering |
| 4001 | // - ADDED: If it is being renamed, we also have custom rendering. |
| 4002 | |
| 4003 | // Ok, first draw the tab and icon. |
| 4004 | |
| 4005 | // Do we draw the tree lines? |
| 4006 | if( mFlags.test(ShowTreeLines) ) |
| 4007 | { |
| 4008 | drawRect.point.x += ( mTabSize * item->mTabLevel ); |
| 4009 | Item* parent = item->mParent; |
| 4010 | for ( S32 i = item->mTabLevel; ( parent && i > 0 ); i-- ) |
| 4011 | { |
| 4012 | drawRect.point.x -= mTabSize; |
| 4013 | if ( parent->mNext ) |
| 4014 | drawer->drawBitmapSR( mProfile->mTextureObject, drawRect.point, mProfile->mBitmapArrayRects[BmpLine] ); |
| 4015 | |
| 4016 | parent = parent->mParent; |
| 4017 | } |
| 4018 | } |
| 4019 | |
| 4020 | // Now, the icon... |
| 4021 | drawRect.point.x = offset.x + mTabSize * item->mTabLevel; |
| 4022 | |
| 4023 | // First, draw the rollover glow, if it's an inner node. |
| 4024 | if ( item->isParent() && item->mState.test( Item::MouseOverBmp ) ) |
| 4025 | drawer->drawBitmapSR( mProfile->mTextureObject, drawRect.point, mProfile->mBitmapArrayRects[BmpGlow] ); |
| 4026 | |
| 4027 | // Now, do we draw a treeview-selected item or an item dependent one? |
| 4028 | S32 newOffset = 0; // This is stored so we can render glow, then update render pos. |
nothing calls this directly
no test coverage detected