MCPcopy Create free account
hub / github.com/assimp/assimp / HandleTreeViewPopup2

Method HandleTreeViewPopup2

tools/assimp_view/Display.cpp:1314–1496  ·  view source on GitHub ↗

-------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1312}
1313//-------------------------------------------------------------------------------
1314int CDisplay::HandleTreeViewPopup2(WPARAM wParam,LPARAM /*lParam*/)
1315{
1316 char szFileName[MAX_PATH];
1317 DWORD dwTemp = MAX_PATH;
1318
1319 switch (LOWORD(wParam))
1320 {
1321 case ID_HEY_REPLACE:
1322 {
1323 // get a path to a new texture
1324 if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"ReplaceTextureSrc",nullptr,nullptr,
1325 (BYTE*)szFileName,&dwTemp))
1326 {
1327 // Key was not found. Use C:
1328 strcpy(szFileName,"");
1329 }
1330 else
1331 {
1332 // need to remove the file name
1333 char* sz = strrchr(szFileName,'\\');
1334 if (!sz)
1335 sz = strrchr(szFileName,'/');
1336 if (sz)
1337 *sz = 0;
1338 }
1339 OPENFILENAME sFilename1 = {
1340 sizeof(OPENFILENAME),
1341 g_hDlg,GetModuleHandle(nullptr),
1342 "Textures\0*.png;*.dds;*.tga;*.bmp;*.tif;*.ppm;*.ppx;*.jpg;*.jpeg;*.exr\0*.*\0",
1343 nullptr, 0, 1,
1344 szFileName, MAX_PATH, nullptr, 0, nullptr,
1345 "Replace this texture",
1346 OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_NOCHANGEDIR,
1347 0, 1, ".jpg", 0, nullptr, nullptr
1348 };
1349 if(GetOpenFileName(&sFilename1) == 0) return 0;
1350
1351 // Now store the file in the registry
1352 RegSetValueExA(g_hRegistry,"ReplaceTextureSrc",0,REG_SZ,(const BYTE*)szFileName,MAX_PATH);
1353 this->ReplaceCurrentTexture(szFileName);
1354 }
1355 return 1;
1356
1357 case ID_HEY_EXPORT:
1358 {
1359 if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"TextureExportDest",nullptr,nullptr,
1360 (BYTE*)szFileName,&dwTemp))
1361 {
1362 // Key was not found. Use C:
1363 strcpy(szFileName,"");
1364 }
1365 else
1366 {
1367 // need to remove the file name
1368 char* sz = strrchr(szFileName,'\\');
1369 if (!sz)
1370 sz = strrchr(szFileName,'/');
1371 if (sz)

Callers

nothing calls this directly

Calls 11

ReplaceCurrentTextureMethod · 0.95
ASSIMP_stricmpFunction · 0.85
InstanceClass · 0.85
DeleteMaterialMethod · 0.80
eraseMethod · 0.80
AddEntryMethod · 0.45
ReleaseMethod · 0.45
RemovePropertyMethod · 0.45
CreateMaterialMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected