Ejemplo n.º 1
0
        private void BindEvents()
        {
            btnShowSearchBox.Click += (s, a) => ShowFormSearch();

            btnGoto.Click += (s, a) => GotoLine();

            tboxGoto.Click += (s, a) => tboxGoto.SelectAll();

            tboxGoto.KeyDown += (s, a) =>
            {
                if (a.KeyCode == Keys.Enter)
                {
                    Invoke(GotoLine);
                }
            };

            editor.InsertCheck += Scintilla_InsertCheck;
            editor.CharAdded   += Scintilla_CharAdded;
            editor.TextChanged += Scintilla_TextChanged;
            editor.MouseClick  += Scintilla_MouseClicked;
            editor.DoubleClick += Scintilla_DoubleClick;

            btnNewScript.Click += (s, a) => ClearEditor();

            btnKillLuaCore.Click += (s, a) => luaCoreCtrl.Abort();

            btnStopLuaCore.Click += (s, a) => luaCoreCtrl.Stop();

            btnRunScript.Click += (s, a) =>
            {
                formEditor.SetOutputPanelCollapseState(false);

                var name = cboxScriptName.Text;

                luaCoreCtrl.Abort();
                luaCoreCtrl.SetScriptName(string.IsNullOrEmpty(name) ? $"({I18N.Empty})" : name);
                luaCoreCtrl.ReplaceScript(editor.Text);
                luaCoreCtrl.isLoadClr = isLoadClrLib;
                luaCoreCtrl.Start();
            };

            btnClearOutput.Click += (s, a) =>
            {
                qLogger?.Reset();
            };


            btnSaveScript.Click += (s, a) => OnBtnSaveScriptClickHandler(true);

            cboxScriptName.DropDown += (s, a) => ReloadScriptName();

            cboxScriptName.SelectedValueChanged += CboxScriptNameChangedHandler;
        }
Ejemplo n.º 2
0
        void OnBtnRunScriptClickHandler(object sender, EventArgs args)
        {
            formEditor.SetOutputPanelCollapseState(false);

            var name = cboxScriptName.Text;

            luaCoreCtrl.Abort();
            luaCoreCtrl.SetScriptName(string.IsNullOrEmpty(name) ? $"({I18N.Empty})" : name);
            luaCoreCtrl.ReplaceScript(editor.Text);
            luaCoreCtrl.isLoadClr = isLoadClrLib;
            luaCoreCtrl.Start();
        }