From 8d3a394993673df4b9fab8bee62f4ac8b25e1a5a Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 11 Mar 2019 08:56:10 +0200 Subject: Working on scripting engine. --- .../CodeCompletion/CompletionWindowBase.cs | 14 ++++++++-- .../CodeCompletion/ICompletionData.cs | 31 +++++++++------------- 2 files changed, 25 insertions(+), 20 deletions(-) (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion') diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs index e33ede203..7766d323a 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs @@ -290,7 +290,7 @@ namespace Tango.Scripting.Editors.CodeCompletion //sourceIsInitialized = true; } - private void SetPosition() + public void SetPosition() { if (document != null && this.StartOffset != this.TextArea.Caret.Offset) { @@ -301,6 +301,16 @@ namespace Tango.Scripting.Editors.CodeCompletion SetPosition(this.TextArea.Caret.Position); } } + + public void UpdatePositionFix() + { + SetPosition(this.TextArea.Caret.Position); + } + + //public void UpdatePosition() + //{ + // SetPosition(this.TextArea.Caret.Position); + //} /// protected override void OnClosed(EventArgs e) @@ -337,7 +347,7 @@ namespace Tango.Scripting.Editors.CodeCompletion /// Updates the position of the CompletionWindow based on the parent TextView position and the screen working area. /// It ensures that the CompletionWindow is completely visible on the screen. /// - protected void UpdatePosition() + public void UpdatePosition() { TextView textView = this.TextArea.TextView; // PointToScreen returns device dependent units (physical pixels) diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs index b0e9eeccb..9f16876b3 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs @@ -3,6 +3,7 @@ using System; using System.Windows.Media; +using System.Windows.Media.Imaging; using Tango.Scripting.Editors.Document; using Tango.Scripting.Editors.Editing; @@ -13,32 +14,26 @@ namespace Tango.Scripting.Editors.CodeCompletion /// public interface ICompletionData { - /// - /// Gets the image. - /// - ImageSource Image { get; } - - /// - /// Gets the text. This property is used to filter the list of visible elements. - /// - string Text { get; } - - /// - /// The displayed content. This can be the same as 'Text', or a WPF UIElement if - /// you want to display rich content. - /// - object Content { get; } + /// + /// Gets the image. + /// + BitmapSource Image { get; } + + /// + /// Gets the text. This property is used to filter the list of visible elements. + /// + string Text { get; } /// /// Gets the description. /// - object Description { get; } + object Description { get; set; } /// /// Gets the priority. This property is used in the selection logic. You can use it to prefer selecting those items /// which the user is accessing most frequently. /// - double Priority { get; } + double Priority { get; set; } /// /// Perform the completion. @@ -49,6 +44,6 @@ namespace Tango.Scripting.Editors.CodeCompletion /// The EventArgs used for the insertion request. /// These can be TextCompositionEventArgs, KeyEventArgs, MouseEventArgs, depending on how /// the insertion was triggered. - void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs); + void Complete(ScriptEditor editor); } } -- cgit v1.3.1