2005-01-05 Mike Kestner <mkestner@novell.com>

* gtk/TreeView.custom : add back the TreeCellDataFunc overloads for
	backward compat.
	* gtk/TreeViewColumn.custom : add back the TreeCellDataFunc overloads for
	backward compat.

svn path=/trunk/gtk-sharp/; revision=38396
This commit is contained in:
Mike Kestner 2005-01-05 21:59:06 +00:00
parent 458a09ff4c
commit 2eb246518a
6 changed files with 71 additions and 15 deletions

View file

@ -1,3 +1,10 @@
2005-01-05 Mike Kestner <mkestner@novell.com>
* gtk/TreeView.custom : add back the TreeCellDataFunc overloads for
backward compat.
* gtk/TreeViewColumn.custom : add back the TreeCellDataFunc overloads for
backward compat.
2005-01-05 Mike Kestner <mkestner@novell.com>
* generator/Field.cs : deal with LPGen/LPUGen fields.

View file

@ -87,19 +87,6 @@
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="Timezone" Deprecated="true">
<MemberSignature Language="C#" Value="public long Timezone;" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<summary>To be added</summary>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="Timezone">
<MemberSignature Language="C#" Value="public long Timezone { set; get; };" />
<MemberType>Property</MemberType>
@ -114,4 +101,4 @@
</Docs>
</Member>
</Members>
</Type>
</Type>

View file

@ -1820,5 +1820,25 @@ tree_view.AppendColumn ("title", text, "text", 0);
<remarks />
</Docs>
</Member>
<Member MemberName="AppendColumn">
<MemberSignature Language="C#" Value="public Gtk.TreeViewColumn AppendColumn (string title, Gtk.CellRenderer cell, Gtk.TreeCellDataFunc cell_data);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gtk.TreeViewColumn</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="title" Type="System.String" />
<Parameter Name="cell" Type="Gtk.CellRenderer" />
<Parameter Name="cell_data" Type="Gtk.TreeCellDataFunc" />
</Parameters>
<Docs>
<summary>Adds a new <see cref="T:Gtk.TreeViewColumn" /> to the TreeView and returns it.</summary>
<param name="title">a <see cref="T:System.String" /></param>
<param name="cell">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="cell_data">a <see cref="T:Gtk.TreeCellDataFunc" /></param>
<returns>a <see cref="T:Gtk.TreeViewColumn" /></returns>
<remarks>This method actually creates the column, rather than relying on a column object to be passed in. There's an alternate invokation form if you'd like to pass in an existing column object.</remarks>
</Docs>
</Member>
</Members>
</Type>

View file

@ -712,7 +712,24 @@
<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 consist of pairs of attribute name and column index.</remarks>
<remarks>The <paramref name="attrs" /> array should consist of pairs of attribute name and column index.</remarks>
</Docs>
</Member>
<Member MemberName="SetCellDataFunc">
<MemberSignature Language="C#" Value="public void SetCellDataFunc (Gtk.CellRenderer cell_renderer, Gtk.TreeCellDataFunc func);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell_renderer" Type="Gtk.CellRenderer" />
<Parameter Name="func" Type="Gtk.TreeCellDataFunc" />
</Parameters>
<Docs>
<summary>Sets the <see cref="T:Gtk.CellLayoutDataFunc" /> to use for a renderer.</summary>
<param name="cell_renderer">a <see cref="T:Gtk.CellRenderer" /></param>
<param name="func">a <see cref="T:Gtk.TreeCellDataFunc" /></param>
<remarks>This function is used instead of the standard attributes mapping for setting the column value, and should set the value of the <see cref="T:Gtk.TreeViewColumn" /><paramref name="cell_renderer" /> as appropriate. <paramref name="func" /> may be <see langword="null" /> to remove an older one.</remarks>
</Docs>
</Member>
</Members>

View file

@ -120,6 +120,17 @@
return raw_ret;
}
public TreeViewColumn AppendColumn (string title, CellRenderer cell, TreeCellDataFunc cell_data)
{
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
col.Title = title;
col.PackStart (cell, true);
col.SetCellDataFunc (cell, cell_data);
AppendColumn (col);
return col;
}
public TreeViewColumn AppendColumn (string title, CellRenderer cell, CellLayoutDataFunc cell_data) {
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
col.Title = title;

View file

@ -85,9 +85,23 @@
gtk_tree_view_column_set_cell_data_func(Handle, cell.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
}
[DllImport("libgtk-win32-2.0-0.dll")]
static extern void gtk_tree_view_column_set_cell_data_func(IntPtr raw, IntPtr cell_renderer, GtkSharp.TreeCellDataFuncNative func, IntPtr func_data, IntPtr destroy);
[DllImport("libgtk-win32-2.0-0.dll")]
static extern void gtk_tree_view_column_set_cell_data_func(IntPtr raw, IntPtr cell_renderer, GtkSharp.CellLayoutDataFuncNative func, IntPtr func_data, IntPtr destroy);
public void SetCellDataFunc (CellRenderer cell_renderer, TreeCellDataFunc func)
{
if (func == null) {
ReleaseDataFunc (cell_renderer);
return;
}
;
GtkSharp.TreeCellDataFuncWrapper wrapper = new GtkSharp.TreeCellDataFuncWrapper (func, this);
CellDataFuncs [cell_renderer.Handle] = wrapper;
gtk_tree_view_column_set_cell_data_func(Handle, cell_renderer.Handle, wrapper.NativeDelegate, IntPtr.Zero, IntPtr.Zero);
}
public void SetCellDataFunc (CellRenderer cell_renderer, CellLayoutDataFunc func)
{
if (func == null) {