Ejemplo n.º 1
0
        private void UpdateEditorScriptStatus(ScriptWindow_CodeEditor editor)
        {
            if (editor != null)
            {
                MenuBar_Script_Run.Enabled  = !editor.IsScriptBusy;
                MenuBar_Script_Stop.Enabled = editor.IsScriptBusy;
            }
            else
            {
                MenuBar_Script_Run.Enabled  = false;
                MenuBar_Script_Stop.Enabled = false;
            }

            Btn_Script_Run.Enabled  = MenuBar_Script_Run.Enabled;
            Btn_Script_Stop.Enabled = MenuBar_Script_Stop.Enabled;

            DC_Console.ClearMessage();
            if (editor != null)
            {
                foreach (var msg in editor.ScriptMessageList)
                {
                    DC_Console.AddMessage(msg);
                }
            }
        }
Ejemplo n.º 2
0
        private void OpenScriptFile(string path)
        {
            var editor = GetOpenedScriptEditor(path);

            if (editor != null)
            {
                DockPanel_Main.SetActiveDocumentControl(editor);
                return;
            }

            editor = new ScriptWindow_CodeEditor();

            editor.BorderStyle = BorderStyle.None;
            editor.Tag         = path;
            editor.ScriptPath  = path;

            editor.EditorStatusUpdated   += OnEditorStatusUpdated;
            editor.ScriptMessageAppended += OnScriptMessageOutput;
            editor.ScriptStatusChanged   += OnScriptStatusChanged;

            /* 新しいタブでテキストを開く */
            DockPanel_Main.AddDockContent(
                "DC_CodeEditor",
                (path != null) ? (Path.GetFileName(path)) : ("(Temp)"),
                0,
                Icon.FromHandle(Ratatoskr.Resource.Images.memo_32x32.GetHicon()),
                DockAreas.Document,
                DockState.Document,
                true,
                editor);
        }
Ejemplo n.º 3
0
        private void UpdateEditorCursorStatus(ScriptWindow_CodeEditor editor)
        {
            var row_text = "";
            var col_text = "";

            if (editor != null)
            {
                var caret_pos = editor.CaretPosition;

                row_text = string.Format("Row: {0}", caret_pos.Y);
                col_text = string.Format("Column: {0}", caret_pos.X);
            }

            Label_CodeRowNo.Text    = row_text;
            Label_CodeColumnNo.Text = col_text;
        }