]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
Code cleaning done
[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
50 /*!     @namespace <creaButtonContainer>
51  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
52  */
53 namespace creaButtonContainer
54 {
55         /*!     @namespace<creaButtonContainer::controller>
56          *      @brief Contains the implementation of the controller in creaButtonContainer library.
57          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
58          */
59         namespace controller
60         {
61                 /*! @class ButtonContainerController buttonContainerController.h "buttonContainerController.h"
62                  *      @brief This class contains the ButtonContainerPanel controller.
63                  *  @details This class describes the button events, it derives from wxEvtHandler.
64                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxevthandler.html">wxEvtHandler</a>
65                  */
66                 class ButtonContainerController;
67         }
68
69         /*! @namespace <creaButtonContainer::view>
70          *      @brief Contains the implementation of the view in creaButtonContainer library.
71          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
72          */
73         namespace view
74         {
75                 /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
76                  *  @brief This class is the container of the creaButtonContainer.
77                  *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
78                  *  @bug The scrolled it doesn't work! (to be changed soon)
79                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
80                  */
81                 class ButtonContainerPanel: public wxScrolledWindow
82                 {
83                         public:
84                                 //typedef definition
85                                 // ----------------------------------------------------------------------------------
86                                 /*!     @typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
87                                  *      @brief Defines the ButtonGroup type.
88                                  */
89                                 typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
90                                 // ----------------------------------------------------------------------------------
91                                 /*!     @typedef creaButtonContainer::view::GroupManager GroupManager;
92                                  *      @brief Defines the GroupManager type.
93                                  */
94                                 typedef creaButtonContainer::view::GroupManager GroupManager;
95                                 // ----------------------------------------------------------------------------------
96                                 /*!     @typedef std::list< ButtonGroup* > ButtonGroupList;
97                                  *      @brief Defines the ButtonGroupList type.
98                                  */
99                                 typedef std::list<ButtonGroup*> ButtonGroupList;
100                                 // ----------------------------------------------------------------------------------
101                                 /*!     @typedef std::map< long, GroupManager* > GroupManagerList;
102                                  *      @brief Defines the GroupManagerList type.
103                                  */
104                                 typedef std::map<long, GroupManager*> GroupManagerList;
105                                 // ----------------------------------------------------------------------------------
106                                 /*!     @typedef wxFlexGridSizer Sizer;
107                                  *      @brief Defines the Sizer type.
108                                  */
109                                 typedef wxFlexGridSizer Sizer;
110                                 // ----------------------------------------------------------------------------------
111                                 /*!     @typedef std::list< long > KeyList;
112                                  *      @brief Defines the KeyList type.
113                                  */
114                                 typedef std::list<long> KeyList;
115                                 // ----------------------------------------------------------------------------------
116                                 /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
117                                  *      @brief Defines the ButtonGroupSettings type.
118                                  */
119                                 typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
120                                 // ----------------------------------------------------------------------------------
121                                 /*!     @typedef creaButtonContainer::model::ButtonGroupFactory ButtonGroupFactory;
122                                  *      @brief Defines the ButtonGroupFactory type.
123                                  */
124                                 typedef creaButtonContainer::model::ButtonGroupFactory ButtonGroupFactory;
125                                 // ----------------------------------------------------------------------------------
126                                 /*!     creaButtonContainer::controller::ButtonContainerController BCController;
127                                  *      @brief Defines the BCController type.
128                                  */
129                                 typedef creaButtonContainer::controller::ButtonContainerController BCController;
130
131                                 // ----------------------------------------------------------------------------------
132                                 //end of typedef definition
133                         public:
134                                 /*! @fn ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings );
135                                  * @brief This is the parameterized constructor.
136                                  * @param parent wxWindow pointer to parent.
137                                  * @param settings ButtonGroupSettings Pointer to button container settings.
138                                  */
139                                 ButtonContainerPanel(wxWindow* parent, ButtonGroupSettings* settings);
140                                 // ----------------------------------------------------------------------------------
141                                 /*! @fn ~ButtonContainerPanel( );
142                                  * @brief This is the destructor.
143                                  */
144                                 virtual
145                                 ~ButtonContainerPanel();
146                                 // ----------------------------------------------------------------------------------
147                                 /*! @fn SetGroupContainer( ButtonGroupList groupContainer );
148                                  * @brief This method sets the settings to the container.
149                                  * @param groupContainer
150                                  */
151                                 void
152                                 SetButtonGroupContainer(ButtonGroupList groupContainer);
153                                 // ----------------------------------------------------------------------------------
154                                 /*! @fn PanelInit( );
155                                  *      This method initializes the panel.
156                                  *      @exception std::bad_alloc
157                                  */
158                                 void
159                                 PanelInit();
160                                 // ----------------------------------------------------------------------------------
161
162                                 //void
163                                 //SetListGroupContainer(ListGroupList groupContainer );
164                                 // ----------------------------------------------------------------------------------
165                                 /*! @fn FitSizer( );
166                                  * This method fits and organizes the sizer.
167                                  */
168                                 void
169                                 FitSizer();
170                                 // ----------------------------------------------------------------------------------
171                         public:
172                                 friend class creaButtonContainer::controller::ButtonContainerController;
173                         private:
174                                 GroupManagerList m_GroupManagerList; //!<The container of managers.
175                                 ButtonGroupList m_ButtonGroupList; //!<The list of button groups.
176                                 BCController* m_ButtonCController; //!<Pontier to controller.
177                                 Sizer* m_Sizer; //!<Pointer to wxSizer
178
179                                 DECLARE_EVENT_TABLE()
180                                 //!<Event Table declaration.
181                 };
182         } //ecapseman
183 } //ecapseman
184
185 #endif // BUTTONCONTAINERPANEL_H