21#ifndef KICAD_GRID_TEXT_HELPERS_H
22#define KICAD_GRID_TEXT_HELPERS_H
26#include <wx/generic/gridctrl.h>
29class wxStyledTextCtrl;
30class wxStyledTextEvent;
43 void SetSize(
const wxRect& aRect )
override;
45 virtual void SetValidator(
const wxValidator& validator )
override;
46 virtual void StartingKey( wxKeyEvent& event )
override;
62 void Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC& aDC,
const wxRect& aRect,
int aRow,
63 int aCol,
bool isSelected )
override;
65 wxSize
GetBestSize( wxGrid&
grid, wxGridCellAttr& attr, wxDC& dc,
int row,
int col )
override;
75 void SetSize(
const wxRect& aRect )
override;
76 void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
override;
78 wxGridCellEditor*
Clone()
const override
86 void Show(
bool aShow, wxGridCellAttr *aAttr =
nullptr )
override;
87 void BeginEdit(
int aRow,
int aCol, wxGrid* aGrid )
override;
88 bool EndEdit(
int aRow,
int aCol,
const wxGrid*,
const wxString&, wxString* aNewVal )
override;
89 void ApplyEdit(
int aRow,
int aCol, wxGrid* aGrid )
override;
A text renderer that can unescape text for display This is useful where it's desired to keep the unde...
wxSize GetBestSize(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, int row, int col) override
void Draw(wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDC, const wxRect &aRect, int aRow, int aCol, bool isSelected) override
GRID_CELL_ESCAPED_TEXT_RENDERER()
void SetSize(const wxRect &aRect) override
void ApplyEdit(int aRow, int aCol, wxGrid *aGrid) override
void onFocusLoss(wxFocusEvent &aEvent)
void StartingKey(wxKeyEvent &event) override
std::function< void(wxStyledTextEvent &, SCINTILLA_TRICKS *)> m_onCharFn
bool EndEdit(int aRow, int aCol, const wxGrid *, const wxString &, wxString *aNewVal) override
void BeginEdit(int aRow, int aCol, wxGrid *aGrid) override
wxString GetValue() const override
wxGridCellEditor * Clone() const override
void Create(wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
void Show(bool aShow, wxGridCellAttr *aAttr=nullptr) override
wxStyledTextCtrl * stc_ctrl() const
SCINTILLA_TRICKS * m_scintillaTricks
This class works around a bug in wxGrid where the first keystroke doesn't get sent through the valida...
std::unique_ptr< wxValidator > m_validator
void SetSize(const wxRect &aRect) override
virtual void StartingKey(wxKeyEvent &event) override
virtual void SetValidator(const wxValidator &validator) override
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.