2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 #include "wxMaracas_N_ViewersWidget.h"
29 #include "OpenImageDialog.h"
30 #include "vtkImageData.h"
33 class MyApp:public wxApp
36 virtual bool OnInit();
39 class MyFrame:public wxFrame
43 MyFrame(const wxString& title);
45 void OnQuit(wxCommandEvent& event);
46 void OnOpen(wxCommandEvent& event);
47 void OnAbout(wxCommandEvent& event);
48 //void SimpleSliderDialog();
52 //bbwx::Slider::Pointer mSlider;
53 // bbcreaMaracasVisu::bbmaracasVisuViewerNV::Pointer viewer;
66 MyFrame *frame = new MyFrame(wxT("CREATIS basic"));
68 const int width = 600;
69 const int height = 250;
71 frame->SetSize(width,height);
78 BEGIN_EVENT_TABLE(MyFrame,wxFrame)
79 EVT_MENU(wxID_ABOUT,MyFrame::OnAbout)
80 EVT_MENU(wxID_OPEN,MyFrame::OnOpen)
81 EVT_MENU(wxID_EXIT,MyFrame::OnQuit)
85 void MyFrame::OnOpen(wxCommandEvent& event)
87 //wxMessageBox(wxT("You clicked the open option"));
89 creaMaracasVisuKernel::OpenImageDialog *diag = new creaMaracasVisuKernel::OpenImageDialog(true);
90 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
92 if(diag->getImageData() != NULL){
93 std::vector<int>* vectype;
94 vectype = new std::vector<int>();
95 vectype->push_back(5);
96 vectype->push_back(0);
97 viewer = new wxMaracas_N_ViewersWidget(this,diag->getImageData(), vectype);
98 sizer->Add(viewer,1,wxGROW);
103 void MyFrame::OnAbout(wxCommandEvent& event)
108 void MyFrame::OnQuit(wxCommandEvent& event)
113 MyFrame::MyFrame(const wxString& title):wxFrame(NULL,wxID_ANY,title)
117 // viewer = bbcreaMaracasVisu::bbmaracasVisuViewerNV::New("Viewer");
118 //mSlider = bbwx::Slider::New("slider");
119 //mSlider->bbUserCreateWidget(this);
122 //sizer->Add(mSlider->bbGetOutputWidget(),1,wxGROW);
126 wxMenu *fileMenu = new wxMenu;
128 wxMenu *helpMenu = new wxMenu;
130 helpMenu->Append(wxID_ABOUT,wxT("&About...\tF1"),wxT("Show about dialog"));
132 fileMenu->Append(wxID_OPEN,wxT("&O&pen\tAlt-O"),wxT("Open Files"));
133 fileMenu->Append(wxID_EXIT,wxT("&E&xit\tAlt-X"),wxT("Quit"));
136 wxMenuBar *menuBar = new wxMenuBar();
137 menuBar->Append(fileMenu,wxT("&File"));
138 menuBar->Append(helpMenu,wxT("&Help"));
142 // SetAutoLayout(true);
143 /*CreateStatusBar(2);
144 SetStatusText(wxT("CREATIS"));*/