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

Method construct

Engine/source/gui/editor/guiInspectorTypes.cpp:201–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201GuiControl* GuiInspectorTypeMaterialName::construct(const char* command)
202{
203 GuiControl* retCtrl = new GuiTextEditCtrl();
204
205 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" );
206
207 _registerEditControl( retCtrl );
208
209 char szBuffer[512];
210 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() );
211 retCtrl->setField("AltCommand", szBuffer );
212 retCtrl->setField("Validate", szBuffer );
213
214 //return retCtrl;
215 mBrowseButton = new GuiBitmapButtonCtrl();
216
217 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) );
218
219 dSprintf( szBuffer, 512, command, getId());
220 mBrowseButton->setField( "Command", szBuffer );
221
222 //temporary static button name
223 char bitmapName[512] = "tools/materialEditor/gui/change-material-btn";
224 mBrowseButton->setBitmap( bitmapName );
225
226 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiButtonProfile" );
227 mBrowseButton->registerObject();
228 addObject( mBrowseButton );
229
230 // Position
231 mBrowseButton->resize( browseRect.point, browseRect.extent );
232
233 return retCtrl;
234}
235
236GuiControl* GuiInspectorTypeMaterialName::constructEditControl()
237{

Callers

nothing calls this directly

Calls 13

dSprintfFunction · 0.85
getLeftFunction · 0.85
getWidthFunction · 0.85
getTopFunction · 0.85
setFieldMethod · 0.80
Point2IClass · 0.50
getHeightFunction · 0.50
setDataFieldMethod · 0.45
insertMethod · 0.45
getIdMethod · 0.45
setBitmapMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected