MCPcopy Create free account
hub / github.com/TASEmulators/fceux / ReplayMetadataDialogProc

Function ReplayMetadataDialogProc

src/drivers/win/replay.cpp:326–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324
325
326INT_PTR CALLBACK ReplayMetadataDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
327{
328 RECT wrect;
329 switch(uMsg)
330 {
331 case WM_INITDIALOG:
332 {
333 if (MetaPosX==-32000) MetaPosX=0; //Just in case
334 if (MetaPosY==-32000) MetaPosY=0;
335 SetWindowPos(hwndDlg,0,MetaPosX,MetaPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER);
336
337 //setup columns
338 HWND hwndList = GetDlgItem(hwndDlg,IDC_LIST1);
339
340 ListView_SetExtendedListViewStyleEx(hwndList,
341 LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES ,
342 LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );
343
344 ListView_SetUnicodeFormat(hwndList,TRUE);
345
346 RECT listRect;
347 GetClientRect(hwndList,&listRect);
348 LVCOLUMN lvc;
349 int colidx=0;
350 lvc.mask = LVCF_TEXT | LVCF_WIDTH;
351 lvc.pszText = "Key";
352 lvc.cx = 100;
353 ListView_InsertColumn(hwndList, colidx++, &lvc);
354 lvc.mask = LVCF_TEXT | LVCF_WIDTH;
355 lvc.pszText = "Value";
356 lvc.cx = listRect.right - 100;
357 ListView_InsertColumn(hwndList, colidx++, &lvc);
358
359
360 //Display the Subtitles into the Metadata as well
361 for(uint32 i=0;i<currSubtitles.size();i++)
362 {
363 std::string& subtitle = currSubtitles[i];
364 size_t splitat = subtitle.find_first_of(' ');
365 std::wstring key, value;
366 //if we can't split it then call it an unnamed key
367 if(splitat == std::string::npos)
368 {
369 value = mbstowcs(subtitle);
370 } else
371 {
372 key = mbstowcs(subtitle.substr(0,splitat));
373 value = mbstowcs(subtitle.substr(splitat+1));
374 }
375
376 LVITEM lvi;
377 lvi.iItem = i;
378 lvi.mask = LVIF_TEXT;
379 lvi.iSubItem = 0;
380 lvi.pszText = (LPSTR)key.c_str();
381 SendMessageW(hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
382
383 lvi.iSubItem = 1;

Callers

nothing calls this directly

Calls 3

mbstowcsFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected