wxGrid bugs

Redhat 7.1
Python 2.2.1
wxPython 2.3.4.2

I have run into a couple bugs.

The first one can be reproduced by adding the following lines to the
GridHugeTable.py file.

class HugeTableGrid(wxGrid):
    def __init__(self, parent, log):
        wxGrid.__init__(self, parent, -1)

        table = HugeTable(log)
        self.SetTable(table, true)
        
        EVT_GRID_CELL_RIGHT_CLICK(self, self.OnRightDown) #added

    def OnRightDown(self, event): #added
        print self.GetSelectedRows() #added

When no rows are selected, this prints the expected empty list. When
any rows are selected, any right click, on any cell, causes a core dump.
No debug or error messages.. just a quick trip back to the shell prompt.

The second bug might not be a bug, but it was unexpected behavior. It
deals with selecting rows. In the same grid used above, if I Left-Click
on row 8, and then Shift-Left-Click on row 15, I would expect rows 8
through 15 to be selected. In actuality, rows 1 through 15 are
selected.

Now if I move the cell selection down to row 8 and repeat the above
sequence, then the expected rows (8 through 15) are selected. Is it
normal for multiple row selection to be dependent on where the cell
selection is?

···

--
Bryan Muir <bmuir@eyrie.gsfc.nasa.gov>

I'd say the later is the correct behavior. That's exactly what you tried doing
in the first place - put the selection to row 8 and select up to 15 IMHO is
much the same like selection row 15 and expanding the selection to row 8.
However - I don't think it selects 1 to 15. The cursor isn't moved on
selecting a row.
Check it out. When you reproduce this the cell A1 has the focus (or whatever
you want to name it). The selection expands from the currently selected CELL
to where you shift click. If I follow your instructions exactly the second
selection actually leaves me with a selection from 1 to 8 and row 15.
I think the solution to what you expect is to change your program and actually
activate the first cell in the row that has been selected via the row
selection.
It's hard to explain, but try again and monitor the active cell (on my screen
- linux - the cell that has the blue frame around it). The multi select is
based on the currently active cell, not the row you last clicked on.

  UC

···

On Friday 10 January 2003 07:54 am, Bryan Muir wrote:

The second bug might not be a bug, but it was unexpected behavior. It
deals with selecting rows. In the same grid used above, if I Left-Click
on row 8, and then Shift-Left-Click on row 15, I would expect rows 8
through 15 to be selected. In actuality, rows 1 through 15 are
selected.

Now if I move the cell selection down to row 8 and repeat the above
sequence, then the expected rows (8 through 15) are selected. Is it
normal for multiple row selection to be dependent on where the cell
selection is?

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417

Bryan Muir wrote:

Redhat 7.1
Python 2.2.1
wxPython 2.3.4.2

I have run into a couple bugs.

The first one can be reproduced by adding the following lines to the
GridHugeTable.py file.

class HugeTableGrid(wxGrid):
    def __init__(self, parent, log):
        wxGrid.__init__(self, parent, -1)

        table = HugeTable(log)
        self.SetTable(table, true)
                EVT_GRID_CELL_RIGHT_CLICK(self, self.OnRightDown) #added

    def OnRightDown(self, event): #added
        print self.GetSelectedRows() #added

When no rows are selected, this prints the expected empty list. When
any rows are selected, any right click, on any cell, causes a core dump.
No debug or error messages.. just a quick trip back to the shell prompt.

Thanks. This was a bug with how the wrapper was generated that I've just fixed.

The second bug might not be a bug, but it was unexpected behavior. It
deals with selecting rows. In the same grid used above, if I Left-Click
on row 8, and then Shift-Left-Click on row 15, I would expect rows 8
through 15 to be selected. In actuality, rows 1 through 15 are
selected.

Now if I move the cell selection down to row 8 and repeat the above
sequence, then the expected rows (8 through 15) are selected. Is it
normal for multiple row selection to be dependent on where the cell
selection is?

Yep. The shift clicks alwyas take the current cell into account. To select multiple rows without dealing with the current cell you can just drag over the row labels.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!