MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetWidgetOfType

Method GetWidgetOfType

src/widget.cpp:969–972  ·  view source on GitHub ↗

* Retrieve a widget by its type. * @param tp Widget type to search for. * @return Returns the first widget of the specified type, or \c nullptr if no widget can be found. */

Source from the content-addressed store, hash-verified

967 * @return Returns the first widget of the specified type, or \c nullptr if no widget can be found.
968 */
969NWidgetBase *NWidgetBase::GetWidgetOfType(WidgetType tp)
970{
971 return (this->type == tp) ? this : nullptr;
972}
973
974void NWidgetBase::ApplyAspectRatio()
975{

Callers 5

ApplyDefaultsMethod · 0.80
RaiseButtonsMethod · 0.80
InitializeDataMethod · 0.80
EnsureVisibleCaptionFunction · 0.80
MakeWindowNWidgetTreeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected