158 wxDialog( aParent, wxID_ANY,
_(
"Edit Advanced Configuration" ), wxDefaultPosition, wxDefaultSize,
159 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
164 m_grid->CreateGrid( 0, 3 );
165 m_grid->SetColSize( 0, 100 );
166 m_grid->SetColSize( 1, 80 );
167 m_grid->SetColLabelValue( 0,
_(
"Key" ) );
168 m_grid->SetColLabelValue( 1,
_(
"Value" ) );
169 m_grid->SetColLabelValue( 2,
_(
"Extant" ) );
171 m_grid->SetRowLabelSize( 0 );
172 m_grid->SetupColumnAutosizer( 1 );
174 wxStdDialogButtonSizer* buttonSizer =
new wxStdDialogButtonSizer();
175 wxButton* okButton =
new wxButton(
this, wxID_OK,
_(
"OK" ) );
176 okButton->SetDefault();
177 buttonSizer->AddButton( okButton );
178 buttonSizer->Realize();
180 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
181 sizer->Add(
m_grid, 1, wxEXPAND | wxALL, 5 );
182 sizer->Add( buttonSizer, 0, wxEXPAND | wxALL, 5 );
185 wxDisplay display( wxDisplay::GetFromWindow(
this ) );
186 wxRect displayRect = display.GetClientArea();
188 SetMinSize( wxSize( 500, 300 ) );
189 SetMaxSize( wxSize( displayRect.GetWidth() - 100, displayRect.GetHeight() - 100 ) );
190 SetSizeHints( wxSize( 700, 500 ) );
194 Bind( wxEVT_SIZE, &DIALOG_EDIT_CFG::OnSize,
this );
234 int rows =
m_grid->GetNumberRows();
236 for(
int row = 0; row < rows; ++row )
238 wxString key =
m_grid->GetCellValue( row, 0 );
239 wxString val =
m_grid->GetCellValue( row, 1 );
240 wxString ext =
m_grid->GetCellValue( row, 2 );
242 if( key.IsEmpty() || ext != wxS(
"1" ) )
247 if( entry->m_Ident == key )
262 int row = aEvent.GetRow();
263 int col = aEvent.GetCol();
265 if( col == 0 || col == 1 )
267 m_grid->SetCellValue( row, 2, wxS(
"1" ) );
273 int lastRow =
m_grid->GetNumberRows() - 1;
275 if( !
m_grid->GetCellValue( lastRow, 0 ).IsEmpty() || !
m_grid->GetCellValue( lastRow, 1 ).IsEmpty() )
278 m_grid->SetCellValue(
m_grid->GetNumberRows() - 1, 2, wxS(
"0" ) );
324 bool ext =
m_grid->GetCellValue( aRow, 2 ) == wxS(
"1" );
325 wxFont font =
m_grid->GetCellFont( aRow, 0 );
326 font.SetWeight( ext ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL );
327 m_grid->SetCellFont( aRow, 0, font );
328 m_grid->SetCellFont( aRow, 1, font );