]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
b7a8fb6093a95b6d3ab7427ee33cd32d7a063367
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / button.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 button.h
28  * @brief Contains the Button class.
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef BUTTON_H
34 #define BUTTON_H
35
36 #include <wx/bmpbuttn.h>
37 #include <wx/image.h>
38 #include <wx/string.h>
39 #include <wx/bitmap.h>
40
41 #include "system.h"
42
43 /*!     @namespace <creaButtonContainer>
44  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
45  */
46 namespace creaButtonContainer
47 {
48         /*! @namespace <creaButtonContainer::view>
49          *      @brief Contains the implementation of the view in creaButtonContainer library.
50          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
51          */
52         namespace view
53         {
54                 /*! @class Button button.h "button.h"
55                  *      @brief This class contains the Button in the view perspective.
56                  *  @details This class contains the information of a button, it derives from wxBitmapButton.
57                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxbitmapbutton.html">wxBitmapButton</a>
58                  */
59                 class Button : public wxBitmapButton
60                 {
61                         public:
62                                 //typedef definition
63                                 // ----------------------------------------------------------------------------------
64                                 /*!     @typedef creaButtonContainer::model::TFunctor TFunctor;
65                                  *      @brief Defines the TFunctor type.
66                                  */
67                                 typedef creaButtonContainer::model::TFunctor TFunctor;
68                                 // ----------------------------------------------------------------------------------
69                                 //end of typedef definition
70                         public:
71                                 
72                                 // ----------------------------------------------------------------------------------
73                                 /*! @fn Button::Button( wxWindow* parent, long id, ButtonPair* pair );
74                                  *      @brief This is the constructor.
75                                  *      @param parent The wxWindow* parent.
76                                  *      @param id The wxID of the button.
77                                  *      @param pair The button information.
78                                  */
79                                 Button( wxWindow* parent, long id, ButtonPair* pair );
80                                 // ----------------------------------------------------------------------------------
81                                 /*! @fn virtual Button::~Button( );
82                                  *      @brief This is the destructor.
83                                  */
84                                 virtual
85                                 ~Button( );
86                                 // ----------------------------------------------------------------------------------
87                                 /*! @fn long Button::GetID( );
88                                  *      @brief This method gets the wxID of the button.
89                                  *      @return long wxID of the button.
90                                  */
91                                 long
92                                 GetID( );
93                                 // ----------------------------------------------------------------------------------
94                                 /*! @fn std::string Button::GetButtonName( );
95                                  *      @brief This method returns the name of the button.
96                                  *      @return std::string The name of the button.
97                                  */
98                                 StringType
99                                 GetButtonName( );
100                                 
101                                 // ----------------------------------------------------------------------------------
102                                 /*! @fn std::string Button::GetIconPath( );
103                                  *      @brief This method returns the iconPath of the button.
104                                  *      @return std::string The path of the icon.
105                                  */
106                                 BitmapType
107                                 GetIcon( );
108
109                                 // ----------------------------------------------------------------------------------
110                                 /*! @fn std::string Button::GetIconPath( );
111                                  *      @brief This method returns the iconPath of the button.
112                                  *      @return std::string The path of the icon.
113                                  */
114                                 //StringType
115                                 //GetIconPath( );
116                                 // ----------------------------------------------------------------------------------
117                                 /*! @fn std::string Button::GetDescription( );
118                                  *      @brief This method returns a the description of the button.
119                                  *      @return std::string The tooltip of the button.
120                                  */
121                                 StringType
122                                 GetDescription( );
123                                 // ----------------------------------------------------------------------------------
124                                 /*! @fn void Button::Execute( );
125                                  *      @brief This method executes the Functor (Call_Back Function).
126                                  *      This is the event of the button that it was defined to be called remotely using
127                                  *      call_back functions. In this project it was implemented using Functors.
128                                  *      @exception std::bad_alloc
129                                  *      @see TFunctor
130                                  */
131                                 void
132                                 Execute( );
133                                 // ----------------------------------------------------------------------------------
134                         private:
135                                 ButtonPair* m_ButtonPair; //! <The pair with the button information.
136                                 
137                 };
138         }//ecapseman
139 }//ecapseman
140
141 #endif // BUTTON_H