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

Method constructEditControl

Engine/source/gui/editor/guiInspectorTypes.cpp:56–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54);
55
56GuiControl* GuiInspectorTypeMenuBase::constructEditControl()
57{
58 GuiControl* retCtrl = new GuiPopUpMenuCtrl();
59
60 GuiPopUpMenuCtrl *menu = dynamic_cast<GuiPopUpMenuCtrl*>(retCtrl);
61
62 // Let's make it look pretty.
63 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiPopUpMenuProfile" );
64 _registerEditControl( retCtrl );
65
66 // Configure it to update our value when the popup is closed
67 char szBuffer[512];
68 dSprintf( szBuffer, 512, "%d.apply( %d.getText() );", getId(), menu->getId() );
69 menu->setField("Command", szBuffer );
70
71 //now add the entries, allow derived classes to override this
72 _populateMenu( menu );
73
74 // Select the active item, or just set the text field if that fails
75 S32 id = menu->findText(getData());
76 if (id != -1)
77 menu->setSelected(id, false);
78 else
79 menu->setField("text", getData());
80
81 return retCtrl;
82}
83
84void GuiInspectorTypeMenuBase::setValue( StringTableEntry newValue )
85{

Callers

nothing calls this directly

Calls 15

dSprintfFunction · 0.85
getDataFunction · 0.85
getLeftFunction · 0.85
getWidthFunction · 0.85
getTopFunction · 0.85
getUnitCountFunction · 0.85
getUnitFunction · 0.85
setFieldMethod · 0.80
isMethodMethod · 0.80
setConsoleCommandMethod · 0.80
setUseMouseEventsMethod · 0.80
setStateOnMethod · 0.80

Tested by

no test coverage detected