]> Creatis software - creaImageIO.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Thu, 19 Feb 2009 10:00:57 +0000 (10:00 +0000)
committerguigues <guigues>
Thu, 19 Feb 2009 10:00:57 +0000 (10:00 +0000)
appli/CMakeLists.txt
appli/wxGimmick/CMakeLists.txt [new file with mode: 0644]
appli/wxGimmick/main.cxx [new file with mode: 0644]
src2/CMakeLists.txt
src2/creaImageIOWxGimmickFrame.cpp [new file with mode: 0644]
src2/creaImageIOWxGimmickFrame.h [new file with mode: 0644]

index 6dcb4e04ebe0c685a3233b21a729ab4a6c7666a0..2c2bcd19bb707da1ff7f8637fefc4c2047ee47e7 100644 (file)
@@ -1,6 +1,7 @@
 IF (BUILD_V2)
   SUBDIRS(gimmick)
   SUBDIRS(wxGimmick)
+  SUBDIRS(TestWxGimmickReaderDialog)
 ELSE (BUILD_V2)
   SUBDIRS(TestWxGimmickDialog)
 ENDIF (BUILD_V2)
diff --git a/appli/wxGimmick/CMakeLists.txt b/appli/wxGimmick/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f94aeaf
--- /dev/null
@@ -0,0 +1,11 @@
+SET(NAME wxGimmick)
+IF(WIN32)
+  ADD_EXECUTABLE(${NAME} WIN32 main)  
+  SET_TARGET_PROPERTIES(${NAME} PROPERTIES LINK_FLAGS /subsystem:console )
+ELSE(WIN32)
+  ADD_EXECUTABLE(${NAME} main)
+ENDIF(WIN32)
+
+TARGET_LINK_LIBRARIES( ${NAME} creaImageIO2)
+
+INSTALL_TARGETS(/bin/ ${NAME} )
diff --git a/appli/wxGimmick/main.cxx b/appli/wxGimmick/main.cxx
new file mode 100644 (file)
index 0000000..4485fde
--- /dev/null
@@ -0,0 +1,43 @@
+#include <creaWx.h>
+#include <creaImageIOWxGimmickFrame.h>
+
+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(9);
+   creaImageIO::SetGimmickDebugMessageLevel(9);
+   */
+
+   int threads = 1;
+
+   creaImageIO::WxGimmickFrame* f = new
+     creaImageIO::WxGimmickFrame(0,
+                                -1,
+                                _T("wxGimmick! (c) CREATIS-LRMN 2008"),
+                                wxDefaultPosition,
+                                wxSize(1200,800),
+                                threads);
+   f->Show();
+   
+   return true;
+}
+
+
index 88d506dbc0d114b7a24a9eb671c20146c0011f4b..0f2b35e19cdd843aa52397fe0b7103802639c0c4 100644 (file)
@@ -38,6 +38,7 @@ SET( SRCS
   creaImageIOWxGimmickView
   creaImageIOWxTreeView
   creaImageIOWxGimmickReaderDialog
+  creaImageIOWxGimmickFrame
 
 
 )
diff --git a/src2/creaImageIOWxGimmickFrame.cpp b/src2/creaImageIOWxGimmickFrame.cpp
new file mode 100644 (file)
index 0000000..d0e04fe
--- /dev/null
@@ -0,0 +1,84 @@
+#include <creaImageIOWxGimmickFrame.h>
+#include <creaImageIOSystem.h>
+
+namespace creaImageIO
+{
+  // CTor
+  WxGimmickFrame::WxGimmickFrame(wxWindow *parent, 
+                                              wxWindowID id,
+                                              wxString title,
+                                              const wxPoint& pos,
+                                              const wxSize& size,
+                                              int threads)
+ :   wxFrame( parent, 
+                 id, 
+                 title,
+                 pos,
+                 size,
+                 wxRESIZE_BORDER | 
+             //  wxSYSTEM_MENU  |
+                 wxCLOSE_BOX |
+                 wxMAXIMIZE_BOX | 
+                 wxMINIMIZE_BOX | 
+                 wxCAPTION  
+              ),
+     mGimmick(0),
+     mView(0)
+  {
+    GimmickDebugMessage(1,"WxGimmickFrame::WxGimmickFrame"
+                       <<std::endl);
+    wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
+    
+    try {
+      
+      mGimmick = new Gimmick();
+      mGimmick->Initialize();
+     
+      int image_type = GIMMICK_3D_IMAGE_SELECTION;
+      mView = new WxGimmickView(mGimmick,
+                               this,
+                               -1,
+                               wxDefaultPosition,
+                               size,
+                               image_type,
+                               threads);
+      mView->Initialize();
+    }
+    catch (crea::Exception e)
+    {
+      e.Print();
+      return;
+    }
+
+    topsizer->Add( mView,1,wxGROW,0);
+
+    SetSizer( topsizer );     
+    Layout(); 
+  }
+
+  /// Destructor
+  WxGimmickFrame::~WxGimmickFrame()
+  {
+    GimmickDebugMessage(1,"WxGimmickFrame::~WxGimmickFrame"
+                       <<std::endl);
+    if (mView) 
+      {
+       delete mView;
+      }
+    if (mGimmick) 
+      {
+       mGimmick->Finalize();
+       delete mGimmick;
+      }
+  }
+  
+  
+  //================================================================
+  //  BEGIN_EVENT_TABLE(WxGimmickFrame, wxDialog)
+  //    END_EVENT_TABLE()
+  //================================================================
+
+
+} // EO namespace creaImageIO
+
+
diff --git a/src2/creaImageIOWxGimmickFrame.h b/src2/creaImageIOWxGimmickFrame.h
new file mode 100644 (file)
index 0000000..0572fcb
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __creaImageIOWxGimmickFrame_h_INCLUDED__
+#define __creaImageIOWxGimmickFrame_h_INCLUDED__
+
+#ifdef USE_WXWIDGETS
+
+#include <creaImageIOWxGimmickView.h>
+#include <creaWx.h>
+
+namespace creaImageIO
+{
+  /**
+   * \ingroup GUI
+   */
+  //=====================================================================
+ //=====================================================================
+  class /*CREAIMAGEIO_EXPORT*/ WxGimmickFrame : public wxFrame
+  {
+  public:
+    WxGimmickFrame();    
+    WxGimmickFrame(wxWindow *parent, 
+                  const wxWindowID id,
+                  wxString title,
+                  const wxPoint& pos, 
+                  const wxSize& size,
+                  int threads = 0);
+    
+    ~WxGimmickFrame();
+
+    //    Gimmick* GetGimmick() { return mGimmick; }
+    //    typedef WxGimmick ViewType;
+    //    typedef WxGimmickView::EventType EventType;
+
+
+
+     
+    //    void OnSelChanged(EventType& event);
+    //    void OnContextualMenu(EventType& event);
+    //    void OnMenuTest(wxCommandEvent& event);
+    //    void OnButtonOk(wxCommandEvent& event);
+    //    void OnButtonCancel(wxCommandEvent& event);
+
+    //    DECLARE_EVENT_TABLE();
+  private :
+    
+    Gimmick*       mGimmick;
+    WxGimmickView* mView;
+
+  }; // class WxGimmickFrame
+  //=====================================================================
+
+  
+} // EO namespace creaImageIO
+
+
+#endif // USE_WIDGETS
+// EOF
+#endif