~ubuntu-branches/ubuntu/utopic/fceux/utopic

« back to all changes in this revision

Viewing changes to src/drivers/win/ram_search.cpp

  • Committer: Package Import Robot
  • Author(s): Joe Nahmias
  • Date: 2014-03-02 19:22:04 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140302192204-9f0aehi5stfnhn7d
Tags: 2.2.2+dfsg0-1
* Imported Upstream version 2.2.2
  + remove patches merged upstream; refresh remaining
  + remove windows compiled help files and non-free Visual C files
* Use C++11 standard static assertion functionality
* fix upstream installation of support files
* New patch 0004-ignore-missing-windows-help-CHM-file.patch
* update d/copyright for new, renamed, deleted files
* d/control: bump std-ver to 3.9.5, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#else
45
45
        #include "stdint.h"
46
46
#endif
 
47
#include "memview.h"
47
48
 
48
49
bool ShowROM = false;
49
50
 
1111
1112
                {
1112
1113
                        EnableWindow(GetDlgItem(hDlg, IDC_C_WATCH), (selCount >= 1 && WatchCount < MAX_WATCH_COUNT) ? TRUE : FALSE);
1113
1114
                        EnableWindow(GetDlgItem(hDlg, IDC_C_ADDCHEAT), (selCount >= 1) ? TRUE : FALSE);
 
1115
                        EnableWindow(GetDlgItem(hDlg, IDC_C_HEXEDITOR), (selCount >= 1) ? TRUE : FALSE);
1114
1116
                        EnableWindow(GetDlgItem(hDlg, IDC_C_ELIMINATE), (selCount >= 1) ? TRUE : FALSE);
1115
1117
                }
1116
1118
                prevSelCount = selCount;
1520
1522
                        LPNMHDR lP = (LPNMHDR) lParam;
1521
1523
                        switch (lP->code)
1522
1524
                        {
 
1525
                                case NM_CUSTOMDRAW:
 
1526
                                {
 
1527
                                        SetWindowLong(hDlg, DWL_MSGRESULT, CustomDraw(lParam));
 
1528
                                        return TRUE;
 
1529
                                }
 
1530
 
1523
1531
                                case LVN_ITEMCHANGED: // selection changed event
1524
1532
                                {
1525
1533
                                        NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)lP;
1529
1537
                                                // disable buttons that we don't have the right number of selected items for
1530
1538
                                                RefreshRamListSelectedCountControlStatus(hDlg);
1531
1539
                                        }
1532
 
                                }       break;
 
1540
                                        break;
 
1541
                                }
1533
1542
 
1534
1543
                                case LVN_GETDISPINFO:
1535
1544
                                {
1588
1597
                                        }
1589
1598
                                }
1590
1599
 
1591
 
                                case NM_CUSTOMDRAW:
 
1600
                                case NM_RCLICK:
1592
1601
                                {
1593
 
                                        SetWindowLong(hDlg, DWL_MSGRESULT, CustomDraw(lParam));
1594
 
                                        return TRUE;
1595
 
                                }       break;
 
1602
                                        // go to the address in Hex Editor
 
1603
                                        LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE)lParam;
 
1604
                                        int watchItemIndex = lpnmitem->iItem;
 
1605
                                        if (watchItemIndex >= 0)
 
1606
                                        {
 
1607
                                                unsigned int addr = CALL_WITH_T_SIZE_TYPES_1(GetHardwareAddressFromItemIndex, rs_type_size, rs_t=='s', noMisalign, watchItemIndex);
 
1608
                                                ChangeMemViewFocus(0, addr, -1);
 
1609
                                        }
 
1610
                                        break;
 
1611
                                }
1596
1612
 
1597
1613
                                //case LVN_ODCACHEHINT: //Copied this bit from the MSDN virtual listbox code sample. Eventually it should probably do something.
1598
1614
                                //{
1605
1621
                                //      return 0;
1606
1622
                                //}
1607
1623
                        }
1608
 
                }       break;
 
1624
                        break;
 
1625
                }
1609
1626
 
1610
1627
                case WM_COMMAND:
1611
1628
                {
1862
1879
                                        }
1863
1880
                                        {rv = true; break;}
1864
1881
                                }
 
1882
                                case IDC_C_HEXEDITOR:
 
1883
                                {
 
1884
                                        HWND ramListControl = GetDlgItem(hDlg,IDC_RAMLIST);
 
1885
                                        int selCount = ListView_GetSelectedCount(ramListControl);
 
1886
                                        int watchItemIndex = ListView_GetNextItem(ramListControl, -1, LVNI_SELECTED);
 
1887
                                        if (watchItemIndex >= 0)
 
1888
                                        {
 
1889
                                                unsigned int addr = CALL_WITH_T_SIZE_TYPES_1(GetHardwareAddressFromItemIndex, rs_type_size, rs_t=='s', noMisalign, watchItemIndex);
 
1890
                                                ChangeMemViewFocus(0, addr, -1);
 
1891
                                        }
 
1892
                                        break;
 
1893
                                }
1865
1894
                                case IDC_C_WATCH:
1866
1895
                                {
1867
1896
                                        HWND ramListControl = GetDlgItem(hDlg,IDC_RAMLIST);