MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / showDefinition

Method showDefinition

radiant/ui/modelselector/ModelTreeView.cpp:146–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void ModelTreeView::showDefinition()
147{
148 auto item = GetSelection();
149 wxutil::TreeModel::Row row(item, *GetModel());
150
151 decl::IDeclaration::Ptr decl;
152
153 if (row[Columns().isSkin].getBool())
154 {
155 decl = GlobalDeclarationManager().findDeclaration(decl::Type::Skin, GetSelectedSkin());
156 }
157 else
158 {
159 // Must be a modelDef
160 auto selectedModelPath = row[Columns().modelPath].getString().ToStdString();
161 decl = GlobalDeclarationManager().findDeclaration(decl::Type::ModelDef, selectedModelPath);
162 }
163
164 if (decl)
165 {
166 auto view = new wxutil::DeclarationSourceView(this);
167 view->setDeclaration(decl);
168
169 view->ShowModal();
170 view->Destroy();
171 }
172}
173
174bool ModelTreeView::testShowDefinition()
175{

Callers

nothing calls this directly

Calls 7

getBoolMethod · 0.80
setDeclarationMethod · 0.80
ColumnsClass · 0.70
findDeclarationMethod · 0.45
getStringMethod · 0.45
ShowModalMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected