--------------------------------------------------------------------------
| 999 | |
| 1000 | //-------------------------------------------------------------------------- |
| 1001 | void GuiMLTextCtrl::scrollToTag( U32 id ) |
| 1002 | { |
| 1003 | // If the parent control is not a GuiScrollContentCtrl, then this call is invalid: |
| 1004 | GuiScrollCtrl *pappy = dynamic_cast<GuiScrollCtrl*>(getParent()); |
| 1005 | if ( !pappy ) |
| 1006 | return; |
| 1007 | |
| 1008 | // Find the indicated tag: |
| 1009 | LineTag* tag = NULL; |
| 1010 | for ( tag = mTagList; tag; tag = tag->next ) |
| 1011 | { |
| 1012 | if ( tag->id == id ) |
| 1013 | break; |
| 1014 | } |
| 1015 | |
| 1016 | if ( !tag ) |
| 1017 | { |
| 1018 | Con::warnf( ConsoleLogEntry::General, "GuiMLTextCtrl::scrollToTag - tag id %d not found!", id ); |
| 1019 | return; |
| 1020 | } |
| 1021 | pappy->scrollRectVisible(RectI(0, tag->y, 1, 1)); |
| 1022 | } |
| 1023 | |
| 1024 | //-------------------------------------------------------------------------- |
| 1025 | void GuiMLTextCtrl::scrollToTop() |
no test coverage detected