Пример #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();
}
Пример #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;
}
Пример #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;
}
Пример #4
0
wxString TimeEditor::GetValue() const
{
    return wxString::Format(wxT("%g"), GetTimeCtrl()->GetValue());
}
Пример #5
0
void TimeEditor::Reset()
{
    GetTimeCtrl()->SetValue(mOld);
}