Esempio n. 1
0
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();
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
wxString TimeEditor::GetValue() const
{
    return wxString::Format(wxT("%g"), GetTimeCtrl()->GetValue());
}
Esempio n. 5
0
void TimeEditor::Reset()
{
    GetTimeCtrl()->SetValue(mOld);
}