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"
18 #include "wxContour_ActionCommandsID.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;
53 wxContour_ActionCommandsID a;
56 wxContourMainFrame :: ~wxContourMainFrame()
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;
70 //------------------------------------------------------------------------------------------------------------
71 // Creational and initialization methods using WxAui
72 //------------------------------------------------------------------------------------------------------------
74 wxAuiNotebook * wxContourMainFrame :: createNotebook()
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));
83 //------------------------------------------------------------------------------------------------------------
84 // Creational and initialization methods
85 //------------------------------------------------------------------------------------------------------------
86 bool wxContourMainFrame :: configurePanels(wxAuiNotebook* theNoteBook)
88 bool configured = _theViewPanel!=NULL;
90 configured &= _theViewPanel!=NULL;
91 if( _theViewPanel!=NULL )
93 theNoteBook->AddPage( _theViewPanel, wxT(" View ") );
100 theNoteBook->AddPage( _instantPanel, wxT("Instant Page") );
104 m_mgr.AddPane(theNoteBook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
106 configured &= _buttonsBar!=NULL;
107 if( _buttonsBar!=NULL )
109 m_mgr.AddPane(_buttonsBar, wxAuiPaneInfo().
110 Name(wxT("TB")).Caption(wxT("Buttons Bar")).
112 LeftDockable( ).RightDockable( false ).CloseButton(false));
117 SetMinSize(wxSize(300,300));
122 void wxContourMainFrame :: setNotebook( wxAuiNotebook * noteBook )
127 //------------------------------------------------------------------------------------------------------------
128 // Attributes getters and setters
129 //------------------------------------------------------------------------------------------------------------
132 void wxContourMainFrame :: setViewPanel( wxContourViewPanel * theViewPanel )
134 _theViewPanel = theViewPanel;
137 void wxContourMainFrame :: setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel )
139 _instantPanel = theInstantChooserPanel;
142 void wxContourMainFrame :: setButtonsBar( wxContour_ButtonsBar * theButtonsBar )
144 _buttonsBar = theButtonsBar;
147 void wxContourMainFrame :: setGrid( wxContour_Grid * theGridPanel )
149 _gridPanel = theGridPanel;
152 void wxContourMainFrame :: setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel )
154 _drawToolsPanel = theDrawToolsPanel;
157 void wxContourMainFrame :: setOperationsToolsPanel( wxContour_OperationsToolsPanel * theOperationsToolsPanel )
159 _operationsToolsPanel = theOperationsToolsPanel;
162 void wxContourMainFrame :: setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel )
164 _autoFormsPanel = theAutoFormsPanel;
167 void wxContourMainFrame :: setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel )
169 _standardToolsPanel= theStandardToolsPanel;
172 void wxContourMainFrame :: setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel )
174 _editionToolsPanel = theEditionToolsPanel;
177 void wxContourMainFrame :: setListViewPanel( wxContour_ListViewPanel * theListViewPanel )
179 _listViewPanel = theListViewPanel;