160 wxDialog( aParent, wxID_ANY,
_(
"Edit Advanced Configuration" ), wxDefaultPosition, wxDefaultSize,
161 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
165 m_filterCtrl =
new wxSearchCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize );
170 m_grid->CreateGrid( 0, 3 );
171 m_grid->SetColSize( 0, 100 );
172 m_grid->SetColSize( 1, 80 );
173 m_grid->SetColLabelValue( 0,
_(
"Key" ) );
174 m_grid->SetColLabelValue( 1,
_(
"Value" ) );
175 m_grid->SetColLabelValue( 2,
_(
"Extant" ) );
177 m_grid->SetRowLabelSize( 0 );
178 m_grid->SetupColumnAutosizer( 1 );
180 wxStdDialogButtonSizer* buttonSizer =
new wxStdDialogButtonSizer();
181 wxButton* okButton =
new wxButton(
this, wxID_OK,
_(
"OK" ) );
182 okButton->SetDefault();
183 buttonSizer->AddButton( okButton );
184 buttonSizer->Realize();
186 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
187 sizer->Add(
m_filterCtrl, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
188 sizer->Add(
m_grid, 1, wxEXPAND | wxALL, 5 );
189 sizer->Add( buttonSizer, 0, wxEXPAND | wxALL, 5 );
192 wxDisplay display( wxDisplay::GetFromWindow(
this ) );
193 wxRect displayRect = display.GetClientArea();
195 SetMinSize( wxSize( 500, 300 ) );
196 SetMaxSize( wxSize( displayRect.GetWidth() - 100, displayRect.GetHeight() - 100 ) );
197 SetSizeHints( wxSize( 700, 500 ) );
251 int rows =
m_grid->GetNumberRows();
253 for(
int row = 0; row < rows; ++row )
255 wxString key =
m_grid->GetCellValue( row, 0 );
256 wxString val =
m_grid->GetCellValue( row, 1 );
257 wxString ext =
m_grid->GetCellValue( row, 2 );
259 if( key.IsEmpty() || ext != wxS(
"1" ) )
264 if( entry->m_Ident == key )
344 bool ext =
m_grid->GetCellValue( aRow, 2 ) == wxS(
"1" );
345 wxFont font =
m_grid->GetCellFont( aRow, 0 );
346 font.SetWeight( ext ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL );
347 m_grid->SetCellFont( aRow, 0, font );
348 m_grid->SetCellFont( aRow, 1, font );
383 int row = aEvent.GetRow();
384 int col = aEvent.GetCol();
392 wxString key =
m_grid->GetCellValue( row, 0 );
398 wxString currentValue =
m_grid->GetCellValue( row, 1 );
399 bool isTrueValue = currentValue.CmpNoCase( wxS(
"true" ) ) == 0
400 || currentValue.CmpNoCase( wxS(
"yes" ) ) == 0
401 || currentValue.CmpNoCase( wxS(
"1" ) ) == 0;
403 wxString newValue = isTrueValue ? wxS(
"false" ) : wxS(
"true" );
404 m_grid->SetCellValue( row, 1, newValue );
405 m_grid->SetCellValue( row, 2, wxS(
"1" ) );
413 cfg.value = newValue;
414 cfg.extant = wxS(
"1" );