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

Function MemWatchCallB

src/drivers/win/memwatch.cpp:727–990  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725}
726
727static INT_PTR CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
728{
729 const int FMAX = 6;
730 string formula[FMAX] = {"> than", "> by 1", "< than", "< by 1", "equal", "!equal"};
731
732 const int kLabelControls[] = {MW_VALUELABEL1, MW_VALUELABEL2};
733
734 switch(uMsg)
735 {
736 case WM_ENTERMENULOOP:
737 EnableMenuItem(memwmenu, MEMW_FILE_SAVE, MF_BYCOMMAND | fileChanged ? MF_ENABLED : MF_GRAYED);
738 break;
739 case WM_MOVE: {
740 if (!IsIconic(hwndDlg)) {
741 RECT wrect;
742 GetWindowRect(hwndDlg,&wrect);
743 MemWatch_wndx = wrect.left;
744 MemWatch_wndy = wrect.top;
745
746 #ifdef WIN32
747 WindowBoundsCheckNoResize(MemWatch_wndx,MemWatch_wndy,wrect.right);
748 #endif
749 }
750 break;
751 };
752
753 case WM_INITDIALOG:
754 POINT pt;
755 if (MemWatch_wndx != 0 && MemWatch_wndy != 0)
756 {
757 pt.x = MemWatch_wndx;
758 pt.y = MemWatch_wndy;
759 pt = CalcSubWindowPos(hwndDlg, &pt);
760 }
761 else
762 pt = CalcSubWindowPos(hwndDlg, NULL);
763 MemWatch_wndx = pt.x;
764 MemWatch_wndy = pt.y;
765
766 hdc = GetDC(hwndDlg);
767 SelectObject (hdc, debugSystem->hFixedFont);
768 SetTextAlign(hdc,TA_UPDATECP | TA_TOP | TA_LEFT);
769
770 //Collapse window if necesasry
771 if (MemWCollapsed)
772 {
773 MemWCollapsed = false; //This is necessary in order for CollapseWindow to collapse properly
774 CollapseWindow(); //If flagged as collapsed mode collapse
775 }
776
777 //find the positions where we should draw string values
778 for(int i = 0; i < MWNUM; i++) {
779 int col = 0;
780 if(i >= MWNUM / 2)
781 col = 1;
782 RECT r;
783 GetWindowRect(GetDlgItem(hwndDlg, MW_ADDR[i]), &r);
784 ScreenToClient(hwndDlg, (LPPOINT)&r);

Callers

nothing calls this directly

Calls 15

CalcSubWindowPosFunction · 0.85
CollapseWindowFunction · 0.85
CreateCheatMapFunction · 0.85
UpdateMemWatchFunction · 0.85
CloseMemoryWatchFunction · 0.85
ReleaseCheatMapFunction · 0.85
MemwAddRecentFileFunction · 0.85
OpenMemwatchRecentFileFunction · 0.85
LoadMemWatchFunction · 0.85
QuickSaveMemWatchFunction · 0.85
SaveMemWatchFunction · 0.85

Tested by

no test coverage detected