| 1243 | //------------------------------------------------------------------------------ |
| 1244 | |
| 1245 | void GuiTreeViewCtrl::buildVisibleTree(bool bForceFullUpdate) |
| 1246 | { |
| 1247 | // Recursion Prevention. |
| 1248 | if( mFlags.test( BuildingVisTree ) ) |
| 1249 | return; |
| 1250 | mFlags.set( BuildingVisTree, true ); |
| 1251 | |
| 1252 | if( mDebug ) |
| 1253 | Con::printf( "Rebuilding visible tree" ); |
| 1254 | |
| 1255 | mMaxWidth = 0; |
| 1256 | mVisibleItems.clear(); |
| 1257 | |
| 1258 | // If we're filtering, force a full update. |
| 1259 | |
| 1260 | if( !mFilterText.isEmpty() ) |
| 1261 | bForceFullUpdate = true; |
| 1262 | |
| 1263 | // Update the flags. |
| 1264 | mFlags.clear(RebuildVisible); |
| 1265 | |
| 1266 | // build the root items |
| 1267 | Item *traverse = mRoot; |
| 1268 | while(traverse) |
| 1269 | { |
| 1270 | _buildItem(traverse, 0, bForceFullUpdate); |
| 1271 | traverse = traverse->mNext; |
| 1272 | } |
| 1273 | |
| 1274 | // adjust the GuiArrayCtrl |
| 1275 | mCellSize.set( mMaxWidth + mTextOffset, mItemHeight ); |
| 1276 | setSize(Point2I(1, mVisibleItems.size())); |
| 1277 | syncSelection(); |
| 1278 | |
| 1279 | // Done Recursing. |
| 1280 | mFlags.clear( BuildingVisTree ); |
| 1281 | } |
| 1282 | |
| 1283 | //------------------------------------------------------------------------------ |
| 1284 |
no test coverage detected