Esempio n. 1
0
 /// <summary>
 /// 要求を受けたコマンドツリーを選択する
 /// </summary>
 private void uctlOneText_FoundCommandNode(object sender, CtrlComponent.Text.ctlOneTextEditor.FoundCommandNodeEventArgs e)
 {
     Common.FoundCommandNode(
         (this.tbcEVPages.SelectedTab.Controls[0] as CtrlComponent.Map.ctlEVPage).uctlTextEditor,
         this.comTree,
         (this.tbcEVPages.SelectedTab.Controls[0] as CtrlComponent.Map.ctlEVPage).uctlTextEditor.DBCtrl.DBList,
         e);
     if (!Settings.Default.Map_SQEasyMode)
     {
         ((this.tbcEVPages.SelectedTab.Controls[0] as CtrlComponent.Map.ctlEVPage).uctlTextEditor).Focus();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 対象行を直接編集する
        /// </summary>
        private void ctmEdit_Click(object sender, EventArgs e)
        {
            if (this.CurrentIndex == this.lstEditor.Items.Count - 1)
            {
                //末尾の項目は削除対象にできないので挿入モードにする
                this.ctmInsert_Click(sender, e);
                return;
            }

            //特殊なコードは専門のダイアログで編集できるようにする
            var code = this.GetLineRawCode(this.CurrentIndex);

            CtrlComponent.Text.ctlOneTextEditor.FoundCommandNodeEventArgs argData;
            string newCode;

            if (code.IndexOf(Resources.SQ_EVMessage.Substring(0, Resources.SQ_EVMessage.IndexOf("("))) != -1)
            {
                //メッセージ表示のコマンド
                argData = new CtrlComponent.Text.ctlOneTextEditor.FoundCommandNodeEventArgs(CtrlComponent.Text.ctlCommandTree.TagToolMessage, code);
                newCode = Common.EditCommandByTool(this.comTree.dbCtl.DBList, argData);
                if (!string.IsNullOrEmpty(newCode))
                {
                    this.ReplaceLine(this.CurrentIndex, newCode);
                }
            }
            else if (code.IndexOf(Resources.SQ_ChangeMap.Substring(0, Resources.SQ_ChangeMap.IndexOf("("))) != -1)
            {
                //場所移動のコマンド
                argData = new CtrlComponent.Text.ctlOneTextEditor.FoundCommandNodeEventArgs(CtrlComponent.Text.ctlCommandTree.TagToolChangeMap, code);
                newCode = Common.EditCommandByTool(this.comTree.dbCtl.DBList, argData);
                if (!string.IsNullOrEmpty(newCode))
                {
                    this.ReplaceLine(this.CurrentIndex, newCode);
                }
            }
            else
            {
                //選択先頭行を直接入力で編集する
                var dlg = new Dialog.Text.Script.dlgInsertCommand(
                    this.comTree,
                    "直接編集モード:置換",
                    "タイプミスには十分注意して下さい。\r\n入力欄はスクリプト表記になっています。",
                    "",
                    code);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    this.ReplaceLine(this.CurrentIndex, dlg.Result);
                    this.RefreshIndentAll();
                }
            }
        }