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