2 #include "wxMaracas_N_ViewersWidget.h"
3 #include "OpenImageDialog.h"
4 #include "vtkImageData.h"
7 class MyApp:public wxApp
10 virtual bool OnInit();
13 class MyFrame:public wxFrame
17 MyFrame(const wxString& title);
19 void OnQuit(wxCommandEvent& event);
20 void OnOpen(wxCommandEvent& event);
21 void OnAbout(wxCommandEvent& event);
22 //void SimpleSliderDialog();
26 //bbwx::Slider::Pointer mSlider;
27 // bbcreaMaracasVisu::bbmaracasVisuViewerNV::Pointer viewer;
40 MyFrame *frame = new MyFrame(wxT("CREATIS basic"));
42 const int width = 600;
43 const int height = 250;
45 frame->SetSize(width,height);
52 BEGIN_EVENT_TABLE(MyFrame,wxFrame)
53 EVT_MENU(wxID_ABOUT,MyFrame::OnAbout)
54 EVT_MENU(wxID_OPEN,MyFrame::OnOpen)
55 EVT_MENU(wxID_EXIT,MyFrame::OnQuit)
59 void MyFrame::OnOpen(wxCommandEvent& event)
61 //wxMessageBox(wxT("You clicked the open option"));
64 creaMaracasVisuKernel::OpenImageDialog *diag = new creaMaracasVisuKernel::OpenImageDialog(true);
65 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
67 if(diag->getImageData() != NULL){
68 std::vector<int>* vectype;
69 vectype = new std::vector<int>();
70 vectype->push_back(5);
71 vectype->push_back(0);
72 viewer = new wxMaracas_N_ViewersWidget(this,diag->getImageData(), vectype);
73 sizer->Add(viewer,1,wxGROW);
78 creaMaracasVisuKernel::OpenImageDialog *diag = new creaMaracasVisuKernel::OpenImageDialog(false);
79 if(diag->getImageData() != NULL){
80 image = diag->getImageData();
81 strfilename = diag->getFilename();
86 void MyFrame::OnAbout(wxCommandEvent& event)
91 void MyFrame::OnQuit(wxCommandEvent& event)
96 MyFrame::MyFrame(const wxString& title):wxFrame(NULL,wxID_ANY,title)
100 // viewer = bbcreaMaracasVisu::bbmaracasVisuViewerNV::New("Viewer");
101 //mSlider = bbwx::Slider::New("slider");
102 //mSlider->bbUserCreateWidget(this);
105 //sizer->Add(mSlider->bbGetOutputWidget(),1,wxGROW);
109 wxMenu *fileMenu = new wxMenu;
111 wxMenu *helpMenu = new wxMenu;
113 helpMenu->Append(wxID_ABOUT,wxT("&About...\tF1"),wxT("Show about dialog"));
115 fileMenu->Append(wxID_OPEN,wxT("&O&pen\tAlt-O"),wxT("Open Files"));
116 fileMenu->Append(wxID_EXIT,wxT("&E&xit\tAlt-X"),wxT("Quit"));
119 wxMenuBar *menuBar = new wxMenuBar();
120 menuBar->Append(fileMenu,wxT("&File"));
121 menuBar->Append(helpMenu,wxT("&Help"));
125 // SetAutoLayout(true);
126 /*CreateStatusBar(2);
127 SetStatusText(wxT("CREATIS"));*/