1
1
using System ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
- using System . Text ;
5
- using System . ComponentModel ;
6
2
7
3
namespace Eto . Forms ;
8
4
9
5
/// <summary>
10
6
/// Presents a combination of an editable text box and drop down to select from a list of items and enter text.
11
7
/// </summary>
8
+ /// <example>
9
+ /// Here is a short example on how to create an autocompleting check box.
10
+ /// <code>
11
+ /// var list = new List<string>() { "First item", "Second item", "Third item" };
12
+ /// var comboBox = new ComboBox() { AutoComplete = true, DataStore = list };
13
+ /// </code>
14
+ /// </example>
12
15
[ Handler ( typeof ( IHandler ) ) ]
13
16
public class ComboBox : DropDown
14
17
{
@@ -20,7 +23,7 @@ public class ComboBox : DropDown
20
23
public const string TextChangedEvent = "ComboBox.TextChanged" ;
21
24
22
25
/// <summary>
23
- /// Occurs when the Text property is changed either by the user or programatically.
26
+ /// Occurs when the <see cref=" Text"/> property is changed either by the user or programatically.
24
27
/// </summary>
25
28
public event EventHandler < EventArgs > TextChanged
26
29
{
@@ -31,7 +34,7 @@ public event EventHandler<EventArgs> TextChanged
31
34
/// <summary>
32
35
/// Raises the <see cref="TextChanged"/> event.
33
36
/// </summary>
34
- /// <param name="e">Event arguments</param>
37
+ /// <param name="e">Event arguments. </param>
35
38
protected virtual void OnTextChanged ( EventArgs e )
36
39
{
37
40
Properties . TriggerEvent ( TextChangedEvent , this , e ) ;
@@ -45,7 +48,7 @@ public ComboBox()
45
48
}
46
49
47
50
/// <summary>
48
- /// Gets or sets the text of the ComboBox .
51
+ /// Gets or sets the text of the combo box .
49
52
/// </summary>
50
53
/// <value>The text content.</value>
51
54
public string Text
@@ -58,8 +61,9 @@ public string Text
58
61
/// Gets or sets whether the user can change the text in the combo box.
59
62
/// </summary>
60
63
/// <remarks>
61
- /// When <c>true</c>, the user will still be able to select/copy the text, select items from the drop down, etc.
62
- /// To disable the control, use the <see cref="Control.Enabled"/> property.
64
+ /// When <see langword="true"/>, the user will still be able to select/copy the text or select items from the drop down.
65
+ /// They will only be unable to type in different text. <br/>
66
+ /// To fully disable the control, use the <see cref="Control.Enabled"/> property.
63
67
/// </remarks>
64
68
public bool ReadOnly
65
69
{
@@ -71,9 +75,9 @@ public bool ReadOnly
71
75
/// Gets or sets a value indicating that the text should autocomplete when the user types in a value.
72
76
/// </summary>
73
77
/// <remarks>
74
- /// The autocomplete will be based off of the items in the combo box.
78
+ /// The autocomplete will be based off of the available items in the combo box.
75
79
/// </remarks>
76
- /// <value><c> true</c > to auto complete the text; otherwise, <c> false</c >.</value>
80
+ /// <value><see langword=" true"/ > to auto complete the text; otherwise, <see langword=" false"/ >.</value>
77
81
public bool AutoComplete
78
82
{
79
83
get { return Handler . AutoComplete ; }
@@ -82,65 +86,49 @@ public bool AutoComplete
82
86
83
87
static readonly object callback = new Callback ( ) ;
84
88
85
- /// <summary>
86
- /// Gets an instance of an object used to perform callbacks to the widget from handler implementations
87
- /// </summary>
88
- /// <returns>The callback instance to use for this widget</returns>
89
+ /// <inheritdoc/>
89
90
protected override object GetCallback ( )
90
91
{
91
92
return callback ;
92
93
}
93
94
94
95
/// <summary>
95
- /// Callback interface for the <see cref="ComboBox"/>
96
+ /// Callback interface for the <see cref="ComboBox"/>.
96
97
/// </summary>
97
98
public new interface ICallback : DropDown . ICallback
98
99
{
99
100
/// <summary>
100
- /// Raises the text changed event.
101
+ /// <inheritdoc cref="ComboBox.OnTextChanged" path="/summary"/>
101
102
/// </summary>
103
+ // TODO: document parameters
102
104
void OnTextChanged ( ComboBox widget , EventArgs e ) ;
103
105
}
104
106
105
107
/// <summary>
106
- /// Callback implementation for handlers of <see cref="ListControl "/>
108
+ /// Callback implementation for handlers of <see cref="ComboBox "/>.
107
109
/// </summary>
108
110
protected new class Callback : DropDown . Callback , ICallback
109
111
{
110
- /// <summary>
111
- /// Raises the text changed event.
112
- /// </summary>
112
+ /// <inheritdoc cref="ICallback.OnTextChanged"/>
113
113
public void OnTextChanged ( ComboBox widget , EventArgs e )
114
114
{
115
115
using ( widget . Platform . Context )
116
116
widget . OnTextChanged ( e ) ;
117
117
}
118
118
}
119
-
120
-
119
+
121
120
/// <summary>
122
- /// Handler interface for the <see cref="ComboBox"/>
121
+ /// Handler interface for the <see cref="ComboBox"/>.
123
122
/// </summary>
124
123
public new interface IHandler : DropDown . IHandler
125
124
{
126
- /// <summary>
127
- /// Gets or sets the text of the ComboBox.
128
- /// </summary>
129
- /// <value>The text content.</value>
125
+ /// <inheritdoc cref="ComboBox.Text"/>
130
126
string Text { get ; set ; }
131
127
132
- /// <summary>
133
- /// Gets or sets the editable of ComboBox.
134
- /// </summary>
128
+ /// <inheritdoc cref="ComboBox.ReadOnly"/>
135
129
bool ReadOnly { get ; set ; }
136
130
137
- /// <summary>
138
- /// Gets or sets a value indicating that the text should autocomplete when the user types in a value.
139
- /// </summary>
140
- /// <remarks>
141
- /// The autocomplete will be based off of the items in the combo box.
142
- /// </remarks>
143
- /// <value><c>true</c> to auto complete the text; otherwise, <c>false</c>.</value>
131
+ /// <inheritdoc cref="ComboBox.AutoComplete"/>
144
132
bool AutoComplete { get ; set ; }
145
133
}
146
134
}
0 commit comments