// ----------------------------------------------------------------------------------
ButtonContainerController::ButtonContainerController( BCPanel* panel )
{
+ std::cout<< "MLER | ButtonContainerController::ButtonContainerController( BCPanel* panel )" << std::endl;
this->m_BCPanel = panel;
}
// ----------------------------------------------------------------------------------
{
try
{
+ std::cout<< "MLER | ButtonContainerController:: AddEvents( )" << std::endl;
//Adding ButtonManagerEvents
for( GroupManagerList::iterator it =
this->m_BCPanel->m_GroupManagerList.begin( ); it
ButtonContainerController::ButtonExpEvent( wxCommandEvent& event )
{
long id = event.GetId( );
+ std::cout<< "MLER | ButtonContainerController:: ButtonExpEvent( wxCommandEvent& event )" << std::endl;
+
try
{
//changing the button label when its clicked and then hide the buttons of the group.
void
ButtonContainerController::ButtonEvent( wxCommandEvent& event )
{
+ std::cout<< "MLER | ButtonContainerController:: ButtonEvent( wxCommandEvent& event )" << std::endl;
try
{
for( ButtonGroupList::iterator it =
}//hctac
}
// ----------------------------------------------------------------------------------
+
+
}//ecapsename
}//ecapsename
void
ButtonEvent( wxCommandEvent& event );
// ----------------------------------------------------------------------------------
+
private:
BCPanel* m_BCPanel; //! <ButtonContainerPanel View pointer.
};
// ----------------------------------------------------------------------------------
ButtonGroupFactory::ButtonGroupFactory( )
{
+ std::cout<< "MLER | ButtonGroupFactory::ButtonGroupFactory( )" << std::endl;
}
// ----------------------------------------------------------------------------------
ButtonGroupFactory::~ButtonGroupFactory( )
ButtonGroupContainer groupView;
try
{
- std::cout<< std::endl << " MLER buttonGroupFactory.cxx / CreateButtonGroupContainer(): " << std::endl;
+ std::cout<< "MLER | ButtonGroupFactory::CreateButtonGroupContainer()" << std::endl;
ButtonGroupMap map = settings->GetButtonGroupContainer( );
for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
{
ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
{
ButtonContainer buttonList;
+
+ std::cout<< "MLER | ButtonGroupFactory::GetButtons()" << std::endl;
try
{
for( ButtonList::iterator it = buttonModel.begin( ); it
// ----------------------------------------------------------------------------------
ContainerSettings::ContainerSettings( )
{
+
}
// ----------------------------------------------------------------------------------
ContainerSettings::~ContainerSettings( )
ButtonGroupMap
ContainerSettings::GetButtonGroupContainer( )
{
+ std::cout<< "MLER | ContainerSettings::GetButtonGroupContainer( )" << std::endl;
return ( this->m_ButtonGroupContainer );
}
// ----------------------------------------------------------------------------------
KeyMapList
ContainerSettings::GetGroupNameList( )
{
+ std::cout<< "MLER | ContainerSettings::GetGroupNameList( )" << std::endl;
return ( this->m_GroupNameList );
}
void
ContainerSettings::SetButtonGroupContainer(ButtonGroupMap bgContainer)
{
+ std::cout<< "MLER | ContainerSettings:: SetButtonGroupContainer(ButtonGroupMap bgContainer)" << std::endl;
this->m_ButtonGroupContainer = bgContainer;
}
// ----------------------------------------------------------------------------------
void
ContainerSettings::SetGroupNameList( KeyMapList gNameList )
{
+ std::cout<< "MLER | ContainerSettings::SetGroupNameList" << std::endl;
this->m_GroupNameList = gNameList;
}
const StringType &buttonName, const wxBitmap &icon,
const StringType &buttonDescription, FunctionEventType event )
{
- std::cout<< std::endl<<"MLER CLASS : ContainerSettings" << std::endl;
- std::cout<< std::endl<<"MLER ContainerSettings // AddButton "<<std::endl;
-
+ std::cout<< "MLER | ContainerSettings::AddButton( const StringType & groupName," << std::endl;
ButtonPair* pair = new ButtonPair(
new ButtonInfo( buttonName, icon ),
void
ContainerSettings::AddButton( BCSettingsStruct* info )
{
+ std::cout<< "MLER | ContainerSettings::AddButton( BCSettingsStruct* info )" << std::endl;
ButtonPair* pair = new ButtonPair(
new ButtonInfo( info->buttonName, info->icon ),
new ButtonAction( info->buttonDescription, info->eventFunction ) );
void
ContainerSettings::AddButtons( BCStructVectorType infoList )
{
+ std::cout<< "MLER | ContainerSettings::AddButtons( BCStructVectorType infoList )" << std::endl;
try
{
for( BCStructVectorType::iterator it = infoList.begin( ); it
template< typename TClass >
void
TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )
- {
+ {std::cout << "MLER - TConcreteFunctor< TClass >::operator():" << buttonName << std::endl;
try
{
( *pt2Object.*fpt )( buttonName );
void
TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )
{
+ std::cout << "MLER - TConcreteFunctor< TClass >::Call " << buttonName << std::endl;
try
{
( *pt2Object.*fpt )( buttonName );
#include <exception>
#include <string>
#include "functor.h"
-//#include "listWx.h"
-//#include <wx/listctrl.h>
-/*! @namespace <creaButtonContainer>
- * @brief Contains the creaButtonContainer library included in creaMaracasVisu.
- */
-
-/*namespace creaButtonContainer
-{
- namespace view
- {
- typedef std::list< ListWx* > ListLst;
- typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
- }
-
-
-}*/
namespace creaButtonContainer
{
//using namespace view;
typedef std::map< StringType, ButtonList > ButtonGroupMap;
-
- //typedef wxListItem* Item; //lista objeto
- //typedef std::list< Item > ItemsList; //lista de los objetos lista
- //typedef std::list <ItemsList> Lista;
- //typedef std::map< StringType, ItemsList > ListGroupMap; // ex: grupo A,items lista A (la lista de ese grupo)
-
-
- //typedef std::list< ListWx > ListLst; // lista contenedor
- //typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
-
// ----------------------------------------------------------------------------------
}
#endif /* SYSTEM_H_ */
// ----------------------------------------------------------------------------------
Button::Button( wxWindow* parent, long id, ButtonPair* pair )
{
+ std::cout<< "MLER | Button::Button()" << std::endl;
+
this->m_ButtonPair = pair;
StringType wXbuttonName = this->m_ButtonPair->first->first;
BitmapType wXicon = this->m_ButtonPair->first->second;
StringType
Button::GetButtonName( )
{
+ std::cout<< "MLER | Button::GetButtonName( )" << std::endl;
return ( this->m_ButtonPair->first->first );
}
BitmapType
Button::GetIcon( )
{
+ std::cout<< "MLER | Button::GetIcon( )" << std::endl;
return ( this->m_ButtonPair->first->second );
}
StringType
Button::GetDescription( )
{
+ std::cout<< "MLER | Button::GetDescription( )" << std::endl;
return ( this->m_ButtonPair->second->first );
}
void
Button::Execute( )
{
+ std::cout<< "MLER | Button::Execute( )" << std::endl;
try
{
TFunctor* vTable[ ] =
{ this->m_ButtonPair->second->second };
+
vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
+ std::cout<< "Call Button: " << this->m_ButtonPair->first->first <<std::endl;
}//yrt
catch ( const std::exception& e )
{
: wxScrolledWindow(parent,-1, wxDefaultPosition,wxDefaultSize, wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
{
- std::cout<< std::endl << " MLER buttonContainerPanel.cxx / ButtonContainerPanel() " << std::endl;
+ std::cout<< "MLER | ButtonContainerPanel::ButtonContainerPanel( )" << std::endl;
ButtonGroupFactory factory;
//ListGroupFactory listFactory;
// ----------------------------------------------------------------------------------
void ButtonContainerPanel::SetButtonGroupContainer(ButtonGroupList groupContainer )
{
+ std::cout<< "MLER | ButtonContainerPanel::SetButtonGroupContainer()" << std::endl;
this->m_ButtonGroupList = groupContainer;
}
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
void ButtonContainerPanel::PanelInit( int type )
{
+ std::cout<< "MLER | ButtonContainerPanel::PanelInit( int type )" << std::endl;
try
{
// ----------------------------------------------------------------------------------
void ButtonContainerPanel::FitSizer( )
{
+ std::cout<< "MLER | ButtonContainerPanel::FitSizer( )" << std::endl;
this->m_Sizer->Fit( this );
this->m_Sizer->FitInside( this );
this->SetScrollRate( 20, 20 );
// ----------------------------------------------------------------------------------
ButtonGroup::ButtonGroup( wxStaticText* groupName, ButtonContainer cartoButtons )
{
+ std::cout<< "MLER | ButtonGroup::ButtonGroup()" << std::endl;
this->m_GroupName = groupName;
this->m_Buttons = cartoButtons;
}
ButtonGroup::ButtonContainer
ButtonGroup::GetButtonContainer( )
{
+ std::cout<< "MLER | ButtonGroup::GetButtonContainer( )" << std::endl;
return ( this->m_Buttons );
}
ButtonGroup::IdButtonContainer
ButtonGroup::GetButtonIdContainer( )
{
+ std::cout<< "MLER | ButtonGroup::GetButtonIdContainer( )" << std::endl;
IdButtonContainer idContainer;
try
{
Button*
ButtonGroup::GetButton( long id )
{
+ std::cout<< "MLER | ButtonGroup::GetButton( long id )" << std::endl;
try
{
//return ( this->m_Buttons[ id ] ); // JPR
ButtonManager::ButtonManager( ) :
wxFlexGridSizer( 0, 1, 0, 0 )
{
+ std::cout<< "MLER | ButtonManager::ButtonManager( )" << std::endl;
}
//EED 20/01/2012 Flag03
{
try
{
- std::cout << " MLER buttonManager.cxx / GroupManager(ButtonGroup* buttonGroup) " << std::endl;
+ std::cout<< "MLER | ButtonManager::ButtonManager( ButtonGroup* buttonGroup )" << std::endl;
this->SetGroupName( buttonGroup->GetGroupName( ) );
this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
}//yrt
// ----------------------------------------------------------------------------------
void ButtonManager::SetGroupName( wxStaticText* groupName )
{
+ std::cout<< "MLER | ButtonManager::SetGroupName( wxStaticText* groupName )" << std::endl;
this->m_GroupName = groupName;
this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
}
// ----------------------------------------------------------------------------------
void ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
{
+ std::cout<< "MLER | ButtonManager::SetButtonManager( ButtonContainer buttonContainer )" << std::endl;
try
{
if ( this->m_GroupName != NULL )
void
ButtonManager::ShowButtonManager( )
{
+ std::cout<< "MLER | ButtonManager::ShowButtonManager( )" << std::endl;
this->Show( this->m_GridSizer, true, false );
}
// ----------------------------------------------------------------------------------
void
ButtonManager::HideButtonManager( )
{
+ std::cout<< "MLER | ButtonManager::HideButtonManager( )" << std::endl;
this->Show( this->m_GridSizer, false, false );
}
// ----------------------------------------------------------------------------------
wxFlexGridSizer( 1, 0, 0, 0 )
{
//EED 20/01/2012 flag 02
- std::cout << " MLER groupManager.cxx / GroupManager(ButtonGroup* buttonGroup) " << std::endl;
+ std::cout<< "MLER | GroupManager::GroupManager( )" << std::endl;
this->m_IDExpButton = wxNewId( );
this->m_ExpansionButton = new ExpansionButton( parent, this->m_IDExpButton, _("-"), wxDefaultPosition, wxSize( 20, 20 ), 0, wxDefaultValidator, _T("EXPBUTTON") );
this->Add( m_ExpansionButton, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
long
GroupManager::GetButtonID( )
{
+ std::cout<< "MLER | GroupManager::GetButtonID( )" << std::endl;
return ( this->m_IDExpButton );
}
GroupManager::ExpansionButton*
GroupManager::GetButton( )
{
+ std::cout<< "MLER | GroupManager::GetButton( )" << std::endl;
return ( this->m_ExpansionButton );
}
void
GroupManager::HideSubPanel( bool hide )
{
+ std::cout<< "MLER | GroupManager::HideSubPanel( bool hide )" << std::endl;
if ( hide == true )
{
this->m_ButtonManager->HideButtonManager( );
namespace view
{
// ----------------------------------------------------------------------------------
- ListWx::ListWx( wxWindow* parent, wxWindowID id, ItemsMap iMap , TFunctor* functor ): wxListCtrl(parent,id)
+ ListWx::ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor ): wxListCtrl(parent,id)
{
+
+ std::cout<< "MLER | ListWx::ListWx()" << std::endl;
this->m_itemsMap = iMap;
+
this->functor = functor;
+ int i = 0;
for (ItemsMap::iterator it=this->m_itemsMap.begin(); it!=this->m_itemsMap.end(); ++it)
{
+
std::string key = it->first;
- long index = this->InsertItem(0, wxString::From8BitData(key.c_str()));
- //this->Connect( index, wxEVT_LIST_ITEM_SELECTED,
- // (wxObjectEventFunction) &ListWx::ButtonEvent );
+ long index = this->InsertItem(i, wxString(key.c_str(), wxConvUTF8));
+
+ std::cout << "index" << index << std::endl;
+ this->Connect( -1, wxEVT_COMMAND_LIST_ITEM_SELECTED,
+ wxListEventHandler(ListWx::ListEvent) );
+ i++;
}
}
}
void
- ListWx::ButtonEvent( wxCommandEvent& event )
+ ListWx::ListEvent( wxListEvent& event )
{
try
{
- //MLDR - Aqui necesita el nombre de la funcion para poderla ejecutar
- this->functor->Call("PanelButtonContainer::GenericButtonEvent");
+ std::cout<< "MLER | ListWx::ListEvent( wxListEvent& event )" << std::endl;
+
+ wxString itemNom = event.GetItem().GetText();
+
+ std::string itemNomC = std::string(itemNom.mb_str());
+
+ this->functor->Call(itemNomC);
+ std::cout<<"mmmmmmmmmmmmmmmmmmmmmmm"<<std::endl;
+
}//yrt
catch ( const std::exception& e )
{
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/listctrl.h>
+#include <wx/wx.h>
+
+
#include <map>
-#include <cstring>
+#include <string>
#include "functor.h"
+#include <wx/event.h>
#include "system.h"
typedef creaButtonContainer::model::TFunctor TFunctor;
typedef std::map<std::string, wxPanel*> ItemsMap;
+
public:
- ListWx( wxWindow* parent, wxWindowID id, ItemsMap iMap , TFunctor* functor );
+ ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor );
// ----------------------------------------------------------------------------------
virtual
GetID( );
void
- ButtonEvent( wxCommandEvent& event );
+ ListEvent( wxListEvent& event );
// ----------------------------------------------------------------------------------
private:
ItemsMap m_itemsMap; //! <The pair with the button information.
// ----------------------------------------------------------------------------------
ButtonContainerSettings::ButtonContainerSettings( )
{
+
}
// ----------------------------------------------------------------------------------
ButtonContainerSettings::~ButtonContainerSettings( )
ButtonContainerSettings::ButtonGroupMap
ButtonContainerSettings::GetButtonGroupContainer( )
{
+ std::cout<< "MLER | ButtonContainerSettings:: GetButtonGroupContainer( ) " << std::endl;
return m_ButtonGroupContainer;
}
// ----------------------------------------------------------------------------------
ButtonContainerSettings::KeyMapList
ButtonContainerSettings::GetGroupNameList( )
{
+ std::cout<< "MLER | ButtonContainerSettings:: GetGroupNameList( ) " << std::endl;
return m_GroupNameList;
}
// ----------------------------------------------------------------------------------
{
try
{
- std::cout<<"MLER ButtonContainerSettings // GetPanelButton "<<std::endl;
+ std::cout<< "MLER | ButtonContainerSettings:: GetPanelButton " << std::endl;
for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
!= this->m_GroupNameList.end( ); ++it )
{
- std::cout<< std::endl<<"MLER ButtonContainerSettings // GetPanelButton :: it "<< *it<<std::endl;
+ //std::cout<< std::endl<<"MLER ButtonContainerSettings // GetPanelButton :: it "<< *it<<std::endl;
ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
}//hctac
return ( NULL );
}
+ // ----------------------------------------------------------------------------------
+ ButtonContainerSettings::PanelButton
+ ButtonContainerSettings::GetPanelList( const StringType &buttonName )
+ {
+ std::cout<< "MLER | ButtonContainerSettings:: GetPanelList " << std::endl;
+
+
+ try {
+ if(m_itemsMap.empty())
+ std::cout<< "no tengo nada "<< std::endl;
+
+ for( ItemsMap::iterator it= this->m_itemsMap.begin(); it!=this->m_itemsMap.end(); ++it )
+ {
+ if( (*it).first.compare(buttonName) == 0 )
+ return ( (*it).second );
+ }
+
+
+ }catch ( std::exception& e )
+ {
+ std::cerr
+ << "ButtonContainerSettings::GetPanelButton( const StringType &buttonName ) "
+ << "exception: " << e.what( ) << std::endl;
+ }//hctac
+ return (NULL);
+
+ }
+
+
// ----------------------------------------------------------------------------------
ButtonContainerSettings::ButtonGroupSettings*
ButtonContainerSettings::GetButtonGroupSettings( TFunctor* functor )
ButtonGroupSettings* settings = NULL;
try
{
- std::cout<< std::endl<<"MLER CLASS : ButtonContainerSettings" << std::endl;
- std::cout<< std::endl<<"MLER ButtonContainerSettings // GetButtonGroupSettings "<<std::endl;
+ std::cout<< "MLER | ButtonContainerSettings:: GetButtonGroupSettings() " << std::endl;
settings = new ButtonGroupSettings( );
for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
!= this->m_GroupNameList.end( ); ++it )
{
- ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ]; //MLER : Hacer cambio de contenedor
-
- std::cout<<"MLER ButtonContainerSettings // GetButtonGroupSettings :: it "<< *it<<std::endl;
+ ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
{
ButtonContainerSettings::SetButtonGroupContainer(
ButtonGroupMap m_ButtonGroupContainer )
{
+ std::cout<< "MLER | ButtonContainerSettings:: SetButtonGroupContainer() " << std::endl;
this->m_ButtonGroupContainer = m_ButtonGroupContainer;
}
// ----------------------------------------------------------------------------------
void
ButtonContainerSettings::SetGroupNameList( KeyMapList m_GroupNameList )
{
+ std::cout<< "MLER | ButtonContainerSettings:: SetGroupNameList() " << std::endl;
this->m_GroupNameList = m_GroupNameList;
}
{
try
{
- std::cout<< std::endl<<"MLER ButtonContainerSettings / AddButton(groupname...)"<<std::endl;
+ std::cout<< "MLER | ButtonContainerSettings:: AddButton( const StringType & groupName ..) " << std::endl;
//builds the button information
//I don't know the try catch doesn't work!!
{
try
{
+ std::cout<< "MLER | ButtonContainerSettings:: AddButton( BCPSettingsStruct* info )" << std::endl;
+
//builds the button information
//I don't know the try catch doesn't work!!
if ( info->panel == NULL )
void
ButtonContainerSettings::AddButtons( BCStructVectorType infoList, int type )
{
+ std::cout<< "MLER | ButtonContainerSettings:: AddButtons( BCStructVectorType infoList, int type )" << std::endl;
try
{
for( BCStructVectorType::iterator it = infoList.begin( ); it
{
try
{
+ std::cout<< "MLER | ButtonContainerSettings:: AddItems(BCPSettingsStruct* info)" << std::endl;
//builds the button information
//I don't know the try catch doesn't work!!
if ( info->panel == NULL )
<< "exception: NULL Pointer in panel " << std::endl;
exit( 1 );
}
+
info->panel->Show( false );
+
std::string mapKey = info->groupName + ":" + info->buttonName;
m_itemsMap[mapKey] = info->panel;
ButtonContainerSettings::ItemsMap
ButtonContainerSettings::GetItemsMap()
{
+ std::cout<< "MLER | ButtonContainerSettings:: GetItemsMap()" << std::endl;
return m_itemsMap;
}
ItemsMap
GetItemsMap();
+ PanelButton
+ GetPanelList( const StringType &buttonName );
+
// ----------------------------------------------------------------------------------
private:
namespace creaPanelButtonContainer
{
BEGIN_EVENT_TABLE(PanelButtonContainer,wxPanel)
+ //EVT_LIST_ITEM_SELECTED(-1, ListWx::ListEvent)
+
//(*EventTable(ButtonContainerPanel)
//*)
END_EVENT_TABLE()
PanelButtonContainer::PanelButtonContainer( wxWindow* parent, ButtonContainerSettings* bcSettings, int type )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") )
{
- std::cout<< std::endl << " MLER creaPanelButtonContainer.cxx / PanelButtonContainer() " << std::endl;
+ std::cout<< "MLER | creaPanelButtonContainer:: PanelButtonContainer() " << std::endl;
this->m_ButtonContainerSettings = bcSettings;
this->m_ButtonPanel = new wxPanel( this );
// TConcreteFunctor* functor = new TConcreteFunctor( this->m_ButtonPanel, &PanelButtonContainer::GenericButtonEvent );
//end of the event definition
+ TConcreteFunctor* lFunctor = new TConcreteFunctor( this, &PanelButtonContainer::GenericListEvent );
+ //MLER
- wxPanel* listPanel = new wxPanel(this);
+ this->m_ListPanel = new wxPanel(this);
if(type == 0)
+ {
+ std::cout << "tipo 0; new ButtonContainerPanel"<<std::endl;
this->m_ButtonContainerPanel = new ButtonContainerPanel( this, this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ),type );
+ }
else if( type == 1)
- this->mylist = new ListWx(listPanel, -1, this->m_ButtonContainerSettings->GetItemsMap(), functor);
- //MLER
+ {
+ std::cout << "tipo 1; new LIstWx"<<std::endl;
+ this->mylist = new ListWx(this->m_ListPanel, -1,this->m_ButtonContainerSettings->GetItemsMap(), lFunctor);
+ }//MLER
//Using AuiManager to Manage the Panels
this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT );
- this->m_AuiManager->AddPane(this->m_ButtonPanel, wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+ if(type == 0)
+ this->m_AuiManager->AddPane(this->m_ButtonContainerPanel, wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+ else if(type == 1)
+ this->m_AuiManager->AddPane(this->m_ListPanel, wxAuiPaneInfo( ).Name( _T("ListPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+
//CartoButtonPanel Management
if(type == 0)
- this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(_("creaButtonContainer") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
- else
- this->m_AuiManager->AddPane( listPanel,wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(_("creaButtonContainer") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
+ this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption(_("ListPanel") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
+ else if(type ==1)
+ {this->m_AuiManager->AddPane( this->m_ListPanel,wxAuiPaneInfo( ).Name( _T("ListPanel") ).Caption(_("ListPanel") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );}
this->m_AuiManager->Update( );
}
// ----------------------------------------------------------------------------------
{
try
{
+ std::cout<< "MLER | creaPanelButtonContainer:: UpdatePanel() " << std::endl;
+
//Hiding the last CartoSettingsPanel
this->m_ButtonPanel->Show( false );
//Finding the CartoSettingsPanel of the ButtonClicket
this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(buttonName );
+ std::cout<< buttonName << "---testEvento 2 "<<std::endl;
//changing the parent of the panel!
if ( this->m_ButtonPanel->GetParent( ) != this )
{
this->m_ButtonPanel->Reparent( this );
}//fi
- //CartoSettingsPanel Management
+ //Panel Management
this->m_AuiManager->GetPane( _T("ButtonPanel") ).window = this->m_ButtonPanel;
//Updating the manager
this->m_AuiManager->Update( );
void
PanelButtonContainer::GenericButtonEvent( const std::string &buttonName )
{
+ std::cout<< "MLER | creaPanelButtonContainer:: GenericButtonEvent() " << std::endl;
+ std::cout<< buttonName << "---testEvento 1 "<<std::endl;
this->UpdatePanel( buttonName );
}
// ----------------------------------------------------------------------------------
+
+ void
+ PanelButtonContainer::UpdateListPanel( const std::string &buttonName )
+ {
+ try{
+
+ std::cout<< "MLER | creaPanelButtonContainer:: UpdateListPanel() " << std::endl;
+ std::cout<< buttonName << " --- test 2 "<<std::endl;
+
+ this->m_ListPanel->Show( false );
+
+ this->m_ListPanel = this->m_ButtonContainerSettings->GetPanelList(buttonName );
+
+ if ( this->m_ListPanel->GetParent( ) != this )
+ {
+ this->m_ListPanel->Reparent( this );
+ }//fi
+ //Panel Management
+ this->m_AuiManager->GetPane( _T("ListPanel") ).window = this->m_ListPanel;
+ //Updating the manager
+ this->m_AuiManager->Update( );
+
+ }catch( const std::exception& e )
+ {
+ std::cerr
+ << "PanelButtonContainer::UpdatePanel( const std::string &buttonName )"
+ << "exception: " << e.what( ) << std::endl;
+ std::cout << "Maybe the panel of the list is NULL" << std::endl;
+ exit( 1 );
+ }//hctac
+ }
+
+ void
+ PanelButtonContainer::GenericListEvent( const std::string &buttonName )
+ {
+ std::cout<< "MLER | creaPanelButtonContainer:: GenericListEvent() " << std::endl;
+ std::cout<< buttonName << " --- test 3 "<<std::endl;
+ this->UpdateListPanel( buttonName );
+ }
+
+
}//ecapseman
#include <wx/panel.h>
#include <wx/aui/aui.h>
#include <string>
+#include <wx/gdicmn.h>
#include "containerSettings.h"
#include "buttonContainerPanel.h"
*/
void
GenericButtonEvent( const std::string &buttonName );
+
+ // ----------------------------------------------------------------------------------
+ void
+ UpdateListPanel( const std::string &buttonName );
+
+ void
+ GenericListEvent( const std::string &buttonName );
+ //MLER
+
// ----------------------------------------------------------------------------------
private:
//Settings
ButtonContainerPanel* m_ButtonContainerPanel; //!<This is the panel with de buttons (creaButtonContainer)
wxAuiManager* m_AuiManager; //!<The AUI Manager for the panels.
wxPanel* m_ButtonPanel; //!<This is the panel used to contain the panels of the buttons. (it changes with the buttonAction)
-
+ wxPanel* m_ListPanel;
ListWx* mylist; //MLER