[Debugger] Add tooltips to scripts window

This commit is contained in:
shygoo 2020-12-18 14:15:16 -06:00
parent 033d9b8327
commit 7ca05cde8a
3 changed files with 21 additions and 4 deletions

View File

@ -15,6 +15,7 @@
CDebugScripts::CDebugScripts(CDebuggerUI* debugger) :
CDebugDialog<CDebugScripts>(debugger),
CToolTipDialog<CDebugScripts>(),
m_SelectedScriptName(NULL),
m_hQuitScriptDirWatchEvent(NULL),
m_hScriptDirWatchThread(NULL)
@ -33,6 +34,7 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
{
DlgResize_Init(false, true);
DlgSavePos_Init(DebuggerUI_ScriptsPos);
DlgToolTip_Init();
HFONT monoFont = CreateFont(-11, 0, 0, 0,
FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
@ -446,6 +448,11 @@ void CDebugScripts::EvaluateInSelectedInstance(const char* 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)

View File

@ -12,6 +12,7 @@
#pragma once
#include "DebuggerUI.h"
#include "ScriptSystem.h"
#include <Project64/UserInterface/WTLControls/TooltipDialog.h>
class CScriptList : public CListViewCtrl
{
@ -78,8 +79,9 @@ public:
};
class CDebugScripts :
public CDebugDialog < CDebugScripts >,
public CDialogResize<CDebugScripts>
public CDebugDialog<CDebugScripts>,
public CDialogResize<CDebugScripts>,
public CToolTipDialog<CDebugScripts>
{
private:
enum {
@ -161,4 +163,12 @@ public:
DLGRESIZE_CONTROL(IDC_SCRIPTDIR_BTN, DLSZ_MOVE_Y)
DLGRESIZE_CONTROL(IDC_STATUSBAR, DLSZ_SIZE_X | DLSZ_MOVE_Y)
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()
};

View File

@ -836,8 +836,8 @@ BEGIN
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
PUSHBUTTON "Stop",IDC_STOP_BTN,83,165,37,13
PUSHBUTTON "Run",IDC_RUN_BTN,43,165,37,13,WS_DISABLED
PUSHBUTTON "Stop",IDC_STOP_BTN,83,165,37,13,WS_DISABLED
END
IDD_Debugger_RegPI DIALOGEX 0, 0, 190, 210