ramwatch: add more (ListView_GetSelectionMark() != -1) checks
This commit is contained in:
parent
bab64f3c94
commit
ce279995de
|
@ -965,15 +965,21 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
return true;
|
return true;
|
||||||
case IDC_C_WATCH_REMOVE:
|
case IDC_C_WATCH_REMOVE:
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
if(watchIndex != -1)
|
||||||
|
{
|
||||||
RemoveWatch(watchIndex);
|
RemoveWatch(watchIndex);
|
||||||
ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);
|
ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);
|
||||||
RWfileChanged=true;
|
RWfileChanged=true;
|
||||||
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
case IDC_C_WATCH_EDIT:
|
case IDC_C_WATCH_EDIT:
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
if(watchIndex != -1)
|
||||||
|
{
|
||||||
DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) watchIndex);
|
DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) watchIndex);
|
||||||
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
case IDC_C_WATCH:
|
case IDC_C_WATCH:
|
||||||
rswatches[WatchCount].Address = rswatches[WatchCount].WrongEndian = 0;
|
rswatches[WatchCount].Address = rswatches[WatchCount].WrongEndian = 0;
|
||||||
|
@ -984,12 +990,15 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
return true;
|
return true;
|
||||||
case IDC_C_WATCH_DUPLICATE:
|
case IDC_C_WATCH_DUPLICATE:
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
if(watchIndex != -1)
|
||||||
|
{
|
||||||
rswatches[WatchCount].Address = rswatches[watchIndex].Address;
|
rswatches[WatchCount].Address = rswatches[watchIndex].Address;
|
||||||
rswatches[WatchCount].WrongEndian = rswatches[watchIndex].WrongEndian;
|
rswatches[WatchCount].WrongEndian = rswatches[watchIndex].WrongEndian;
|
||||||
rswatches[WatchCount].Size = rswatches[watchIndex].Size;
|
rswatches[WatchCount].Size = rswatches[watchIndex].Size;
|
||||||
rswatches[WatchCount].Type = rswatches[watchIndex].Type;
|
rswatches[WatchCount].Type = rswatches[watchIndex].Type;
|
||||||
DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) WatchCount);
|
DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) WatchCount);
|
||||||
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
case IDC_C_WATCH_UP:
|
case IDC_C_WATCH_UP:
|
||||||
{
|
{
|
||||||
|
@ -1038,7 +1047,10 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
case IDC_C_ADDCHEAT:
|
case IDC_C_ADDCHEAT:
|
||||||
{
|
{
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST)) | (1 << 24);
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST)) | (1 << 24);
|
||||||
|
if(watchIndex != -1)
|
||||||
|
{
|
||||||
// DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITCHEAT), hDlg, (DLGPROC) EditCheatProc,(LPARAM) searchIndex); //TODO: made a IDD_EDITCHEAT dialog, and EditCheatProc (are they in GENS?) and integrate into cheats system
|
// DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITCHEAT), hDlg, (DLGPROC) EditCheatProc,(LPARAM) searchIndex); //TODO: made a IDD_EDITCHEAT dialog, and EditCheatProc (are they in GENS?) and integrate into cheats system
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
|
|
Loading…
Reference in New Issue