MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / findNextTabable

Method findNextTabable

Engine/source/gui/core/guiControl.cpp:2107–2136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2105//-----------------------------------------------------------------------------
2106
2107GuiControl *GuiControl::findNextTabable(GuiControl *curResponder, bool firstCall)
2108{
2109 // No tabbing if the control is disabled or hidden.
2110 if ( !mAwake || !mVisible )
2111 return NULL;
2112
2113 //if this is the first call, clear the global
2114 if (firstCall)
2115 smCurResponder = NULL;
2116
2117 //first find the current responder
2118 if (curResponder == this)
2119 smCurResponder = this;
2120
2121 //if the first responder has been found, return the very next *tabable* control
2122 else if ( smCurResponder && mProfile->mTabable && mAwake && mVisible && mActive )
2123 return( this );
2124
2125 //loop through, checking each child to see if it is the one that follows the firstResponder
2126 GuiControl *tabCtrl = NULL;
2127 iterator i;
2128 for (i = begin(); i != end(); i++)
2129 {
2130 GuiControl *ctrl = static_cast<GuiControl *>(*i);
2131 tabCtrl = ctrl->findNextTabable(curResponder, false);
2132 if (tabCtrl) break;
2133 }
2134 mFirstResponder = tabCtrl;
2135 return tabCtrl;
2136}
2137
2138//-----------------------------------------------------------------------------
2139

Callers 1

tabNextMethod · 0.45

Calls 2

beginFunction · 0.85
endFunction · 0.85

Tested by

no test coverage detected