void CtrlRegisterList::mousePressEvent(QMouseEvent *e) { int x = e->pos().x(); int y = e->pos().y(); if (x>16) { oldSelection=selection; if (y>rowHeight) { selection=yToIndex(y); bool oldselecting=selecting; selecting=true; if (!oldselecting || (selection!=oldSelection)) redraw(); } else { int lastCat = category; category = (x*cpu->GetNumCategories())/(rect().width()); if (category<0) category=0; if (category>=cpu->GetNumCategories()) category=cpu->GetNumCategories()-1; if (category!=lastCat) { curVertOffset = 0; redraw(); } } } else { redraw(); } }
void CtrlRegisterList::onMouseUp(WPARAM wParam, LPARAM lParam, int button) { if (button==2) { //popup menu? int cat = category; int reg = selection; if (selection >= cpu->GetNumRegsInCategory(cat)) return; POINT pt; GetCursorPos(&pt); u32 val = cpu->GetRegValue(cat,reg); switch(TrackPopupMenuEx(GetSubMenu(g_hPopupMenus,3),TPM_RIGHTBUTTON|TPM_RETURNCMD,pt.x,pt.y,wnd,0)) { case ID_REGLIST_GOTOINMEMORYVIEW: for (int i=0; i<numCPUs; i++) if (memoryWindow[i]) memoryWindow[i]->Goto(val); break; case ID_REGLIST_GOTOINDISASM: for (int i=0; i<numCPUs; i++) if (disasmWindow[i]) disasmWindow[i]->Goto(val); break; case ID_REGLIST_COPYVALUE: { char temp[24]; sprintf(temp,"%08x",val); W32Util::CopyTextToClipboard(wnd,temp); } break; case ID_REGLIST_CHANGE: { if (InputBox_GetHex(GetModuleHandle(NULL),wnd,"Set new value",val,val)) { cpu->SetRegValue(cat,reg,val); redraw(); } } break; } return; } int x = LOWORD(lParam); int y = HIWORD(lParam); if (x>16) { selection=yToIndex(y); selecting=false; ReleaseCapture(); redraw(); } }
void CtrlRegisterList::onMouseUp(WPARAM wParam, LPARAM lParam, int button) { if (button==2) { //popup menu? int cat = category; int reg = selection; if (selection >= cpu->GetNumRegsInCategory(cat)) return; POINT pt; GetCursorPos(&pt); u32 val = cpu->GetRegValue(cat,reg); switch(TrackPopupMenuEx(GetSubMenu(g_hPopupMenus,3),TPM_RIGHTBUTTON|TPM_RETURNCMD,pt.x,pt.y,wnd,0)) { case ID_REGLIST_GOTOINMEMORYVIEW: for (int i=0; i<numCPUs; i++) if (memoryWindow[i]) memoryWindow[i]->Goto(val); break; case ID_REGLIST_GOTOINDISASM: for (int i=0; i<numCPUs; i++) if (disasmWindow[i]) disasmWindow[i]->Goto(val); break; case ID_REGLIST_COPYVALUE: copyRegisterValue(); break; case ID_REGLIST_CHANGE: editRegisterValue(); break; } return; } int x = LOWORD(lParam); int y = HIWORD(lParam); if (x>16) { selection=yToIndex(y); selecting=false; ReleaseCapture(); redraw(); } }
void CtrlRegisterList::onMouseDown(WPARAM wParam, LPARAM lParam, int button) { int x = (s16)LOWORD(lParam); int y = (s16)HIWORD(lParam); if (x>16) { oldSelection=selection; if (y>rowHeight) { selection=yToIndex(y); SetCapture(wnd); bool oldselecting=selecting; selecting=true; if (!oldselecting || (selection!=oldSelection)) redraw(); } else { RECT rc; SetCapture(wnd); GetWindowRect(wnd,&rc); int lastCat = category; category = (x*cpu->GetNumCategories())/(rc.right-rc.left); if (category<0) category=0; if (category>=cpu->GetNumCategories()) category=cpu->GetNumCategories()-1; if (category!=lastCat) redraw(); } } else { redraw(); } }
void CtrlRegisterList::onMouseUp(WPARAM wParam, LPARAM lParam, int button) { int x = LOWORD(lParam); int y = HIWORD(lParam); if (button==2 && x>16) { //popup menu? int cat = category; int reg = selection; u32 val; if (selection < cpu->GetNumRegsInCategory(cat)) { val = cpu->GetRegValue(cat, reg); } else if (cat == 0 && selection < REGISTERS_END) { switch (selection) { case REGISTER_PC: val = cpu->GetPC(); break; case REGISTER_HI: val = cpu->GetHi(); break; case REGISTER_LO: val = cpu->GetLo(); break; default: return; } } else { return; } POINT pt; GetCursorPos(&pt); switch(TrackPopupMenuEx(GetSubMenu(g_hPopupMenus,3),TPM_RIGHTBUTTON|TPM_RETURNCMD,pt.x,pt.y,wnd,0)) { case ID_REGLIST_GOTOINMEMORYVIEW: SendMessage(GetParent(wnd),WM_DEB_GOTOHEXEDIT,val,0); break; case ID_REGLIST_GOTOINDISASM: for (int i=0; i<numCPUs; i++) if (disasmWindow[i]) disasmWindow[i]->Goto(val); break; case ID_REGLIST_COPYVALUE: copyRegisterValue(); break; case ID_REGLIST_CHANGE: editRegisterValue(); break; } return; } if (x>16) { selection=yToIndex(y); selecting=false; ReleaseCapture(); redraw(); } }