]> Creatis software - creaMaracasVisu.git/commitdiff
2413 creaMaracasVisu Feature New Normal New blackBox BitmapButtonIcon and fix the...
authorctorres <carlos.torres@creatis.insa-lyon.fr>
Fri, 27 Jun 2014 12:36:51 +0000 (14:36 +0200)
committerctorres <carlos.torres@creatis.insa-lyon.fr>
Fri, 27 Jun 2014 12:36:51 +0000 (14:36 +0200)
21 files changed:
bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.h [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx
bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx
bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h
data/Icons/five.xpm [new file with mode: 0644]
data/Icons/four.xpm [new file with mode: 0644]
data/Icons/one.xpm [new file with mode: 0644]
data/Icons/three.xpm [new file with mode: 0644]
data/Icons/two.xpm [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/system.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h

diff --git a/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.cxx b/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.cxx
new file mode 100644 (file)
index 0000000..b02d67c
--- /dev/null
@@ -0,0 +1,54 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaMaracasVisuBitmapButtonIcon.h"
+#include "bbcreaMaracasVisuPackage.h"
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,BitmapButtonIcon)
+BBTK_BLACK_BOX_IMPLEMENTATION(BitmapButtonIcon,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void BitmapButtonIcon::Process()
+{
+               int index = bbGetInputIndex();
+               
+               wxBitmap icon1(one_xpm);
+               wxBitmap icon2(two_xpm);
+               wxBitmap icon3(three_xpm);
+               wxBitmap icon4(four_xpm);
+               wxBitmap icon5(five_xpm);
+               
+               if(index==1){ bbSetOutputIcon( icon1 );}
+               if(index==2){ bbSetOutputIcon( icon2 );}
+               if(index==3){ bbSetOutputIcon( icon3 );}
+               if(index==4){ bbSetOutputIcon( icon4 );}
+               if(index==5){ bbSetOutputIcon( icon5 );}
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void BitmapButtonIcon::bbUserSetDefaultValues()
+{
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void BitmapButtonIcon::bbUserInitializeProcessing()
+{
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void BitmapButtonIcon::bbUserFinalizeProcessing()
+{
+
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
diff --git a/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.h b/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.h
new file mode 100644 (file)
index 0000000..dbe4950
--- /dev/null
@@ -0,0 +1,52 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaMaracasVisuBitmapButtonIcon_h_INCLUDED__
+#define __bbcreaMaracasVisuBitmapButtonIcon_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+#include "wx/bitmap.h"
+
+#include "one.xpm"
+#include "two.xpm"
+#include "three.xpm"
+#include "four.xpm"
+#include "five.xpm"
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT BitmapButtonIcon
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(BitmapButtonIcon,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Index,int);
+  BBTK_DECLARE_OUTPUT(Icon,wxBitmap);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(BitmapButtonIcon,bbtk::AtomicBlackBox);
+BBTK_NAME("BitmapButtonIcon");
+BBTK_AUTHOR("Carlos torres");
+BBTK_DESCRIPTION("No Description.");
+BBTK_CATEGORY("empty");
+BBTK_INPUT(BitmapButtonIcon,Index,"Index btw 1-5",int,"");
+BBTK_OUTPUT(BitmapButtonIcon,Icon,"Bitmap Icon",wxBitmap,"");
+BBTK_END_DESCRIBE_BLACK_BOX(BitmapButtonIcon);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuBitmapButtonIcon_h_INCLUDED__
+
index 36954640326f102df186a2fffd347cccd12a383b..fc31b69bf7703e43bae1f0fd524e81668ce669a9 100644 (file)
@@ -43,7 +43,6 @@ PanelButtonContainer::Process( )
        ButtonContainerSettings* settings = new ButtonContainerSettings( );
        printf("EED PanelButtonContainer::Process %d\n", bbGetInputIn( ).size() );
        settings->AddButtons( bbGetInputIn( ) );
-       
        PBContainer* panel = new PBContainer( myPanel, settings );
        wxBoxSizer* sizer  = new wxBoxSizer( wxHORIZONTAL );
        sizer->Add( panel, 1, wxEXPAND, 0 );
index ecc5b70a816604bd679860414c35cd465d10d8e8..3e8df9fe0a6dfc687838d0548fd4c44c9fb5a8b9 100644 (file)
@@ -44,7 +44,8 @@ PanelButtonContainerSettings::Process( )
        this->m_BSettings->groupName                    = bbGetInputGroupName( );
        this->m_BSettings->buttonName                   = bbGetInputButtonName( );
        this->m_BSettings->buttonDescription            = bbGetInputButtonDescription( );
-       this->m_BSettings->iconpath                     = bbGetInputIconpath( );
+       //this->m_BSettings->iconpath                   = bbGetInputIconpath( );
+       this->m_BSettings->icon                 = bbGetInputIcon( );
        this->m_BSettings->panel                        = this->myPanel;
        this->m_BCSettingsVector                        = bbGetInputIn();
        this->m_BCSettingsVector.push_back(  this->m_BSettings );
index 69ac1f455b4b4ab12fd8128733a1303e0a879fdc..cb449d55b99affe120cd861743c991c80ac383f1 100644 (file)
@@ -31,6 +31,7 @@
 #define __bbcreaMaracasVisuPanelButtonContainerSettings_h_INCLUDED__
 #include "bbcreaMaracasVisu_EXPORT.h"
 #include "bbtkWxBlackBox.h"
+#include "wx/bitmap.h"
 
 #include <string>
 #include <vector>
@@ -53,6 +54,7 @@ namespace bbcreaMaracasVisu
                        BBTK_DECLARE_INPUT(GroupName,std::string);
                        BBTK_DECLARE_INPUT(ButtonName,std::string);
                        BBTK_DECLARE_INPUT(Iconpath,std::string);
+                       BBTK_DECLARE_INPUT(Icon,wxBitmap);
                        BBTK_DECLARE_INPUT(ButtonDescription,std::string);
                        BBTK_DECLARE_INPUT(Widget,wxWindow*);
                        BBTK_DECLARE_OUTPUT(Out,BCStructVectorType);
@@ -82,6 +84,7 @@ namespace bbcreaMaracasVisu
        BBTK_INPUT(PanelButtonContainerSettings,GroupName,"Group Name",std::string,"");
        BBTK_INPUT(PanelButtonContainerSettings,ButtonName,"Button Name",std::string,"");
        BBTK_INPUT(PanelButtonContainerSettings,Iconpath,"The path of the Icon",std::string,"");
+       BBTK_INPUT(PanelButtonContainerSettings,Icon,"The Icon",wxBitmap,"");
        BBTK_INPUT(PanelButtonContainerSettings,ButtonDescription,"Full description of the button",std::string,"");
        BBTK_INPUT(PanelButtonContainerSettings,Widget,"Panel associated to the button",wxWindow*,"");
        BBTK_OUTPUT(PanelButtonContainerSettings,Out,"ButtonContainerSettings List",BCStructVectorType,"");
diff --git a/data/Icons/five.xpm b/data/Icons/five.xpm
new file mode 100644 (file)
index 0000000..f79d4b6
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static char * five_xpm[] = {
+"17 17 2 1",
+"      c None",
+".     c #000000",
+"   ............  ",
+"   ...........   ",
+"   ..........    ",
+"   ...           ",
+"   ...           ",
+"   ...    ..     ",
+"   ...........   ",
+"   ............  ",
+"    ...........  ",
+"    ...    ....  ",
+"            ...  ",
+"            ...  ",
+"            ...  ",
+"   ...     ....  ",
+"   ...........   ",
+"    ..........   ",
+"     ........    "};
diff --git a/data/Icons/four.xpm b/data/Icons/four.xpm
new file mode 100644 (file)
index 0000000..2926516
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static char * four_xpm[] = {
+"17 17 2 1",
+"      c None",
+".     c #000000",
+"    ..           ",
+"   ...           ",
+"   ...           ",
+"   ....   ..     ",
+"   ....   ..     ",
+"   ....   ..     ",
+"   ....  ....    ",
+"    ..........   ",
+"    ..........   ",
+"    .........    ",
+"         ...     ",
+"          ..     ",
+"          ..     ",
+"          ..     ",
+"          ..     ",
+"          ..     ",
+"                 "};
diff --git a/data/Icons/one.xpm b/data/Icons/one.xpm
new file mode 100644 (file)
index 0000000..74ba208
--- /dev/null
@@ -0,0 +1,25 @@
+/* XPM */
+static char * one_xpm[] = {
+"17 17 5 1",
+"      c None",
+".     c #000000",
+"+     c #010201",
+"@     c #010100",
+"#     c #020201",
+"        ...      ",
+"       ....      ",
+"      .....+     ",
+"     .......     ",
+"    ........     ",
+"   .........     ",
+"  ..... ...@     ",
+"  ....  ...#     ",
+" ....   ....     ",
+"  ..    ....     ",
+"        ....     ",
+"        ....     ",
+"        ....     ",
+"        ....     ",
+"        ....     ",
+"         ...     ",
+"                 "};
diff --git a/data/Icons/three.xpm b/data/Icons/three.xpm
new file mode 100644 (file)
index 0000000..e5a3a99
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static char * three_xpm[] = {
+"17 17 2 1",
+"      c None",
+".     c #000000",
+"       ....      ",
+"     .......     ",
+"    .........    ",
+"   ...........   ",
+"  ...... .....   ",
+"  ...     ....   ",
+"  ..       ...   ",
+"          ...    ",
+"        .....    ",
+"       ......    ",
+"       ......    ",
+"          ....   ",
+"           ...   ",
+"           ....  ",
+" ..        ....  ",
+" ..............  ",
+" ............    "};
diff --git a/data/Icons/two.xpm b/data/Icons/two.xpm
new file mode 100644 (file)
index 0000000..124fc4e
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static char * two_xpm[] = {
+"17 17 2 1",
+"      c None",
+".     c #000000",
+"                 ",
+"     .......     ",
+"   ..........    ",
+"  ............   ",
+" .....    ....   ",
+"....       ...   ",
+"...        ...   ",
+"...       ...    ",
+"         ....    ",
+"        ....     ",
+"       .....     ",
+"      .....      ",
+"    .....        ",
+"   .....         ",
+"   ............. ",
+"   ............. ",
+"   ............. "};
index dfc9956e209181c807deef736449a3914330e07d..759faa3af8f63be74b8623453e4d2a95ea9dfd3e 100644 (file)
@@ -69,6 +69,7 @@ namespace creaButtonContainer
                        return ( groupView );
                }
                
+               
                // ----------------------------------------------------------------------------------
                ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
                {
index f0d96f9ef63a05688d22c90b5191b77b067de220..a349df61eda207c1a14c899337532e63055c8c86 100644 (file)
@@ -98,6 +98,7 @@ namespace creaButtonContainer
                                 */
                                virtual
                                ~ButtonGroupFactory( );
+                               
                                /*! @fn ButtonGroupContainer ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings );
                                 * @brief This method creates the ButtonGroupContainer.
                                 * @param parent the wxWindow* parent to be attached.
@@ -109,6 +110,8 @@ namespace creaButtonContainer
                                CreateButtonGroupContainer( wxWindow* parent,
                                    ButtonGroupModel* settings );
                        private:
+                               
+
                                /*! @fn ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel );
                                 * @brief  This method creates a wx button container for a group.
                                 * @param parent the wxWindow* parent to be attached.
index 7acfd8a272f5b98b2f42fa1452da9645c62f1afc..d3f426967b37faf9d0a1c31c4d1d6ff97754fe66 100644 (file)
@@ -44,6 +44,7 @@ namespace creaButtonContainer
                ContainerSettings::~ContainerSettings( )
                {
                }
+               
                // ----------------------------------------------------------------------------------
                ButtonGroupMap
                ContainerSettings::GetButtonGroupContainer( )
@@ -56,6 +57,7 @@ namespace creaButtonContainer
                {
                        return ( this->m_GroupNameList );
                }
+               
                // ----------------------------------------------------------------------------------
                void
                ContainerSettings::SetButtonGroupContainer( ButtonGroupMap bgContainer )
@@ -68,14 +70,15 @@ namespace creaButtonContainer
                {
                        this->m_GroupNameList = gNameList;
                }
+               
                // ----------------------------------------------------------------------------------
                void
                ContainerSettings::AddButton( const StringType & groupName,
-                   const StringType &buttonName, const StringType &iconpath,
+                   const StringType &buttonName, const wxBitmap &icon,
                    const StringType &buttonDescription, FunctionEventType event )
                {
                        ButtonPair* pair = new ButtonPair(
-                           new ButtonInfo( buttonName, iconpath ),
+                           new ButtonInfo( buttonName, icon ),
                            new ButtonAction( buttonDescription, event ) );
                        try
                        {
@@ -105,7 +108,7 @@ namespace creaButtonContainer
                ContainerSettings::AddButton( BCSettingsStruct* info )
                {
                        ButtonPair* pair = new ButtonPair(
-                           new ButtonInfo( info->buttonName, info->iconpath ),
+                           new ButtonInfo( info->buttonName, info->icon ),
                            new ButtonAction( info->buttonDescription, info->eventFunction ) );
                        try
                        {
index 4d6ddb97dfea1b76d7d2753820f9545a3d25ae53..cb5a4f554553e91c25aad54b5c1c658991cbdfcc 100644 (file)
@@ -34,6 +34,7 @@
 #define BUTTONGROUPSETTINGS_H_
 
 #include <vector>
+#include <wx/bitmap.h>
 
 #include "structBCSettings.h"
 #include "system.h"
@@ -80,6 +81,7 @@ namespace creaButtonContainer
                                 */
                                virtual
                                ~ContainerSettings( );
+                               
                                // ----------------------------------------------------------------------------------
                                /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
                                 *      @brief This method returns a container of buttons ordered by group.
@@ -94,6 +96,7 @@ namespace creaButtonContainer
                                 */
                                KeyMapList
                                GetGroupNameList( );
+                               
                                // ----------------------------------------------------------------------------------
                                /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
                                 *      @brief This method allows to create the ButtonGroupContainer.
@@ -108,6 +111,7 @@ namespace creaButtonContainer
                                 */
                                void
                                SetGroupNameList( KeyMapList gNameList );
+                               
                                // ----------------------------------------------------------------------------------
                                /*!
                                 * @fn ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName,
@@ -124,7 +128,7 @@ namespace creaButtonContainer
                                 */
                                void
                                AddButton( const StringType & groupName, const StringType &buttonName,
-                                   const StringType &iconpath, const StringType &buttonDescription,
+                                   const wxBitmap &icon, const StringType &buttonDescription,
                                    FunctionEventType event );
                                // ----------------------------------------------------------------------------------
                                /*! @fn void AddButton( BCSettingsStruct* info );
index c7b015d41d397fa868010c8eee50a4b8c7a5e5b3..80cda3283001d24f03b483b385b1d9a2afe6be1e 100755 (executable)
@@ -54,6 +54,7 @@ namespace creaButtonContainer
                                StringType groupName;                   //! <The name of the group of buttons.
                                StringType buttonName;                  //! <The name of the button.
                                StringType iconpath;                    //! <The iconPath of the button.
+                               BitmapType icon;                        //! <The iconPath of the button.
                                StringType buttonDescription;           //! <The description of the button.
                                FunctionEventType eventFunction;        //! <The event associated to the button.
                };
index 93c87b304847c7b96e98a3046c9156c6ca156bff..ab863ea211103dc75f02e9775b3f74a2f869c534 100644 (file)
@@ -39,6 +39,7 @@
 #include <exception>
 #include <string>
 #include "functor.h"
+#include "wx/bitmap.h"
 
 /*!    @namespace <creaButtonContainer>
  *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
@@ -51,6 +52,11 @@ namespace creaButtonContainer
         */
        typedef std::string StringType;
        // ----------------------------------------------------------------------------------
+       /*!     @typedef std::string* BitmapType;
+        *      @brief Defines the BitmapType type.
+        */
+       typedef wxBitmap BitmapType;
+       // ----------------------------------------------------------------------------------
        /*!     @typedef model::TFunctor* FunctionEventType;
         *      @brief Defines the FunctionEventType type.
         */
@@ -61,12 +67,14 @@ namespace creaButtonContainer
         *      First is the button description, Second FunctionEventType
         */
        typedef std::pair< StringType, FunctionEventType > ButtonAction;
+       
        // ----------------------------------------------------------------------------------
-       /*!     @typedef std::pair< std::string, std::string > ButtonInfo;
+       /*!     @typedef std::pair< std::string, BitmapType > ButtonInfo;
         *      @brief Defines the ButtonInfo type.
         *      First is the ButtonName and Second is the IconPath
         */
-       typedef std::pair< StringType, StringType > ButtonInfo;
+       typedef std::pair< StringType, BitmapType > ButtonInfo;
+
        // ----------------------------------------------------------------------------------
        /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
         *      @brief Defines the ButtonPair type.
@@ -77,11 +85,13 @@ namespace creaButtonContainer
         *      @brief Defines the KeyMapList type.
         */
        typedef std::list< StringType > KeyMapList;
+       
        // ----------------------------------------------------------------------------------
        /*!     @typedef std::list< ButtonPair* > ButtonList;
         *      @brief Defines the ButtonList type.
         */
        typedef std::list< ButtonPair* > ButtonList;
+       
        // ----------------------------------------------------------------------------------
        /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
         *      @brief Defines the ButtonGroupMap type.
index 4795f77a5f6d7bde0c83849e90fa50745d6a8c79..39a30e3ce9c11664443fd6f0eb73b173428c6e1b 100644 (file)
@@ -41,19 +41,18 @@ namespace creaButtonContainer
                {
                        this->m_ButtonPair                      = pair;
                        StringType wXbuttonName         = this->m_ButtonPair->first->first;
-                       StringType wXiconPath           = this->m_ButtonPair->first->second;
+                       BitmapType wXicon               = this->m_ButtonPair->first->second;
                        StringType wXdescription        = this->m_ButtonPair->second->first;
                        wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
-                       wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 );
                        wxString description( wXdescription.c_str( ), wxConvUTF8 );
                        //creating the button.
                        this->Create( parent, id,
-                           wxBitmap( wxImage( imageIcon, wxBITMAP_TYPE_ANY, -1 ) ),
+                           wXicon,
                            wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
                            buttonName );
                        this->SetToolTip( description );
                }
-               
+
                // ----------------------------------------------------------------------------------
                Button::~Button( )
                {
@@ -65,13 +64,20 @@ namespace creaButtonContainer
                {
                        return ( this->m_ButtonPair->first->first );
                }
-               
+
                // ----------------------------------------------------------------------------------
-               StringType
+               BitmapType
+               Button::GetIcon( )
+               {
+                       return ( this->m_ButtonPair->first->second );
+               }               
+
+               // ----------------------------------------------------------------------------------
+               /*StringType
                Button::GetIconPath( )
                {
                        return ( this->m_ButtonPair->first->second );
-               }
+               }*/
                
                // ----------------------------------------------------------------------------------
                StringType
index e8024bbec3f4259e3205993462f68c6de21b38d7..b7a8fb6093a95b6d3ab7427ee33cd32d7a063367 100644 (file)
@@ -36,6 +36,7 @@
 #include <wx/bmpbuttn.h>
 #include <wx/image.h>
 #include <wx/string.h>
+#include <wx/bitmap.h>
 
 #include "system.h"
 
@@ -67,6 +68,7 @@ namespace creaButtonContainer
                                // ----------------------------------------------------------------------------------
                                //end of typedef definition
                        public:
+                               
                                // ----------------------------------------------------------------------------------
                                /*! @fn Button::Button( wxWindow* parent, long id, ButtonPair* pair );
                                 *      @brief This is the constructor.
@@ -95,13 +97,22 @@ namespace creaButtonContainer
                                 */
                                StringType
                                GetButtonName( );
+                               
                                // ----------------------------------------------------------------------------------
                                /*! @fn std::string Button::GetIconPath( );
                                 *      @brief This method returns the iconPath of the button.
                                 *      @return std::string The path of the icon.
                                 */
-                               StringType
-                               GetIconPath( );
+                               BitmapType
+                               GetIcon( );
+
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn std::string Button::GetIconPath( );
+                                *      @brief This method returns the iconPath of the button.
+                                *      @return std::string The path of the icon.
+                                */
+                               //StringType
+                               //GetIconPath( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn std::string Button::GetDescription( );
                                 *      @brief This method returns a the description of the button.
@@ -122,6 +133,7 @@ namespace creaButtonContainer
                                // ----------------------------------------------------------------------------------
                        private:
                                ButtonPair* m_ButtonPair; //! <The pair with the button information.
+                               
                };
        }//ecapseman
 }//ecapseman
index 9497e0d2e2e809223a0ef610046f4df362c59ed5..f8cd8f3f70d64cecdfec0a3beb3bed16a601e084 100644 (file)
@@ -42,6 +42,7 @@ namespace creaPanelButtonContainer
        ButtonContainerSettings::~ButtonContainerSettings( )
        {
        }
+       
        // ----------------------------------------------------------------------------------
        ButtonContainerSettings::ButtonGroupMap
        ButtonContainerSettings::GetButtonGroupContainer( )
@@ -96,8 +97,7 @@ namespace creaPanelButtonContainer
                                ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
                                for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
                                {
-                                       settings->AddButton( ( *it ), ( *it1 )->first->first,
-                                           ( *it1 )->first->second, ( *it1 )->second->first, functor );
+                                       settings->AddButton( ( *it ), ( *it1 )->first->first, ( *it1 )->first->second, ( *it1 )->second->first, functor );
                                }//rof
                        }//rof
                }//yrt
@@ -122,10 +122,11 @@ namespace creaPanelButtonContainer
        {
                this->m_GroupNameList = m_GroupNameList;
        }
+       
        // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::AddButton( const StringType & groupName,
-           const StringType &buttonName, const StringType &iconpath,
+           const StringType &buttonName, const wxBitmap &icon,
            const StringType &buttonDescription, PanelButton panel )
        {
                try
@@ -140,7 +141,7 @@ namespace creaPanelButtonContainer
                        }
                        panel->Show( false );
                        ButtonPair* pair = new ButtonPair(
-                           new ButtonInfo( buttonName, iconpath ),
+                           new ButtonInfo( buttonName, icon ),
                            new ActionButton( buttonDescription, panel ) );
                        for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
                            != this->m_GroupNameList.end( ); ++it )
