# knowledge of the CeCILL-B license and that you accept its terms.
# ------------------------------------------------------------------------ */
+
#include "listWx.h"
namespace creaButtonContainer
{
namespace view
{
- ListWx::ListWx(wxWindow* parent, ItemsList items)
+ // ----------------------------------------------------------------------------------
+ ListWx::ListWx( wxWindow* parent, long id, ButtonPair* pair )
{
- wxListCtrl* lstCtrl = new wxListCtrl (parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_REPORT);
-
- this->m_items = items;
- lstCtrl->InsertItem(0,(*items.front()).GetText());
+ this->m_ButtonPair = pair;
+ StringType wXbuttonName = this->m_ButtonPair->first->first;
+ BitmapType wXicon = this->m_ButtonPair->first->second;
+ StringType wXdescription = this->m_ButtonPair->second->first;
+ wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
+ wxString description( wXdescription.c_str( ), wxConvUTF8 );
+ //creating the button.
+ /*this->Create( parent, id,
+ wXicon,
+ wxDefaultPosition, wxDefaultSize,wxBU_AUTODRAW, wxDefaultValidator,
+ buttonName );*/
+ this->Create( parent, id,
+ wxDefaultPosition, wxDefaultSize,wxLC_LIST, wxDefaultValidator,
+ buttonName );
+ this->SetToolTip( description );
}
- //-------------------------------------------------------
-
- tList::~tList( )
+ // ----------------------------------------------------------------------------------
+ ListWx::~ListWx( )
{
}
- //-------------------------------------------------------
-
- ItemsList getItems() const
+ // ----------------------------------------------------------------------------------
+ StringType
+ ListWx::GetButtonName( )
{
- return m_items;
+ return ( this->m_ButtonPair->first->first );
}
- void setItems(ItemsList items)
+ // ----------------------------------------------------------------------------------
+ BitmapType
+ ListWx::GetIcon( )
{
- m_items = items;
+ return ( this->m_ButtonPair->first->second );
}
+ // ----------------------------------------------------------------------------------
+ /*StringType
+ Button::GetIconPath( )
+ {
+ return ( this->m_ButtonPair->first->second );
+ }*/
+ // ----------------------------------------------------------------------------------
+ StringType
+ ListWx::GetDescription( )
+ {
+ return ( this->m_ButtonPair->second->first );
+ }
- }
-
-}
+ // ----------------------------------------------------------------------------------
+ void
+ ListWx::Execute( )
+ {
+ try
+ {
+ TFunctor* vTable[ ] =
+ { this->m_ButtonPair->second->second };
+ vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
+ }//hctac
+ }
+ // ----------------------------------------------------------------------------------
+ }//ecapseman
+}//ecapseman