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"));
63 creaMaracasVisuKernel::OpenImageDialog *diag = new creaMaracasVisuKernel::OpenImageDialog(true);
64 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
66 if(diag->getImageData() != NULL){
67 std::vector<int>* vectype;
68 vectype = new std::vector<int>();
69 vectype->push_back(5);
70 vectype->push_back(0);
71 viewer = new wxMaracas_N_ViewersWidget(this,diag->getImageData(), vectype);
72 sizer->Add(viewer,1,wxGROW);
77 void MyFrame::OnAbout(wxCommandEvent& event)
82 void MyFrame::OnQuit(wxCommandEvent& event)
87 MyFrame::MyFrame(const wxString& title):wxFrame(NULL,wxID_ANY,title)
91 // viewer = bbcreaMaracasVisu::bbmaracasVisuViewerNV::New("Viewer");
92 //mSlider = bbwx::Slider::New("slider");
93 //mSlider->bbUserCreateWidget(this);
96 //sizer->Add(mSlider->bbGetOutputWidget(),1,wxGROW);
100 wxMenu *fileMenu = new wxMenu;
102 wxMenu *helpMenu = new wxMenu;
104 helpMenu->Append(wxID_ABOUT,wxT("&About...\tF1"),wxT("Show about dialog"));
106 fileMenu->Append(wxID_OPEN,wxT("&O&pen\tAlt-O"),wxT("Open Files"));
107 fileMenu->Append(wxID_EXIT,wxT("&E&xit\tAlt-X"),wxT("Quit"));
110 wxMenuBar *menuBar = new wxMenuBar();
111 menuBar->Append(fileMenu,wxT("&File"));
112 menuBar->Append(helpMenu,wxT("&Help"));
116 // SetAutoLayout(true);
117 /*CreateStatusBar(2);
118 SetStatusText(wxT("CREATIS"));*/