44 m_project( aProject ),
45 m_errorRow( -1 ), m_errorCol( -1 ),
46 m_gridWidthsDirty( true )
61 m_TextVars->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
75 m_TextVars->Disconnect( wxEVT_GRID_CELL_CHANGING,
85 for(
const auto& var : variables )
103 nameCellAttr->SetEditor( nameTextEditor );
104 nameCellAttr->DecRef();
115 for(
int row = 0; row <
m_TextVars->GetNumberRows(); ++row )
121 m_errorMsg =
_(
"Variable name cannot be empty." );
130 for(
int row = 0; row <
m_TextVars->GetNumberRows(); ++row )
134 variables[
name ] = value;
143 int row =
event.GetRow();
144 int col =
event.GetCol();
145 wxString
text =
event.GetString();
149 m_errorMsg =
_(
"Variable name cannot be empty." );
177 if( curRow < 0 || m_TextVars->GetNumberRows() <= curRow )
200 int width =
m_TextVars->GetClientRect().GetWidth();
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
This class works around a bug in wxGrid where the first keystroke doesn't get sent through the valida...
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Class PANEL_TEXT_VARIABLES_BASE.
STD_BITMAP_BUTTON * m_btnAddTextVar
STD_BITMAP_BUTTON * m_btnDeleteTextVar
bool TransferDataToWindow() override
void OnGridCellChanging(wxGridEvent &event)
~PANEL_TEXT_VARIABLES() override
void OnUpdateUI(wxUpdateUIEvent &event) override
void OnRemoveTextVar(wxCommandEvent &event) override
bool TransferDataFromWindow() override
void OnAddTextVar(wxCommandEvent &event) override
void OnGridSize(wxSizeEvent &event) override
void AppendTextVar(const wxString &aName, const wxString &aValue)
void OnGridCellChange(wxGridEvent &event) override
wxTextValidator m_nameValidator
PANEL_TEXT_VARIABLES(wxWindow *aParent, PROJECT *aProject)
Container for project specific data.
virtual std::map< wxString, wxString > & GetTextVars() const
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
Custom text control validator definitions.