44 m_project( aProject ),
45 m_lastCheckedTicker( 0 ),
46 m_errorRow( -1 ), m_errorCol( -1 ),
47 m_gridWidthsDirty( true )
62 m_TextVars->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
70 [
this]( wxIdleEvent& aEvent )
76 wxWindow* dialog = wxGetTopLevelParent( this );
77 wxWindow* topLevelFocus = wxGetTopLevelParent( wxWindow::FindFocus() );
79 if( topLevelFocus == dialog && m_lastLoaded != m_project->GetTextVars() )
91 m_TextVars->Disconnect( wxEVT_GRID_CELL_CHANGING,
103 if(
IsOK( m_parent,
_(
"The text variables have been changed outside the Setup dialog.\n"
104 "Do you wish to reload them?" ) ) )
139 nameCellAttr->SetEditor( nameTextEditor );
140 nameCellAttr->DecRef();
151 for(
int row = 0; row <
m_TextVars->GetNumberRows(); ++row )
157 m_errorMsg =
_(
"Variable name cannot be empty." );
166 for(
int row = 0; row <
m_TextVars->GetNumberRows(); ++row )
170 variables[
name ] = value;
179 int row =
event.GetRow();
180 int col =
event.GetCol();
181 wxString
text =
event.GetString();
185 m_errorMsg =
_(
"Variable name cannot be empty." );
213 if( curRow < 0 || m_TextVars->GetNumberRows() <= curRow )
236 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
std::map< wxString, wxString > m_lastLoaded
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.
bool GetTextVarsTicker() const
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.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
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.