@@ -163,6 +164,7 @@ namespace creaPanelButtonContainer
                            << "exception: " << e.what( ) << std::endl;
                }//hctac
        }
+       
        // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::AddButton( BCPSettingsStruct* info )
@@ -179,7 +181,7 @@ namespace creaPanelButtonContainer
                        }
                        info->panel->Show( false );
                        ButtonPair* pair = new ButtonPair(
-                           new ButtonInfo( info->buttonName, info->iconpath ),
+                           new ButtonInfo( info->buttonName, info->icon ),
                            new ActionButton( info->buttonDescription, info->panel ) );
                        for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
                            != this->m_GroupNameList.end( ); ++it )
@@ -201,6 +203,7 @@ namespace creaPanelButtonContainer
                        exit( 1 );
                }//hctac
        }
+       
        // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::AddButtons( BCStructVectorType infoList )
index ef4819635b46eef281d65ff30cbd3c55e728fff5..a502b9a37fed363c3e2cb5a95f80a27916d9a469 100644 (file)
@@ -34,6 +34,7 @@
 #define BUTTONCONTAINERSETTINGS_H_
 
 #include <wx/panel.h>
+#include <wx/bitmap.h>
 
 #include <list>
 #include <map>
@@ -82,12 +83,14 @@ namespace creaPanelButtonContainer
                         *      First is the button description, Second FunctionEventType
                         */
                        typedef std::pair< std::string, PanelButton > ActionButton;
