Skip to content

Commit 8fcfdbe

Browse files
authored
Merge pull request #2430 from Miepee/combobox-doc
Revise documentation for ComboBox
2 parents 679b9db + 1e1272b commit 8fcfdbe

File tree

5 files changed

+27
-45
lines changed

5 files changed

+27
-45
lines changed

src/Eto/Forms/Controls/CheckBoxList.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using Eto.Drawing;
5-
using System.Collections;
65

76
namespace Eto.Forms;
87

src/Eto/Forms/Controls/CollectionEditor.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.ComponentModel;
43

54
namespace Eto.Forms;
65

src/Eto/Forms/Controls/ColorPicker.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using Eto.Drawing;
3-
using System.ComponentModel;
43

54
namespace Eto.Forms;
65

src/Eto/Forms/Controls/ComboBox.cs

+26-38
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.ComponentModel;
62

73
namespace Eto.Forms;
84

95
/// <summary>
106
/// Presents a combination of an editable text box and drop down to select from a list of items and enter text.
117
/// </summary>
8+
/// <example>
9+
/// Here is a short example on how to create an autocompleting check box.
10+
/// <code>
11+
/// var list = new List&lt;string&gt;() { "First item", "Second item", "Third item" };
12+
/// var comboBox = new ComboBox() { AutoComplete = true, DataStore = list };
13+
/// </code>
14+
/// </example>
1215
[Handler(typeof(IHandler))]
1316
public class ComboBox : DropDown
1417
{
@@ -20,7 +23,7 @@ public class ComboBox : DropDown
2023
public const string TextChangedEvent = "ComboBox.TextChanged";
2124

2225
/// <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.
2427
/// </summary>
2528
public event EventHandler<EventArgs> TextChanged
2629
{
@@ -31,7 +34,7 @@ public event EventHandler<EventArgs> TextChanged
3134
/// <summary>
3235
/// Raises the <see cref="TextChanged"/> event.
3336
/// </summary>
34-
/// <param name="e">Event arguments</param>
37+
/// <param name="e">Event arguments.</param>
3538
protected virtual void OnTextChanged(EventArgs e)
3639
{
3740
Properties.TriggerEvent(TextChangedEvent, this, e);
@@ -45,7 +48,7 @@ public ComboBox()
4548
}
4649

4750
/// <summary>
48-
/// Gets or sets the text of the ComboBox.
51+
/// Gets or sets the text of the combo box.
4952
/// </summary>
5053
/// <value>The text content.</value>
5154
public string Text
@@ -58,8 +61,9 @@ public string Text
5861
/// Gets or sets whether the user can change the text in the combo box.
5962
/// </summary>
6063
/// <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.
6367
/// </remarks>
6468
public bool ReadOnly
6569
{
@@ -71,9 +75,9 @@ public bool ReadOnly
7175
/// Gets or sets a value indicating that the text should autocomplete when the user types in a value.
7276
/// </summary>
7377
/// <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.
7579
/// </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>
7781
public bool AutoComplete
7882
{
7983
get { return Handler.AutoComplete; }
@@ -82,65 +86,49 @@ public bool AutoComplete
8286

8387
static readonly object callback = new Callback();
8488

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/>
8990
protected override object GetCallback()
9091
{
9192
return callback;
9293
}
9394

9495
/// <summary>
95-
/// Callback interface for the <see cref="ComboBox"/>
96+
/// Callback interface for the <see cref="ComboBox"/>.
9697
/// </summary>
9798
public new interface ICallback : DropDown.ICallback
9899
{
99100
/// <summary>
100-
/// Raises the text changed event.
101+
/// <inheritdoc cref="ComboBox.OnTextChanged" path="/summary"/>
101102
/// </summary>
103+
// TODO: document parameters
102104
void OnTextChanged(ComboBox widget, EventArgs e);
103105
}
104106

105107
/// <summary>
106-
/// Callback implementation for handlers of <see cref="ListControl"/>
108+
/// Callback implementation for handlers of <see cref="ComboBox"/>.
107109
/// </summary>
108110
protected new class Callback : DropDown.Callback, ICallback
109111
{
110-
/// <summary>
111-
/// Raises the text changed event.
112-
/// </summary>
112+
/// <inheritdoc cref="ICallback.OnTextChanged"/>
113113
public void OnTextChanged(ComboBox widget, EventArgs e)
114114
{
115115
using (widget.Platform.Context)
116116
widget.OnTextChanged(e);
117117
}
118118
}
119-
120-
119+
121120
/// <summary>
122-
/// Handler interface for the <see cref="ComboBox"/>
121+
/// Handler interface for the <see cref="ComboBox"/>.
123122
/// </summary>
124123
public new interface IHandler : DropDown.IHandler
125124
{
126-
/// <summary>
127-
/// Gets or sets the text of the ComboBox.
128-
/// </summary>
129-
/// <value>The text content.</value>
125+
/// <inheritdoc cref="ComboBox.Text"/>
130126
string Text { get; set; }
131127

132-
/// <summary>
133-
/// Gets or sets the editable of ComboBox.
134-
/// </summary>
128+
/// <inheritdoc cref="ComboBox.ReadOnly"/>
135129
bool ReadOnly { get; set; }
136130

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"/>
144132
bool AutoComplete { get; set; }
145133
}
146134
}

src/Eto/Forms/Controls/DropDown.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ public event EventHandler<DropDownFormatEventArgs> FormatItem
175175
/// <param name="e">Event Arguments</param>
176176
protected virtual void OnFormatItem(DropDownFormatEventArgs e) => Properties.TriggerEvent(FormatItemEvent, this, e);
177177

178-
/// <summary>
179-
/// Gets the callback.
180-
/// </summary>
181-
/// <returns>The callback.</returns>
178+
/// <inheritdoc/>
182179
protected override object GetCallback() => new Callback();
183180

184181
/// <summary>

0 commit comments

Comments
 (0)