--------------------------------------------------------------------------
| 256 | |
| 257 | //-------------------------------------------------------------------------- |
| 258 | void GuiMessageVectorCtrl::lineInserted(const U32 arg) |
| 259 | { |
| 260 | AssertFatal(mMessageVector != NULL, "Should not be here unless we're attached!"); |
| 261 | |
| 262 | GuiScrollCtrl* pScroll = dynamic_cast<GuiScrollCtrl*>(getParent()); |
| 263 | bool fullyScrolled = pScroll->isScrolledToBottom(); |
| 264 | |
| 265 | mSpecialMarkers.insert(arg); |
| 266 | createSpecialMarkers(mSpecialMarkers[arg], mMessageVector->getLine(arg).message); |
| 267 | |
| 268 | mLineWrappings.insert(arg); |
| 269 | createLineWrapping(mLineWrappings[arg], mMessageVector->getLine(arg).message); |
| 270 | |
| 271 | mLineElements.insert(arg); |
| 272 | createLineElement(mLineElements[arg], mLineWrappings[arg], mSpecialMarkers[arg]); |
| 273 | |
| 274 | U32 numLines = 0; |
| 275 | for (U32 i = 0; i < mLineWrappings.size(); i++) { |
| 276 | // We need to rebuild the physicalLineStart markers at the same time as |
| 277 | // we find out how many of them are left... |
| 278 | mLineElements[i].physicalLineStart = numLines; |
| 279 | |
| 280 | numLines += mLineWrappings[i].numLines; |
| 281 | } |
| 282 | |
| 283 | Point2I newExtent = getExtent(); |
| 284 | newExtent.y = (mProfile->mFont->getHeight() + mLineSpacingPixels) * getMax(numLines, U32(1)); |
| 285 | setExtent(newExtent); |
| 286 | if(fullyScrolled) |
| 287 | pScroll->scrollTo(0, 0x7FFFFFFF); |
| 288 | } |
| 289 | |
| 290 | |
| 291 | void GuiMessageVectorCtrl::lineDeleted(const U32 arg) |