+                       
                        // ----------------------------------------------------------------------------------
-                       /*!     @typedef std::pair< std::string, std::string > ButtonInfo;
+                       /*!     @typedef std::pair< std::string, wxBitmap > ButtonInfo;
                         *      @brief Defines the ButtonInfo type.
-                        *      First is the ButtonName, Second is the ImageIconPath
+                        *      First is the ButtonName, Second is the ImageIcon
                         */
-                       typedef std::pair< std::string, std::string > ButtonInfo;
+                       typedef std::pair< std::string, wxBitmap > ButtonInfo;
+                       
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
                         *      @brief Defines the ButtonPair type.
@@ -98,11 +101,13 @@ namespace creaPanelButtonContainer
                         *      @brief Defines the KeyMapList type.
                         */
                        typedef std::list< std::string > KeyMapList;
+               
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::list< ButtonPair* > ButtonList;
                         *      @brief Defines the ButtonList type.
                         */
-                       typedef std::list< ButtonPair* > ButtonList;
+                       typedef std::list< ButtonPair* > ButtonList;                    
+                       
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
                         *      @brief Defines the ButtonGroupMap type.
@@ -130,6 +135,7 @@ namespace creaPanelButtonContainer
                         */
                        virtual
                        ~ButtonContainerSettings( );
