]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
*** empty log message ***
[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
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         }
54
55         wxContourMainFrame :: ~wxContourMainFrame()
56         {
57                   m_mgr.UnInit();
58                   //El problema al cerrar la aplicacion puede estar asociado 
59                   //a que  wxAUINotebook esta en la aplicacion 
60                   //principal (wxContourGUIExample)tambien
61 //EED????               delete _theViewPanel;             
62 //EED????               delete _instantPanel;
63 //EED????               delete _buttonsBar;
64 //EED????               delete _actualInstant;           
65 //EED????               delete _sceneManager;
66         }
67
68
69         //------------------------------------------------------------------------------------------------------------
70         // Creational and initialization methods using WxAui
71         //------------------------------------------------------------------------------------------------------------
72         //
73         wxAuiNotebook * wxContourMainFrame :: createNotebook()
74         {
75                 wxSize client_size = GetClientSize();
76                 wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
77                 wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
78                 return noteBook;
79         }
80         
81
82         //------------------------------------------------------------------------------------------------------------
83         // Creational and initialization methods 
84         //------------------------------------------------------------------------------------------------------------
85         bool wxContourMainFrame :: configurePanels(wxAuiNotebook* theNoteBook)
86         {
87                 bool configured = _theViewPanel!=NULL;
88                                         
89                 configured &= _theViewPanel!=NULL;
90                 if( _theViewPanel!=NULL )
91                 {
92                         theNoteBook->AddPage( _theViewPanel, wxT("       View       ") );               
93                         m_mgr.Update();
94                 }
95
96
97                 if( configured )
98                 {
99                         theNoteBook->AddPage( _instantPanel, wxT("Instant Page") );
100                         m_mgr.Update();
101                 }
102
103                 m_mgr.AddPane(theNoteBook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
104                 m_mgr.Update();
105                 configured &= _buttonsBar!=NULL;
106                 if( _buttonsBar!=NULL )
107                 {                       
108                         m_mgr.AddPane(_buttonsBar, wxAuiPaneInfo().
109                                         Name(wxT("TB")).Caption(wxT("Buttons Bar")).
110                                         ToolbarPane().Top().
111                                         LeftDockable(  ).RightDockable( false ).CloseButton(false));
112                         m_mgr.Update();
113                 }
114                 //CreateStatusBar();
115                          
116                 SetMinSize(wxSize(300,300));
117                 m_mgr.Update();
118                 return configured;
119         }
120
121         void wxContourMainFrame :: setNotebook( wxAuiNotebook * noteBook )
122         {
123
124         }
125
126         //------------------------------------------------------------------------------------------------------------
127         //  Attributes getters and setters
128         //------------------------------------------------------------------------------------------------------------
129         
130
131         void wxContourMainFrame :: setViewPanel(  wxContourViewPanel * theViewPanel )
132         {
133                 _theViewPanel = theViewPanel;           
134         }
135
136         void wxContourMainFrame :: setInstantChooserPanel(  wxInstantChooserPanel * theInstantChooserPanel )
137         {
138                 _instantPanel = theInstantChooserPanel; 
139         }
140
141         void wxContourMainFrame :: setButtonsBar(  wxContour_ButtonsBar * theButtonsBar )
142         {
143                 _buttonsBar = theButtonsBar;
144         }
145
146         void wxContourMainFrame :: setGrid(  wxContour_Grid * theGridPanel )
147         {
148                 _gridPanel = theGridPanel;
149         }
150
151         void wxContourMainFrame :: setDrawToolsPanel(  wxContour_DrawToolsPanel * theDrawToolsPanel )
152         {
153                 _drawToolsPanel = theDrawToolsPanel;
154         }
155
156         void wxContourMainFrame :: setOperationsToolsPanel(  wxContour_OperationsToolsPanel * theOperationsToolsPanel )
157         {       
158                 _operationsToolsPanel = theOperationsToolsPanel;
159         }
160
161         void wxContourMainFrame :: setAutomaticFormsPanel(  wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel )
162         {
163                 _autoFormsPanel = theAutoFormsPanel;
164         }
165
166         void wxContourMainFrame :: setStandardToolsPanel(  wxContour_StandardToolsPanel * theStandardToolsPanel )
167         {
168                 _standardToolsPanel= theStandardToolsPanel;
169         }
170
171         void wxContourMainFrame :: setEditionToolsPanel(  wxContour_EdtionToolsPanel * theEditionToolsPanel )
172         {
173                 _editionToolsPanel =  theEditionToolsPanel;
174         }
175
176         void wxContourMainFrame :: setListViewPanel(  wxContour_ListViewPanel * theListViewPanel )
177         {
178                 _listViewPanel = theListViewPanel;
179         }
180