]> Creatis software - creaMaracasVisu.git/commitdiff
#2647 creaMaracasVisu Feature New Normal - Merge creaButtonContainer BRANCH
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Wed, 27 May 2015 14:10:01 +0000 (16:10 +0200)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Wed, 27 May 2015 14:10:01 +0000 (16:10 +0200)
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/comboBox.cxx [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/comboBox.h [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.cxx [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.h [new file with mode: 0644]

diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/comboBox.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/comboBox.cxx
new file mode 100644 (file)
index 0000000..aa30564
--- /dev/null
@@ -0,0 +1,142 @@
+/*# ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Sant�)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+#include "comboBox.h"
+
+namespace creaButtonContainer
+{
+       namespace view
+       {
+               // ----------------------------------------------------------------------------------
+
+       ComboBox::ComboBox(wxWindow* parent, wxWindowID id, ItemsVector iVector,
+                               TFunctor* functor)
+                               : wxPanel(parent, id)
+               {
+
+                       this->m_Functor = functor;
+
+                       wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
+
+                       this->SetSizer(sizer);
+
+                       this->m_ComboBox = new wxComboBox(this, -1);
+                       this->m_FunctorEnabled = true;
+
+                       this->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED,
+                                       wxCommandEventHandler(ComboBox::OnComboBoxEvent));
+
+                       if (!iVector.empty())
+                       {
+                               for (ItemsVector::iterator it = iVector.begin(); it != iVector.end();
+                                               ++it)
+                               {
+                                       std::string key = it->first;
+                                       this->m_ComboBox->Append(wxString(key.c_str(), wxConvUTF8));
+                               }
+                       }
+
+                       sizer->Add(this->m_ComboBox, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL);
+
+               }
+               // ----------------------------------------------------------------------------------
+
+       ComboBox::ComboBox(wxWindow* parent, wxWindowID id, TFunctor* functor)
+                               : wxPanel(parent, id)
+               {
+                       this->m_Functor = functor;
+
+                       wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
+
+                       this->SetSizer(sizer);
+
+                       this->m_ComboBox = new wxComboBox(this, -1);
+                       this->m_FunctorEnabled = true;
+
+                       this->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED,
+                                       wxCommandEventHandler(ComboBox::OnComboBoxEvent));
+
+                       sizer->Add(this->m_ComboBox, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL);
+
+               }
+               // ----------------------------------------------------------------------------------
+
+       ComboBox::~ComboBox()
+               {
+
+               }
+
+               // ----------------------------------------------------------------------------------
+
+               void ComboBox::OnComboBoxEvent(wxCommandEvent& event)
+               {
+                       if (!this->IsFunctorEnabled())
+                               return;
+                       else
+                       {
+                               try
+                               {
+                                       std::cout << "MLER | ComboBox::OnComboBoxEvent( wxCommandEvent& event )"
+                                                       << std::endl;
+
+                                       int iSelection;
+                                       iSelection = this->m_ComboBox->GetSelection();
+
+                                       wxString itemNom = this->m_ComboBox->GetString(iSelection);
+                                       std::string itemNomC = std::string(itemNom.mb_str());
+
+                                       this->m_Functor->Call(itemNomC);
+
+                               } //yrt
+                               catch (const std::exception& e)
+                               {
+                                       std::cerr
+                                                       << "ButtonContainerController::OnComboBoxEvent( wxCommandEvent& event ) exception: "
+                                                       << e.what() << std::endl;
+                               } //hctac
+                       }
+               }
+               // ----------------------------------------------------------------------------------
+
+               void ComboBox::SetFunctorEnabled(const bool& enabled)
+               {
+                       this->m_FunctorEnabled = enabled;
+               }
+               // ----------------------------------------------------------------------------------
+               bool ComboBox::IsFunctorEnabled() const
+               {
+                       return this->m_FunctorEnabled;
+               }
+
+               // ----------------------------------------------------------------------------------
+               wxComboBox*
+               ComboBox::GetComboBox() const
+               {
+                       return this->m_ComboBox;
+               }
+
+       } //ecapseman
+} //ecapseman
+
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/comboBox.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/comboBox.h
new file mode 100644 (file)
index 0000000..aa359f4
--- /dev/null
@@ -0,0 +1,157 @@
+/*# ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Sant�)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+/*!
+ * @file listWx.h
+ * @brief This contains the ListWx class.
+ * @author Monica ESPINOSA (espinosa[AT]creatis.insa-lyon.fr)
+ * @date  2015-01-02
+ */
+
+#ifndef COMBOBOX_H
+#define COMBOBOX_H
+
+//#include <wx/bmpbuttn.h>
+#include <wx/panel.h>
+#include <wx/string.h>
+#include <wx/combobox.h>
+#include <wx/wx.h>
+#include <wx/event.h>
+
+#include <string>
+#include <vector>
+#include <utility>
+
+#include "functor.h"
+#include "system.h"
+
+/*!    @namespace <creaButtonContainer>
+ *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
+ */
+namespace creaButtonContainer
+{
+       /*! @namespace <creaButtonContainer::view>
+        *      @brief Contains the implementation of the view in creaButtonContainer library.
+        *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
+        */
+       namespace view
+       {
+               /*! @class ListWx listWx.h "listWx.h"
+                *      @brief This class contains the list in the panel.
+                *  @details This class contains the information of a list, it derives from wxPanel.
+                *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxpanel.html">wxPanel</a>
+                */
+               class ComboBox: public wxPanel
+               {
+                       public:
+                               //typedef definition.
+                               // ----------------------------------------------------------------------------------
+                               /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
+                                *      @brief Defines the TFunctor type.
+                                */
+                               typedef creaButtonContainer::model::TFunctor TFunctor;
+                               // ----------------------------------------------------------------------------------
+                               /*!     @typedef std::pair<std::string, wxPanel*> ListAction;
+                                *      @brief Defines the ListAction type.
+                                *      First is the button name(item list), Second FunctionEventType
+                                */
+                               typedef std::pair<std::string, wxPanel*> ListAction;
+                               // ----------------------------------------------------------------------------------
+                               /*!     @typedef std::vector<ListAction> ItemsVector;
+                                *      @brief Defines the Items Vector type.
+                                */
+                               typedef std::vector<ListAction> ItemsVector;
+                               // ----------------------------------------------------------------------------------
+                               //end of typedef definition.
+
+                       public:
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn ListWx( wxWindow* parent, wxWindowID id, ItemsVector iVector,
+                                TFunctor* functor );
+                                *      @brief This is the parameterized constructor.
+                                *      @param parent The wxWindow pointer to parent.
+                                *      @param id The wxID of the button.
+                                *      @param ItemsVector //The items Vector (name, wxPanel).
+                                *      @param TFunctor //The functor of items list.
+                                */
+                               ComboBox(wxWindow* parent, wxWindowID id, ItemsVector iVector,
+                                               TFunctor* functor);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn ListWx( wxWindow* parent, wxWindowID id, TFunctor* functor );
+                                *      @brief This is the parameterized constructor.
+                                *      @param parent The wxWindow pointer to parent.
+                                *      @param id The wxID of the button.
+                                *      @param TFunctor //The functor of items list.
+                                */
+                               ComboBox(wxWindow* parent, wxWindowID id, TFunctor* functor);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn virtual ~Button( );
+                                *      @brief This is the destructor.
+                                */
+                               virtual
+                               ~ComboBox();
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnListEvent( wxCommandEvent& event );
+                                *  @brief This method calls the functor when
+                                *  an item of list is clicked.
+                                *      @param event
+                                */
+                               void
+                               OnComboBoxEvent(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void SetFunctorEnabled( wxCommandEvent& event );
+                                *  @brief This method set the state of Functor (enable or disable)
+                                *      @param enabled
+                                */
+                               void
+                               SetFunctorEnabled(const bool& enabled);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn bool OnListEvent( wxCommandEvent& event );
+                                *  @brief This method ask the state of functor.
+                                *      @return
+                                */
+                               bool
+                               IsFunctorEnabled() const;
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn wxListBox* GetListBox() const;
+                                *      @brief This method returns the wxlistBox.
+                                *      @exception std::bad_alloc
+                                *      @return wxListBox
+                                */
+                               wxComboBox*
+                               GetComboBox() const;
+                               // ----------------------------------------------------------------------------------
+
+                       private:
+
+                               wxComboBox* m_ComboBox;                         //!< This is the Items List.
+                               TFunctor* m_Functor;                            //!< This is the functor.
+                               bool m_FunctorEnabled;                          //!< Disable or Enable Functor.
+
+               };
+       } //ecapseman
+} //ecapseman
+
+#endif // COMBOBOX_H
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.cxx
new file mode 100644 (file)
index 0000000..75d34ac
--- /dev/null
@@ -0,0 +1,242 @@
+/*# ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Sant�)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+#include "listConfigDialog.h"
+
+namespace creaButtonContainer
+{
+
+       namespace view
+       {
+               ListConfigDialog::ListConfigDialog(wxWindow* parent, wxWindowID id,
+                               const wxString& title, ListWx* modelList, ListWx* currentList) :
+                               wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE)
+               {
+                       this->m_OriginalListWx = modelList;
+                       this->m_OriginalListWx->Reparent(this);
+                       this->m_OriginalListWx->Show(true);
+                       this->m_OriginalListWx->SetFunctorEnabled(false);
+
+                       this->m_CurrentListWx = currentList;
+                       this->m_CurrentListWx->Reparent(this);
+                       this->m_CurrentListWx->SetFunctorEnabled(false);
+                       this->m_CurrentListWx->Show(true);
+                       this->m_LastStatus = this->m_CurrentListWx->GetListBox()->GetStrings();
+
+                       wxGridBagSizer* dialogSizer = new wxGridBagSizer(0, 0);
+                       dialogSizer->AddGrowableCol(0);
+                       dialogSizer->AddGrowableRow(0);
+
+                       //Top Sizer
+                       wxGridBagSizer* topSizer = new wxGridBagSizer(0, 0);
+                       topSizer->AddGrowableCol(0);
+                       topSizer->AddGrowableCol(2);
+                       topSizer->AddGrowableRow(0);
+                       topSizer->Add(this->m_OriginalListWx, wxGBPosition(0, 0), wxDefaultSpan,
+                                       wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL
+                                                       | wxALIGN_CENTER_VERTICAL, 5);
+                       wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL);
+
+                       wxBitmap AddIcon(ArrowNextG_xpm); //Icon of button
+
+                       this->m_AddButton = new wxBitmapButton(this, 1, AddIcon,
+                                       wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
+                                       _T(">"));
+
+                       boxSizer1->Add(this->m_AddButton, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+
+                       wxBitmap DeleteIcon(ArrowBackG_xpm); //Icon of button
+
+                       this->m_RemoveButton = new wxBitmapButton(this, 2, DeleteIcon,
+                                       wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
+                                       _T("<"));
+                       boxSizer1->Add(this->m_RemoveButton, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       topSizer->Add(boxSizer1, wxGBPosition(0, 1), wxDefaultSpan,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+
+                       topSizer->Add(this->m_CurrentListWx, wxGBPosition(0, 2), wxDefaultSpan,
+                                       wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL
+                                                       | wxALIGN_CENTER_VERTICAL, 5);
+                       wxBoxSizer* boxSizer2 = new wxBoxSizer(wxVERTICAL);
+
+                       wxBitmap TopIcon(ArrowTopG_xpm); //Icon of button
+
+                       this->m_UpButton = new wxBitmapButton(this, 3, TopIcon,
+                                       wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
+                                       _T("+"));
+                       boxSizer2->Add(this->m_UpButton, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+
+
+                       wxBitmap DownIcon(ArrowDownG_xpm); //Icon of button
+
+                       this->m_DownButton = new wxBitmapButton(this, 4, DownIcon,
+                                       wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
+                                       _T("-"));
+                       boxSizer2->Add(this->m_DownButton, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       topSizer->Add(boxSizer2, wxGBPosition(0, 3), wxDefaultSpan,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       dialogSizer->Add(topSizer, wxGBPosition(0, 0), wxDefaultSpan,
+                                       wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL
+                                                       | wxALIGN_CENTER_VERTICAL, 5);
+
+                       //Bottom Sizer
+
+                       wxBoxSizer* bottomSizer = new wxBoxSizer(wxHORIZONTAL);
+                       bottomSizer->Add(0, 0, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       this->m_CancelButton = new wxButton(this, 5, _("Cancel"),
+                                       wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
+                                       _T("Cancel"));
+                       bottomSizer->Add(this->m_CancelButton, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       this->m_OkButton = new wxButton(this, 6, _("Ok"), wxDefaultPosition,
+                                       wxDefaultSize, 0, wxDefaultValidator, _T("Ok"));
+                       bottomSizer->Add(this->m_OkButton, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       bottomSizer->Add(0, 0, 1,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       dialogSizer->Add(bottomSizer, wxGBPosition(1, 0), wxDefaultSpan,
+                                       wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+                       this->SetSizer(dialogSizer);
+                       dialogSizer->Fit(this);
+                       dialogSizer->SetSizeHints(this);
+
+
+                       //---------------------------------------------------------------------------------------------
+                       // Events
+                       //Add
+                       Connect(1, wxEVT_COMMAND_BUTTON_CLICKED,
+                                       (wxObjectEventFunction) &ListConfigDialog::OnAdd);
+
+                       //Remove
+                       Connect(2, wxEVT_COMMAND_BUTTON_CLICKED,
+                                       (wxObjectEventFunction) &ListConfigDialog::OnDelete);
+
+                       //Up
+                       Connect(3, wxEVT_COMMAND_BUTTON_CLICKED,
+                                       (wxObjectEventFunction) &ListConfigDialog::OnMoveUp);
+
+                       //Down
+                       Connect(4, wxEVT_COMMAND_BUTTON_CLICKED,
+                                       (wxObjectEventFunction) &ListConfigDialog::OnMoveDown);
+
+                       //Cancel
+                       Connect(5, wxEVT_COMMAND_BUTTON_CLICKED,
+                                       (wxObjectEventFunction) &ListConfigDialog::OnCancel);
+
+                       //Ok
+                       Connect(6, wxEVT_COMMAND_BUTTON_CLICKED,
+                                       (wxObjectEventFunction) &ListConfigDialog::OnOk);
+
+               }
+
+               ListConfigDialog::~ListConfigDialog()
+               {
+
+               }
+
+               void ListConfigDialog::OnAdd(wxCommandEvent& event)
+               {
+                       wxString itSelect = m_OriginalListWx->GetListBox()->GetStringSelection();
+                       std::cout << "Count = " << this->m_CurrentListWx->GetListBox()->GetCount()
+                                       << std::endl;
+                       if (!itSelect.IsEmpty())
+                       {
+                               int v = this->m_CurrentListWx->GetListBox()->FindString(itSelect);
+                               if (v == -1)
+                               {
+                                       this->m_CurrentListWx->GetListBox()->Append(itSelect);
+                                       this->m_CurrentListWx->GetListBox()->Update();
+                               }
+                       }
+
+               }
+               void ListConfigDialog::OnDelete(wxCommandEvent& event)
+               {
+                       wxString itSelect = m_CurrentListWx->GetListBox()->GetStringSelection();
+
+                       if (!itSelect.IsEmpty())
+                       {
+                               int v = this->m_CurrentListWx->GetListBox()->FindString(itSelect);
+                               if (v != -1)
+                               {
+                                       this->m_CurrentListWx->GetListBox()->Delete(v);
+                                       this->m_CurrentListWx->GetListBox()->Update();
+                               }
+                       }
+               }
+               void ListConfigDialog::OnMoveUp(wxCommandEvent& event)
+               {
+                       wxString itSelect = m_CurrentListWx->GetListBox()->GetStringSelection();
+
+                       if (!itSelect.IsEmpty())
+                       {
+                               int v = this->m_CurrentListWx->GetListBox()->FindString(itSelect);
+                               if (v > 0)
+                               {
+                                       this->m_CurrentListWx->GetListBox()->Delete(v);
+                                       this->m_CurrentListWx->GetListBox()->Insert(itSelect, v - 1);
+                                       this->m_CurrentListWx->GetListBox()->Update();
+                               }
+                       }
+
+               }
+               void ListConfigDialog::OnMoveDown(wxCommandEvent& event)
+               {
+                       wxString itSelect = m_CurrentListWx->GetListBox()->GetStringSelection();
+
+                       if (!itSelect.IsEmpty())
+                       {
+                               int v = this->m_CurrentListWx->GetListBox()->FindString(itSelect);
+                               std::cout << "Count = "
+                                               << this->m_CurrentListWx->GetListBox()->GetCount() << std::endl;
+                               if ((v < this->m_CurrentListWx->GetListBox()->GetCount() - 1)
+                                               && (v != -1))
+                               {
+                                       this->m_CurrentListWx->GetListBox()->Delete(v);
+                                       this->m_CurrentListWx->GetListBox()->Insert(itSelect, v + 1);
+                                       this->m_CurrentListWx->GetListBox()->Update();
+                               }
+                       }
+
+               }
+               void ListConfigDialog::OnOk(wxCommandEvent& event)
+               {
+
+                       this->EndModal(1);
+               }
+               void ListConfigDialog::OnCancel(wxCommandEvent& event)
+               {
+
+                       this->m_CurrentListWx->GetListBox()->Clear();
+                       this->m_CurrentListWx->GetListBox()->Append(this->m_LastStatus);
+                       this->Close();
+               }
+       }
+}
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.h
new file mode 100644 (file)
index 0000000..d89c17b
--- /dev/null
@@ -0,0 +1,164 @@
+/*# ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Sant�)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+/*!
+ * @file listConfigDialog.h
+ * @brief This contains the ListConfigDialog class.
+ * @author Monica ESPINOSA (espinosa[AT]creatis.insa-lyon.fr)
+ * @date  2015-01-02
+ */
+
+#ifndef LISTCONFIGDIALOG_H
+#define LISTCONFIGDIALOG_H
+
+#include <wx/panel.h>
+#include <wx/sizer.h>
+#include <wx/gbsizer.h>
+#include <wx/wx.h>
+#include <wx/bmpbuttn.h>
+#include <wx/msgdlg.h>
+
+
+#include <string>
+#include <vector>
+
+#include "functor.h"
+#include "listWx.h"
+#include "ArrowBackG.xpm"
+#include "ArrowNextG.xpm"
+#include "ArrowTopG.xpm"
+#include "ArrowDownG.xpm"
+
+/*!    @namespace <creaButtonContainer>
+ *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
+ */
+namespace creaButtonContainer
+{
+       /*! @namespace <creaButtonContainer::view>
+        *      @brief Contains the implementation of the view in creaButtonContainer library.
+        *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
+        */
+       namespace view
+       {
+               /*! @class ListConfigDialog listConfigDialog.h "listConfigDialog.h"
+                *      @brief This class contains the list in the wxDialog.
+                *  @details This class contains the information of a Dialog with the lists, it derives from wxDialog.
+                *  @see <a href="http://docs.wxwidgets.org/trunk/classwx_dialog.html">wxDialog</a>
+                */
+               class ListConfigDialog: public wxDialog
+               {
+                       public:
+                               //typedef definition.
+                               // ----------------------------------------------------------------------------------
+                               /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
+                                *      @brief Defines the TFunctor type.
+                                */
+                               typedef creaButtonContainer::model::TFunctor TFunctor;
+                               /*!     typedef creaButtonContainer::view::ListWx ListWx;
+                                *      @brief Defines the List Panel.
+                                */
+                               typedef creaButtonContainer::view::ListWx ListWx;
+                               // ----------------------------------------------------------------------------------
+                               //end of typedef definition.
+                       public:
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn ListConfigDialog( wxWindow* parent, wxWindowID id,const wxString& title,
+                                ListWx* modelList, ListWx* currentList );
+                                *      @brief This is the parameterized constructor.
+                                *      @param parent The wxWindow pointer to parent.
+                                *      @param id The wxID of the button.
+                                *      @param title //The title wxDialog.
+                                *      @param modelList //The list is filled with the elements of model.
+                                *      @param currentList //The list is filled with the events.
+                                */
+                               ListConfigDialog(wxWindow* parent, wxWindowID id, const wxString& title,
+                                               ListWx* modelList, ListWx* currentList);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn virtual ~Button( );
+                                *      @brief This is the destructor.
+                                */
+                               virtual
+                               ~ListConfigDialog();
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnAdd( wxCommandEvent& event );
+                                *  @brief This method add an item to current list.
+                                *      @param event
+                                */
+                               void
+                               OnAdd(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnDelete( wxCommandEvent& event );
+                                *  @brief This method remove an item of current list.
+                                *      @param event
+                                */
+                               void
+                               OnDelete(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnMoveUp( wxCommandEvent& event );
+                                *  @brief This method move up an item of current list.
+                                *      @param event
+                                */
+                               void
+                               OnMoveUp(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnMoveDown( wxCommandEvent& event );
+                                *  @brief This method move down an item of current list.
+                                *      @param event
+                                */
+                               void
+                               OnMoveDown(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnOk( wxCommandEvent& event );
+                                *  @brief This method confirm the changes of current list.
+                                *      @param event
+                                */
+                               void
+                               OnOk(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void OnCancel( wxCommandEvent& event );
+                                *  @brief This method discard the changes of current list.
+                                *      @param event
+                                */
+                               void
+                               OnCancel(wxCommandEvent& event);
+                               // ----------------------------------------------------------------------------------
+
+                       private:
+
+                               wxBitmapButton* m_AddButton;                            //!< ">" Add button.
+                               wxBitmapButton* m_RemoveButton;                         //!< "<" Remove button.
+                               wxButton* m_OkButton;                           //!< "Ok" Remove button.
+                               wxButton* m_CancelButton;                               //!< "Cancel" Remove button.
+                               wxBitmapButton* m_UpButton;                             //!< "/\" Move Up button.
+                               wxBitmapButton* m_DownButton;                           //!< "\/" Move Down button.
+                               wxArrayString m_LastStatus; //!<Last status array.
+
+                               ListWx* m_OriginalListWx; //!< The Original list.
+                               ListWx* m_CurrentListWx; //!<The Configurable list.
+               };
+       }
+}
+
+#endif // LISTCONFIGDIALOGL_H