--- /dev/null
+//=====
+// 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
+
+
--- /dev/null
+//=====
+// 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__
+
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 );
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 );
#define __bbcreaMaracasVisuPanelButtonContainerSettings_h_INCLUDED__
#include "bbcreaMaracasVisu_EXPORT.h"
#include "bbtkWxBlackBox.h"
+#include "wx/bitmap.h"
#include <string>
#include <vector>
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);
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,"");
--- /dev/null
+/* XPM */
+static char * five_xpm[] = {
+"17 17 2 1",
+" c None",
+". c #000000",
+" ............ ",
+" ........... ",
+" .......... ",
+" ... ",
+" ... ",
+" ... .. ",
+" ........... ",
+" ............ ",
+" ........... ",
+" ... .... ",
+" ... ",
+" ... ",
+" ... ",
+" ... .... ",
+" ........... ",
+" .......... ",
+" ........ "};
--- /dev/null
+/* XPM */
+static char * four_xpm[] = {
+"17 17 2 1",
+" c None",
+". c #000000",
+" .. ",
+" ... ",
+" ... ",
+" .... .. ",
+" .... .. ",
+" .... .. ",
+" .... .... ",
+" .......... ",
+" .......... ",
+" ......... ",
+" ... ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" "};
--- /dev/null
+/* XPM */
+static char * one_xpm[] = {
+"17 17 5 1",
+" c None",
+". c #000000",
+"+ c #010201",
+"@ c #010100",
+"# c #020201",
+" ... ",
+" .... ",
+" .....+ ",
+" ....... ",
+" ........ ",
+" ......... ",
+" ..... ...@ ",
+" .... ...# ",
+" .... .... ",
+" .. .... ",
+" .... ",
+" .... ",
+" .... ",
+" .... ",
+" .... ",
+" ... ",
+" "};
--- /dev/null
+/* XPM */
+static char * three_xpm[] = {
+"17 17 2 1",
+" c None",
+". c #000000",
+" .... ",
+" ....... ",
+" ......... ",
+" ........... ",
+" ...... ..... ",
+" ... .... ",
+" .. ... ",
+" ... ",
+" ..... ",
+" ...... ",
+" ...... ",
+" .... ",
+" ... ",
+" .... ",
+" .. .... ",
+" .............. ",
+" ............ "};
--- /dev/null
+/* XPM */
+static char * two_xpm[] = {
+"17 17 2 1",
+" c None",
+". c #000000",
+" ",
+" ....... ",
+" .......... ",
+" ............ ",
+" ..... .... ",
+".... ... ",
+"... ... ",
+"... ... ",
+" .... ",
+" .... ",
+" ..... ",
+" ..... ",
+" ..... ",
+" ..... ",
+" ............. ",
+" ............. ",
+" ............. "};
return ( groupView );
}
+
// ----------------------------------------------------------------------------------
ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
{
*/
virtual
~ButtonGroupFactory( );
+
/*! @fn ButtonGroupContainer ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings );
* @brief This method creates the ButtonGroupContainer.
* @param parent the wxWindow* parent to be attached.
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.
ContainerSettings::~ContainerSettings( )
{
}
+
// ----------------------------------------------------------------------------------
ButtonGroupMap
ContainerSettings::GetButtonGroupContainer( )
{
return ( this->m_GroupNameList );
}
+
// ----------------------------------------------------------------------------------
void
ContainerSettings::SetButtonGroupContainer( ButtonGroupMap bgContainer )
{
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
{
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
{
#define BUTTONGROUPSETTINGS_H_
#include <vector>
+#include <wx/bitmap.h>
#include "structBCSettings.h"
#include "system.h"
*/
virtual
~ContainerSettings( );
+
// ----------------------------------------------------------------------------------
/*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
* @brief This method returns a container of buttons ordered by group.
*/
KeyMapList
GetGroupNameList( );
+
// ----------------------------------------------------------------------------------
/*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
* @brief This method allows to create the ButtonGroupContainer.
*/
void
SetGroupNameList( KeyMapList gNameList );
+
// ----------------------------------------------------------------------------------
/*!
* @fn ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName,
*/
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 );
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.
};
#include <exception>
#include <string>
#include "functor.h"
+#include "wx/bitmap.h"
/*! @namespace <creaButtonContainer>
* @brief Contains the creaButtonContainer library included in creaMaracasVisu.
*/
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.
*/
* 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.
* @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.
{
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( )
{
{
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
#include <wx/bmpbuttn.h>
#include <wx/image.h>
#include <wx/string.h>
+#include <wx/bitmap.h>
#include "system.h"
// ----------------------------------------------------------------------------------
//end of typedef definition
public:
+
// ----------------------------------------------------------------------------------
/*! @fn Button::Button( wxWindow* parent, long id, ButtonPair* pair );
* @brief This is the constructor.
*/
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.
// ----------------------------------------------------------------------------------
private:
ButtonPair* m_ButtonPair; //! <The pair with the button information.
+
};
}//ecapseman
}//ecapseman
ButtonContainerSettings::~ButtonContainerSettings( )
{
}
+
// ----------------------------------------------------------------------------------
ButtonContainerSettings::ButtonGroupMap
ButtonContainerSettings::GetButtonGroupContainer( )
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
{
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
}
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 )
<< "exception: " << e.what( ) << std::endl;
}//hctac
}
+
// ----------------------------------------------------------------------------------
void
ButtonContainerSettings::AddButton( BCPSettingsStruct* info )
}
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 )
exit( 1 );
}//hctac
}
+
// ----------------------------------------------------------------------------------
void
ButtonContainerSettings::AddButtons( BCStructVectorType infoList )
#define BUTTONCONTAINERSETTINGS_H_
#include <wx/panel.h>
+#include <wx/bitmap.h>
#include <list>
#include <map>
* 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.
* @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.
*/
virtual
~ButtonContainerSettings( );
+
// ----------------------------------------------------------------------------------
/*! @fn ButtonGroupMap GetButtonGroupContainer( );
* @brief This method returns ButtonGroupMap with all buttons.
*/
void
SetGroupNameList( KeyMapList gNameList );
+
// ----------------------------------------------------------------------------------
/*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
const std::string &iconpath, const std::string &buttonDescription,
*/
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.
*/
void
AddButton( BCPSettingsStruct* info );
+
// ----------------------------------------------------------------------------------
/*! @fn void AddButtons( BCStructVectorType infoList );
* @brief This method adds new buttons into the container.
#include <string>
#include <wx/panel.h>
+#include <wx/bitmap.h>
/*! @namespace <creaPanelButtonContainer>
* @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
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.
};