mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 11:10:23 +02:00
gtk2: fix TListview.GetItemAtXY (issue #0013845)
git-svn-id: trunk@20272 -
This commit is contained in:
parent
07ef806b61
commit
c5b68e067f
@ -1199,13 +1199,22 @@ var
|
||||
Widgets: PTVWidgets;
|
||||
ItemPath: PGtkTreePath;
|
||||
Column: PGtkTreeViewColumn;
|
||||
cx, cy: gint;
|
||||
begin
|
||||
Result := -1;
|
||||
if not WSCheckHandleAllocated(ALV, 'GetItemAt')
|
||||
then Exit;
|
||||
|
||||
GetCommonTreeViewWidgets(PGtkWidget(ALV.Handle), Widgets);
|
||||
|
||||
|
||||
// convert X, Y to bin window coords
|
||||
x := x + Round(PGtkTreeView(Widgets^.MainView)^.priv^.hadjustment^.value);
|
||||
if GTK_TREE_VIEW_FLAG_SET(PGtkTreeView(Widgets^.MainView), GTK_TREE_VIEW_HEADERS_VISIBLE) then
|
||||
begin
|
||||
gdk_window_get_size(PGtkTreeView(Widgets^.MainView)^.priv^.header_window, @cx, @cy);
|
||||
y := y - cy;
|
||||
end;
|
||||
|
||||
if gtk_tree_view_get_path_at_pos(PGtkTreeView(Widgets^.MainView), x, y, ItemPath, Column, nil, nil) then
|
||||
begin
|
||||
if ItemPath <> nil then
|
||||
|
Loading…
Reference in New Issue
Block a user