wxwindows/preferences_widgets.cpp: ModuleCatList widget now add modules in

the order of selection, patch by  Christophe Mutricy < xtophe -at-
nxtelevision dott com >
parent a1e1abb4
......@@ -445,14 +445,35 @@ wxString ModuleListCatConfigControl::GetPszValue()
void ModuleListCatConfigControl::OnUpdate( wxCommandEvent &event )
{
wxString newtext = wxU("");
bool b_waschecked = false;
wxString newtext = text->GetValue();
for( unsigned int i = 0 ; i< pp_checkboxes.size() ; i++ )
{
if( pp_checkboxes[i]->checkbox->IsChecked() )
b_waschecked = newtext.Find( wxU(pp_checkboxes[i]->psz_module)) != -1 ;
/* For some reasons, ^^ doesn't compile :( */
if( (pp_checkboxes[i]->checkbox->IsChecked() && ! b_waschecked )||
(! pp_checkboxes[i]->checkbox->IsChecked() && b_waschecked) )
{
if( b_waschecked )
{
/* Maybe not the clest solution */
if( ! newtext.Replace(wxU(",")
+wxU(pp_checkboxes[i]->psz_module),
wxU("")))
{
if( ! newtext.Replace(wxU(pp_checkboxes[i]->psz_module)
+ wxU(","),wxU("")))
{
newtext.Replace(wxU(pp_checkboxes[i]->psz_module),wxU(""));
}
}
}
else
{
if( newtext.Len() == 0 )
{
newtext = newtext + wxU( pp_checkboxes[i]->psz_module );
newtext = wxU(pp_checkboxes[i]->psz_module);
}
else
{
......@@ -461,6 +482,7 @@ void ModuleListCatConfigControl::OnUpdate( wxCommandEvent &event )
}
}
}
}
text->SetValue( newtext );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment