1 /***************************************************************
3 * Purpose: Implements Button.h
4 * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
6 * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
8 **************************************************************/
13 namespace creaButtonContainer
17 //--------------------------------------------------------------------
18 Button::Button( wxWindow* parent, long id, ButtonPair* pair )
20 this->m_ButtonPair = pair;
21 std::string wXbuttonName = this->m_ButtonPair->first->first;
22 std::string wXiconPath = this->m_ButtonPair->first->second;
23 std::string wXdescription = this->m_ButtonPair->second->first;
24 wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
25 wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 );
26 wxString description( wXdescription.c_str( ), wxConvUTF8 );
27 this->Create( parent, id,
28 wxBitmap( wxImage( imageIcon, wxBITMAP_TYPE_ANY, -1 ) ),
29 wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
31 this->SetToolTip( description );
33 //--------------------------------------------------------------------
37 //--------------------------------------------------------------------
38 //--------------------------------------------------------------------
40 Button::GetButtonName( )
42 return( this->m_ButtonPair->first->first );
44 //--------------------------------------------------------------------
46 Button::GetIconPath( )
48 return( this->m_ButtonPair->first->second );
50 //--------------------------------------------------------------------
52 Button::GetDescription( )
54 return( this->m_ButtonPair->second->first );
56 //--------------------------------------------------------------------
60 std::cout << "ButtonAction: "<< this->m_ButtonPair->first->first <<std::endl;
61 TFunctor* vTable[] = {this->m_ButtonPair->second->second};
62 vTable[0]->Call( this->m_ButtonPair->first->first );