3 * @brief Implements the Button class implementation.
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
10 namespace creaButtonContainer
14 // ----------------------------------------------------------------------------------
15 Button::Button( wxWindow* parent, long id, ButtonPair* pair )
17 this->m_ButtonPair = pair;
18 StringType wXbuttonName = this->m_ButtonPair->first->first;
19 StringType wXiconPath = this->m_ButtonPair->first->second;
20 StringType wXdescription = this->m_ButtonPair->second->first;
21 wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
22 wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 );
23 wxString description( wXdescription.c_str( ), wxConvUTF8 );
24 //creating the button.
25 this->Create( parent, id,
26 wxBitmap( wxImage( imageIcon, wxBITMAP_TYPE_ANY, -1 ) ),
27 wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
29 this->SetToolTip( description );
32 // ----------------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------------
39 Button::GetButtonName( )
41 return ( this->m_ButtonPair->first->first );
44 // ----------------------------------------------------------------------------------
46 Button::GetIconPath( )
48 return ( this->m_ButtonPair->first->second );
51 // ----------------------------------------------------------------------------------
53 Button::GetDescription( )
55 return ( this->m_ButtonPair->second->first );
58 // ----------------------------------------------------------------------------------
65 { this->m_ButtonPair->second->second };
66 vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
68 catch ( const std::exception& e )
70 std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
73 // ----------------------------------------------------------------------------------