wxGridCellEditor for the NumericTextCtrl.
More...
#include <Grid.h>
|
| NumericEditor (NumericConverter::Type type, const NumericFormatSymbol &format, double rate) |
|
| ~NumericEditor () |
|
void | Create (wxWindow *parent, wxWindowID id, wxEvtHandler *handler) override |
|
bool | IsAcceptedKey (wxKeyEvent &event) override |
|
void | SetSize (const wxRect &rect) override |
|
void | BeginEdit (int row, int col, wxGrid *grid) override |
|
bool | EndEdit (int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval) override |
|
void | ApplyEdit (int row, int col, wxGrid *grid) override |
|
void | Reset () override |
|
NumericFormatSymbol | GetFormat () const |
|
double | GetRate () const |
|
void | SetFormat (const NumericFormatSymbol &format) |
|
void | SetRate (double rate) |
|
wxGridCellEditor * | Clone () const override |
|
wxString | GetValue () const override |
|
NumericTextCtrl * | GetNumericTextControl () const |
|
wxGridCellEditor for the NumericTextCtrl.
Definition at line 37 of file Grid.h.
◆ NumericEditor()
◆ ~NumericEditor()
NumericEditor::~NumericEditor |
( |
| ) |
|
◆ ApplyEdit()
void NumericEditor::ApplyEdit |
( |
int |
row, |
|
|
int |
col, |
|
|
wxGrid * |
grid |
|
) |
| |
|
override |
◆ BeginEdit()
void NumericEditor::BeginEdit |
( |
int |
row, |
|
|
int |
col, |
|
|
wxGrid * |
grid |
|
) |
| |
|
override |
Definition at line 164 of file Grid.cpp.
165{
166 wxGridTableBase *table = grid->GetTable();
167
170
172 control->SetValue(
mOld);
173 control->EnableMenu();
174
175 control->SetFocus();
176}
NumericTextCtrl * GetNumericTextControl() const
References GetNumericTextControl(), mOld, and mOldString.
◆ Clone()
wxGridCellEditor * NumericEditor::Clone |
( |
| ) |
const |
|
override |
◆ Create()
void NumericEditor::Create |
( |
wxWindow * |
parent, |
|
|
wxWindowID |
id, |
|
|
wxEvtHandler * |
handler |
|
) |
| |
|
override |
Definition at line 134 of file Grid.cpp.
135{
136 wxASSERT(parent);
138 parent, wxID_ANY,
147 );
148 m_control = control;
149
150 wxGridCellEditor::Create(parent,
id,
handler);
151}
static const int UndefinedFrequency
AuthorizationHandler handler
Options & AutoPos(bool enable)
References NumericTextCtrl::Options::AutoPos(), NumericConverter::FREQUENCY, cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mFormat, mOld, mRate, mType, safenew, and SelectedRegion::UndefinedFrequency.
◆ EndEdit()
bool NumericEditor::EndEdit |
( |
int |
row, |
|
|
int |
col, |
|
|
const wxGrid * |
grid, |
|
|
const wxString & |
oldval, |
|
|
wxString * |
newval |
|
) |
| |
|
override |
◆ GetFormat()
◆ GetNumericTextControl()
◆ GetRate()
double NumericEditor::GetRate |
( |
| ) |
const |
◆ GetValue()
wxString NumericEditor::GetValue |
( |
| ) |
const |
|
override |
◆ IsAcceptedKey()
bool NumericEditor::IsAcceptedKey |
( |
wxKeyEvent & |
event | ) |
|
|
override |
Definition at line 202 of file Grid.cpp.
203{
204 if (wxGridCellEditor::IsAcceptedKey(event)) {
205 if (event.GetKeyCode() == WXK_RETURN) {
206 return true;
207 }
208 }
209
210 return false;
211}
◆ Reset()
void NumericEditor::Reset |
( |
| ) |
|
|
override |
◆ SetFormat()
◆ SetRate()
void NumericEditor::SetRate |
( |
double |
rate | ) |
|
◆ SetSize()
void NumericEditor::SetSize |
( |
const wxRect & |
rect | ) |
|
|
override |
Definition at line 153 of file Grid.cpp.
154{
155 wxSize
size = m_control->GetSize();
156
157
158 int x = rect.x + ((rect.width / 2) - (
size.x / 2)) + 1;
159 int y = rect.y + ((rect.height / 2) - (
size.y / 2)) + 1;
160
161 m_control->Move(x, y);
162}
References size.
◆ mFormat
◆ mOld
double NumericEditor::mOld |
|
private |
◆ mOldString
wxString NumericEditor::mOldString |
|
private |
◆ mRate
double NumericEditor::mRate |
|
private |
◆ mType
◆ mValueAsString
wxString NumericEditor::mValueAsString |
|
private |
The documentation for this class was generated from the following files: