Merge pull request #1885 from shygoo/script-ui
[Debugger] Improve script window
This commit is contained in:
commit
4a4b0b2e33
|
@ -13,24 +13,28 @@
|
||||||
|
|
||||||
#include "DebuggerUI.h"
|
#include "DebuggerUI.h"
|
||||||
|
|
||||||
//char* CEditEval::m_EvalString;
|
|
||||||
|
|
||||||
CDebugScripts::CDebugScripts(CDebuggerUI* debugger) :
|
CDebugScripts::CDebugScripts(CDebuggerUI* debugger) :
|
||||||
CDebugDialog<CDebugScripts>(debugger)
|
CDebugDialog<CDebugScripts>(debugger),
|
||||||
|
CToolTipDialog<CDebugScripts>(),
|
||||||
|
m_SelectedScriptName(NULL),
|
||||||
|
m_hQuitScriptDirWatchEvent(NULL),
|
||||||
|
m_hScriptDirWatchThread(NULL)
|
||||||
{
|
{
|
||||||
m_SelectedScriptName = (char*)malloc(MAX_PATH);
|
|
||||||
//CScriptSystem::SetScriptsWindow(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CDebugScripts::~CDebugScripts(void)
|
CDebugScripts::~CDebugScripts(void)
|
||||||
|
{
|
||||||
|
if (m_SelectedScriptName != NULL)
|
||||||
{
|
{
|
||||||
free(m_SelectedScriptName);
|
free(m_SelectedScriptName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||||
{
|
{
|
||||||
DlgResize_Init(false, true);
|
DlgResize_Init(false, true);
|
||||||
DlgSavePos_Init(DebuggerUI_ScriptsPos);
|
DlgSavePos_Init(DebuggerUI_ScriptsPos);
|
||||||
|
DlgToolTip_Init();
|
||||||
|
|
||||||
HFONT monoFont = CreateFont(-11, 0, 0, 0,
|
HFONT monoFont = CreateFont(-11, 0, 0, 0,
|
||||||
FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
|
FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
|
||||||
|
@ -38,11 +42,11 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
|
||||||
CLEARTYPE_QUALITY, FF_DONTCARE, L"Consolas"
|
CLEARTYPE_QUALITY, FF_DONTCARE, L"Consolas"
|
||||||
);
|
);
|
||||||
|
|
||||||
m_InstanceInfoEdit.Attach(GetDlgItem(IDC_CTX_INFO_EDIT));
|
|
||||||
|
|
||||||
m_ScriptList.Attach(GetDlgItem(IDC_SCRIPT_LIST));
|
m_ScriptList.Attach(GetDlgItem(IDC_SCRIPT_LIST));
|
||||||
m_ScriptList.AddColumn(L"Script", 0, 0);
|
m_ScriptList.AddColumn(L"Status", 0);
|
||||||
m_ScriptList.SetColumnWidth(0, 100);
|
m_ScriptList.AddColumn(L"Script", 1);
|
||||||
|
m_ScriptList.SetColumnWidth(0, 16);
|
||||||
|
m_ScriptList.SetColumnWidth(1, LVSCW_AUTOSIZE_USEHEADER);
|
||||||
m_ScriptList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
|
m_ScriptList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
|
||||||
m_ScriptList.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
|
m_ScriptList.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
|
||||||
|
|
||||||
|
@ -55,61 +59,86 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
|
||||||
m_ConsoleEdit.SetLimitText(0);
|
m_ConsoleEdit.SetLimitText(0);
|
||||||
m_ConsoleEdit.SetFont(monoFont);
|
m_ConsoleEdit.SetFont(monoFont);
|
||||||
|
|
||||||
|
int statusPaneWidths[] = { -1 };
|
||||||
|
m_StatusBar.Attach(GetDlgItem(IDC_STATUSBAR));
|
||||||
|
m_StatusBar.SetParts(1, statusPaneWidths);
|
||||||
|
|
||||||
RefreshList();
|
RefreshList();
|
||||||
|
|
||||||
LoadWindowPos();
|
LoadWindowPos();
|
||||||
WindowCreated();
|
WindowCreated();
|
||||||
|
|
||||||
|
m_hQuitScriptDirWatchEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
m_hScriptDirWatchThread = CreateThread(NULL, 0, ScriptDirWatchProc, (void*)this, 0, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT CDebugScripts::OnDestroy(void)
|
||||||
|
{
|
||||||
|
SetEvent(m_hQuitScriptDirWatchEvent);
|
||||||
|
WaitForSingleObject(m_hScriptDirWatchThread, INFINITE);
|
||||||
|
CloseHandle(m_hQuitScriptDirWatchEvent);
|
||||||
|
CloseHandle(m_hScriptDirWatchThread);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CDebugScripts::OnCtlColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
|
||||||
|
{
|
||||||
|
HDC hDC = (HDC)wParam;
|
||||||
|
HWND hCtrl = (HWND)lParam;
|
||||||
|
WORD ctrlId = (WORD) ::GetWindowLong(hCtrl, GWL_ID);
|
||||||
|
|
||||||
|
if (ctrlId == IDC_CONSOLE_EDIT)
|
||||||
|
{
|
||||||
|
SetBkColor(hDC, RGB(255, 255, 255));
|
||||||
|
SetDCBrushColor(hDC, RGB(255, 255, 255));
|
||||||
|
return (LRESULT)GetStockObject(DC_BRUSH);
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD WINAPI CDebugScripts::ScriptDirWatchProc(void* ctx)
|
||||||
|
{
|
||||||
|
CDebugScripts* _this = (CDebugScripts*)ctx;
|
||||||
|
|
||||||
|
HANDLE hEvents[2];
|
||||||
|
|
||||||
|
hEvents[0] = FindFirstChangeNotification(L"Scripts", FALSE, FILE_NOTIFY_CHANGE_FILE_NAME);
|
||||||
|
|
||||||
|
if (hEvents[0] == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hEvents[1] = _this->m_hQuitScriptDirWatchEvent;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
DWORD status = WaitForMultipleObjects(2, hEvents, FALSE, INFINITE);
|
||||||
|
|
||||||
|
switch (status)
|
||||||
|
{
|
||||||
|
case WAIT_OBJECT_0:
|
||||||
|
if (FindNextChangeNotification(hEvents[0]) == FALSE)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_this->PostMessage(WM_REFRESH_LIST, 0, 0);
|
||||||
|
break;
|
||||||
|
case WAIT_OBJECT_0 + 1:
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CDebugScripts::OnExitSizeMove(void)
|
void CDebugScripts::OnExitSizeMove(void)
|
||||||
{
|
{
|
||||||
SaveWindowPos(true);
|
SaveWindowPos(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDebugScripts::ConsolePrint(const char* text)
|
|
||||||
{
|
|
||||||
::ShowWindow(*this, SW_SHOWNOACTIVATE);
|
|
||||||
|
|
||||||
// Get scrollbar state
|
|
||||||
SCROLLINFO scroll;
|
|
||||||
scroll.cbSize = sizeof(SCROLLINFO);
|
|
||||||
scroll.fMask = SIF_ALL;
|
|
||||||
m_ConsoleEdit.GetScrollInfo(SB_VERT, &scroll);
|
|
||||||
|
|
||||||
m_ConsoleEdit.SetRedraw(FALSE);
|
|
||||||
|
|
||||||
m_ConsoleEdit.AppendText(stdstr(text).ToUTF16().c_str());
|
|
||||||
|
|
||||||
m_ConsoleEdit.SetRedraw(TRUE);
|
|
||||||
|
|
||||||
if ((scroll.nPage + scroll.nPos) - 1 == (uint32_t)scroll.nMax)
|
|
||||||
{
|
|
||||||
m_ConsoleEdit.ScrollCaret();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugScripts::RefreshConsole()
|
|
||||||
{
|
|
||||||
CGuard guard(m_CS);
|
|
||||||
|
|
||||||
m_Debugger->OpenScriptsWindow();
|
|
||||||
CScriptSystem* scriptSystem = m_Debugger->ScriptSystem();
|
|
||||||
vector<char*>* logData = scriptSystem->LogData();
|
|
||||||
|
|
||||||
while (logData->size() != 0)
|
|
||||||
{
|
|
||||||
ConsolePrint((*logData)[0]);
|
|
||||||
free((*logData)[0]);
|
|
||||||
logData->erase(logData->begin() + 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugScripts::ConsoleClear()
|
|
||||||
{
|
|
||||||
m_ConsoleEdit.SetWindowText(L"");
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugScripts::ConsoleCopy()
|
void CDebugScripts::ConsoleCopy()
|
||||||
{
|
{
|
||||||
if (!OpenClipboard())
|
if (!OpenClipboard())
|
||||||
|
@ -127,41 +156,33 @@ void CDebugScripts::ConsoleCopy()
|
||||||
m_ConsoleEdit.GetWindowText(memBuf, nChars);
|
m_ConsoleEdit.GetWindowText(memBuf, nChars);
|
||||||
|
|
||||||
GlobalUnlock(hMem);
|
GlobalUnlock(hMem);
|
||||||
SetClipboardData(CF_TEXT, hMem);
|
SetClipboardData(CF_UNICODETEXT, hMem);
|
||||||
|
|
||||||
GlobalFree(hMem);
|
GlobalFree(hMem);
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDebugScripts::RefreshList()
|
void CDebugScripts::ConsolePrint(const char* text)
|
||||||
{
|
{
|
||||||
CGuard guard(m_CS);
|
if (m_hWnd != NULL)
|
||||||
|
|
||||||
int nIndex = m_ScriptList.GetSelectedIndex();
|
|
||||||
|
|
||||||
CPath SearchPath("Scripts", "*");
|
|
||||||
|
|
||||||
if (!SearchPath.FindFirst(CPath::FIND_ATTRIBUTE_ALLFILES))
|
|
||||||
{
|
{
|
||||||
return;
|
SendMessage(WM_CONSOLE_PRINT, (WPARAM)text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ScriptList.SetRedraw(false);
|
void CDebugScripts::ConsoleClear()
|
||||||
m_ScriptList.DeleteAllItems();
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
stdstr scriptFileName = SearchPath.GetNameExtension();
|
if (m_hWnd != NULL)
|
||||||
m_ScriptList.AddItem(0, 0, scriptFileName.ToUTF16().c_str());
|
|
||||||
} while (SearchPath.FindNext());
|
|
||||||
|
|
||||||
m_ScriptList.SetRedraw(true);
|
|
||||||
m_ScriptList.Invalidate();
|
|
||||||
|
|
||||||
if (nIndex >= 0)
|
|
||||||
{
|
{
|
||||||
m_ScriptList.SelectItem(nIndex);
|
SendMessage(WM_CONSOLE_CLEAR);
|
||||||
RefreshStatus();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugScripts::RefreshList()
|
||||||
|
{
|
||||||
|
if (m_hWnd != NULL)
|
||||||
|
{
|
||||||
|
PostMessage(WM_REFRESH_LIST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,9 +194,11 @@ LRESULT CDebugScripts::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*
|
||||||
EndDialog(0);
|
EndDialog(0);
|
||||||
break;
|
break;
|
||||||
case ID_POPUP_RUN:
|
case ID_POPUP_RUN:
|
||||||
|
case IDC_RUN_BTN:
|
||||||
RunSelected();
|
RunSelected();
|
||||||
break;
|
break;
|
||||||
case ID_POPUP_STOP:
|
case ID_POPUP_STOP:
|
||||||
|
case IDC_STOP_BTN:
|
||||||
StopSelected();
|
StopSelected();
|
||||||
break;
|
break;
|
||||||
case ID_POPUP_SCRIPT_EDIT:
|
case ID_POPUP_SCRIPT_EDIT:
|
||||||
|
@ -187,6 +210,9 @@ LRESULT CDebugScripts::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*
|
||||||
case IDC_COPY_BTN:
|
case IDC_COPY_BTN:
|
||||||
ConsoleCopy();
|
ConsoleCopy();
|
||||||
break;
|
break;
|
||||||
|
case IDC_SCRIPTDIR_BTN:
|
||||||
|
ShellExecute(NULL, L"open", L"Scripts", NULL, NULL, SW_SHOW);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +223,10 @@ LRESULT CDebugScripts::OnScriptListDblClicked(NMHDR* pNMHDR)
|
||||||
NMITEMACTIVATE* pIA = reinterpret_cast<NMITEMACTIVATE*>(pNMHDR);
|
NMITEMACTIVATE* pIA = reinterpret_cast<NMITEMACTIVATE*>(pNMHDR);
|
||||||
int nItem = pIA->iItem;
|
int nItem = pIA->iItem;
|
||||||
|
|
||||||
m_ScriptList.SelectItem(nItem);
|
if (nItem == -1)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ToggleSelected();
|
ToggleSelected();
|
||||||
|
|
||||||
|
@ -206,66 +235,55 @@ LRESULT CDebugScripts::OnScriptListDblClicked(NMHDR* pNMHDR)
|
||||||
|
|
||||||
void CDebugScripts::RefreshStatus()
|
void CDebugScripts::RefreshStatus()
|
||||||
{
|
{
|
||||||
CGuard guard(m_CS);
|
|
||||||
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
||||||
|
|
||||||
char* szState = "";
|
stdstr statusText;
|
||||||
switch (state)
|
CPath(stdstr_f("Scripts\\%s", m_SelectedScriptName)).GetFullyQualified(statusText);
|
||||||
{
|
|
||||||
case STATE_RUNNING: szState = "Running"; break;
|
|
||||||
case STATE_STARTED: szState = "Started"; break;
|
|
||||||
case STATE_STOPPED: szState = "Stopped"; break;
|
|
||||||
case STATE_INVALID: szState = "Not running"; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
stdstr instanceInfo = stdstr_f("%s (%s)", m_SelectedScriptName, szState);
|
|
||||||
|
|
||||||
m_InstanceInfoEdit.SetWindowText(instanceInfo.ToUTF16().c_str());
|
|
||||||
|
|
||||||
if (state == STATE_RUNNING)
|
if (state == STATE_RUNNING)
|
||||||
{
|
{
|
||||||
|
statusText += " (Running)";
|
||||||
m_EvalEdit.EnableWindow(TRUE);
|
m_EvalEdit.EnableWindow(TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (state == STATE_STARTED)
|
||||||
|
{
|
||||||
|
statusText += " (Started)";
|
||||||
|
}
|
||||||
m_EvalEdit.EnableWindow(FALSE);
|
m_EvalEdit.EnableWindow(FALSE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT CDebugScripts::OnScriptListClicked(NMHDR* pNMHDR)
|
m_StatusBar.SetText(0, statusText.ToUTF16().c_str());
|
||||||
{
|
|
||||||
// Select instance for console input
|
|
||||||
NMITEMACTIVATE* pIA = reinterpret_cast<NMITEMACTIVATE*>(pNMHDR);
|
|
||||||
int nItem = pIA->iItem;
|
|
||||||
|
|
||||||
wchar_t ScriptName[MAX_PATH];
|
|
||||||
m_ScriptList.GetItemText(nItem, 0, ScriptName, MAX_PATH);
|
|
||||||
strcpy(m_SelectedScriptName, stdstr().FromUTF16(ScriptName).c_str());
|
|
||||||
|
|
||||||
RefreshStatus();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CDebugScripts::OnScriptListRClicked(NMHDR* pNMHDR)
|
LRESULT CDebugScripts::OnScriptListRClicked(NMHDR* pNMHDR)
|
||||||
{
|
{
|
||||||
OnScriptListClicked(pNMHDR);
|
NMITEMACTIVATE* pIA = reinterpret_cast<NMITEMACTIVATE*>(pNMHDR);
|
||||||
|
int nItem = pIA->iItem;
|
||||||
|
|
||||||
|
if (nItem == -1)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
||||||
|
|
||||||
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_SCRIPT_POPUP));
|
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_SCRIPT_POPUP));
|
||||||
HMENU hPopupMenu = GetSubMenu(hMenu, 0);
|
HMENU hPopupMenu = GetSubMenu(hMenu, 0);
|
||||||
|
|
||||||
/*
|
if (state == STATE_STARTED || state == STATE_RUNNING)
|
||||||
if (m_Breakpoints->m_RBP.size() == 0 && m_Breakpoints->m_WBP.size() == 0)
|
|
||||||
{
|
{
|
||||||
EnableMenuItem(hPopupMenu, ID_POPUPMENU_CLEARALLBPS, MF_DISABLED | MF_GRAYED);
|
EnableMenuItem(hPopupMenu, ID_POPUP_RUN, MF_DISABLED | MF_GRAYED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EnableMenuItem(hPopupMenu, ID_POPUP_STOP, MF_DISABLED | MF_GRAYED);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
POINT mouse;
|
POINT mouse;
|
||||||
GetCursorPos(&mouse);
|
GetCursorPos(&mouse);
|
||||||
|
|
||||||
TrackPopupMenu(hPopupMenu, TPM_LEFTALIGN, mouse.x, mouse.y, 0, m_hWnd, NULL);
|
TrackPopupMenu(hPopupMenu, TPM_LEFTALIGN, mouse.x, mouse.y, 0, m_hWnd, NULL);
|
||||||
|
|
||||||
DestroyMenu(hMenu);
|
DestroyMenu(hMenu);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -291,7 +309,7 @@ LRESULT CDebugScripts::OnScriptListCustomDraw(NMHDR* pNMHDR)
|
||||||
DWORD nItem = pLVCD->nmcd.dwItemSpec;
|
DWORD nItem = pLVCD->nmcd.dwItemSpec;
|
||||||
|
|
||||||
wchar_t scriptName[MAX_PATH];
|
wchar_t scriptName[MAX_PATH];
|
||||||
m_ScriptList.GetItemText(nItem, 0, scriptName, MAX_PATH);
|
m_ScriptList.GetItemText(nItem, 1, scriptName, MAX_PATH);
|
||||||
|
|
||||||
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(stdstr("").FromUTF16(scriptName).c_str());
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(stdstr("").FromUTF16(scriptName).c_str());
|
||||||
|
|
||||||
|
@ -307,6 +325,116 @@ LRESULT CDebugScripts::OnScriptListCustomDraw(NMHDR* pNMHDR)
|
||||||
return CDRF_DODEFAULT;
|
return CDRF_DODEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT CDebugScripts::OnScriptListItemChanged(NMHDR* pNMHDR)
|
||||||
|
{
|
||||||
|
NMLISTVIEW* lpStateChange = reinterpret_cast<NMLISTVIEW*>(pNMHDR);
|
||||||
|
if ((lpStateChange->uNewState ^ lpStateChange->uOldState) & LVIS_SELECTED)
|
||||||
|
{
|
||||||
|
if (lpStateChange->iItem == -1)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wchar_t ScriptName[MAX_PATH];
|
||||||
|
|
||||||
|
m_ScriptList.GetItemText(lpStateChange->iItem, 1, ScriptName, MAX_PATH);
|
||||||
|
|
||||||
|
if (m_SelectedScriptName != NULL)
|
||||||
|
{
|
||||||
|
free(m_SelectedScriptName);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_SelectedScriptName = strdup(stdstr().FromUTF16(ScriptName).c_str());
|
||||||
|
|
||||||
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
||||||
|
|
||||||
|
::EnableWindow(GetDlgItem(IDC_STOP_BTN), state == STATE_RUNNING || state == STATE_STARTED);
|
||||||
|
::EnableWindow(GetDlgItem(IDC_RUN_BTN), state == STATE_STOPPED || state == STATE_INVALID);
|
||||||
|
|
||||||
|
RefreshStatus();
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CDebugScripts::OnConsoleLog(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||||
|
{
|
||||||
|
const char *text = (const char*)wParam;
|
||||||
|
|
||||||
|
::ShowWindow(*this, SW_SHOWNOACTIVATE);
|
||||||
|
|
||||||
|
SCROLLINFO scroll;
|
||||||
|
scroll.cbSize = sizeof(SCROLLINFO);
|
||||||
|
scroll.fMask = SIF_ALL;
|
||||||
|
m_ConsoleEdit.GetScrollInfo(SB_VERT, &scroll);
|
||||||
|
|
||||||
|
m_ConsoleEdit.SetRedraw(FALSE);
|
||||||
|
m_ConsoleEdit.AppendText(stdstr(text).ToUTF16().c_str());
|
||||||
|
m_ConsoleEdit.SetRedraw(TRUE);
|
||||||
|
|
||||||
|
if ((scroll.nPage + scroll.nPos) - 1 == (uint32_t)scroll.nMax)
|
||||||
|
{
|
||||||
|
m_ConsoleEdit.ScrollCaret();
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CDebugScripts::OnConsoleClear(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||||
|
{
|
||||||
|
m_ConsoleEdit.SetWindowText(L"");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CDebugScripts::OnRefreshList(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||||
|
{
|
||||||
|
int nIndex = m_ScriptList.GetSelectedIndex();
|
||||||
|
|
||||||
|
CPath SearchPath("Scripts", "*");
|
||||||
|
|
||||||
|
if (!SearchPath.FindFirst(CPath::FIND_ATTRIBUTE_ALLFILES))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ScriptList.SetRedraw(false);
|
||||||
|
m_ScriptList.DeleteAllItems();
|
||||||
|
|
||||||
|
size_t nItem = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
stdstr scriptFileName = SearchPath.GetNameExtension();
|
||||||
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(scriptFileName.c_str());
|
||||||
|
const wchar_t *statusIcon = L"";
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case STATE_STARTED:
|
||||||
|
statusIcon = L"*";
|
||||||
|
break;
|
||||||
|
case STATE_RUNNING:
|
||||||
|
statusIcon = L">";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
statusIcon = L"-";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ScriptList.AddItem(nItem, 0, statusIcon);
|
||||||
|
m_ScriptList.SetItemText(nItem, 1, scriptFileName.ToUTF16().c_str());
|
||||||
|
nItem++;
|
||||||
|
} while (SearchPath.FindNext());
|
||||||
|
|
||||||
|
m_ScriptList.SetRedraw(true);
|
||||||
|
m_ScriptList.Invalidate();
|
||||||
|
|
||||||
|
if (nIndex >= 0)
|
||||||
|
{
|
||||||
|
m_ScriptList.SelectItem(nIndex);
|
||||||
|
RefreshStatus();
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void CDebugScripts::EvaluateInSelectedInstance(const char* code)
|
void CDebugScripts::EvaluateInSelectedInstance(const char* code)
|
||||||
{
|
{
|
||||||
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
||||||
|
@ -314,11 +442,53 @@ void CDebugScripts::EvaluateInSelectedInstance(const char* code)
|
||||||
if (state == STATE_RUNNING || state == STATE_STARTED)
|
if (state == STATE_RUNNING || state == STATE_STARTED)
|
||||||
{
|
{
|
||||||
CScriptInstance* instance = m_Debugger->ScriptSystem()->GetInstance(m_SelectedScriptName);
|
CScriptInstance* instance = m_Debugger->ScriptSystem()->GetInstance(m_SelectedScriptName);
|
||||||
//instance->EvalAsync(code);
|
|
||||||
instance->Eval(code);
|
instance->Eval(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDebugScripts::RunSelected()
|
||||||
|
{
|
||||||
|
if (m_SelectedScriptName == NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
||||||
|
|
||||||
|
if (state == STATE_INVALID || state == STATE_STOPPED)
|
||||||
|
{
|
||||||
|
m_Debugger->ScriptSystem()->RunScript(m_SelectedScriptName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Debugger->Debug_LogScriptsWindow("[Error: Script is already running]\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugScripts::StopSelected()
|
||||||
|
{
|
||||||
|
m_Debugger->ScriptSystem()->StopScript(m_SelectedScriptName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugScripts::ToggleSelected()
|
||||||
|
{
|
||||||
|
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
||||||
|
|
||||||
|
if (state == STATE_INVALID || state == STATE_STOPPED)
|
||||||
|
{
|
||||||
|
RunSelected();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StopSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugScripts::EditSelected()
|
||||||
|
{
|
||||||
|
ShellExecute(NULL, L"edit", stdstr(m_SelectedScriptName).ToUTF16().c_str(), NULL, L"Scripts", SW_SHOWNORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
// Console input
|
// Console input
|
||||||
LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
|
LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
|
@ -390,43 +560,3 @@ LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BO
|
||||||
bHandled = FALSE;
|
bHandled = FALSE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDebugScripts::RunSelected()
|
|
||||||
{
|
|
||||||
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
|
||||||
|
|
||||||
if (state == STATE_INVALID || state == STATE_STOPPED)
|
|
||||||
{
|
|
||||||
m_Debugger->ScriptSystem()->RunScript(m_SelectedScriptName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_Debugger->Debug_LogScriptsWindow("[Error: Script is already running]\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugScripts::StopSelected()
|
|
||||||
{
|
|
||||||
m_Debugger->ScriptSystem()->StopScript(m_SelectedScriptName);
|
|
||||||
|
|
||||||
//m_Debugger->Debug_RefreshScriptsWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugScripts::ToggleSelected()
|
|
||||||
{
|
|
||||||
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
|
|
||||||
|
|
||||||
if (state == STATE_INVALID || state == STATE_STOPPED)
|
|
||||||
{
|
|
||||||
RunSelected();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
StopSelected();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugScripts::EditSelected()
|
|
||||||
{
|
|
||||||
ShellExecute(NULL, L"edit", stdstr(m_SelectedScriptName).ToUTF16().c_str(), NULL, L"Scripts", SW_SHOWNORMAL);
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "DebuggerUI.h"
|
#include "DebuggerUI.h"
|
||||||
#include "ScriptSystem.h"
|
#include "ScriptSystem.h"
|
||||||
|
#include <Project64/UserInterface/WTLControls/TooltipDialog.h>
|
||||||
|
|
||||||
class CScriptList : public CListViewCtrl
|
class CScriptList : public CListViewCtrl
|
||||||
{
|
{
|
||||||
|
@ -79,17 +80,32 @@ public:
|
||||||
|
|
||||||
class CDebugScripts :
|
class CDebugScripts :
|
||||||
public CDebugDialog<CDebugScripts>,
|
public CDebugDialog<CDebugScripts>,
|
||||||
public CDialogResize<CDebugScripts>
|
public CDialogResize<CDebugScripts>,
|
||||||
|
public CToolTipDialog<CDebugScripts>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CEdit m_InstanceInfoEdit;
|
enum {
|
||||||
|
WM_REFRESH_LIST = WM_USER + 1,
|
||||||
|
WM_CONSOLE_PRINT = WM_USER + 2,
|
||||||
|
WM_CONSOLE_CLEAR = WM_USER + 3
|
||||||
|
};
|
||||||
|
|
||||||
CEditEval m_EvalEdit;
|
CEditEval m_EvalEdit;
|
||||||
CEditConsole m_ConsoleEdit;
|
CEditConsole m_ConsoleEdit;
|
||||||
CScriptList m_ScriptList;
|
CScriptList m_ScriptList;
|
||||||
|
CStatusBarCtrl m_StatusBar;
|
||||||
char* m_SelectedScriptName;
|
char* m_SelectedScriptName;
|
||||||
|
|
||||||
|
HANDLE m_hQuitScriptDirWatchEvent;
|
||||||
|
HANDLE m_hScriptDirWatchThread;
|
||||||
|
static DWORD WINAPI ScriptDirWatchProc(void *ctx);
|
||||||
|
|
||||||
|
void RunSelected();
|
||||||
|
void StopSelected();
|
||||||
|
void ToggleSelected();
|
||||||
|
void EditSelected();
|
||||||
void RefreshStatus();
|
void RefreshStatus();
|
||||||
CriticalSection m_CS;
|
void ConsoleCopy();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_Scripts };
|
enum { IDD = IDD_Debugger_Scripts };
|
||||||
|
@ -97,51 +113,62 @@ public:
|
||||||
CDebugScripts(CDebuggerUI * debugger);
|
CDebugScripts(CDebuggerUI * debugger);
|
||||||
virtual ~CDebugScripts(void);
|
virtual ~CDebugScripts(void);
|
||||||
|
|
||||||
|
void EvaluateInSelectedInstance(const char* code);
|
||||||
void ConsolePrint(const char* text);
|
void ConsolePrint(const char* text);
|
||||||
void ConsoleClear();
|
void ConsoleClear();
|
||||||
void ConsoleCopy();
|
|
||||||
|
|
||||||
void RefreshList();
|
void RefreshList();
|
||||||
void RefreshConsole();
|
|
||||||
|
|
||||||
void EvaluateInSelectedInstance(const char* code);
|
|
||||||
void RunSelected();
|
|
||||||
void StopSelected();
|
|
||||||
void ToggleSelected();
|
|
||||||
void EditSelected();
|
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
LRESULT OnDestroy(void)
|
LRESULT OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
{
|
LRESULT OnDestroy(void);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||||
LRESULT OnScriptListDblClicked(NMHDR* pNMHDR);
|
LRESULT OnScriptListDblClicked(NMHDR* pNMHDR);
|
||||||
LRESULT OnScriptListClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnScriptListRClicked(NMHDR* pNMHDR);
|
LRESULT OnScriptListRClicked(NMHDR* pNMHDR);
|
||||||
LRESULT OnScriptListCustomDraw(NMHDR* pNMHDR);
|
LRESULT OnScriptListCustomDraw(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnScriptListItemChanged(NMHDR* pNMHDR);
|
||||||
void OnExitSizeMove(void);
|
void OnExitSizeMove(void);
|
||||||
|
|
||||||
|
LRESULT OnConsoleLog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnConsoleClear(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnRefreshList(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugScripts)
|
BEGIN_MSG_MAP_EX(CDebugScripts)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
|
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_DBLCLK, OnScriptListDblClicked)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_DBLCLK, OnScriptListDblClicked)
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CLICK, OnScriptListClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_RCLICK, OnScriptListRClicked)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_RCLICK, OnScriptListRClicked)
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CUSTOMDRAW, OnScriptListCustomDraw)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CUSTOMDRAW, OnScriptListCustomDraw)
|
||||||
CHAIN_MSG_MAP_MEMBER(m_ScriptList)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, LVN_ITEMCHANGED, OnScriptListItemChanged)
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugScripts>)
|
|
||||||
MSG_WM_EXITSIZEMOVE(OnExitSizeMove);
|
MSG_WM_EXITSIZEMOVE(OnExitSizeMove);
|
||||||
|
MESSAGE_HANDLER(WM_CONSOLE_PRINT, OnConsoleLog)
|
||||||
|
MESSAGE_HANDLER(WM_CONSOLE_CLEAR, OnConsoleClear)
|
||||||
|
MESSAGE_HANDLER(WM_REFRESH_LIST, OnRefreshList)
|
||||||
|
CHAIN_MSG_MAP(CDialogResize<CDebugScripts>)
|
||||||
|
CHAIN_MSG_MAP_MEMBER(m_ScriptList)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugScripts)
|
BEGIN_DLGRESIZE_MAP(CDebugScripts)
|
||||||
DLGRESIZE_CONTROL(IDC_CTX_INFO_EDIT, DLSZ_SIZE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_EVAL_EDIT, DLSZ_SIZE_X | DLSZ_MOVE_Y)
|
|
||||||
DLGRESIZE_CONTROL(IDC_CONSOLE_EDIT, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
DLGRESIZE_CONTROL(IDC_CONSOLE_EDIT, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
DLGRESIZE_CONTROL(IDC_SCRIPT_LIST, DLSZ_SIZE_Y)
|
DLGRESIZE_CONTROL(IDC_SCRIPT_LIST, DLSZ_SIZE_Y)
|
||||||
DLGRESIZE_CONTROL(IDC_CLEAR_BTN, DLSZ_MOVE_X)
|
DLGRESIZE_CONTROL(IDC_CLEAR_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
||||||
DLGRESIZE_CONTROL(IDC_COPY_BTN, DLSZ_MOVE_X)
|
DLGRESIZE_CONTROL(IDC_COPY_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SCRIPTS_GRP, DLSZ_SIZE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_OUTPUT_GRP, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_EVAL_LBL, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_EVAL_EDIT, DLSZ_SIZE_X | DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_RUN_BTN, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_STOP_BTN, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SCRIPTDIR_BTN, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_STATUSBAR, DLSZ_SIZE_X | DLSZ_MOVE_Y)
|
||||||
END_DLGRESIZE_MAP()
|
END_DLGRESIZE_MAP()
|
||||||
|
|
||||||
|
BEGIN_TOOLTIP_MAP()
|
||||||
|
TOOLTIP(IDC_CLEAR_BTN, "Clear console output")
|
||||||
|
TOOLTIP(IDC_COPY_BTN, "Copy console output to the clipboard")
|
||||||
|
TOOLTIP(IDC_RUN_BTN, "Run selected script")
|
||||||
|
TOOLTIP(IDC_STOP_BTN, "Stop selected script")
|
||||||
|
TOOLTIP(IDC_SCRIPTDIR_BTN, "Open scripts directory in file explorer")
|
||||||
|
END_TOOLTIP_MAP()
|
||||||
};
|
};
|
|
@ -132,15 +132,6 @@ void CScriptInstance::StartScriptProc()
|
||||||
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &m_hThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
|
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &m_hThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
|
||||||
SetState(STATE_STARTED);
|
SetState(STATE_STARTED);
|
||||||
|
|
||||||
bool bWasUnpaused = false;
|
|
||||||
|
|
||||||
if (!g_Settings->LoadBool(GameRunning_CPU_Paused) && g_MMU)
|
|
||||||
{
|
|
||||||
// Pause CPU during startup phase
|
|
||||||
bWasUnpaused = true;
|
|
||||||
g_System->ExternalEvent(SysEvent_PauseCPU_AppLostFocus);
|
|
||||||
}
|
|
||||||
|
|
||||||
duk_context* ctx = m_Ctx;
|
duk_context* ctx = m_Ctx;
|
||||||
|
|
||||||
duk_push_object(ctx);
|
duk_push_object(ctx);
|
||||||
|
@ -176,11 +167,6 @@ void CScriptInstance::StartScriptProc()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bWasUnpaused)
|
|
||||||
{
|
|
||||||
g_System->ExternalEvent(SysEvent_ResumeCPU_AppGainedFocus);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HaveEvents())
|
if (HaveEvents())
|
||||||
{
|
{
|
||||||
StartEventLoop();
|
StartEventLoop();
|
||||||
|
|
|
@ -821,17 +821,23 @@ BEGIN
|
||||||
LTEXT "CPU Floating Point Registers (COP1)",IDC_STATIC,3,4,119,8
|
LTEXT "CPU Floating Point Registers (COP1)",IDC_STATIC,3,4,119,8
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_Debugger_Scripts DIALOGEX 0, 0, 337, 170
|
IDD_Debugger_Scripts DIALOGEX 0, 0, 421, 216
|
||||||
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||||
CAPTION "Scripts"
|
CAPTION "Scripts"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
EDITTEXT IDC_CONSOLE_EDIT,101,17,231,133,ES_MULTILINE | ES_AUTOHSCROLL | WS_VSCROLL
|
EDITTEXT IDC_CONSOLE_EDIT,136,15,274,147,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL
|
||||||
EDITTEXT IDC_EVAL_EDIT,5,153,327,12,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN
|
EDITTEXT IDC_EVAL_EDIT,28,186,386,12,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN
|
||||||
CONTROL "",IDC_SCRIPT_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_OWNERDRAWFIXED | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,5,4,94,146
|
CONTROL "",IDC_SCRIPT_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,13,15,106,147
|
||||||
EDITTEXT IDC_CTX_INFO_EDIT,101,4,172,12,ES_AUTOHSCROLL | ES_READONLY
|
PUSHBUTTON "Clear",IDC_CLEAR_BTN,373,165,37,13
|
||||||
PUSHBUTTON "Clear",IDC_CLEAR_BTN,304,4,29,12
|
PUSHBUTTON "Copy",IDC_COPY_BTN,333,165,37,13
|
||||||
PUSHBUTTON "Copy",IDC_COPY_BTN,274,4,29,12
|
LTEXT "Eval:",IDC_EVAL_LBL,7,187,18,8
|
||||||
|
GROUPBOX "Scripts",IDC_SCRIPTS_GRP,7,5,118,177,0,WS_EX_TRANSPARENT
|
||||||
|
GROUPBOX "Output",IDC_OUTPUT_GRP,129,5,285,177,0,WS_EX_TRANSPARENT
|
||||||
|
CONTROL "",IDC_STATUSBAR,"msctls_statusbar32",WS_TABSTOP,0,205,420,11
|
||||||
|
PUSHBUTTON "...",IDC_SCRIPTDIR_BTN,13,165,21,13
|
||||||
|
PUSHBUTTON "Run",IDC_RUN_BTN,43,165,37,13,WS_DISABLED
|
||||||
|
PUSHBUTTON "Stop",IDC_STOP_BTN,83,165,37,13,WS_DISABLED
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_Debugger_RegPI DIALOGEX 0, 0, 190, 210
|
IDD_Debugger_RegPI DIALOGEX 0, 0, 190, 210
|
||||||
|
@ -1648,10 +1654,8 @@ BEGIN
|
||||||
|
|
||||||
IDD_Debugger_Scripts, DIALOG
|
IDD_Debugger_Scripts, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
RIGHTMARGIN, 379
|
||||||
RIGHTMARGIN, 330
|
BOTTOMMARGIN, 214
|
||||||
TOPMARGIN, 7
|
|
||||||
BOTTOMMARGIN, 163
|
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_Debugger_RegPI, DIALOG
|
IDD_Debugger_RegPI, DIALOG
|
||||||
|
|
|
@ -362,7 +362,6 @@
|
||||||
#define IDC_HI_EDIT 1183
|
#define IDC_HI_EDIT 1183
|
||||||
#define IDC_LO_EDIT 1184
|
#define IDC_LO_EDIT 1184
|
||||||
#define IDC_BP_LIST 1185
|
#define IDC_BP_LIST 1185
|
||||||
#define IDC_CTX_INFO_EDIT 1185
|
|
||||||
#define IDC_ADDBP_BTN 1186
|
#define IDC_ADDBP_BTN 1186
|
||||||
#define IDC_REMOVESYMBOL_BTN 1186
|
#define IDC_REMOVESYMBOL_BTN 1186
|
||||||
#define IDC_RMBP_BTN 1187
|
#define IDC_RMBP_BTN 1187
|
||||||
|
@ -453,8 +452,11 @@
|
||||||
#define IDC_CLEAR_BTN 1302
|
#define IDC_CLEAR_BTN 1302
|
||||||
#define IDC_DMA_RAM_EDIT 1303
|
#define IDC_DMA_RAM_EDIT 1303
|
||||||
#define IDC_COPY_BTN 1303
|
#define IDC_COPY_BTN 1303
|
||||||
|
#define IDC_SCRIPTDIR_BTN 1304
|
||||||
#define IDC_EXPORT_BTN 1305
|
#define IDC_EXPORT_BTN 1305
|
||||||
|
#define IDC_RUN_BTN 1305
|
||||||
#define IDC_DMA_ROM_EDIT 1306
|
#define IDC_DMA_ROM_EDIT 1306
|
||||||
|
#define IDC_STOP_BTN 1306
|
||||||
#define IDC_TRACE_STATIC 1307
|
#define IDC_TRACE_STATIC 1307
|
||||||
#define IDC_RAM_STATIC 1308
|
#define IDC_RAM_STATIC 1308
|
||||||
#define IDC_ROM_STATIC 1309
|
#define IDC_ROM_STATIC 1309
|
||||||
|
@ -701,8 +703,11 @@
|
||||||
#define IDC_F2_LBL 1577
|
#define IDC_F2_LBL 1577
|
||||||
#define IDC_EMAIL 1577
|
#define IDC_EMAIL 1577
|
||||||
#define IDC_F3_LBL 1578
|
#define IDC_F3_LBL 1578
|
||||||
|
#define IDC_SCRIPTS_GRP 1578
|
||||||
#define IDC_F4_LBL 1579
|
#define IDC_F4_LBL 1579
|
||||||
|
#define IDC_OUTPUT_GRP 1579
|
||||||
#define IDC_F5_LBL 1580
|
#define IDC_F5_LBL 1580
|
||||||
|
#define IDC_EVAL_LBL 1580
|
||||||
#define IDC_F6_LBL 1581
|
#define IDC_F6_LBL 1581
|
||||||
#define IDC_F7_LBL 1582
|
#define IDC_F7_LBL 1582
|
||||||
#define IDC_F8_LBL 1583
|
#define IDC_F8_LBL 1583
|
||||||
|
|
Loading…
Reference in New Issue