]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
compile
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
1 //----------------------------------------------------------------------------------------------------------------
2 // Class definition include
3 //----------------------------------------------------------------------------------------------------------------
4 #include "wxContourMainFrame.h"
5
6 //----------------------------------------------------------------------------------------------------------------
7 // Includes
8 //----------------------------------------------------------------------------------------------------------------
9
10
11 #include "NameWrapper.h"
12 #include "wx/artprov.h"
13 #include "ConceptDataWrap.h"
14
15 #include <manualContour.h>
16 #include "ImageSourceThing.h"
17 #include "vtkImageData.h"
18 #include "wxContour_ActionCommandsID.h"
19
20 //----------------------------------------------------------------------------------------------------------------
21 // Class implementation
22 //----------------------------------------------------------------------------------------------------------------
23 /** @file wxContourMainFrame.cxx */
24
25         //------------------------------------------------------------------------------------------------------------
26         // Constructors & Destructors
27         //------------------------------------------------------------------------------------------------------------
28                 
29         wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style)
30                 //: wxPanel(parent, id, title, pos, size, style)
31                 //: wxWindow(parent, id, pos, size, style)
32                 : wxPanel(parent, id, pos, size, style)
33         {
34                 m_mgr.SetManagedWindow(this);
35                 _creatingContoursActive         = false;
36                 _theViewPanel                           = NULL;
37                 _modelManager                           = NULL;
38                 _instantPanel                           = NULL;
39                 _buttonsBar                                     = NULL;
40                 _gridPanel                                      = NULL; 
41                 _drawToolsPanel                         = NULL;
42                 _operationsToolsPanel           = NULL;
43                 _autoFormsPanel                         = NULL; 
44                 _standardToolsPanel                     = NULL;
45                 _editionToolsPanel                      = NULL;
46                 _listViewPanel                          = NULL;
47                 _sceneManager                           = NULL;
48                 _actualInstant                          = NULL;
49
50                 // set up default notebook style
51                 m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
52                 m_notebook_theme = 0;   
53                 wxContour_ActionCommandsID a;
54         }
55
56         wxContourMainFrame :: ~wxContourMainFrame()
57         {
58                   m_mgr.UnInit();
59                   //El problema al cerrar la aplicacion puede estar asociado 
60                   //a que  wxAUINotebook esta en la aplicacion 
61                   //principal (wxContourGUIExample)tambien
62 //EED????               delete _theViewPanel;             
63 //EED????               delete _instantPanel;
64 //EED????               delete _buttonsBar;
65 //EED????               delete _actualInstant;           
66 //EED????               delete _sceneManager;
67         }
68
69
70         //------------------------------------------------------------------------------------------------------------
71         // Creational and initialization methods using WxAui
72         //------------------------------------------------------------------------------------------------------------
73         //
74         wxAuiNotebook * wxContourMainFrame :: createNotebook()
75         {
76                 wxSize client_size = GetClientSize();
77                 wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
78                 wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
79                 return noteBook;
80         }
81         
82
83         //------------------------------------------------------------------------------------------------------------
84         // Creational and initialization methods 
85         //------------------------------------------------------------------------------------------------------------
86         bool wxContourMainFrame :: configurePanels(wxAuiNotebook* theNoteBook)
87         {
88                 bool configured = _theViewPanel!=NULL;
89                                         
90                 configured &= _theViewPanel!=NULL;
91                 if( _theViewPanel!=NULL )
92                 {
93                         theNoteBook->AddPage( _theViewPanel, wxT("       View       ") );               
94                         m_mgr.Update();
95                 }
96
97
98                 if( configured )
99                 {
100                         theNoteBook->AddPage( _instantPanel, wxT("Instant Page") );
101                         m_mgr.Update();
102                 }
103
104                 m_mgr.AddPane(theNoteBook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
105                 m_mgr.Update();
106                 configured &= _buttonsBar!=NULL;
107                 if( _buttonsBar!=NULL )
108                 {                       
109                         m_mgr.AddPane(_buttonsBar, wxAuiPaneInfo().
110                                         Name(wxT("TB")).Caption(wxT("Buttons Bar")).
111                                         ToolbarPane().Top().
112                                         LeftDockable(  ).RightDockable( false ).CloseButton(false));
113                         m_mgr.Update();
114                 }
115                 //CreateStatusBar();
116                          
117                 SetMinSize(wxSize(300,300));
118                 m_mgr.Update();
119                 return configured;
120         }
121
122         void wxContourMainFrame :: setNotebook( wxAuiNotebook * noteBook )
123         {
124
125         }
126
127         //------------------------------------------------------------------------------------------------------------
128         //  Attributes getters and setters
129         //------------------------------------------------------------------------------------------------------------
130         
131
132         void wxContourMainFrame :: setViewPanel(  wxContourViewPanel * theViewPanel )
133         {
134                 _theViewPanel = theViewPanel;           
135         }
136
137         void wxContourMainFrame :: setInstantChooserPanel(  wxInstantChooserPanel * theInstantChooserPanel )
138         {
139                 _instantPanel = theInstantChooserPanel; 
140         }
141
142         void wxContourMainFrame :: setButtonsBar(  wxContour_ButtonsBar * theButtonsBar )
143         {
144                 _buttonsBar = theButtonsBar;
145         }
146
147         void wxContourMainFrame :: setGrid(  wxContour_Grid * theGridPanel )
148         {
149                 _gridPanel = theGridPanel;
150         }
151
152         void wxContourMainFrame :: setDrawToolsPanel(  wxContour_DrawToolsPanel * theDrawToolsPanel )
153         {
154                 _drawToolsPanel = theDrawToolsPanel;
155         }
156
157         void wxContourMainFrame :: setOperationsToolsPanel(  wxContour_OperationsToolsPanel * theOperationsToolsPanel )
158         {       
159                 _operationsToolsPanel = theOperationsToolsPanel;
160         }
161
162         void wxContourMainFrame :: setAutomaticFormsPanel(  wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel )
163         {
164                 _autoFormsPanel = theAutoFormsPanel;
165         }
166
167         void wxContourMainFrame :: setStandardToolsPanel(  wxContour_StandardToolsPanel * theStandardToolsPanel )
168         {
169                 _standardToolsPanel= theStandardToolsPanel;
170         }
171
172         void wxContourMainFrame :: setEditionToolsPanel(  wxContour_EdtionToolsPanel * theEditionToolsPanel )
173         {
174                 _editionToolsPanel =  theEditionToolsPanel;
175         }
176
177         void wxContourMainFrame :: setListViewPanel(  wxContour_ListViewPanel * theListViewPanel )
178         {
179                 _listViewPanel = theListViewPanel;
180         }
181