MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / OnPropertyButtonClick

Method OnPropertyButtonClick

neo/tools/materialeditor/MaterialPreviewPropView.cpp:325–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325void MaterialPreviewPropView::OnPropertyButtonClick( NMHDR *nmhdr, LRESULT *lresult ) {
326 NMPROPTREE *nmProp;
327 CPropTreeItem *item;
328
329 nmProp = (NMPROPTREE *)nmhdr;
330 item = nmProp->pItem;
331
332 idStr itemLabel = item->GetLabelText();
333
334 if ( itemLabel == "Preview Lights" ) {
335 AddLight();
336
337 } else if ( itemLabel.Left(5) == "Light" ) {
338 CPropTreeItem *light;
339 int lightId = item->GetCtrlID();
340 int testLightNum = 0;
341
342 m_Tree.DeleteItem( item );
343
344 for( light = m_Tree.GetRootItem()->GetChild(); light != NULL; light = light->GetSibling() ) {
345 idStr label = light->GetLabelText();
346
347 if ( label.Left(5) == "Light" ) {
348 testLightNum++;
349 light->SetLabelText(_T(va("Light #%d", testLightNum)));
350 light->SetInfoText(_T(va("Parameters for light number %d.", testLightNum)));
351 light->SetCtrlID( testLightNum - 1 );
352 }
353 }
354
355 materialPreview->OnDeleteLight( lightId );
356
357 numLights--;
358 } else if ( itemLabel == "Custom Model" ) {
359 CFileDialog dlg(TRUE);
360 dlg.m_ofn.Flags |= OFN_FILEMUSTEXIST;
361 item->Check(FALSE);
362 if( dlg.DoModal()== IDOK) {
363 item->Check(FALSE);
364 item->SetItemValue((LPARAM)fileSystem->OSPathToRelativePath(dlg.m_ofn.lpstrFile));
365 m_Tree.SendNotify(PTN_ITEMCHANGED, item);
366 }
367 }
368}

Callers

nothing calls this directly

Calls 15

vaFunction · 0.85
GetLabelTextMethod · 0.80
LeftMethod · 0.80
GetCtrlIDMethod · 0.80
DeleteItemMethod · 0.80
GetRootItemMethod · 0.80
SetLabelTextMethod · 0.80
SetInfoTextMethod · 0.80
SetCtrlIDMethod · 0.80
OnDeleteLightMethod · 0.80
SendNotifyMethod · 0.80
GetChildMethod · 0.45

Tested by

no test coverage detected