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 **************************************************************/
10 //! @include "button.h"
13 //! @namespace <creaButtonContainer>
14 namespace creaButtonContainer
19 // ----------------------------------------------------------------------------------
20 Button::Button( wxWindow* parent, long id, ButtonPair* pair )
22 this->m_ButtonPair = pair;
23 std::string wXbuttonName = this->m_ButtonPair->first->first;
24 std::string wXiconPath = this->m_ButtonPair->first->second;
25 std::string wXdescription = this->m_ButtonPair->second->first;
26 wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
27 wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 );
28 wxString description( wXdescription.c_str( ), wxConvUTF8 );
29 //creating the button.
30 this->Create( parent, id,
31 wxBitmap( wxImage( imageIcon, wxBITMAP_TYPE_ANY, -1 ) ),
32 wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
34 this->SetToolTip( description );
36 // ----------------------------------------------------------------------------------
40 // ----------------------------------------------------------------------------------
42 Button::GetButtonName( )
44 return ( this->m_ButtonPair->first->first );
46 // ----------------------------------------------------------------------------------
48 Button::GetIconPath( )
50 return ( this->m_ButtonPair->first->second );
52 // ----------------------------------------------------------------------------------
54 Button::GetDescription( )
56 return ( this->m_ButtonPair->second->first );
58 // ----------------------------------------------------------------------------------
62 std::cout << "ButtonAction: " << this->m_ButtonPair->first->first
65 { this->m_ButtonPair->second->second };
66 vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
68 // ----------------------------------------------------------------------------------