]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
#2502 creaMaracasVisu Feature New Normal - alternation between containers: button...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / buttonContainerPanel.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*!
27  * @file buttonContainerController.h
28  * @brief This contains the ButtonContainerController class
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef BUTTONCONTAINERPANEL_H
34 #define BUTTONCONTAINERPANEL_H
35
36 #include <wx/scrolwin.h>
37 #include <wx/button.h>
38 #include <wx/sizer.h>
39
40 #include <list>
41 #include <map>
42 #include <exception>
43
44 #include "buttonGroup.h"
45 #include "groupManager.h"
46 #include "buttonGroupFactory.h"
47 #include "containerSettings.h"
48 #include "buttonContainerController.h"
49 #include "listGroup.h"
50 #include "listGroupFactory.h"
51
52 /*!     @namespace <creaButtonContainer>
53  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
54  */
55 namespace creaButtonContainer
56 {
57         /*!     @namespace<creaButtonContainer::controller>
58          *      @brief Contains the implementation of the controller in creaButtonContainer library.
59          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
60          */
61         namespace controller
62         {
63                 /*! @class ButtonContainerController buttonContainerController.h "buttonContainerController.h"
64                  *      @brief This class contains the ButtonContainerPanel controller.
65                  *  @details This class describes the button events, it derives from wxEvtHandler.
66                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxevthandler.html">wxEvtHandler</a>
67                  */
68                 class ButtonContainerController;
69         }
70
71         /*! @namespace <creaButtonContainer::view>
72          *      @brief Contains the implementation of the view in creaButtonContainer library.
73          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
74          */
75         namespace view
76         {
77                 /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
78                  *  @brief This class is the container of the creaButtonContainer.
79                  *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
80                  *  @bug The scrolled it doesn't work! (to be changed soon)
81                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
82                  */
83                 class ButtonContainerPanel : public wxScrolledWindow
84                 {
85                         public:
86                                 //typedef definition
87                                 // ----------------------------------------------------------------------------------
88                                 /*!     @typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
89                                  *      @brief Defines the ButtonGroup type.
90                                  */
91                                 typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
92                                 // ----------------------------------------------------------------------------------
93                                 /*!     @typedef creaButtonContainer::view::GroupManager GroupManager;
94                                  *      @brief Defines the GroupManager type.
95                                  */
96                                 typedef creaButtonContainer::view::GroupManager GroupManager;
97                                 // ----------------------------------------------------------------------------------
98                                 /*!     @typedef std::list< ButtonGroup* > ButtonGroupList;
99                                  *      @brief Defines the ButtonGroupList type.
100                                  */
101                                 typedef std::list< ButtonGroup* > ButtonGroupList;
102                                 // ----------------------------------------------------------------------------------
103                                 /*!     @typedef std::map< long, GroupManager* > GroupManagerList;
104                                  *      @brief Defines the GroupManagerList type.
105                                  */
106                                 typedef std::map< long, GroupManager* > GroupManagerList;
107                                 // ----------------------------------------------------------------------------------
108                                 /*!     @typedef wxFlexGridSizer Sizer;
109                                  *      @brief Defines the Sizer type.
110                                  */
111                                 typedef wxFlexGridSizer Sizer;
112                                 // ----------------------------------------------------------------------------------
113                                 /*!     @typedef std::list< long > KeyList;
114                                  *      @brief Defines the KeyList type.
115                                  */
116                                 typedef std::list< long > KeyList;
117                                 // ----------------------------------------------------------------------------------
118                                 /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
119                                  *      @brief Defines the ButtonGroupSettings type.
120                                  */
121                                 typedef creaButtonContainer::model::ContainerSettings
122                                     ButtonGroupSettings;
123                                 // ----------------------------------------------------------------------------------
124                                 /*!     @typedef creaButtonContainer::model::ButtonGroupFactory ButtonGroupFactory;
125                                  *      @brief Defines the ButtonGroupFactory type.
126                                  */
127                                 typedef creaButtonContainer::model::ButtonGroupFactory
128                                     ButtonGroupFactory;
129                                 // ----------------------------------------------------------------------------------
130                                 /*!     creaButtonContainer::controller::ButtonContainerController BCController;
131                                  *      @brief Defines the BCController type.
132                                  */
133                                 typedef creaButtonContainer::controller::ButtonContainerController
134                                     BCController;
135
136                                 typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
137
138                                 typedef creaButtonContainer::view::ListGroup ListGroup;
139
140                                 typedef std::list< ListGroup* > ListGroupList;
141
142                                 //typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
143
144                                 // ----------------------------------------------------------------------------------
145                                 //end of typedef definition
146                         public:
147                                 /*! @fn ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings );
148                                  * @brief This is the parameterized constructor.
149                                  * @param parent wxWindow pointer to parent.
150                                  * @param settings ButtonGroupSettings Pointer to button container settings.
151                                  */
152                                 ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, int type );
153                                 // ----------------------------------------------------------------------------------
154                                 /*! @fn ~ButtonContainerPanel( );
155                                  * @brief This is the destructor.
156                                  */
157                                 virtual
158                                 ~ButtonContainerPanel( );
159                                 // ----------------------------------------------------------------------------------
160                                 /*! @fn SetGroupContainer( ButtonGroupList groupContainer );
161                                  * @brief This method sets the settings to the container.
162                                  * @param groupContainer
163                                  */
164                                 void
165                                 SetButtonGroupContainer( ButtonGroupList groupContainer );
166                                 // ----------------------------------------------------------------------------------
167                                 /*! @fn PanelInit( );
168                                  *      This method initializes the panel.
169                                  *      @exception std::bad_alloc
170                                  */
171                                 void
172                                 PanelInit( int type);
173                                 // ----------------------------------------------------------------------------------
174
175                                 void
176                                 SetListGroupContainer(ListGroupList groupContainer );
177                                 // ----------------------------------------------------------------------------------
178                                 /*! @fn FitSizer( );
179                                  * This method fits and organizes the sizer.
180                                  */
181                                 void
182                                 FitSizer( );
183                                 // ----------------------------------------------------------------------------------
184                         public:
185                                 friend class creaButtonContainer::controller::ButtonContainerController;
186                         private:
187                                 GroupManagerList m_GroupManagerList; //!<The container of managers.
188                                 ButtonGroupList m_ButtonGroupList; //!<The list of button groups.
189                                 BCController* m_ButtonCController; //!<Pontier to controller.
190                                 Sizer* m_Sizer; //!<Pointer to wxSizer
191
192                                 ListGroupList m_ListGroupList;
193                         DECLARE_EVENT_TABLE() //!<Event Table declaration.
194                 };
195         }//ecapseman
196 }//ecapseman
197
198 #endif // BUTTONCONTAINERPANEL_H