| 323 | } |
| 324 | |
| 325 | void 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 | } |
nothing calls this directly
no test coverage detected