]> Creatis software - creaMaracasVisu.git/commitdiff
#2516 creaMaracasVisu Feature New Normal - creaPanelButtonContainer ListPanel with...
authorespinosa <espinosa@creatis.insa-lyon.fr>
Mon, 2 Feb 2015 23:03:35 +0000 (00:03 +0100)
committerespinosa <espinosa@creatis.insa-lyon.fr>
Mon, 2 Feb 2015 23:03:35 +0000 (00:03 +0100)
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listConfigDialog.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.h

index d1b1776fd40a3616249ed5154a4f267053501c7c..154bac42f6c06a8ccb1a1d83c0da399298d4ba2c 100644 (file)
@@ -43,6 +43,7 @@ namespace creaButtonContainer
                        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);
@@ -90,6 +91,8 @@ namespace creaButtonContainer
                                        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);
@@ -211,11 +214,15 @@ namespace creaButtonContainer
                }
                void ListConfigDialog::OnOk(wxCommandEvent& event)
                {
+
                        this->EndModal(1);
                }
                void ListConfigDialog::OnCancel(wxCommandEvent& event)
                {
-                       Close();
+
+                       this->m_CurrentListWx->GetListBox()->Clear();
+                       this->m_CurrentListWx->GetListBox()->Append(this->m_LastStatus);
+                       this->Close();
                }
        }
 }
index f878bd6e276b8bacce751127763322fe0f9102f0..7c34317871fb1d8a59d4c02be8361fea26769e7f 100644 (file)
@@ -38,6 +38,8 @@
 #include <wx/gbsizer.h>
 #include <wx/wx.h>
 #include <wx/bmpbuttn.h>
+#include <wx/msgdlg.h>
+
 
 #include <string>
 #include <vector>
@@ -147,6 +149,7 @@ namespace creaButtonContainer
                                wxButton* m_CancelButton;                               //!< "Cancel" Remove button.
                                wxBitmapButton* m_UpButton;                             //!< "/\" Remove button.
                                wxBitmapButton* m_DownButton;                           //!< "\/" Remove button.
+                               wxArrayString m_LastStatus; //!<Last status array.
 
                                ListWx* m_OriginalListWx; //!< The Original list.
                                ListWx* m_CurrentListWx; //!<The Configurable list.
index b23fe4bfeae59092422ad45eb45128c44e3fdcfe..93cf74cf778684ea7eace66fd37a82884c540e8f 100644 (file)
@@ -103,7 +103,8 @@ namespace creaPanelButtonContainer
                        TConcreteFunctor* lFunctor = new TConcreteFunctor(this,
                                        &PanelButtonContainer::GenericListEvent);
 
-                       this->m_EventPanel = new wxPanel(this);
+                       this->m_EmptyPanel = new wxPanel(this);
+                       this->m_EventPanel = this->m_EmptyPanel;
 
                        this->m_PanelUp = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize,
                                        wxTAB_TRAVERSAL, _T("ListConfigContainerPanel"));
@@ -242,14 +243,23 @@ namespace creaPanelButtonContainer
 
                std::cout << "Button Event" << std::endl;
 
+               this->m_EventPanel->Show(false);
+
                this->m_ListConfigDialog->ShowModal();                                                  //Show Dialog
                this->m_CurrentWxPanel->Reparent(this->m_PanelUp);
                this->m_CurrentWxPanel->Show(true);
                this->m_CurrentWxPanel->SetFunctorEnabled(true);
+
+               this->m_CurrentWxPanel->GetListBox()->Deselect(
+                               this->m_CurrentWxPanel->GetListBox()->GetSelection());
                this->m_CurrentWxPanel->Update();
                this->m_ListWxPanel->Show(false);
                this->m_EventPanel->Show(false);
+               this->m_EventPanel = this->m_EmptyPanel;
+
+               this->m_AuiManager->GetPane(_T("EventPanel")).window = this->m_EventPanel;
                this->m_AuiManager->Update();
+
        }
        //End MLER
 // ----------------------------------------------------------------------------------
index b0cb014fc8a0e1f673b7b838852d2940f20ad005..5afb5dceb7dcab0418b15ec7f94459638f2ba57e 100644 (file)
@@ -156,6 +156,7 @@ namespace creaPanelButtonContainer
                        ListConfigDialog* m_ListConfigDialog;//!<This wxDialog shows the list of the elements and allows  modifications.
 
                        wxPanel* m_PanelUp;//!<This panel contains the list of the elements empty,full and the config button.
+                       wxPanel* m_EmptyPanel; //!<This panel is empty.
                        ListWx* m_CurrentWxPanel;//!<This panel contains the final list of the elements .
 
                        wxBitmapButton* m_ConfigButton;//!< "Config" Settings button.