Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12195 closed defect (fixed)

wxGrid sample block cell selection

Reported by: johnr Owned by:
Priority: normal Milestone: 2.9.2
Component: samples Version: stable-latest
Keywords: wxGrid sample GetSelectedCells block Cc:
Blocked By: Blocking:
Patch: yes

Description

Attached patch adds wxLog reporting of cells selected in a block.
Also removes menu item and associated code that added the invalid fourth selection mode SelectRowsOrCols. Interestingly this did not assert in wxGrid::SetSelectionMode() but did assert when showing a selection via GetSelectedCells().

Attachments (1)

gridsampleselect.patch download (3.0 KB) - added by johnr 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by johnr

comment:1 follow-up: Changed 4 years ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed

Sorry, why is this mode invalid? It is valid and I don't see why should it be removed... also, AFAICS this still doesn't take into account the row/column selections. We really need to implement a proper selection access API as discussed ad nauseam on wx-dev.

comment:2 in reply to: ↑ 1 Changed 4 years ago by johnr

Replying to vadz:

Sorry, why is this mode invalid? It is valid and I don't see why should it be removed... also, AFAICS this still doesn't take into account the row/column selections. We really need to implement a proper selection access API as discussed ad nauseam on wx-dev.

I see in grid.h that it is a valid mode.
The help docs need updating as I don't see wxGridSelectRowsOrColumns in help docs and they initially led me to believe it was invalid when coupled with the grid sample assert.

quote help
enum wxGridSelectionModes {

wxGridSelectCells,
wxGridSelectRows,
wxGridSelectColumns

}

It asserts in the griddemo.cpp sample at 1149 because wxGridSelectRowsOrColumns is not included in the switch routine in GridFrame::OnShowSelection()


comment:3 Changed 4 years ago by VZ

(In [65074]) Document wxGridSelectRowsOrColumns selection mode.

See #12195.

comment:4 Changed 4 years ago by VZ

  • Resolution changed from invalid to fixed

(In [65075]) Remove selection showing code from the grid sample.

This code is broken as it doesn't always show the selection correctly and
doesn't handle rows-or-columns selection mode at all. Until we can fix it
properly it's better to not have it at all so that at least people avoid
copying the wrong code into their own programs.

Closes #12195.

Note: See TracTickets for help on using tickets.