// that first key if desired.
virtual void StartingKey(wxKeyEvent& event);
+ // if the editor is enabled by clicking on the cell, this method will be
+ // called
+ virtual void StartingClick();
+
// Some types of controls on some platforms may need some help
// with the Return key.
virtual void HandleReturn(wxKeyEvent& event);
virtual bool EndEdit(int row, int col, bool saveValue, wxGrid* grid);
virtual void Reset();
- virtual void StartingKey(wxKeyEvent& event);
+ virtual void StartingClick();
protected:
wxCheckBox *CBox() const { return (wxCheckBox *)m_control; }
void wxGridCellEditor::StartingKey(wxKeyEvent& event)
{
- wxASSERT_MSG(m_control,
- wxT("The wxGridCellEditor must be Created first!"));
+ event.Skip();
+}
- // pass the event to the control
- m_control->GetEventHandler()->ProcessEvent(event);
+void wxGridCellEditor::StartingClick()
+{
}
// ----------------------------------------------------------------------------
CBox()->SetValue(m_startValue);
}
-void wxGridCellBoolEditor::StartingKey(wxKeyEvent& event)
+void wxGridCellBoolEditor::StartingClick()
{
- event.Skip();
+ CBox()->SetValue(!CBox()->GetValue());
}
// ----------------------------------------------------------------------------
CanEnableCellControl())
{
EnableCellEditControl();
+
+ wxGridCellAttr* attr = GetCellAttr(m_currentCellCoords);
+ attr->GetEditor()->StartingClick();
+ attr->DecRef();
+
m_waitForSlowClick = FALSE;
}
else