]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.h
9b7aca409e019cfc9338eedc9ac945144070cf9f
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / buttonManager.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 buttonManager.h
28  * @brief This contains the ButtonManager class.
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef CARTOBUTTONCONTAINER_H
34 #define CARTOBUTTONCONTAINER_H
35
36 #include <wx/sizer.h>
37 #include <wx/bmpbuttn.h>
38 #include <wx/stattext.h>
39 #include <wx/string.h>
40
41 #include <map>
42 #include <exception>
43
44 #include "button.h"
45 #include "buttonGroup.h"
46
47 /*!     @namespace <creaButtonContainer>
48  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
49  */
50 namespace creaButtonContainer
51 {
52         /*! @namespace <creaButtonContainer::view>
53          *      @brief Contains the implementation of the view in creaButtonContainer library.
54          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
55          */
56         namespace view
57         {
58                 /*! @class ButtonManager buttonManager.h "buttonManager.h"
59                  *      @brief This class contains the ButtonManager view.
60                  *  @details This class describes a wxFlexGridSizer with the button manager.
61                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxflexGridSizer.html">wxFlexGridSizer</a>
62                  */
63                 class ButtonManager : public wxFlexGridSizer
64                 {
65                         public:
66                                 //typedef definition.
67                                 // ----------------------------------------------------------------------------------
68                                 /*!     @typedef creaButtonContainer::view::Button Button;
69                                  *      @brief Defines the Button type.
70                                  */
71                                 typedef creaButtonContainer::view::Button Button;
72                                 // ----------------------------------------------------------------------------------
73                                 /*!     @typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
74                                  *      @brief Defines the ButtonGroup type.
75                                  */
76                                 typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
77                                 // ----------------------------------------------------------------------------------
78                                 /*!     @typedef std::map< long, Button* > ButtonContainer;
79                                  *      @brief Defines the ButtonContainer type.
80                                  */
81                                 typedef std::map< long, Button* > ButtonContainer;
82                                 // ----------------------------------------------------------------------------------
83                                 //end of typedef definition.
84                         public:
85                                 // ----------------------------------------------------------------------------------
86                                 /*! @fn ButtonManager( );
87                                  * @brief This is the default constructor.
88                                  * @exception std::bad_alloc
89                                  */
90                                 ButtonManager( );
91                                 // ----------------------------------------------------------------------------------
92                                 /*! @fn ButtonManager( ButtonGroup* buttonGroup );
93                                  * @brief This is the parameterized constructor
94                                  * @param buttonGroup The group of buttons.
95                                  */
96                                 ButtonManager( ButtonGroup* buttonGroup );
97                                 // ----------------------------------------------------------------------------------
98                                 /*! @fn ~ButtonManager( );
99                                  * @brief This is the destructor.
100                                  */
101                                 virtual
102                                 ~ButtonManager( );
103                                 // ----------------------------------------------------------------------------------
104                                 /*! @fn SetGroupName( wxStaticText* groupName );
105                                  * @details Sets the groupName.
106                                  * @param groupName
107                                  */
108                                 void
109                                 SetGroupName( wxStaticText* groupName );
110                                 // ----------------------------------------------------------------------------------
111                                 /*! @fn ShowButtonManager( );
112                                  * @brief This method shows the ButtonManager
113                                  */
114                                 void
115                                 ShowButtonManager( );
116                                 // ----------------------------------------------------------------------------------
117                                 /*! @fn HideButtonManager( );
118                                  * @brief This method hides the ButtonManager.
119                                  * @exception std::bad_alloc
120                                  */
121                                 void
122                                 HideButtonManager( );
123                                 // ----------------------------------------------------------------------------------
124                         private:
125                                 // ----------------------------------------------------------------------------------
126                                 /*! @fn SetButtonManager( ButtonContainer buttonContainer );
127                                  * @brief This method set the buttons and it is private.
128                                  * @param buttonContainer
129                                  */
130                                 void
131                                 SetButtonManager( ButtonContainer buttonContainer );
132                                 // ----------------------------------------------------------------------------------
133                         private:
134                                 wxStaticText* m_GroupName; //!<The name of the group.
135                                 wxGridSizer* m_GridSizer; //!<The sizer that contains the buttons.
136                 };
137         }//ecapseman
138 }//ecapseman
139
140 #endif // CARTOBUTTONCONTAINER_H