202{
204 return nullptr;
205
206 DataViewBitmapText data;
207 data << value;
208
210
211 wxPoint position = labelRect.GetPosition();
213 const int bmp_width = data.
GetBitmap().GetWidth();
214 position.x += bmp_width;
215 labelRect.SetWidth(labelRect.GetWidth() - bmp_width);
216 }
217
218#ifdef __WXMSW__
219
220 if (auto children = parent->GetChildren(); children.GetCount() > 0)
221 for (auto child : children)
222 if (dynamic_cast<wxTextCtrl*>(child)) {
223 parent->RemoveChild(child);
224 child->Destroy();
225 break;
226 }
227#endif
228
229 wxTextCtrl* text_editor =
new wxTextCtrl(parent, wxID_ANY, data.
GetText(),
230 position, labelRect.GetSize(), wxTE_PROCESS_ENTER);
231 text_editor->SetInsertionPointEnd();
232 text_editor->SelectAll();
233 text_editor->SetBackgroundColour(parent->GetBackgroundColour());
234 text_editor->SetForegroundColour(parent->GetForegroundColour());
235
236 return text_editor;
237}
bool m_was_unusable_symbol
Definition ExtraRenderers.hpp:132
std::function< bool()> can_create_editor_ctrl
Definition ExtraRenderers.hpp:134
const wxBitmap & GetBitmap() const
Definition ExtraRenderers.hpp:52
wxString GetText() const
Definition ExtraRenderers.hpp:50