void TimeEditor::BeginEdit(int row, int col, wxGrid *grid) { wxGridTableBase *table = grid->GetTable(); table->GetValue(row, col).ToDouble(&mOld); GetTimeCtrl()->SetTimeValue(mOld); GetTimeCtrl()->EnableMenu(); GetTimeCtrl()->SetFocus(); }
bool TimeEditor::EndEdit(int row, int col, wxGrid *grid) { double newtime = GetTimeCtrl()->GetTimeValue(); bool changed = newtime != mOld; if (changed) { grid->GetTable()->SetValue(row, col, wxString::Format(wxT("%g"), newtime)); } return changed; }
bool TimeEditor::EndEdit(int WXUNUSED(row), int WXUNUSED(col), const wxGrid *WXUNUSED(grid), const wxString &WXUNUSED(oldval), wxString *newval) { double newtime = GetTimeCtrl()->GetValue(); bool changed = newtime != mOld; if (changed) { mValueAsString = wxString::Format(wxT("%g"), newtime); *newval = mValueAsString; } return changed; }
wxString TimeEditor::GetValue() const { return wxString::Format(wxT("%g"), GetTimeCtrl()->GetValue()); }
void TimeEditor::Reset() { GetTimeCtrl()->SetValue(mOld); }