wxGridCellEditor for the NumericTextCtrl.
More...
#include <Grid.h>
|
| NumericEditor (const FormatterContext &context, NumericConverterType type, const NumericFormatID &format) |
|
| ~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 |
|
NumericFormatID | GetFormat () const |
|
void | SetFormat (const NumericFormatID &format) |
|
wxGridCellEditor * | Clone () const override |
|
wxString | GetValue () const override |
|
NumericTextCtrl * | GetNumericTextControl () const |
|
wxGridCellEditor for the NumericTextCtrl.
Definition at line 39 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 166 of file Grid.cpp.
167{
168 wxGridTableBase *table = grid->GetTable();
169
172
174 control->SetValue(
mOld);
175 control->EnableMenu();
176
177 control->SetFocus();
178}
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 137 of file Grid.cpp.
138{
139 wxASSERT(parent);
141 parent, wxID_ANY,
149 );
150 m_control = control;
151
152 wxGridCellEditor::Create(parent,
id,
handler);
153}
const NumericConverterType & NumericConverterType_FREQUENCY()
static const int UndefinedFrequency
AuthorizationHandler handler
Options & AutoPos(bool enable)
References NumericTextCtrl::Options::AutoPos(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, mContext, mFormat, mOld, mType, NumericConverterType_FREQUENCY(), safenew, and SelectedRegion::UndefinedFrequency.
◆ EndEdit()
bool NumericEditor::EndEdit |
( |
int |
row, |
|
|
int |
col, |
|
|
const wxGrid * |
grid, |
|
|
const wxString & |
oldval, |
|
|
wxString * |
newval |
|
) |
| |
|
override |
◆ GetFormat()
◆ GetNumericTextControl()
◆ GetValue()
wxString NumericEditor::GetValue |
( |
| ) |
const |
|
override |
◆ IsAcceptedKey()
bool NumericEditor::IsAcceptedKey |
( |
wxKeyEvent & |
event | ) |
|
|
override |
Definition at line 204 of file Grid.cpp.
205{
206 if (wxGridCellEditor::IsAcceptedKey(event)) {
207 if (event.GetKeyCode() == WXK_RETURN) {
208 return true;
209 }
210 }
211
212 return false;
213}
◆ Reset()
void NumericEditor::Reset |
( |
| ) |
|
|
override |
◆ SetFormat()
◆ SetSize()
void NumericEditor::SetSize |
( |
const wxRect & |
rect | ) |
|
|
override |
Definition at line 155 of file Grid.cpp.
156{
157 wxSize
size = m_control->GetSize();
158
159
160 int x = rect.x + ((rect.width / 2) - (
size.x / 2)) + 1;
161 int y = rect.y + ((rect.height / 2) - (
size.y / 2)) + 1;
162
163 m_control->Move(x, y);
164}
References size.
◆ mContext
◆ mFormat
◆ mOld
double NumericEditor::mOld |
|
private |
◆ mOldString
wxString NumericEditor::mOldString |
|
private |
◆ mType
◆ mValueAsString
wxString NumericEditor::mValueAsString |
|
private |
The documentation for this class was generated from the following files: