Merge pull request #3172 from Kingcom/Debug

Separate accelerator table when the debugger is active
This commit is contained in:
Henrik Rydgård 2013-08-14 14:52:50 -07:00
commit 9aafdeafcf
6 changed files with 28 additions and 2 deletions

View File

@ -17,6 +17,7 @@
#include "Windows/Debugger/CtrlRegisterList.h"
#include "Windows/Debugger/CtrlMemView.h"
#include "Windows/Debugger/Debugger_Lists.h"
#include "Windows/WndMainWindow.h"
#include "Core/Core.h"
#include "Core/CPU.h"
@ -224,6 +225,9 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
switch(LOWORD(wParam))
{
case ID_TOGGLE_PAUSE:
SendMessage(MainWindow::GetHWND(),WM_COMMAND,ID_TOGGLE_PAUSE,0);
break;
case IDC_SHOWVFPU:
vfpudlg->Show(true);
break;
@ -587,6 +591,14 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_CLOSE:
Show(false);
return TRUE;
case WM_ACTIVATE:
if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE)
{
g_debuggerActive = true;
} else {
g_debuggerActive = false;
}
break;
}
return FALSE;
}

View File

@ -24,5 +24,6 @@
// Globals
HMENU g_hPopupMenus;
bool g_debuggerActive = false;
#endif

View File

@ -124,6 +124,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
EmuThread_Start();
HACCEL hAccelTable = LoadAccelerators(_hInstance, (LPCTSTR)IDR_ACCELS);
HACCEL hDebugAccelTable = LoadAccelerators(_hInstance, (LPCTSTR)IDR_DEBUGACCELS);
//so.. we're at the message pump of the GUI thread
for (MSG msg; GetMessage(&msg, NULL, 0, 0); ) // for no quit
@ -141,7 +142,18 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
}
//Translate accelerators and dialog messages...
if (!TranslateAccelerator(hwndMain, hAccelTable, &msg))
HWND wnd;
HACCEL accel;
if (g_debuggerActive)
{
wnd = disasmWindow[0]->GetDlgHandle();
accel = hDebugAccelTable;
} else {
wnd = hwndMain;
accel = hAccelTable;
}
if (!TranslateAccelerator(wnd, accel, &msg))
{
if (!DialogManager::IsDialogMessage(&msg))
{

View File

@ -28,4 +28,5 @@
extern CDisasm *disasmWindow[MAX_CPUCOUNT];
extern CMemoryDlg *memoryWindow[MAX_CPUCOUNT];
extern HMENU g_hPopupMenus;
extern HMENU g_hPopupMenus;
extern bool g_debuggerActive;

Binary file not shown.

Binary file not shown.