Exemplo n.º 1
0
        //private Line CurrentLine
        //{ get { return this.scintilla.Lines[this.scintilla.CurrentLine]; } }
        //private string GetWholeWord(int pos)
        //{
        //    string res = "";
        //    for (int i = this.CurrentLine.Position; i < this.scintilla.CurrentLine; i++)
        //    {
        //        char c = this.CurrentLine.Text[i];
        //        if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '.' || c == '_')
        //        {
        //            res += c;
        //        }
        //    }
        //    return res;
        //}

        //private ToolTip FTooltip = null;
        //private ToolTip Tooltip
        //{ get { return this.FTooltip; }
        //    set
        //    {
        //        if (this.FTooltip != null)
        //        {
        //            this.FTooltip.Dispose();
        //            this.FTooltip = null;
        //        }

        //        this.FTooltip = value;
        //        if (this.FTooltip != null)
        //        {
        //            //this.FTooltip.Cap
        //        }
        //    }
        //}

        //private CompletionForm FCompletionForm = null;
        //private CompletionForm CompletionForm
        //{ get { return this.FCompletionForm; }

        //    set
        //    {
        //        if (this.FCompletionForm != null)
        //        {
        //            this.FCompletionForm.Dispose();
        //            this.FCompletionForm = null;
        //        }

        //        this.FCompletionForm = value;
        //    }
        //}


        //public void ShowCompletions(List<BaseDefinition> list, Words words)
        //{

        //    //if (this.CompletionForm != null)
        //    //{
        //    //    this.CompletionForm.Dispose();
        //    //    this.CompletionForm = null;
        //    //}
        //    //this.CompletionForm = new CompletionListBox(this.scintilla);
        //    //this.CompletionForm.Words = words;
        //    //this.CompletionForm.Definitions = list;
        //    //this.CompletionForm.Show();
        //    ////AutoCompletion ac = new AutoCompletion(this.scintilla);
        //    ////ac.Show();
        //}

        //private CompletionListBox CompletionForm = null;
        protected override bool ProcessCmdKey(ref Message msg, Keys key)
        {
            const int WM_KEYDOWN    = 0x100;
            const int WM_SYSKEYDOWN = 0x104;

            if (msg.Msg == WM_KEYDOWN || msg.Msg == WM_SYSKEYDOWN)
            {
                if (key == (Keys.Control | Keys.F))
                {
                    //Findtext();
                    _FindReplace = new FindReplace(this.scintilla);
                    _FindReplace.ShowFind();
                    return(true);
                }
                if (key == (Keys.Control | Keys.H))
                {
                    //Findtext();
                    _FindReplace = new FindReplace(this.scintilla);
                    _FindReplace.ShowReplace();
                    return(true);
                }
                if (key == (Keys.F3))
                {
                    //Findtext(true);
                    _FindReplace.Window.FindNext();
                    return(true);
                }
                if (key == (Keys.F4))
                {
                    //Findtext(true,true);
                    _FindReplace.Window.ReplaceNext();
                    return(true);
                }
            }


            return(base.ProcessCmdKey(ref msg, key));
        }
Exemplo n.º 2
0
 public EditorForm(MainForm main_form) : this()
 {
     _FindReplace = new FindReplace(this.scintilla);
     this.Port    = main_form.Port;
 }