Ejemplo n.º 1
0
        public void ShowPrevEditor()
        {
            if (ActiveEditor != null)
            {
                TextEditorEx   nowActive = ActiveEditor;
                EditorForm     form      = null;
                IDockContent[] docList   = m_mainPanel.Documents;
                foreach (IDockContent doc in docList)
                {
                    EditorForm editor = doc as EditorForm;
                    if (editor == null)
                    {
                        continue;                               //次を検索
                    }


                    if (nowActive == editor.TextEditor)
                    {
                        if (form == null)
                        {
                            continue;                                   //自分自身が一番最初の時は最後まで検索する
                        }

                        break;
                    }
                    form = editor;
                }

                if (form != null)
                {
                    form.Show();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// KAGタグヘルプを表示する
        /// </summary>
        /// <param name="editor">エディタ</param>
        private void showKagTagHelp(TextEditorEx editor)
        {
            //カーソル位置のKAGタグ情報を取得する
            Debug.WriteLine("showKagTagHelp START");
            int            colNum = editor.GetKagTagEndFormCaret();
            KagTagKindInfo info   = KagUtility.GetTagKind(editor.Document, editor.ActiveTextArea.Caret.Line, colNum);

            if (info == null)
            {
                util.Msgbox.Error("タグ・マクロのある位置にカーソルが無いため検索できません");
                return;
            }
            if (info.TagName == "")
            {
                return;                 //タグがない
            }

            //KAGタグ情報からマクロ情報を取得する
            KagMacro macro = KagUtility.GetKagMacro(info.TagName);

            if (macro == null)
            {
                //タグ情報が取得できなかった
                util.Msgbox.Error("タグ・マクロの情報が取得できませんでした");
                return;
            }

            //URLを生成する
            string url = "";

            if (macro.DefType == KagMacro.DefineType.Kag)               //KAGのタグの時
            {
                url = String.Format("{0}#{1}", new Uri(ConstEnvOption.Kag3TagRefPath), HttpUtility.UrlEncode(info.TagName));
            }
            else
            {
                return;                 //そのほかのタグは対応するヘルプがない
            }

            switch (GlobalStatus.EnvOption.HelpHelpWindow)
            {
            case EnvOption.HelpWindowState.DockingWindow:
                //ドッキングウィンドウで表示
                GlobalStatus.FormManager.HelpReferenceForm.Show(GlobalStatus.FormManager.MainForm.MainDockPanel);
                GlobalStatus.FormManager.HelpReferenceForm.Navigate(url);
                break;

            case EnvOption.HelpWindowState.DialogWindow:
                //ダイアログウィンドウで表示
                GlobalStatus.FormManager.HelpRefDialogShow();
                GlobalStatus.FormManager.HelpRefDialog.Navigate(url);
                break;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// アクション実行
        /// </summary>
        /// <param name="textArea">エディタ</param>
        public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
        {
            TextEditorEx editor = (TextEditorEx)textArea.MotherTextEditorControl;

            switch (FileType.GetKrkrType(editor.FileName))
            {
            case FileType.KrkrType.Kag:
                showKagTagHelp(editor);
                break;

            case FileType.KrkrType.Tjs:
                //未実装
                break;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// エディタにオプション情報をセットする
        /// </summary>
        /// <param name="editor">オプション情報をセットするエディタ</param>
        public void SetOption(TextEditorEx editor)
        {
            EditorOption option = GetEditorOption(editor.FileName);

            if (option == null)
            {
                util.Msgbox.Error("エディタ設定の読み込みができませんでした");
                return;
            }

            editor.Encoding            = option.Encoding;
            editor.Font                = option.Font;
            editor.UseCodeCompletion   = option.UseCodeCompletion;
            editor.ParseActionSaveFile = option.ParseActionFileSave;

            editor.Document.TextEditorProperties.AllowCaretBeyondEOL   = option.AllowCaretBeyondEOL;
            editor.Document.TextEditorProperties.TabIndent             = option.TabIndent;
            editor.Document.TextEditorProperties.IndentationSize       = option.IndentationSize;
            editor.Document.TextEditorProperties.IndentStyle           = option.IndentStyle;
            editor.Document.TextEditorProperties.DocumentSelectionMode = option.DocumentSelectionMode;
            editor.Document.TextEditorProperties.BracketMatchingStyle  = option.BracketMatchingStyle;
            editor.Document.TextEditorProperties.ShowMatchingBracket   = option.ShowMatchingBracket;
            editor.Document.TextEditorProperties.ShowLineNumbers       = option.ShowLineNumbers;
            editor.Document.TextEditorProperties.ShowSpaces            = option.ShowSpaces;
            editor.Document.TextEditorProperties.ShowWideSpaces        = option.ShowWideSpaces;
            editor.Document.TextEditorProperties.ShowTabs               = option.ShowTabs;
            editor.Document.TextEditorProperties.ShowEOLMarker          = option.ShowEOLMarker;
            editor.Document.TextEditorProperties.ShowInvalidLines       = option.ShowInvalidLines;
            editor.Document.TextEditorProperties.IsIconBarVisible       = option.IsIconBarVisible;
            editor.Document.TextEditorProperties.EnableFolding          = option.EnableFolding;
            editor.Document.TextEditorProperties.ShowHorizontalRuler    = option.ShowHorizontalRuler;
            editor.Document.TextEditorProperties.ShowVerticalRuler      = option.ShowVerticalRuler;
            editor.Document.TextEditorProperties.ConvertTabsToSpaces    = option.ConvertTabsToSpaces;
            editor.Document.TextEditorProperties.UseAntiAliasedFont     = option.UseAntiAliasedFont;
            editor.Document.TextEditorProperties.CreateBackupCopy       = option.CreateBackupCopy;
            editor.Document.TextEditorProperties.MouseWheelScrollDown   = option.MouseWheelScrollDown;
            editor.Document.TextEditorProperties.MouseWheelTextZoom     = option.MouseWheelTextZoom;
            editor.Document.TextEditorProperties.HideMouseCursor        = option.HideMouseCursor;
            editor.Document.TextEditorProperties.CutCopyWholeLine       = option.CutCopyWholeLine;
            editor.Document.TextEditorProperties.VerticalRulerRow       = option.VerticalRulerRow;
            editor.Document.TextEditorProperties.LineViewerStyle        = option.LineViewerStyle;
            editor.Document.TextEditorProperties.LineTerminator         = option.LineTerminator;
            editor.Document.TextEditorProperties.AutoInsertCurlyBracket = option.AutoInsertCurlyBracket;
            editor.Document.TextEditorProperties.UseCustomLine          = option.UseCustomLine;

            GlobalStatus.FormManager.MainForm.UpdateStatusBar(editor);
            editor.OptionsChanged();
        }
Ejemplo n.º 5
0
        public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
        {
            TextEditorEx editor = (TextEditorEx)textArea.MotherTextEditorControl;

            switch (FileType.GetKrkrType(editor.FileName))
            {
            case FileType.KrkrType.Kag:
                //KAG入力補完
                editor.m_codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(GlobalStatus.FormManager.MainForm
                                                                                          , editor, editor.FileName, editor.KagCompDataPrv, '\0');
                break;

            case FileType.KrkrType.Tjs:
                //未実装
                break;
            }
        }
Ejemplo n.º 6
0
        public void ShowNextEditor()
        {
            if (ActiveEditor != null)
            {
                TextEditorEx   nowActive       = ActiveEditor;
                EditorForm     firstActiveForm = null;
                bool           isFind          = false;
                IDockContent[] docList         = m_mainPanel.Documents;
                foreach (IDockContent doc in docList)
                {
                    EditorForm editor = doc as EditorForm;
                    if (editor == null)
                    {
                        continue;                               //次を検索
                    }

                    if (firstActiveForm == null)
                    {
                        firstActiveForm = editor;
                    }
                    if (nowActive == editor.TextEditor)
                    {
                        isFind = true;
                        continue;                               //発見したので次へ行く
                    }
                    if (isFind)
                    {
                        //見つけたとの物が次のエディタとして表示する
                        editor.Show();
                        return;
                    }
                }
                if (isFind && firstActiveForm != null)
                {
                    //発見しても次がないときは最初の物を表示する
                    firstActiveForm.Show();
                    return;
                }
            }
        }