Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVsevolod Kukol <sevoku@microsoft.com>2019-12-18 08:34:18 +0300
committerVsevolod Kukol <sevoku@microsoft.com>2019-12-18 08:34:18 +0300
commit0e96cdf19f4ee68954d52d9e77223074bede56e2 (patch)
tree1b915677080ee4862c2b97996fe9809efde35e09
parent485b51769c480295511348657c60287c8b7b093c (diff)
Add completion support to ComboBoxEntry
Completion can be enabled using the new ComboBoxEntry.Completes property.
-rw-r--r--TestApps/Samples/Samples/ComboBoxes.cs1
-rw-r--r--Xwt/Xwt.Backends/IComboBoxEntryBackend.cs2
-rw-r--r--Xwt/Xwt/ComboBoxEntry.cs14
3 files changed, 17 insertions, 0 deletions
diff --git a/TestApps/Samples/Samples/ComboBoxes.cs b/TestApps/Samples/Samples/ComboBoxes.cs
index 10cd66a9..b6578d3c 100644
--- a/TestApps/Samples/Samples/ComboBoxes.cs
+++ b/TestApps/Samples/Samples/ComboBoxes.cs
@@ -91,6 +91,7 @@ namespace Samples
c4.TextEntry.SelectionChanged += delegate {
la4.Text = "Selected text: " + c4.TextEntry.SelectedText;
};
+ c4.Completes = true;
HBox selBox = new HBox ();
Label las = new Label ("Selection:");
diff --git a/Xwt/Xwt.Backends/IComboBoxEntryBackend.cs b/Xwt/Xwt.Backends/IComboBoxEntryBackend.cs
index dc55bdd1..004b9cf6 100644
--- a/Xwt/Xwt.Backends/IComboBoxEntryBackend.cs
+++ b/Xwt/Xwt.Backends/IComboBoxEntryBackend.cs
@@ -44,6 +44,8 @@ namespace Xwt.Backends
/// The text entry backend.
/// </value>
ITextEntryBackend TextEntryBackend { get; }
+
+ bool Completes { get; set; }
}
public interface IComboBoxEntryEventSink: IComboBoxEventSink
diff --git a/Xwt/Xwt/ComboBoxEntry.cs b/Xwt/Xwt/ComboBoxEntry.cs
index 0499c935..076152a7 100644
--- a/Xwt/Xwt/ComboBoxEntry.cs
+++ b/Xwt/Xwt/ComboBoxEntry.cs
@@ -79,6 +79,20 @@ namespace Xwt
Backend.SetTextColumn (0);
}
}
+
+ /// <summary>
+ /// Get ot sets a value indicating whether Autocompletion is enabled
+ /// </summary>
+ /// <value><c>true</c> if sompletion is enabled, otherwise <c>false</c></value>
+ /// <remarks>
+ /// Enables autocompletion with values from the given source and <see cref="TextField"/> while typing.
+ /// Will reset custom completions specified with <see cref="TextEntry.SetCompletions(string[])"/> when enabled.
+ /// </remarks>
+ public bool Completes
+ {
+ get { return Backend.Completes; }
+ set { Backend.Completes = value; }
+ }
}
class CustomComboTextEntry: TextEntry