win32: tighten up the address mousepos calculation and resize behaviour line in the debugger

This commit is contained in:
zeromus 2011-05-06 20:59:54 +00:00
parent 55e45af3dd
commit 6ce0cee9a0
1 changed files with 17 additions and 10 deletions

View File

@ -931,7 +931,7 @@ BOOL CALLBACK DebuggerEnumWindowsProc(HWND hwnd, LPARAM lParam)
int dy = (newDebuggerRect.bottom-newDebuggerRect.top)-(currDebuggerRect.bottom-currDebuggerRect.top); //ditto wtih height int dy = (newDebuggerRect.bottom-newDebuggerRect.top)-(currDebuggerRect.bottom-currDebuggerRect.top); //ditto wtih height
HWND editbox = GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY); //Get handle for Disassembly list box (large guy on the left) HWND editbox = GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY); //Get handle for Disassembly list box (large guy on the left)
HWND icontray = GetDlgItem(hDebug,IDC_DEBUGGER_ICONTRAY); //Get handle for IContray, vertical column to the left of disassembly HWND icontray = GetDlgItem(hDebug,IDC_DEBUGGER_ICONTRAY); //Get handle for Icontray, vertical column to the left of disassembly
HWND addrline = GetDlgItem(hDebug,IDC_DEBUGGER_ADDR_LINE); //Get handle of address line (text area under the disassembly HWND addrline = GetDlgItem(hDebug,IDC_DEBUGGER_ADDR_LINE); //Get handle of address line (text area under the disassembly
HWND vscr = GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY_VSCR); //Get handle for disassembly Vertical Scrollbar HWND vscr = GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY_VSCR); //Get handle for disassembly Vertical Scrollbar
@ -951,6 +951,7 @@ BOOL CALLBACK DebuggerEnumWindowsProc(HWND hwnd, LPARAM lParam)
SetWindowPos(hwnd,0,0,0,crect.right-crect.left,crect.bottom-crect.top,SWP_NOZORDER | SWP_NOMOVE); SetWindowPos(hwnd,0,0,0,crect.right-crect.left,crect.bottom-crect.top,SWP_NOZORDER | SWP_NOMOVE);
} else if(hwnd == addrline) { } else if(hwnd == addrline) {
crect.top += dy; crect.top += dy;
crect.bottom += dy;
crect.right += dx; crect.right += dx;
SetWindowPos(hwnd,0,crect.left,crect.top,crect.right-crect.left,crect.bottom-crect.top,SWP_NOZORDER); SetWindowPos(hwnd,0,crect.left,crect.top,crect.right-crect.left,crect.bottom-crect.top,SWP_NOZORDER);
} else if(hwnd == vscr) { } else if(hwnd == vscr) {
@ -1227,19 +1228,23 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
//} //}
break; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE: {
mouse_x = GET_X_LPARAM(lParam); mouse_x = GET_X_LPARAM(lParam);
mouse_y = GET_Y_LPARAM(lParam); mouse_y = GET_Y_LPARAM(lParam);
// ################################## Start of SP CODE ###########################
// mouse_y < 538 bool setString = false;
// > 33) tmp = 33 if ((mouse_x > 8) && (mouse_x < 22) && (mouse_y > 12)) {
setString = true;
if ((mouse_x > 8) && (mouse_x < 22) && (mouse_y > 10) && (mouse_y < 538)) { RECT rectDisassembly;
if ((tmp=((mouse_y - 10) / 13)) > 33) tmp = 33; GetClientRect(GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY),&rectDisassembly);
int height = rectDisassembly.bottom-rectDisassembly.top;
// ################################## End of SP CODE ########################### tmp = mouse_y - 12;
if(tmp > height) setString = false;
tmp /= 13;
}
if(setString)
{
i = si.nPos; i = si.nPos;
while (tmp > 0) { while (tmp > 0) {
if ((tmp2=opsize[GetMem(i)]) == 0) tmp2++; if ((tmp2=opsize[GetMem(i)]) == 0) tmp2++;
@ -1263,6 +1268,8 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
} }
else SetDlgItemText(hwndDlg,IDC_DEBUGGER_ADDR_LINE,""); else SetDlgItemText(hwndDlg,IDC_DEBUGGER_ADDR_LINE,"");
break; break;
}
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
mouse_x = GET_X_LPARAM(lParam); mouse_x = GET_X_LPARAM(lParam);
mouse_y = GET_Y_LPARAM(lParam); mouse_y = GET_Y_LPARAM(lParam);