]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
creaButtonContainer: new structure to make easy the button settings
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / buttonContainerPanel.h
1 /*!
2  * @file buttonContainerController.h
3  * @brief This contains the ButtonContainerController class
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-24
6  */
7
8 #ifndef BUTTONCONTAINERPANEL_H
9 #define BUTTONCONTAINERPANEL_H
10
11 #include <wx/scrolwin.h>
12 #include <wx/button.h>
13 #include <wx/sizer.h>
14 #include <list>
15 #include <map>
16
17 #include "buttonGroup.h"
18 #include "groupManager.h"
19 #include "buttonGroupFactory.h"
20 #include "containerSettings.h"
21 #include "buttonContainerController.h"
22
23 /*!     @namespace <creaButtonContainer>
24  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
25  */
26 namespace creaButtonContainer
27 {
28         /*!     @namespace<creaButtonContainer::controller>
29          *      @brief Contains the implementation of the controller in creaButtonContainer library.
30          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
31          */
32         namespace controller
33         {
34                 /*! @class ButtonContainerController buttonContainerController.h "buttonContainerController.h"
35                  *      @brief This class contains the ButtonContainerPanel controller.
36                  *  @details This class describes the button events, it derives from wxEvtHandler and it is the
37                  *  controller in the MVC.
38                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxevthandler.html">wxEvtHandler</a>
39                  */
40                 class ButtonContainerController;
41         }
42
43         /*! @namespace <creaButtonContainer::view>
44          *      @brief Contains the implementation of the view in creaButtonContainer library.
45          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
46          */
47         namespace view
48         {
49                 /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
50                  *  @brief This class is the container of the creaButtonContainer.
51                  *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
52                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
53                  */
54                 class ButtonContainerPanel : public wxScrolledWindow
55                 {
56                         public:
57                                 //typedef definition
58                                 // ----------------------------------------------------------------------------------
59                                 /*!     @typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
60                                  *      @brief Defines the ButtonGroup type.
61                                  */
62                                 typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
63                                 // ----------------------------------------------------------------------------------
64                                 /*!     @typedef creaButtonContainer::view::GroupManager GroupManager;
65                                  *      @brief Defines the GroupManager type.
66                                  */
67                                 typedef creaButtonContainer::view::GroupManager GroupManager;
68                                 // ----------------------------------------------------------------------------------
69                                 /*!     @typedef std::list< ButtonGroup* > ButtonGroupList;
70                                  *      @brief Defines the ButtonGroupList type.
71                                  */
72                                 typedef std::list< ButtonGroup* > ButtonGroupList;
73                                 // ----------------------------------------------------------------------------------
74                                 /*!     @typedef std::map< long, GroupManager* > GroupManagerList;
75                                  *      @brief Defines the GroupManagerList type.
76                                  */
77                                 typedef std::map< long, GroupManager* > GroupManagerList;
78                                 // ----------------------------------------------------------------------------------
79                                 /*!     @typedef wxFlexGridSizer Sizer;
80                                  *      @brief Defines the Sizer type.
81                                  */
82                                 typedef wxFlexGridSizer Sizer;
83                                 // ----------------------------------------------------------------------------------
84                                 /*!     @typedef std::list< long > KeyList;
85                                  *      @brief Defines the KeyList type.
86                                  */
87                                 typedef std::list< long > KeyList;
88                                 // ----------------------------------------------------------------------------------
89                                 /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
90                                  *      @brief Defines the ButtonGroupSettings type.
91                                  */
92                                 typedef creaButtonContainer::model::ContainerSettings
93                                     ButtonGroupSettings;
94                                 // ----------------------------------------------------------------------------------
95                                 /*!     @typedef creaButtonContainer::model::ButtonGroupFactory ButtonGroupFactory;
96                                  *      @brief Defines the ButtonGroupFactory type.
97                                  */
98                                 typedef creaButtonContainer::model::ButtonGroupFactory
99                                     ButtonGroupFactory;
100                                 // ----------------------------------------------------------------------------------
101                                 /*!     creaButtonContainer::controller::ButtonContainerController BCController;
102                                  *      @brief Defines the BCController type.
103                                  */
104                                 typedef creaButtonContainer::controller::ButtonContainerController
105                                     BCController;
106                                 // ----------------------------------------------------------------------------------
107                                 //end of typedef definition
108                         public:
109                                 /*! @fn ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings );
110                                  * @brief This is the parameterized constructor.
111                                  * @param parent wxWindow pointer to parent.
112                                  * @param settings ButtonGroupSettings Pointer to button container settings.
113                                  */
114                                 ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings );
115                                 // ----------------------------------------------------------------------------------
116                                 /*! @fn ~ButtonContainerPanel( );
117                                  * @brief This is the destructor.
118                                  */
119                                 virtual
120                                 ~ButtonContainerPanel( );
121                                 // ----------------------------------------------------------------------------------
122                                 /*! @fn SetGroupContainer( ButtonGroupList groupContainer );
123                                  * @brief This method sets the settings to the container.
124                                  * @param groupContainer
125                                  */
126                                 void
127                                 SetGroupContainer( ButtonGroupList groupContainer );
128                                 // ----------------------------------------------------------------------------------
129                                 /*! @fn PanelInit( );
130                                  *      This method initializes the panel.
131                                  *      @exception std::bad_alloc
132                                  */
133                                 void
134                                 PanelInit( );
135                                 // ----------------------------------------------------------------------------------
136                                 /*! @fn FitSizer( );
137                                  * This method fits and organizes the sizer.
138                                  */
139                                 void
140                                 FitSizer( );
141                                 // ----------------------------------------------------------------------------------
142                         public:
143                                 friend class creaButtonContainer::controller::ButtonContainerController;
144                         private:
145                                 GroupManagerList m_GroupManagerList; //!<The container of managers.
146                                 ButtonGroupList m_ButtonGroupList; //!<The list of button groups.
147                                 BCController* m_ButtonCController; //!<Pontier to controller.
148                                 Sizer* m_Sizer; //!<Pointer to wxSizer
149                 };
150         }//ecapseman
151 }//ecapseman
152
153 #endif // BUTTONCONTAINERPANEL_H