MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / scrollToTag

Method scrollToTag

Engine/source/gui/controls/guiMLTextCtrl.cpp:1001–1022  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

999
1000//--------------------------------------------------------------------------
1001void 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//--------------------------------------------------------------------------
1025void GuiMLTextCtrl::scrollToTop()

Callers 1

guiMLTextCtrl.cppFile · 0.80

Calls 3

warnfFunction · 0.85
scrollRectVisibleMethod · 0.80
RectIClass · 0.50

Tested by

no test coverage detected