+ // ----------------------------------------------------------------------------------
+ void
+ ContainerSettings::AddButton( BCSettingsStruct* info )
+ {
+ ButtonPair* pair = new ButtonPair(
+ new ButtonInfo( info->buttonName, info->icon ),
+ new ButtonAction( info->buttonDescription, info->eventFunction ) );
+ try
+ {
+ for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+ != this->m_GroupNameList.end( ); ++it )
+ {
+ if ( ( *it ).compare( info->groupName ) == 0 )
+ {
+ this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+ return;
+ }//fi
+ }//rof
+ this->m_GroupNameList.push_back( info->groupName );
+ this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "void ContainerSettings::AddButton( BCSettingsStruct* info ) "
+ << "exception: " << e.what( ) << std::endl;
+ }//hctac
+ }
+ // ----------------------------------------------------------------------------------
+ void
+ ContainerSettings::AddButtons( BCStructVectorType infoList )
+ {
+ try
+ {
+ for( BCStructVectorType::iterator it = infoList.begin( ); it
+ != infoList.end( ); ++it )
+ {
+ this->AddButton( *it );
+ }//rof
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
+ << "exception: " << e.what( ) << std::endl;
+ }//hctac
+ }
+
+ void
+ ContainerSettings::AddItems(BCStructVectorType infoList)
+ {
+ try
+ {
+ for( BCStructVectorType::iterator it = infoList.begin( ); it
+ != infoList.end( ); ++it )
+ {
+ this->AddItem(*it);
+ }//rof
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
+ << "exception: " << e.what( ) << std::endl;
+ }//hctac
+ }
+ //-----------------------------------------------------------------------------------
+ void
+ ContainerSettings::AddItem(const StringType & groupName)
+ {
+
+ //Es importante hacer un test, recibiendo como parametro la info de un item.
+
+
+ wxListItem* item;
+ item->SetId(1);
+ item->SetText(wxT("monica"));
+
+ creaButtonContainer::view::ListWx l;
+ l.setItems(item);
+
+
+ try
+ {
+ for( KeyMapList::iterator it = this->m_GroupNameList.begin( );
+ it!= this->m_GroupNameList.end( ); ++it )
+ {
+ if(( *it ).compare( groupName ) == 0 )
+ {
+ this->m_ListGroupContainer[ groupName ].push_back(l);
+ return;
+ }
+ }
+ this->m_GroupNameList.push_back( groupName );
+ this->m_ListGroupContainer[ groupName ].push_back( l );
+ }
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "ContainerSettings::AddButton( const std::string & groupName,"
+ << "const std::string buttonName, const std::string iconpath,"
+ << "const std::string buttonDescription, FunctionEventType event ) exception: "
+ << e.what( ) << std::endl;
+ }//hctac
+ }
+
+
+ void
+ ContainerSettings::AddItem( BCSettingsStruct* info )
+ {
+ wxListItem* item;
+
+ wxString myString((info->buttonName).c_str(),wxConvUTF8);
+ item->SetText(myString);
+
+ creaButtonContainer::view::ListWx l;
+ l.setItems(item);
+
+ try
+ {
+ for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+ != this->m_GroupNameList.end( ); ++it )
+ {
+ if ( ( *it ).compare( info->groupName ) == 0 )
+ {
+ this->m_ListGroupContainer[ info->groupName ].push_back( l );
+ return;
+ }//fi
+ }//rof
+ this->m_GroupNameList.push_back( info->groupName );
+ this->m_ListGroupContainer[ info->groupName ].push_back( l );
+ }
+ catch (const std::exception& e)
+ {
+ std::cerr
+ << "void ContainerSettings::AddItem( BCSettingsStruct* info ) "
+ << "exception: " << e.what( ) << std::endl;
+ }
+
+ }
+
+
+