summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/options.h
blob: 879f06b55ad8358ddc61630a03586cc2b64eedba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once

class CMLuaOptionsMain : public CDlgBase
{
private:
	CMPlugin &m_plugin;

	bool isScriptListInit;
	
	CCtrlCheck m_popupOnError;
	CCtrlCheck m_popupOnObsolete;

	CCtrlListView m_scriptsList;
	CCtrlButton m_reload;

	void LoadScripts();

protected:
	bool OnInitDialog() override;
	bool OnApply() override;

	void OnScriptListClick(CCtrlListView::TEventInfo *evt);
	void OnReload(CCtrlBase*);

	INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;

public:
	CMLuaOptionsMain(CMPlugin &plugin);
};

/***********************************************/

class CMLuaEvaluateOptions : public CDlgBase
{
private:
	lua_State *L = nullptr;
	int threadRef = 0;

	CCtrlEdit m_script;
	CCtrlEdit m_result;

	CCtrlCheck m_autoEval;
	CCtrlButton m_evaluate;

protected:
	bool OnInitDialog() override;
	bool OnApply() override;

	void OnAutoEvalChange(CCtrlBase*);
	void OnEvaluate(CCtrlBase*);

public:
	CMLuaEvaluateOptions(CMPlugin &plugin);
	~CMLuaEvaluateOptions();
};