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 );
31 // ----------------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------------
37 Button::GetButtonName( )
39 return ( this->m_ButtonPair->first->first );
41 // ----------------------------------------------------------------------------------
43 Button::GetIconPath( )
45 return ( this->m_ButtonPair->first->second );
47 // ----------------------------------------------------------------------------------
49 Button::GetDescription( )
51 return ( this->m_ButtonPair->second->first );
53 // ----------------------------------------------------------------------------------
60 { this->m_ButtonPair->second->second };
61 vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
63 catch ( const std::exception& e )
65 std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
68 // ----------------------------------------------------------------------------------