]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx
#2507 creaMaracasVisu Feature New Normal - creaPanelButtonContainerListPanel
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaPanelButtonContainer / buttonContainerSettings.cxx
index e6c991b182b48972a1536be652a43b746b68b073..a0d1ff43e919da508fda06fae53fae68b48600dc 100644 (file)
@@ -226,14 +226,17 @@ namespace creaPanelButtonContainer
        
        // ----------------------------------------------------------------------------------
        void
-       ButtonContainerSettings::AddButtons( BCStructVectorType infoList )
+       ButtonContainerSettings::AddButtons( BCStructVectorType infoList, int type )
        {
                try
                {
                        for( BCStructVectorType::iterator it = infoList.begin( ); it
                            != infoList.end( ); ++it )
                        {
-                               this->AddButton( *it );
+                               if( type == 0 )
+                                       this->AddButton( *it );
+                               else if( type == 1 )
+                                       this->AddItems(*it);
                        }//rof
                }//yrt
                catch ( std::exception& e )
@@ -244,6 +247,39 @@ namespace creaPanelButtonContainer
                }//hctac
        }
 
+       void
+       ButtonContainerSettings::AddItems(BCPSettingsStruct* info)
+       {
+               try
+               {
+                       //builds the button information
+                       //I don't know the try catch doesn't work!!
+                       if ( info->panel == NULL )
+                       {
+                               std::cerr << "ButtonContainerSettings::AddButton"
+                                   << "exception: NULL Pointer in panel " << std::endl;
+                               exit( 1 );
+                       }
+                       info->panel->Show( false );
+                       std::string mapKey = info->groupName + ":" + info->buttonName;
+                       m_itemsMap[mapKey] = info->panel;
+
+               }//yrt
+               catch ( const std::exception& e )
+               {
+                       std::cerr
+                       << "ButtonContainerSettings::AddButton( BCPSettingsStruct* info )"
+                       << "exception: " << e.what( ) << std::endl;
+                       exit( 1 );
+               }//hctac
+       }
+
+       ButtonContainerSettings::ItemsMap
+       ButtonContainerSettings::GetItemsMap()
+       {
+               return m_itemsMap;
+       }
+
 
 // ----------------------------------------------------------------------------------
 }//ecapseman