GtkSharp/doc/en/Gtk/EntryCompletion.xml

531 lines
21 KiB
XML
Raw Normal View History

<Type Name="EntryCompletion" FullName="Gtk.EntryCompletion">
<TypeSignature Language="C#" Value="public class EntryCompletion : GLib.Object, CellLayout, IWrapper, IDisposable" Maintainer="auto" />
<AssemblyInfo>
<AssemblyName>gtk-sharp</AssemblyName>
<AssemblyPublicKey>[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 21 26 CB 36 89 C2 EA 64 96 A4 7C B4]</AssemblyPublicKey>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyCulture>neutral</AssemblyCulture>
<Attributes />
</AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Docs>
<summary>
This object allows a widget to suggest possible completions of a string which has been partially entered.
</summary>
<remarks>
<para>
The partially-entered string is also referred to as a "key".
</para>
<example>
<code lang="C#">
using System;
using Gtk;
public class DemoEntryCompletion : Window
{
static void Main ()
{
Application.Init ();
new DemoEntryCompletion ();
Application.Run ();
}
public DemoEntryCompletion () : base ("Demo Entry Completion")
{
this.BorderWidth = 10;
this.Resizable = false;
VBox vbox = new VBox ();
Label label = new Label ("Completion demo, try writing &lt;b&gt;total&lt;/b&gt; or &lt;/b&gt;gnome&lt;/b&gt; for example.");
label.UseMarkup = true;
vbox.PackStart (label, false, true, 0);
Entry entry = new Entry ();
entry.Completion = new EntryCompletion ();
entry.Completion.Model = CreateCompletionModel ();
entry.Completion.TextColumn = 0;
vbox.PackStart (entry, false, true, 0);
this.Add (vbox);
this.ShowAll ();
}
TreeModel CreateCompletionModel ()
{
ListStore store = new ListStore (typeof (string));
store.AppendValues ("GNOME");
store.AppendValues ("total");
store.AppendValues ("totally");
return store;
}
}
</code>
</example>
</remarks>
</Docs>
<Base>
<BaseTypeName>GLib.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>Gtk.CellLayout</InterfaceName>
</Interface>
<Interface>
<InterfaceName>GLib.IWrapper</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes />
<Members>
<Member MemberName="Finalize">
<MemberSignature Language="C#" Value="protected override void Finalize ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Disposes the resources associated with the object.</summary>
<remarks />
</Docs>
</Member>
<Member MemberName="OnActionActivated">
<MemberSignature Language="C#" Value="protected virtual void OnActionActivated (int index);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<summary>This method is called whenever an action is activated.</summary>
<param name="index">a <see cref="T:System.Int32" /></param>
<remarks />
</Docs>
</Member>
<Member MemberName="OnMatchSelected">
<MemberSignature Language="C#" Value="protected virtual bool OnMatchSelected (Gtk.TreeModel model, Gtk.TreeIter iter);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="model" Type="Gtk.TreeModel" />
<Parameter Name="iter" Type="Gtk.TreeIter" />
</Parameters>
<Docs>
<summary>This method is called whenever the user selects one of the suggested matches.</summary>
<param name="model">a <see cref="T:Gtk.TreeModel" />, the model the match was selected from</param>
<param name="iter">a <see cref="T:Gtk.TreeIter" />, the row the user picked</param>
<returns>a <see cref="T:System.Boolean" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName="InsertActionMarkup">
<MemberSignature Language="C#" Value="public void InsertActionMarkup (int index, string markup);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="markup" Type="System.String" />
</Parameters>
<Docs>
<summary>
Inserts an action in the completion's action item list at
position <paramref name="index_" /> with markup
<paramref name="markup" />.
</summary>
<param name="index">a <see cref="T:System.Int32" /></param>
<param name="markup">a <see cref="T:System.String" /></param>
<remarks />
</Docs>
</Member>
<Member MemberName="InsertActionText">
<MemberSignature Language="C#" Value="public void InsertActionText (int index, string text);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="text" Type="System.String" />
</Parameters>
<Docs>
<summary>
Inserts an action in the completion's action item list at
position <paramref name="index_" /> with text
<paramref name="text" />.
</summary>
<param name="index">a <see cref="T:System.Int32" /></param>
<param name="text">a <see cref="T:System.String" /></param>
<remarks>
If you want the item to have markup, use <see cref="M:Gtk.EntryCompletion.InsertActionMarkup" />.
</remarks>
</Docs>
</Member>
<Member MemberName="Complete">
<MemberSignature Language="C#" Value="public void Complete ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
Requests a completion operation, or in other words a refiltering
of the current list with completions, using the current key. The
completion list view will be updated accordingly.
</summary>
<remarks />
</Docs>
</Member>
<Member MemberName="DeleteAction">
<MemberSignature Language="C#" Value="public void DeleteAction (int index);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<summary>
Deletes the action at <paramref name="index_" />
from the action list for this completion.
</summary>
<param name="index">a <see cref="T:System.Int32" /></param>
<remarks />
</Docs>
</Member>
<Member MemberName="Reorder">
<MemberSignature Language="C#" Value="public virtual void Reorder (Gtk.CellRenderer cell, int position);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="Gtk.CellRenderer" />
<Parameter Name="position" Type="System.Int32" />
</Parameters>
<Docs>
<summary>
Reinserts <paramref name="cell" /> into the completion list
at <paramref name="position" />.
</summary>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="position">a <see cref="T:System.Int32" /></param>
<remarks />
</Docs>
</Member>
<Member MemberName="PackEnd">
<MemberSignature Language="C#" Value="public virtual void PackEnd (Gtk.CellRenderer cell, bool expand);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="Gtk.CellRenderer" />
<Parameter Name="expand" Type="System.Boolean" />
</Parameters>
<Docs>
<summary>Adds the <paramref name="cell" /> to the end of the entry-completion widget.</summary>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="expand">a <see cref="T:System.Boolean" /></param>
<remarks>
If <paramref name="expand" /> is <see langword="false" />, then the
<paramref name="cell" /> is allocated no more space than it needs. Any unused space is
divided evenly between cells for which <paramref name="expand" /> is <see langword="true" />.
</remarks>
</Docs>
</Member>
<Member MemberName="PackStart">
<MemberSignature Language="C#" Value="public virtual void PackStart (Gtk.CellRenderer cell, bool expand);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="Gtk.CellRenderer" />
<Parameter Name="expand" Type="System.Boolean" />
</Parameters>
<Docs>
<summary>Packs the <paramref name="cell" /> into the beginning of the entry-completion widget.</summary>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="expand">a <see cref="T:System.Boolean" /></param>
<remarks>
If <paramref name="expand" /> is <see langword="false" />, then the
<paramref name="cell" /> is allocated no more space than it needs. Any unused space is
divided evenly between cells for which <paramref name="expand" /> is <see langword="true" />.
</remarks>
</Docs>
</Member>
<Member MemberName="AddAttribute">
<MemberSignature Language="C#" Value="public virtual void AddAttribute (Gtk.CellRenderer cell, string attribute, int column);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="Gtk.CellRenderer" />
<Parameter Name="attribute" Type="System.String" />
<Parameter Name="column" Type="System.Int32" />
</Parameters>
<Docs>
<summary>
Adds an attribute mapping to the list in this entry-completion widget.
</summary>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="attribute">a <see cref="T:System.String" />, parameter on <paramref name="cell" /> to be set from the value</param>
<param name="column">a <see cref="T:System.Int32" />, column of the model to get a value from.</param>
<remarks>
The <paramref name="column" /> is the column of the model to get a value from, and the <paramref name="attribute" /> is the
parameter on <paramref name="cell" /> to be set from the value. So for example if column 2
of the model contains strings, you could have the "text" attribute of a
<see cref="T:Gtk.EntryCompletion" /> get its values from column 2.
</remarks>
</Docs>
</Member>
<Member MemberName="ClearAttributes">
<MemberSignature Language="C#" Value="public virtual void ClearAttributes (Gtk.CellRenderer cell);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="Gtk.CellRenderer" />
</Parameters>
<Docs>
<summary>
Clears all existing attributes previously set with
<see cref="M:Gtk.EntryCompletion.SetAttributes" />.
</summary>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<remarks />
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="public virtual void Clear ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Clears the completion.</summary>
<remarks />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected EntryCompletion (GLib.GType gtype);" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters>
<Parameter Name="gtype" Type="GLib.GType" />
</Parameters>
<Docs>
<summary>Protected constructor.</summary>
<param name="gtype">a <see cref="T:GLib.GType" /></param>
<returns>a <see cref="T:Gtk.EntryCompletion" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public EntryCompletion (IntPtr raw);" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters>
<Parameter Name="raw" Type="System.IntPtr" />
</Parameters>
<Docs>
<summary>Constructor for internal use only.</summary>
<param name="raw">a <see cref="T:System.IntPtr" /></param>
<returns>a <see cref="T:Gtk.EntryCompletion" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public EntryCompletion ();" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs>
<summary>Constructor for general use.</summary>
<returns>a <see cref="T:Gtk.EntryCompletion" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName="GType">
<MemberSignature Language="C#" Value="public static GLib.GType GType { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>GLib.GType</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>GType Property.</summary>
<returns>a <see cref="T:GLib.GType" /></returns>
<remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:Gtk.EntryCompletion" />.</remarks>
</Docs>
</Member>
<Member MemberName="MinimumKeyLength">
<MemberSignature Language="C#" Value="public int MinimumKeyLength { set; get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Minimum string length for enabling completion.</summary>
<returns>a <see cref="T:System.Int32" /></returns>
<remarks>
Requires the length of the search key for this completion to be at least
a certain length. This is useful for long lists, where completing using a small
key takes a lot of time and will come up with meaningless results anyway
(ie, a too large dataset).
</remarks>
</Docs>
</Member>
<Member MemberName="TextColumn">
<MemberSignature Language="C#" Value="public int TextColumn { set; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Setting this property generates a completion list with just strings.
</summary>
<returns>a <see cref="T:System.Int32" /></returns>
<remarks>
Setting this convenience property will set up the completion
to have a list displaying all (and just) strings in the completion list,
and to get those strings from a particular column number in the model of the completion object.
</remarks>
</Docs>
</Member>
<Member MemberName="Entry">
<MemberSignature Language="C#" Value="public Gtk.Widget Entry { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gtk.Widget</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
Returns the entry widget this completion object has been attached to.
</summary>
<returns>a <see cref="T:Gtk.Widget" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName="ActionActivated">
<MemberSignature Language="C#" Value="public event Gtk.ActionActivatedHandler ActionActivated;" />
<MemberType>Event</MemberType>
<ReturnValue>
<ReturnType>Gtk.ActionActivatedHandler</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
Event triggered when a particular action is activated.
</summary>
<remarks />
</Docs>
</Member>
<Member MemberName="MatchSelected">
<MemberSignature Language="C#" Value="public event Gtk.MatchSelectedHandler MatchSelected;" />
<MemberType>Event</MemberType>
<ReturnValue>
<ReturnType>Gtk.MatchSelectedHandler</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Event triggered when the user selects a match.</summary>
<remarks />
</Docs>
</Member>
<Member MemberName="SetMatchFunc">
<MemberSignature Language="C#" Value="public void SetMatchFunc (Gtk.EntryCompletionMatchFunc func, IntPtr func_data, IntPtr func_notify);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="func" Type="Gtk.EntryCompletionMatchFunc" />
<Parameter Name="func_data" Type="System.IntPtr" />
<Parameter Name="func_notify" Type="System.IntPtr" />
</Parameters>
<Docs>
<summary>
Sets the match function for this entry completion to be <paramref name="func" />.
</summary>
<param name="func">a <see cref="T:Gtk.EntryCompletionMatchFunc" /></param>
<param name="func_data">a <see cref="T:System.IntPtr" /></param>
<param name="func_notify">a <see cref="T:System.IntPtr" /></param>
<remarks>
The match function is used to determine if a row should or
should not be in the completion list.
</remarks>
</Docs>
</Member>
<Member MemberName="SetCellDataFunc">
<MemberSignature Language="C#" Value="public virtual void SetCellDataFunc (Gtk.CellRenderer renderer, Gtk.CellLayoutDataFunc func);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="renderer" Type="Gtk.CellRenderer" />
<Parameter Name="func" Type="Gtk.CellLayoutDataFunc" />
</Parameters>
<Docs>
<summary>Sets up a data function for this layout.</summary>
<param name="renderer">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="func">a <see cref="T:Gtk.CellLayoutDataFunc" /></param>
<remarks>
The data function is used instead of the standard attributes mapping for setting the
column value, and should set the value of the layout's cell renderer(s)
as appropriate. <paramref name="func" /> may be <see langword="null" /> to remove an older one.
</remarks>
</Docs>
</Member>
<Member MemberName="Model">
<MemberSignature Language="C#" Value="public Gtk.TreeModel Model { set; get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gtk.TreeModel</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Tree data model.</summary>
<returns>a <see cref="T:Gtk.TreeModel" /></returns>
<remarks />
</Docs>
</Member>
<Member MemberName="SetAttributes">
<MemberSignature Language="C#" Value="public virtual void SetAttributes (Gtk.CellRenderer cell, object [] attrs);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="Gtk.CellRenderer" />
<Parameter Name="attrs" Type="System.Object[]" />
</Parameters>
<Docs>
<summary>Sets the attribute to model column bindings for a renderer.</summary>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="attrs">a <see cref="T:System.Object" /></param>
<remarks>The <paramref name="attrs"/> array should be pairs of attribute names and column indexes.</remarks>
</Docs>
</Member>
</Members>
</Type>