]> Creatis software - creaMaracasVisu.git/commitdiff
creaButtonContainer, creaPanelButtonContainer. Cleaned 98% ready to be used :) :) :)
authorDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Sat, 28 May 2011 16:31:44 +0000 (16:31 +0000)
committerDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Sat, 28 May 2011 16:31:44 +0000 (16:31 +0000)
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.h

index 45aeb4f4d83ee54e988c8cdf82275ff8169fc836..67d2861a2b35be8d5f1aeed49ce3b99a101b97ea 100644 (file)
@@ -17,7 +17,6 @@
 #include "functor.h"
 #include "system.h"
 
-
 /*!    @namespace <creaButtonContainer>
  *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
  */
@@ -42,6 +41,7 @@ namespace creaButtonContainer
                                 *      @brief Defines the TFunctor type.
                                 */
                                typedef creaButtonContainer::model::TFunctor TFunctor;
+                               // ----------------------------------------------------------------------------------
                                //end of typedef definition
                        public:
                                // ----------------------------------------------------------------------------------
index 3265447de31e53d75e8c3703609f2918acda461b..934d156ddf465ae30ad0e4bae8bd46efd029f001 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonGroup.cxx
  * @brief Implements the ButtonGroup class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-24
+ * @date  2011-05-28
  */
 
 #include "buttonContainerPanel.h"
@@ -11,6 +11,11 @@ namespace creaButtonContainer
 {
        namespace view
        {
+               BEGIN_EVENT_TABLE(ButtonContainerPanel,wxScrolledWindow)
+               //(*EventTable(ButtonContainerPanel)
+               //*)
+               END_EVENT_TABLE()
+
                // ----------------------------------------------------------------------------------
                ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
                    ButtonGroupSettings* settings ) :
@@ -18,7 +23,7 @@ namespace creaButtonContainer
                                parent,
                                -1,
                                wxDefaultPosition,
-                               wxSize( 400, 400 ),
+                               wxDefaultSize,
                                wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL
                                    | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
                {
index 579ac83941551e2a99bcbb470d003693f0c56e83..a49951f0d7e5df0dd816c2c48e9335832d11f28c 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonContainerController.h
  * @brief This contains the ButtonContainerController class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-24
+ * @date  2011-05-28
  */
 
 #ifndef BUTTONCONTAINERPANEL_H
@@ -148,6 +148,7 @@ namespace creaButtonContainer
                                ButtonGroupList m_ButtonGroupList; //!<The list of button groups.
                                BCController* m_ButtonCController; //!<Pontier to controller.
                                Sizer* m_Sizer; //!<Pointer to wxSizer
+                       DECLARE_EVENT_TABLE() //!<Event Table declaration.
                };
        }//ecapseman
 }//ecapseman
index a9318da37b1040c04fd24a6a64e9d923d9c86329..c2b954ac41e0fa50e77841d1c12599095feb6591 100644 (file)
@@ -2,20 +2,24 @@
  * @file creaPanelButtonContainer.h
  * @brief implements PanelButtonContainer class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-24
+ * @date  2011-05-28
  */
 
 #include "creaPanelButtonContainer.h"
 
 namespace creaPanelButtonContainer
 {
+       BEGIN_EVENT_TABLE(PanelButtonContainer,wxPanel)
+       //(*EventTable(ButtonContainerPanel)
+       //*)
+       END_EVENT_TABLE()
        // ----------------------------------------------------------------------------------
        typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer >
            TConcreteFunctor;
        // ----------------------------------------------------------------------------------
        PanelButtonContainer::PanelButtonContainer( wxWindow* parent,
            ButtonContainerSettings* bcSettings ) :
-                   wxPanel( parent, -1, wxDefaultPosition, wxSize( 300, 700 ),
+                   wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize,
                        wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") )
        {
                this->m_ButtonContainerSettings = bcSettings;
@@ -32,18 +36,16 @@ namespace creaPanelButtonContainer
                //Using AuiManager to Manage the Panels
                this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT );
 
-               // CartoSettingsPanel Management
                this->m_AuiManager->AddPane(
                    this->m_ButtonPanel,
-                   wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( ).CloseButton(
-                       false ).Left( ).MinSize( wxSize( 300, 300 ) ) );
-
+                   wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible(
+                       true ).CloseButton( false ).Bottom( ).Resizable( true ) );
                //CartoButtonPanel Management
                this->m_AuiManager->AddPane(
                    this->m_ButtonContainerPanel,
                    wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(
-                       _("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize(
-                       wxSize( 300, 300 ) ) );
+                       _("creaButtonContainer") ). CaptionVisible( false ).CloseButton(
+                       false ).Center( ).Resizable( true ) );
                this->m_AuiManager->Update( );
        }
        // ----------------------------------------------------------------------------------
@@ -61,6 +63,9 @@ namespace creaPanelButtonContainer
                        //Finding the CartoSettingsPanel of the ButtonClicket
                        this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(
                            buttonName );
+                       //changing the parent of the panel!
+                       if ( this->m_ButtonPanel->GetParent( ) != this )
+                               this->m_ButtonPanel->Reparent( this );
                        //CartoSettingsPanel Management
                        this->m_AuiManager->GetPane( _T("ButtonPanel") ).window
                            = this->m_ButtonPanel;
@@ -72,8 +77,8 @@ namespace creaPanelButtonContainer
                        std::cerr
                            << "PanelButtonContainer::UpdatePanel( const std::string &buttonName )"
                            << "exception: " << e.what( ) << std::endl;
-                       std::cout<<"Maybe the panel of the button is NULL"<<std::endl;
-                       exit(1);
+                       std::cout << "Maybe the panel of the button is NULL" << std::endl;
+                       exit( 1 );
                }//hctac
        }
        // ----------------------------------------------------------------------------------
index 1872527620bd966a9da942477778a0bd6032151d..aac12ec76afb0549a1b453df8c940d18bc9dab6e 100644 (file)
@@ -2,7 +2,7 @@
  * @file PanelButtonContainer
  * @brief This contains the ButtonContainerSettings class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-24
+ * @date  2011-05-28
  */
 
 #ifndef PANELBUTTONCONTAINER_H_
@@ -66,7 +66,7 @@ namespace creaPanelButtonContainer
                        void
                        UpdatePanel( const std::string &buttonName );
                        // ----------------------------------------------------------------------------------
-                       /*! @fn
+                       /*! @fn void GenericButtonEvent( const std::string &buttonName );
                         *      @brief This method is the function that calls the panels contained in the buttons
                         *      (in creaButtonContainer is the function contained in the functors to be called back.
                         *      @param buttonName
@@ -81,6 +81,7 @@ namespace creaPanelButtonContainer
                        ButtonContainerPanel* m_ButtonContainerPanel; //!<This is the panel with de buttons (creaButtonContainer)
                        wxAuiManager* m_AuiManager; //!<The AUI Manager for the panels.
                        wxPanel* m_ButtonPanel; //!<This is the panel used to contain the panels of the buttons. (it changes with the buttonAction)
+               DECLARE_EVENT_TABLE() //!<Event Table declaration.
        };
 }//ecapseman