1 //----------------------------------------------------------------------------------------------------------------
2 // Class definition include
3 //----------------------------------------------------------------------------------------------------------------
4 #include "wxContourMainFrame.h"
6 //----------------------------------------------------------------------------------------------------------------
8 //----------------------------------------------------------------------------------------------------------------
11 #include "NameWrapper.h"
12 #include "wx/artprov.h"
13 #include "ConceptDataWrap.h"
15 #include <manualContour.h>
16 #include "ImageSourceThing.h"
17 #include "vtkImageData.h"
20 //----------------------------------------------------------------------------------------------------------------
21 // Class implementation
22 //----------------------------------------------------------------------------------------------------------------
23 /** @file wxContourMainFrame.cxx */
25 //------------------------------------------------------------------------------------------------------------
26 // Constructors & Destructors
27 //------------------------------------------------------------------------------------------------------------
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)
34 m_mgr.SetManagedWindow(this);
35 _creatingContoursActive = false;
41 _drawToolsPanel = NULL;
42 _operationsToolsPanel = NULL;
43 _autoFormsPanel = NULL;
44 _standardToolsPanel = NULL;
45 _editionToolsPanel = NULL;
46 _listViewPanel = NULL;
48 _actualInstant = NULL;
50 // set up default notebook style
51 m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
55 wxContourMainFrame :: ~wxContourMainFrame()
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;
69 //------------------------------------------------------------------------------------------------------------
70 // Creational and initialization methods using WxAui
71 //------------------------------------------------------------------------------------------------------------
73 wxAuiNotebook * wxContourMainFrame :: createNotebook()
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));
82 //------------------------------------------------------------------------------------------------------------
83 // Creational and initialization methods
84 //------------------------------------------------------------------------------------------------------------
85 bool wxContourMainFrame :: configurePanels(wxAuiNotebook* theNoteBook)
87 bool configured = _theViewPanel!=NULL;
89 configured &= _theViewPanel!=NULL;
90 if( _theViewPanel!=NULL )
92 theNoteBook->AddPage( _theViewPanel, wxT(" View ") );
99 theNoteBook->AddPage( _instantPanel, wxT("Instant Page") );
103 m_mgr.AddPane(theNoteBook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
105 configured &= _buttonsBar!=NULL;
106 if( _buttonsBar!=NULL )
108 m_mgr.AddPane(_buttonsBar, wxAuiPaneInfo().
109 Name(wxT("TB")).Caption(wxT("Buttons Bar")).
111 LeftDockable( ).RightDockable( false ).CloseButton(false));
116 SetMinSize(wxSize(300,300));
121 void wxContourMainFrame :: setNotebook( wxAuiNotebook * noteBook )
126 //------------------------------------------------------------------------------------------------------------
127 // Attributes getters and setters
128 //------------------------------------------------------------------------------------------------------------
131 void wxContourMainFrame :: setViewPanel( wxContourViewPanel * theViewPanel )
133 _theViewPanel = theViewPanel;
136 void wxContourMainFrame :: setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel )
138 _instantPanel = theInstantChooserPanel;
141 void wxContourMainFrame :: setButtonsBar( wxContour_ButtonsBar * theButtonsBar )
143 _buttonsBar = theButtonsBar;
146 void wxContourMainFrame :: setGrid( wxContour_Grid * theGridPanel )
148 _gridPanel = theGridPanel;
151 void wxContourMainFrame :: setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel )
153 _drawToolsPanel = theDrawToolsPanel;
156 void wxContourMainFrame :: setOperationsToolsPanel( wxContour_OperationsToolsPanel * theOperationsToolsPanel )
158 _operationsToolsPanel = theOperationsToolsPanel;
161 void wxContourMainFrame :: setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel )
163 _autoFormsPanel = theAutoFormsPanel;
166 void wxContourMainFrame :: setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel )
168 _standardToolsPanel= theStandardToolsPanel;
171 void wxContourMainFrame :: setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel )
173 _editionToolsPanel = theEditionToolsPanel;
176 void wxContourMainFrame :: setListViewPanel( wxContour_ListViewPanel * theListViewPanel )
178 _listViewPanel = theListViewPanel;