Phoenix - grid

Hi,

Doing test with Phoenix and Dabo I see a hard crash without any traceback when "grid.HideCellEditControl()" is called.

Tried to modify the grid demo to recreate the crash, but no success to this point.

Any tip on how I can further debug this?

I also note that the "Clone" method for custon GridCellEditor and GridCellRenderer is never called, is that expected?

Werner

Hi,

Doing test with Phoenix and Dabo I see a hard crash without any traceback when "grid.HideCellEditControl()" is called.

Tried to modify the grid demo to recreate the crash, but no success to this point.

Any tip on how I can further debug this?

Disclaimer: Never tried Phoenix myself. Can be totally wrong.
Just looked at the source for the first time, all new and different.

Anyway, this may be relevant:

I was struggling with changes in wxGridCellEditorEvtHandler::OnKillFocus
while updating from 2.9.4 to 3.0.0:

http://trac.wxwidgets.org/changeset/73876

and that's related to

http://trac.wxwidgets.org/changeset/58969

"crashes which happen if the control receiving this event gets deleted from it"
This was about 5 years ago.

This is the method in wxWidgets as used in 3.0.0:

void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event)
{
     // We must let the native control have this event so in any case don't mark
     // it as handled, otherwise various weird problems can happen (see #11681).
     event.Skip();

     // Don't disable the cell if we're just starting to edit it
     if (m_inSetFocus)
         return;

     // Tell the grid to dismiss the control but don't do it immediately as it
     // could result in the editor being destroyed right now and a crash in the
     // code searching for the next event handler, so post an event asking the
     // grid to do it slightly later instead.

     // FIXME-VC6: Once we drop support for VC6, we should use a simpler
     // m_grid->CallAfter(&wxGrid::DisableCellEditControl) and get
     // rid of wxEVT_GRID_HIDE_EDITOR entirely.
     m_grid->GetEventHandler()->
         AddPendingEvent(wxCommandEvent(wxEVT_GRID_HIDE_EDITOR));
}

My guess: Editor is destroyed twice,
once by the native control destroying itself soon as it receives OnKillFocus,
once by wxEVT_GRID_HIDE_EDITOR.

I also note that the "Clone" method for custon GridCellEditor and GridCellRenderer is never called, is that expected?

Werner

In my custom Editors in 2.9.4 and 3.0.0 this does not get called either.

Michael

ยทยทยท

On Sat, 05 Jul 2014 16:59:22 +0200, Werner <wernerfbd@gmx.ch> wrote: