Opened 3 years ago

Closed 11 months ago

Last modified 11 months ago

#13531 closed defect (fixed)

Wrong item returned for wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU

Reported by: jdog Owned by: vaclavslavik
Priority: normal Milestone:
Component: wxGTK Version: stable-latest
Keywords: wxDataViewCtrl Cc:
Blocked By: Blocking:
Patch: no

Description

I have a wxDataViewCtrl and use the context menu event to display a context menu related to the item the user clicked on.

There is a problem with wxDataViewEvent::GetItem() returning wrong item if there was other item(s) selected before the user clicked.

With wxMSW it works as expected:

  • When I right click an item it is immediately selected
  • wxDataViewEvent::GetItem() returns the expected item, below the cursor

With wxGTK:

  • When I right click the old selection is kept
  • wxDataViewEvent::GetItem() returns the selected item, and not the item below the cursor

Change History (4)

comment:1 Changed 12 months ago by vadz

  • Keywords wxDataViewCtrl added

comment:2 Changed 11 months ago by vaclavslavik

  • Owner set to vaclavslavik
  • Status changed from new to accepted

wxDataViewEvent::GetItem() returns the selected item, and not the item below the cursor

This was apparently fixed since then.

comment:3 Changed 11 months ago by VS

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [75273]) Fix selection behavior on right-click in wxGTK wxDataViewCtrl.

Select the item under the cursor even when right-clicking it, because
it's expected behavior (Nautilus does it too).

Fixes #13531.

comment:4 Changed 11 months ago by VS

(In [75275]) Fix selection behavior on right-click in wxGTK wxDataViewCtrl.

Select the item under the cursor even when right-clicking it, because
it's expected behavior (Nautilus does it too).

Fixes #13531.

Note: See TracTickets for help on using tickets.