Opened 5 years ago

Closed 5 years ago

#424 closed defect (fixed)

Grid Display of Batch Results broken

Reported by: butler Owned by:
Priority: major Milestone: SasView 3.1.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

Between release 3.1 alpha (using wx 2.8 just before code camp) and the current near release version the grid editing has gone flaky.
1) One can no longer edit ANY cell (so no adding a column of times to plot agains results and no pasting of results).

2) copy and right click context menu (and menu items under edit which duplicate some of context menu) mostly seem to work but can get into a state where they no longer do.

Module that appears to be doing the work is data_processor.py in guiframe. Since alpha and now only 2 edits were made

1- Jeff Krzywon removing all sans to sas nomenclature and
2- Mathieu Doucet pyling cleanup.

Neither likely to caused problem so may be some new behavior from wx 3?

Change History (4)

comment:1 Changed 5 years ago by smk78

Re 1:

So it is not entirely true that you cannot edit any cell, you can. Rather the issue is that whatever you type gets erased.

Running from Eclipse I note that when you click in a column header cell the following error is thrown

  !TypeError: !PaintBackground() takes exactly 3 arguments (4 given)

and when you click in another cell this error is thrown

  !TypeError: !EndEdit() takes exactly 4 arguments (5 given)

So it looks like something is not being passed correctly somewhere?

Last edited 5 years ago by butler (previous) (diff)

comment:2 Changed 5 years ago by butler

Further inspection shows that EndEdit(self, row, col, grid) and PaintBackground(self, rect, attr) are methods of wx.sheet.CCellEditor They are not called by SasView. When a character is typed in a cell the sheet editor is invoked. At this point, it seems that wx.grid may have an internal bug in wx 3.0, but but could not find much in terms of stackoverflow or other sites discussing it. It could still be that something in data_processor is unwittingly overriding something in the sheet. This would presumably have to be a new function in wx 3.0 since the SasView alpha using wx 2.8 works fine.

comment:3 Changed 5 years ago by butler

Further investigation indicates that PaintBackground is a method in both the Grid module and the sheet module that inherits from grit .. they do not seem to have the same number of parameter — and temporarily adding an extra one to sheet allows things to progress but the order I chose was somehow wrong.

Moreover, starting a completely new project with a simple spreadsheet example using CSheet from an online tutorial yields exactly the same errors! Either there is some undocumented new extra setup that needs to take place in using sheet or there is a bug in wx3.

comment:4 Changed 5 years ago by mathieu

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

The problem was with the cell editor class used by CSheet that didn't accept the right number of arguments from its caller.

Note: See TracTickets for help on using tickets.