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

Method insertItem

Engine/source/gui/editor/popupMenu.cpp:145–177  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// Public Methods /////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

143// Public Methods
144//////////////////////////////////////////////////////////////////////////
145S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, const char* cmd, S32 bitmapIndex)
146{
147 String titleString = title;
148
149 MenuItem newItem;
150 newItem.mID = pos;
151 newItem.mText = titleString;
152 newItem.mCMD = cmd;
153 newItem.mBitmapIndex = bitmapIndex;
154
155 if (titleString.isEmpty() || titleString == String("-"))
156 newItem.mIsSpacer = true;
157 else
158 newItem.mIsSpacer = false;
159
160 if (accelerator[0])
161 newItem.mAccelerator = dStrdup(accelerator);
162 else
163 newItem.mAccelerator = NULL;
164
165 newItem.mVisible = true;
166 newItem.mIsChecked = false;
167 newItem.mAcceleratorIndex = 0;
168 newItem.mEnabled = !newItem.mIsSpacer;
169
170 newItem.mIsSubmenu = false;
171 newItem.mSubMenu = nullptr;
172 newItem.mSubMenuParentMenu = nullptr;
173
174 mMenuItems.push_back(newItem);
175
176 return pos;
177}
178
179S32 PopupMenu::insertSubMenu(S32 pos, const char *title, PopupMenu *submenu)
180{

Callers 14

processNodeFunction · 0.45
colladaImport.cppFile · 0.45
fillGuiTreeViewMethod · 0.45
addNodeToTreeMethod · 0.45
addMetaDataToTreeMethod · 0.45
getShaderInfoMethod · 0.45
getMaterialInfoMethod · 0.45
getMaterialInstancesMethod · 0.45
processNodeFunction · 0.45
enumColladaForImportFunction · 0.45
enumDTSForImportFunction · 0.45
forestCell.cppFile · 0.45

Calls 3

StringClass · 0.50
isEmptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected