]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
creaButtonContainer & creaPanelButtonContainer: Deep errors have been solved!! ready...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / button.h
1 /*!
2  * @file button.h
3  * @brief Contains the Button class.
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-24
6  */
7
8 #ifndef BUTTON_H
9 #define BUTTON_H
10
11 #include <wx/bmpbuttn.h>
12 #include <wx/image.h>
13 #include <wx/string.h>
14 #include <string>
15 #include <iostream>
16 #include <exception>
17 #include "functor.h"
18 #include "system.h"
19
20
21 /*!     @namespace <creaButtonContainer>
22  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
23  */
24 namespace creaButtonContainer
25 {
26         /*! @namespace <creaButtonContainer::view>
27          *      @brief Contains the implementation of the view in creaButtonContainer library.
28          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
29          */
30         namespace view
31         {
32                 /*! @class Button button.h "button.h"
33                  *      @brief This class contains the Button in the view perspective.
34                  *  @details This class contains the information of a button, it derives from wxBitmapButton.
35                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxbitmapbutton.html">wxBitmapButton</a>
36                  */
37                 class Button : public wxBitmapButton
38                 {
39                         public:
40                                 //typedef definition
41                                 /*!     @typedef creaButtonContainer::model::TFunctor TFunctor;
42                                  *      @brief Defines the TFunctor type.
43                                  */
44                                 typedef creaButtonContainer::model::TFunctor TFunctor;
45                                 //end of typedef definition
46                         public:
47                                 // ----------------------------------------------------------------------------------
48                                 /*! @fn Button::Button( wxWindow* parent, long id, ButtonPair* pair );
49                                  *      @brief This is the constructor.
50                                  *      @param parent The wxWindow* parent.
51                                  *      @param id The wxID of the button.
52                                  *      @param pair The button information.
53                                  */
54                                 Button( wxWindow* parent, long id, ButtonPair* pair );
55                                 // ----------------------------------------------------------------------------------
56                                 /*! @fn virtual Button::~Button( );
57                                  *      @brief This is the destructor.
58                                  */
59                                 virtual
60                                 ~Button( );
61                                 // ----------------------------------------------------------------------------------
62                                 /*! @fn long Button::GetID( );
63                                  *      @brief This method gets the wxID of the button.
64                                  *      @return long wxID of the button.
65                                  */
66                                 long
67                                 GetID( );
68                                 // ----------------------------------------------------------------------------------
69                                 /*! @fn std::string Button::GetButtonName( );
70                                  *      @brief This method returns the name of the button.
71                                  *      @return std::string The name of the button.
72                                  */
73                                 std::string
74                                 GetButtonName( );
75                                 // ----------------------------------------------------------------------------------
76                                 /*! @fn std::string Button::GetIconPath( );
77                                  *      @brief This method returns the iconPath of the button.
78                                  *      @return std::string The path of the icon.
79                                  */
80                                 std::string
81                                 GetIconPath( );
82                                 // ----------------------------------------------------------------------------------
83                                 /*! @fn std::string Button::GetDescription( );
84                                  *      @brief This method returns a the description of the button.
85                                  *      @return std::string The tooltip of the button.
86                                  */
87                                 std::string
88                                 GetDescription( );
89                                 // ----------------------------------------------------------------------------------
90                                 /*! @fn void Button::Execute( );
91                                  *      @brief This method executes the Functor (Call_Back Function).
92                                  *      This is the event of the button that it was defined to be called remotely using
93                                  *      call_back functions. In this project it was implemented using Functors.
94                                  *      @exception std::bad_alloc
95                                  *      @see TFunctor
96                                  */
97                                 void
98                                 Execute( );
99                                 // ----------------------------------------------------------------------------------
100                         private:
101                                 ButtonPair* m_ButtonPair; //! <ButtonPair* ButtonPair pointer.
102                 };
103         }//ecapseman
104 }//ecapseman
105
106 #endif // BUTTON_H