Ejemplo n.º 1
0
Grid::Grid(wxWindow *parent,
           wxWindowID id,
           const wxPoint& pos,
           const wxSize& size,
           long style,
           const wxString& name)
: wxGrid(parent, id, pos, size, style | wxWANTS_CHARS, name)
{
#if wxUSE_ACCESSIBILITY
   GetGridWindow()->SetAccessible(mAx = safenew GridAx(this));
#endif

   // RegisterDataType takes ownership of renderer and editor

   RegisterDataType(GRID_VALUE_TIME,
                    safenew NumericRenderer{ NumericConverter::TIME },
                    safenew NumericEditor
                      { NumericTextCtrl::TIME, wxT("seconds"), 44100.0 });

   RegisterDataType(GRID_VALUE_FREQUENCY,
                    safenew NumericRenderer{ NumericConverter::FREQUENCY },
                    safenew NumericEditor
                    { NumericTextCtrl::FREQUENCY, wxT("Hz"), 44100.0 });

   RegisterDataType(GRID_VALUE_CHOICE,
                    safenew wxGridCellStringRenderer,
                    safenew ChoiceEditor);
}
Ejemplo n.º 2
0
Grid::Grid(wxWindow *parent,
           wxWindowID id,
           const wxPoint& pos,
           const wxSize& size,
           long style,
           const wxString& name)
    : wxGrid(parent, id, pos, size, style | wxWANTS_CHARS, name)
{
#if wxUSE_ACCESSIBILITY
    mAx = new GridAx(this);
    GetGridWindow()->SetAccessible(mAx);
#endif

    RegisterDataType(GRID_VALUE_TIME,
                     new TimeRenderer,
                     new TimeEditor);

    RegisterDataType(GRID_VALUE_CHOICE,
                     new wxGridCellStringRenderer,
                     new ChoiceEditor);
}