]> Creatis software - creaImageIO.git/blobdiff - appli/TestWxSimpleView/main.cxx
Add a simple dialog box to select file(s or directory or data from creaImageIO database
[creaImageIO.git] / appli / TestWxSimpleView / main.cxx
diff --git a/appli/TestWxSimpleView/main.cxx b/appli/TestWxSimpleView/main.cxx
new file mode 100644 (file)
index 0000000..58ffcdb
--- /dev/null
@@ -0,0 +1,41 @@
+#include <creaImageIOSystem.h>
+#include <creaWx.h>
+#include <creaImageIOWxSimpleDlg.h>
+#include <creaVtkBasicSlicer.h>
+
+// Just to test the selection of file(s), directory or from creaImageIO database.
+class myApp : public wxApp
+{
+public:
+  bool OnInit( );
+  int  OnExit() { return true; }
+};
+
+IMPLEMENT_APP(myApp);
+
+CREA_WXMAIN_WITH_CONSOLE
+
+bool myApp::OnInit( )
+{
+  wxApp::OnInit();
+#ifdef __WXGTK__
+  //See http://www.wxwindows.org/faqgtk.htm#locale
+  setlocale(LC_NUMERIC, "C");
+#endif
+   wxInitAllImageHandlers();
+
+   creaImageIO::SetGimmickMessageLevel(5);
+   creaImageIO::SetGimmickDebugMessageLevel(0);
+
+   creaImageIO::WxSimpleDlg x(0);
+   x.ShowModal();
+   std::vector <vtkImageData*> test = x.getImagesSelected();
+   if(test.size() >0)
+   {
+       crea::VtkBasicSlicer(test.front());
+   }
+   
+   return false;
+}
+
+