From b5cfb4ba67834594463c6d5235a32d876bb10ae0 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Wed, 16 Apr 2003 02:26:12 +0000 Subject: [PATCH] 2003-04-15 Gonzalo Paniagua Javier * gtk/TreeView.custom: (GetPathAtPos): added 3 overloads of this method so that the caller does not need to create extra variables that may not use. * api/gtk-api.xml: * sources/Gtk.metadata: added pass_out attribute for tx and ty arguments of TreeView::WidgetToTreeCoords. Hide TreeView::GetPathAtPos. svn path=/trunk/gtk-sharp/; revision=13677 --- ChangeLog | 10 +++++++ api/gtk-api.xml | 6 ++-- gtk/TreeView.custom | 70 +++++++++++++++++++++++++++++++++++++++++++- sources/Gtk.metadata | 29 +++++++++++++++++- 4 files changed, 110 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c0b62606..f1519e932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-04-15 Gonzalo Paniagua Javier + + * gtk/TreeView.custom: + (GetPathAtPos): added 3 overloads of this method so that the caller + does not need to create extra variables that may not use. + + * api/gtk-api.xml: + * sources/Gtk.metadata: added pass_out attribute for tx and ty + arguments of TreeView::WidgetToTreeCoords. Hide TreeView::GetPathAtPos. + 2003-04-14 Lee Mallabone * api/gtk-api.xml, sources/Gtk.metadata, gtk/ColorSelection.custom: diff --git a/api/gtk-api.xml b/api/gtk-api.xml index a45eb235b..ac0a310e1 100644 --- a/api/gtk-api.xml +++ b/api/gtk-api.xml @@ -8166,7 +8166,7 @@ - + diff --git a/gtk/TreeView.custom b/gtk/TreeView.custom index 4aca41c92..7c8a50cae 100644 --- a/gtk/TreeView.custom +++ b/gtk/TreeView.custom @@ -1,8 +1,11 @@ // Gtk.TreeView.Custom - Gtk TreeView class customizations // -// Author: Kristian Rietveld +// Authors: +// Kristian Rietveld +// Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (c) 2002 Kristian Rietveld +// (c) 2003 Ximian, Inc. (http://www.ximian.com) // // This code is inserted after the automatically generated code. @@ -27,3 +30,68 @@ gtk_tree_view_set_model (Handle, value.Handle); } } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_tree_view_get_path_at_pos (IntPtr raw, + int x, + int y, + out IntPtr path, + IntPtr column, + out int cell_x, + out int cell_y); + + [DllImport("libgtk-win32-2.0-0.dll", EntryPoint="gtk_tree_view_get_path_at_pos")] + static extern bool gtk_tree_view_get_path_at_pos_intptr (IntPtr raw, + int x, + int y, + out IntPtr path, + IntPtr column, + IntPtr cell_x, + IntPtr cell_y); + + public bool GetPathAtPos (int x, int y, out Gtk.TreePath path, Gtk.TreeViewColumn column, out int cell_x, out int cell_y) + { + IntPtr col; + if (column == null) + col = IntPtr.Zero; + else + col = column.Handle; + + IntPtr pathHandle; + bool raw_ret = gtk_tree_view_get_path_at_pos (Handle, x, y, out pathHandle, col, out cell_x, out cell_y); + if (raw_ret) + path = new TreePath (pathHandle); + else + path = null; + + return raw_ret; + } + + + public bool GetPathAtPos (int x, int y, out Gtk.TreePath path) + { + IntPtr pathHandle; + bool raw_ret = gtk_tree_view_get_path_at_pos_intptr (Handle, x, y, out pathHandle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); + if (raw_ret) + path = new TreePath (pathHandle); + else + path = null; + + return raw_ret; + } + + public bool GetPathAtPos (int x, int y, out Gtk.TreePath path, Gtk.TreeViewColumn column) + { + if (column == null) + return GetPathAtPos (x, y, out path); + + IntPtr pathHandle; + bool raw_ret = gtk_tree_view_get_path_at_pos_intptr (Handle, x, y, out pathHandle, column.Handle, IntPtr.Zero, IntPtr.Zero); + if (raw_ret) + path = new TreePath (pathHandle); + else + path = null; + + return raw_ret; + } + diff --git a/sources/Gtk.metadata b/sources/Gtk.metadata index fe42f9b1c..291739338 100644 --- a/sources/Gtk.metadata +++ b/sources/Gtk.metadata @@ -377,7 +377,23 @@ - + + + WidgetToTreeCoords + + + + tx + pass_as + out + + + ty + pass_as + out + + + @@ -1651,6 +1667,17 @@ + + + GetPathAtPos + + + + hidden + 1 + + +