+                       
                        // ----------------------------------------------------------------------------------
                        /*! @fn ButtonGroupMap GetButtonGroupContainer( );
                         *      @brief This method returns ButtonGroupMap with all buttons.
@@ -176,6 +182,7 @@ namespace creaPanelButtonContainer
                         */
                        void
                        SetGroupNameList( KeyMapList gNameList );
+                       
                        // ----------------------------------------------------------------------------------
                        /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
                         const std::string &iconpath, const std::string &buttonDescription,
@@ -190,8 +197,9 @@ namespace creaPanelButtonContainer
                         */
                        void
                        AddButton( const std::string &groupName, const std::string &buttonName,
-                           const std::string &iconpath, const std::string &buttonDescription,
+                           const wxBitmap &icon, const std::string &buttonDescription,
                            PanelButton panel );
+                       
                        // ----------------------------------------------------------------------------------
                        /*! @fn void AddButton( BCPSettingsStruct* info );
                         * @brief This method adds a new button into a group of buttons.
@@ -200,6 +208,7 @@ namespace creaPanelButtonContainer
                         */
                        void
                        AddButton( BCPSettingsStruct* info );
+                       
                        // ----------------------------------------------------------------------------------
                        /*! @fn void AddButtons( BCStructVectorType infoList );
                         * @brief This method adds new buttons into the container.
index 1c74cf336ec8a800edbaf4e5365b7b8dd2d3a7c9..6802a2422d74db74b19ffc6ddd54c969818a4e54 100755 (executable)
@@ -35,6 +35,7 @@
 
 #include <string>
 #include <wx/panel.h>
+#include <wx/bitmap.h>
 
 /*!    @namespace <creaPanelButtonContainer>
  *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
@@ -49,6 +50,7 @@ namespace creaPanelButtonContainer
                        std::string groupName; //! <The name of the group of buttons.
                        std::string buttonName; //! <The name of the button.
                        std::string iconpath; //! <The iconPath of the button.
+                       wxBitmap icon; //! <The icon of the button.
                        std::string buttonDescription; //! <The description of the button.
                        wxPanel* panel; //! <The panel of the button.
        };