When edited a RAM watch item, it is in the original place rather than jump to the last one.
This commit is contained in:
parent
43f2862127
commit
c4b4292a12
|
@ -1056,18 +1056,27 @@ void UpdateCheatWindowRelatedWindow()
|
||||||
// hex editor
|
// hex editor
|
||||||
if (hMemView)
|
if (hMemView)
|
||||||
UpdateColorTable(); //if the memory viewer is open then update any blue freeze locations in it as well
|
UpdateColorTable(); //if the memory viewer is open then update any blue freeze locations in it as well
|
||||||
extern HWND RamSearchHWnd;
|
|
||||||
|
|
||||||
// ram search
|
// ram search
|
||||||
|
extern HWND RamSearchHWnd;
|
||||||
if (RamSearchHWnd)
|
if (RamSearchHWnd)
|
||||||
RedrawWindow(GetDlgItem(RamSearchHWnd, IDC_RAMLIST), NULL, NULL, RDW_INVALIDATE); // if ram search is open then update the ram list.
|
{
|
||||||
|
// if ram search is open then update the ram list.
|
||||||
|
SendDlgItemMessage(RamSearchHWnd, IDC_RAMLIST, LVM_REDRAWITEMS,
|
||||||
|
SendDlgItemMessage(RamSearchHWnd, IDC_RAMLIST, LVM_GETTOPINDEX, 0, 0),
|
||||||
|
SendDlgItemMessage(RamSearchHWnd, IDC_RAMLIST, LVM_GETCOUNTPERPAGE, 0, 0) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
// ram watch
|
// ram watch
|
||||||
extern void UpdateWatchCheats();
|
extern void UpdateWatchCheats();
|
||||||
UpdateWatchCheats();
|
UpdateWatchCheats();
|
||||||
extern HWND RamWatchHWnd;
|
extern HWND RamWatchHWnd;
|
||||||
if (RamWatchHWnd)
|
if (RamWatchHWnd)
|
||||||
RedrawWindow(GetDlgItem(RamWatchHWnd, IDC_WATCHLIST), NULL, NULL, RDW_INVALIDATE); // update the data in watch list to the newest.
|
{
|
||||||
|
// if ram watch is open then update the ram list.
|
||||||
|
SendDlgItemMessage(RamWatchHWnd, IDC_WATCHLIST, LVM_REDRAWITEMS,
|
||||||
|
SendDlgItemMessage(RamWatchHWnd, IDC_WATCHLIST, LVM_GETTOPINDEX, 0, 0),
|
||||||
|
SendDlgItemMessage(RamWatchHWnd, IDC_WATCHLIST, LVM_GETCOUNTPERPAGE, 0, 0) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1975,7 +1975,7 @@ invalid_field:
|
||||||
if (selCount == 1)
|
if (selCount == 1)
|
||||||
inserted |= InsertWatch(tempWatch, hDlg);
|
inserted |= InsertWatch(tempWatch, hDlg);
|
||||||
else
|
else
|
||||||
inserted |= InsertWatch(tempWatch, "");
|
inserted |= InsertWatch(tempWatch);
|
||||||
|
|
||||||
watchItemIndex = ListView_GetNextItem(ramListControl, watchItemIndex, LVNI_SELECTED);
|
watchItemIndex = ListView_GetNextItem(ramListControl, watchItemIndex, LVNI_SELECTED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ bool VerifyWatchNotAlreadyAdded(const AddressWatcher& watch)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool InsertWatch(const AddressWatcher& Watch, char *Comment)
|
bool InsertWatch(const AddressWatcher& Watch)
|
||||||
{
|
{
|
||||||
if(!VerifyWatchNotAlreadyAdded(Watch))
|
if(!VerifyWatchNotAlreadyAdded(Watch))
|
||||||
return false;
|
return false;
|
||||||
|
@ -113,19 +113,14 @@ bool InsertWatch(const AddressWatcher& Watch, char *Comment)
|
||||||
int i = WatchCount++;
|
int i = WatchCount++;
|
||||||
AddressWatcher& NewWatch = rswatches[i];
|
AddressWatcher& NewWatch = rswatches[i];
|
||||||
NewWatch = Watch;
|
NewWatch = Watch;
|
||||||
//if (NewWatch.comment) free(NewWatch.comment);
|
|
||||||
if (NewWatch.comment == NULL)
|
|
||||||
NewWatch.comment = (char *)malloc(strlen(Comment) + 2);
|
|
||||||
else
|
|
||||||
NewWatch.comment = (char *)realloc(NewWatch.comment, strlen(Comment) + 2);
|
|
||||||
strcpy(NewWatch.comment, Comment);
|
|
||||||
|
|
||||||
NewWatch.CurValue = GetCurrentValue(NewWatch);
|
NewWatch.CurValue = GetCurrentValue(NewWatch);
|
||||||
extern int FCEU_CalcCheatAffectedBytes(uint32, uint32);
|
extern int FCEU_CalcCheatAffectedBytes(uint32, uint32);
|
||||||
NewWatch.Cheats = FCEU_CalcCheatAffectedBytes(NewWatch.Address, WatchSizeConv(NewWatch));
|
NewWatch.Cheats = FCEU_CalcCheatAffectedBytes(NewWatch.Address, WatchSizeConv(NewWatch));
|
||||||
|
NewWatch.comment = strcpy((char*)malloc(strlen(Watch.comment) + 2), Watch.comment);
|
||||||
|
|
||||||
if (NewWatch.Type == 'S')
|
if (NewWatch.Type == 'S')
|
||||||
separatorCache[i] = SeparatorCache(RamWatchHWnd, Comment);
|
separatorCache[i] = SeparatorCache(RamWatchHWnd, NewWatch.comment);
|
||||||
|
|
||||||
ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
|
ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
|
||||||
RWfileChanged = true;
|
RWfileChanged = true;
|
||||||
|
@ -133,6 +128,8 @@ bool InsertWatch(const AddressWatcher& Watch, char *Comment)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
LRESULT CALLBACK PromptWatchNameProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) //Gets the description of a watched address
|
LRESULT CALLBACK PromptWatchNameProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) //Gets the description of a watched address
|
||||||
{
|
{
|
||||||
|
@ -475,11 +472,13 @@ void OpenRWRecentFile(int memwRFileNumber)
|
||||||
if (CommentEnd)
|
if (CommentEnd)
|
||||||
{
|
{
|
||||||
*CommentEnd = '\0';
|
*CommentEnd = '\0';
|
||||||
InsertWatch(Temp, Comment);
|
Temp.comment = Comment;
|
||||||
|
InsertWatch(Temp);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// the wch file is probably corrupted
|
// the wch file is probably corrupted
|
||||||
InsertWatch(Temp, Comment);
|
Temp.comment = Comment;
|
||||||
|
InsertWatch(Temp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -662,11 +661,13 @@ bool Load_Watches(bool clear, const char* filename)
|
||||||
if (CommentEnd)
|
if (CommentEnd)
|
||||||
{
|
{
|
||||||
*CommentEnd = '\0';
|
*CommentEnd = '\0';
|
||||||
InsertWatch(Temp, Comment);
|
Temp.comment = Comment;
|
||||||
|
InsertWatch(Temp);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// the wch file is probably corrupted
|
// the wch file is probably corrupted
|
||||||
InsertWatch(Temp, Comment);
|
Temp.comment = Comment;
|
||||||
|
InsertWatch(Temp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -719,12 +720,18 @@ bool ResetWatches()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveWatch(int watchIndex)
|
bool RemoveWatch(int watchIndex)
|
||||||
{
|
{
|
||||||
free(rswatches[watchIndex].comment);
|
AddressWatcher& target = rswatches[watchIndex];
|
||||||
rswatches[watchIndex].comment = NULL;
|
if (watchIndex >= WatchCount)
|
||||||
if (rswatches[watchIndex].Type == 'S')
|
return false;
|
||||||
RemoveSeparatorBuf(watchIndex);
|
if (target.comment)
|
||||||
|
{
|
||||||
|
free(target.comment);
|
||||||
|
target.comment = NULL;
|
||||||
|
}
|
||||||
|
if (target.Type == 'S')
|
||||||
|
separatorCache.erase(watchIndex);
|
||||||
rswatches.erase(watchIndex);
|
rswatches.erase(watchIndex);
|
||||||
for (int i = watchIndex; i <= WatchCount; i++)
|
for (int i = watchIndex; i <= WatchCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -732,11 +739,48 @@ void RemoveWatch(int watchIndex)
|
||||||
separatorCache[i] = separatorCache[i + 1];
|
separatorCache[i] = separatorCache[i + 1];
|
||||||
}
|
}
|
||||||
WatchCount--;
|
WatchCount--;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveSeparatorBuf(int watchIndex)
|
bool EditWatch(int watchIndex, AddressWatcher& watcher)
|
||||||
{
|
{
|
||||||
separatorCache.erase(watchIndex);
|
if (watchIndex >= WatchCount)
|
||||||
|
return InsertWatch(watcher);
|
||||||
|
|
||||||
|
AddressWatcher& original = rswatches[watchIndex];
|
||||||
|
|
||||||
|
if (watcher.Type != 'S' && VerifyWatchNotAlreadyAdded(watcher))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (original.Address != watcher.Address || original.Size != watcher.Size)
|
||||||
|
{
|
||||||
|
extern int FCEU_CalcCheatAffectedBytes(uint32, uint32);
|
||||||
|
original.Cheats = FCEU_CalcCheatAffectedBytes(watcher.Address, WatchSizeConv(watcher));
|
||||||
|
original.CurValue = GetCurrentValue(watcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
original.Address = watcher.Address;
|
||||||
|
original.Type = watcher.Type;
|
||||||
|
original.Size = watcher.Size;
|
||||||
|
original.WrongEndian = watcher.WrongEndian;
|
||||||
|
|
||||||
|
RWfileChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(original.comment, watcher.comment))
|
||||||
|
{
|
||||||
|
if (original.comment)
|
||||||
|
original.comment = strcpy((char*)realloc(original.comment, strlen(watcher.comment) + 2), watcher.comment);
|
||||||
|
else
|
||||||
|
original.comment = strcpy((char*)malloc(strlen(watcher.comment) + 2), watcher.comment);
|
||||||
|
|
||||||
|
if (original.Type == 'S')
|
||||||
|
separatorCache[watchIndex] = SeparatorCache(RamWatchHWnd, watcher.comment);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshWatchListSelectedItemControlStatus(HWND hDlg)
|
void RefreshWatchListSelectedItemControlStatus(HWND hDlg)
|
||||||
|
@ -767,12 +811,12 @@ LRESULT CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
SetWindowPos(hDlg, NULL, r.left, r.top, NULL, NULL, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
|
SetWindowPos(hDlg, NULL, r.left, r.top, NULL, NULL, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
|
||||||
|
|
||||||
index = (int)lParam;
|
index = (int)lParam;
|
||||||
AddressWatcher* watcher = &rswatches[index];
|
AddressWatcher& watcher = rswatches[index];
|
||||||
if (watcher->Type != 'S') {
|
if (watcher.Type != 'S') {
|
||||||
char Str_Tmp[1024];
|
char Str_Tmp[1024];
|
||||||
sprintf(Str_Tmp, "%04X", watcher->Address);
|
sprintf(Str_Tmp, "%04X", watcher.Address);
|
||||||
SetDlgItemText(hDlg, IDC_EDIT_COMPAREADDRESS, Str_Tmp);
|
SetDlgItemText(hDlg, IDC_EDIT_COMPAREADDRESS, Str_Tmp);
|
||||||
switch (watcher->Size)
|
switch (watcher.Size)
|
||||||
{
|
{
|
||||||
case 'b':
|
case 'b':
|
||||||
SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
|
@ -784,7 +828,7 @@ LRESULT CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
SendDlgItemMessage(hDlg, IDC_4_BYTES, BM_SETCHECK, BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_4_BYTES, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (watcher->Type)
|
switch (watcher.Type)
|
||||||
{
|
{
|
||||||
case 's':
|
case 's':
|
||||||
SendDlgItemMessage(hDlg, IDC_SIGNED, BM_SETCHECK, BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_SIGNED, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
|
@ -799,11 +843,11 @@ LRESULT CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
} else
|
} else
|
||||||
SetDlgItemText(hDlg, IDC_EDIT_COMPAREADDRESS, "---------");
|
SetDlgItemText(hDlg, IDC_EDIT_COMPAREADDRESS, "---------");
|
||||||
|
|
||||||
if (watcher->comment != NULL)
|
if (watcher.comment != NULL)
|
||||||
SetDlgItemText(hDlg, IDC_PROMPT_EDIT, watcher->comment);
|
SetDlgItemText(hDlg, IDC_PROMPT_EDIT, watcher.comment);
|
||||||
|
|
||||||
HWND parent = GetParent(hDlg);
|
HWND parent = GetParent(hDlg);
|
||||||
if (watcher->Type == 'S' || parent == RamSearchHWnd)
|
if (watcher.Type == 'S' || parent == RamSearchHWnd)
|
||||||
{
|
{
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_SPECIFICADDRESS), FALSE);
|
EnableWindow(GetDlgItem(hDlg, IDC_SPECIFICADDRESS), FALSE);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_DATATYPE_GROUPBOX), FALSE);
|
EnableWindow(GetDlgItem(hDlg, IDC_DATATYPE_GROUPBOX), FALSE);
|
||||||
|
@ -886,12 +930,15 @@ LRESULT CALLBACK EditWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
|
|
||||||
// comment
|
// comment
|
||||||
GetDlgItemText(hDlg, IDC_PROMPT_EDIT, Str_Tmp, 80);
|
GetDlgItemText(hDlg, IDC_PROMPT_EDIT, Str_Tmp, 80);
|
||||||
|
watcher.comment = Str_Tmp;
|
||||||
|
|
||||||
// finallly update the watch list
|
// finallly update the watch list
|
||||||
if (index < WatchCount)
|
if (index < WatchCount)
|
||||||
// it's a watch editing operation, and the dialog is from Ram Watch Window, remove then insert;
|
// it's a watch editing operation.
|
||||||
RemoveWatch(index);
|
// Only ram watch window can edit a watch, the ram search window only add watch.
|
||||||
InsertWatch(watcher, Str_Tmp);
|
EditWatch(index, watcher);
|
||||||
|
else
|
||||||
|
InsertWatch(watcher);
|
||||||
if (RamWatchHWnd)
|
if (RamWatchHWnd)
|
||||||
ListView_SetItemCount(GetDlgItem(RamWatchHWnd, IDC_WATCHLIST), WatchCount);
|
ListView_SetItemCount(GetDlgItem(RamWatchHWnd, IDC_WATCHLIST), WatchCount);
|
||||||
EndDialog(hDlg, true);
|
EndDialog(hDlg, true);
|
||||||
|
@ -1267,39 +1314,45 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case IDC_C_WATCH:
|
case IDC_C_WATCH:
|
||||||
rswatches[WatchCount].Address = 0;
|
|
||||||
rswatches[WatchCount].WrongEndian = 0;
|
|
||||||
rswatches[WatchCount].Size = 'b';
|
|
||||||
rswatches[WatchCount].Type = 's';
|
|
||||||
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM)WatchCount);
|
|
||||||
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
|
||||||
return true;
|
|
||||||
case IDC_C_WATCH_DUPLICATE:
|
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
|
||||||
if(watchIndex != -1)
|
|
||||||
{
|
{
|
||||||
rswatches[WatchCount].Address = rswatches[watchIndex].Address;
|
AddressWatcher& target = rswatches[WatchCount];
|
||||||
rswatches[WatchCount].WrongEndian = rswatches[watchIndex].WrongEndian;
|
target.Address = 0;
|
||||||
rswatches[WatchCount].Size = rswatches[watchIndex].Size;
|
target.WrongEndian = 0;
|
||||||
rswatches[WatchCount].Type = rswatches[watchIndex].Type;
|
target.Size = 'b';
|
||||||
rswatches[WatchCount].comment = strcpy((char*)malloc(strlen(rswatches[watchIndex].comment) + 2), rswatches[watchIndex].comment);
|
target.Type = 's';
|
||||||
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,WatchCount);
|
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, (LPARAM)WatchCount);
|
||||||
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
SetFocus(GetDlgItem(hDlg, IDC_WATCHLIST));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case IDC_C_WATCH_DUPLICATE:
|
||||||
|
{
|
||||||
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg, IDC_WATCHLIST));
|
||||||
|
if (watchIndex != -1)
|
||||||
|
{
|
||||||
|
char str_tmp[1024];
|
||||||
|
AddressWatcher* target = &rswatches[WatchCount];
|
||||||
|
AddressWatcher* source = &rswatches[watchIndex];
|
||||||
|
memcpy(target, source, sizeof(AddressWatcher));
|
||||||
|
target->comment = strcpy(str_tmp, source->comment);
|
||||||
|
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, WatchCount);
|
||||||
|
SetFocus(GetDlgItem(hDlg, IDC_WATCHLIST));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
case IDC_C_WATCH_SEPARATE:
|
case IDC_C_WATCH_SEPARATE:
|
||||||
rswatches[WatchCount].Address = 0;
|
{
|
||||||
rswatches[WatchCount].WrongEndian = false;
|
AddressWatcher* target = &rswatches[WatchCount];
|
||||||
rswatches[WatchCount].Size = 'S';
|
target->Address = 0;
|
||||||
rswatches[WatchCount].Type = 'S';
|
target->WrongEndian = false;
|
||||||
|
target->Size = 'S';
|
||||||
|
target->Type = 'S';
|
||||||
|
|
||||||
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, (LPARAM)WatchCount);
|
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC)EditWatchProc, (LPARAM)WatchCount);
|
||||||
|
|
||||||
// InsertWatch(separator, "----------------------------");
|
// InsertWatch(separator, "----------------------------");
|
||||||
SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
|
SetFocus(GetDlgItem(hDlg, IDC_WATCHLIST));
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
case IDC_C_WATCH_UP:
|
case IDC_C_WATCH_UP:
|
||||||
{
|
{
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
||||||
|
@ -1317,16 +1370,16 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
memcpy(&separatorCache[watchIndex - 1], tmp, sizeof(SeparatorCache));
|
memcpy(&separatorCache[watchIndex - 1], tmp, sizeof(SeparatorCache));
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
||||||
ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex,0,LVIS_FOCUSED|LVIS_SELECTED);
|
ListView_SetItemState(GetDlgItem(hDlg, IDC_WATCHLIST), watchIndex, 0, LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex-1);
|
ListView_SetSelectionMark(GetDlgItem(hDlg, IDC_WATCHLIST), watchIndex - 1);
|
||||||
ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex-1,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
|
ListView_SetItemState(GetDlgItem(hDlg, IDC_WATCHLIST), watchIndex - 1, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);
|
ListView_SetItemCount(GetDlgItem(hDlg, IDC_WATCHLIST), WatchCount);
|
||||||
RWfileChanged=true;
|
RWfileChanged=true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case IDC_C_WATCH_DOWN:
|
case IDC_C_WATCH_DOWN:
|
||||||
{
|
{
|
||||||
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
|
watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg, IDC_WATCHLIST));
|
||||||
if (watchIndex >= WatchCount - 1 || watchIndex == -1)
|
if (watchIndex >= WatchCount - 1 || watchIndex == -1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -1342,17 +1395,16 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
memcpy(&separatorCache[watchIndex + 1], tmp, sizeof(SeparatorCache));
|
memcpy(&separatorCache[watchIndex + 1], tmp, sizeof(SeparatorCache));
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
||||||
ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex,0,LVIS_FOCUSED|LVIS_SELECTED);
|
ListView_SetItemState(GetDlgItem(hDlg, IDC_WATCHLIST), watchIndex, 0, LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex+1);
|
ListView_SetSelectionMark(GetDlgItem(hDlg, IDC_WATCHLIST),watchIndex + 1);
|
||||||
ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex+1,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
|
ListView_SetItemState(GetDlgItem(hDlg, IDC_WATCHLIST), watchIndex + 1, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);
|
ListView_SetItemCount(GetDlgItem(hDlg, IDC_WATCHLIST), WatchCount);
|
||||||
RWfileChanged=true;
|
RWfileChanged = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case ID_WATCHES_UPDOWN:
|
case ID_WATCHES_UPDOWN:
|
||||||
{
|
{
|
||||||
int delta = ((LPNMUPDOWN)lParam)->iDelta;
|
SendMessage(hDlg, WM_COMMAND, ((LPNMUPDOWN)lParam)->iDelta < 0 ? IDC_C_WATCH_UP : IDC_C_WATCH_DOWN,0);
|
||||||
SendMessage(hDlg, WM_COMMAND, delta<0 ? IDC_C_WATCH_UP : IDC_C_WATCH_DOWN,0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RAMMENU_FILE_AUTOLOAD:
|
case RAMMENU_FILE_AUTOLOAD:
|
||||||
|
@ -1364,7 +1416,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
case RAMMENU_FILE_SAVEWINDOW:
|
case RAMMENU_FILE_SAVEWINDOW:
|
||||||
{
|
{
|
||||||
RWSaveWindowPos ^=1;
|
RWSaveWindowPos ^= 1;
|
||||||
CheckMenuItem(ramwatchmenu, RAMMENU_FILE_SAVEWINDOW, RWSaveWindowPos ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(ramwatchmenu, RAMMENU_FILE_SAVEWINDOW, RWSaveWindowPos ? MF_CHECKED : MF_UNCHECKED);
|
||||||
//regSetDwordValue(RWSAVEPOS, RWSaveWindowPos); TODO
|
//regSetDwordValue(RWSAVEPOS, RWSaveWindowPos); TODO
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -58,11 +58,10 @@ extern char Watch_Dir[1024];
|
||||||
extern HWND RamWatchHWnd;
|
extern HWND RamWatchHWnd;
|
||||||
extern HACCEL RamWatchAccels;
|
extern HACCEL RamWatchAccels;
|
||||||
|
|
||||||
bool InsertWatch(const AddressWatcher& Watch, char *Comment);
|
bool InsertWatch(const AddressWatcher& Watch);
|
||||||
bool InsertWatch(const AddressWatcher& Watch, HWND parent=NULL); // asks user for comment
|
bool InsertWatch(const AddressWatcher& Watch, HWND parent); // asks user for comment)
|
||||||
void EditWatch(int watchIndex, AddressWatcher& watcher);
|
bool EditWatch(int watchIndex, AddressWatcher& watcher);
|
||||||
void RemoveWatch(int watchIndex);
|
bool RemoveWatch(int watchIndex);
|
||||||
void RemoveSeparatorBuf(int index);
|
|
||||||
|
|
||||||
void Update_RAM_Watch();
|
void Update_RAM_Watch();
|
||||||
bool Load_Watches(bool clear, const char* filename);
|
bool Load_Watches(bool clear, const char* filename);
|
||||||
|
|
Loading…
Reference in New Issue