2021-09-03 05:11:04 +00:00
|
|
|
#pragma once
|
|
|
|
#include <unordered_set>
|
|
|
|
|
|
|
|
class CScriptsAutorunDlg :
|
|
|
|
public CDialogImpl<CScriptsAutorunDlg>
|
|
|
|
{
|
|
|
|
public:
|
2022-09-26 02:31:54 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
IDD = IDD_Debugger_ScriptsAutorun
|
|
|
|
};
|
2021-09-03 05:11:04 +00:00
|
|
|
|
|
|
|
CScriptsAutorunDlg();
|
|
|
|
virtual ~CScriptsAutorunDlg();
|
|
|
|
|
2022-09-26 02:31:54 +00:00
|
|
|
INT_PTR DoModal(CDebuggerUI * debugger, stdstr selectedScriptName);
|
2021-09-03 05:11:04 +00:00
|
|
|
|
2022-09-26 02:31:54 +00:00
|
|
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
2021-09-03 05:11:04 +00:00
|
|
|
LRESULT OnDestroy(void);
|
2022-09-26 02:31:54 +00:00
|
|
|
LRESULT OnOKCancel(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL & bHandled);
|
|
|
|
LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL & bHandled);
|
|
|
|
LRESULT OnRemove(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL & bHandled);
|
|
|
|
LRESULT OnScriptListDblClicked(NMHDR * pNMHDR);
|
|
|
|
LRESULT OnAutorunListDblClicked(NMHDR * pNMHDR);
|
|
|
|
LRESULT OnCtrlSetFocus(NMHDR * pNMHDR);
|
|
|
|
LRESULT OnRefreshScriptList(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
|
|
|
|
LRESULT OnRefreshAutorunList(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
|
2021-09-03 05:11:04 +00:00
|
|
|
|
|
|
|
BEGIN_MSG_MAP_EX(CAddBreakpointDlg)
|
2022-09-26 02:31:54 +00:00
|
|
|
{
|
|
|
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog);
|
|
|
|
MSG_WM_DESTROY(OnDestroy);
|
|
|
|
COMMAND_HANDLER(IDOK, BN_CLICKED, OnOKCancel);
|
|
|
|
COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnOKCancel);
|
|
|
|
COMMAND_HANDLER(IDC_ADD_BTN, BN_CLICKED, OnAdd);
|
|
|
|
COMMAND_HANDLER(IDC_REMOVE_BTN, BN_CLICKED, OnRemove);
|
|
|
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_DBLCLK, OnScriptListDblClicked);
|
|
|
|
NOTIFY_HANDLER_EX(IDC_AUTORUN_LIST, NM_DBLCLK, OnAutorunListDblClicked);
|
|
|
|
NOTIFY_CODE_HANDLER_EX(NM_SETFOCUS, OnCtrlSetFocus);
|
|
|
|
MESSAGE_HANDLER(WM_REFRESH_LIST, OnRefreshScriptList);
|
|
|
|
MESSAGE_HANDLER(WM_REFRESH_AUTORUN_LIST, OnRefreshAutorunList);
|
|
|
|
}
|
2021-09-03 05:11:04 +00:00
|
|
|
END_MSG_MAP()
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
WM_REFRESH_LIST = WM_USER + 1,
|
|
|
|
WM_REFRESH_AUTORUN_LIST = WM_USER + 2
|
|
|
|
};
|
2022-09-26 02:31:54 +00:00
|
|
|
|
|
|
|
CDebuggerUI * m_Debugger;
|
|
|
|
CScriptSystem * m_ScriptSystem;
|
2021-09-03 05:11:04 +00:00
|
|
|
|
|
|
|
stdstr m_InitSelectedScriptName;
|
|
|
|
//std::set<std::string> m_AutorunSet;
|
|
|
|
|
|
|
|
bool m_bScriptListNeedsRefocus;
|
|
|
|
bool m_bAutorunListNeedsRefocus;
|
|
|
|
|
|
|
|
CListViewCtrl m_ScriptListView;
|
|
|
|
CListViewCtrl m_AutorunListView;
|
|
|
|
|
|
|
|
HANDLE m_hQuitScriptDirWatchEvent;
|
|
|
|
HANDLE m_hScriptDirWatchThread;
|
2022-09-26 02:31:54 +00:00
|
|
|
static DWORD WINAPI ScriptDirWatchProc(void * ctx);
|
2021-09-03 05:11:04 +00:00
|
|
|
|
|
|
|
void AddSelected();
|
|
|
|
void RemoveSelected();
|
|
|
|
void RefreshScriptList();
|
|
|
|
void RefreshAutorunList();
|
|
|
|
//void LoadAutorunSet();
|
|
|
|
//void SaveAutorunSet();
|
|
|
|
};
|