]> Creatis software - crea.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 27 Aug 2010 20:39:58 +0000 (20:39 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 27 Aug 2010 20:39:58 +0000 (20:39 +0000)
appli/creaNewProject/NewProject/appli/template_appli/main.cxx [new file with mode: 0644]
appli/creaNewProject/NewProject/appli/template_wx_appli/CMakeLists.txt
appli/creaNewProject/NewProject/appli/template_wx_appli/winApp.cpp [new file with mode: 0644]
appli/creaNewProject/NewProject/data/CMakeLists.txt [new file with mode: 0644]
appli/creaNewProject/NewProject/data/README.txt [new file with mode: 0644]

diff --git a/appli/creaNewProject/NewProject/appli/template_appli/main.cxx b/appli/creaNewProject/NewProject/appli/template_appli/main.cxx
new file mode 100644 (file)
index 0000000..8525c7f
--- /dev/null
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main()
+{
+  printf("..Hi..!\n");
+  return 0;
+}
\ No newline at end of file
index e9547e14324b5f2d1a4a8964a97e7c51efb4935a..1e11c91c6bebcbcbc0d153065c7c726c72b17b59 100644 (file)
@@ -56,7 +56,11 @@ SET ( ${EXE_NAME}_LINK_LIBRARIES
 
 #----------------------------------------------------------------------------
 # CREATES AND INSTALLS THE EXE
-CREA_ADD_WX_EXECUTABLE( ${EXE_NAME} )
+
+set ( ${${EXE_NAME}_HAS_GUI} true )
+#set ( ${${EXE_NAME}_CONSOLE} true )
+
+CREA_ADD_EXECUTABLE( ${EXE_NAME} )
 #----------------------------------------------------------------------------
 
 
diff --git a/appli/creaNewProject/NewProject/appli/template_wx_appli/winApp.cpp b/appli/creaNewProject/NewProject/appli/template_wx_appli/winApp.cpp
new file mode 100644 (file)
index 0000000..34be51a
--- /dev/null
@@ -0,0 +1,72 @@
+#include <creaWx.h>
+#include <wx/dirdlg.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();
+
+   wxString dir = wxDirSelector(_T("Select directory in which to create the project"), _T(""), wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
+
+   if (dir.IsEmpty()) return false;
+
+   wxString name = wxGetTextFromUser(_T("Enter project name"),
+                                    _T("creaNewProject"),
+                                    _T("New"));
+   if (name.IsEmpty()) return false;
+   
+#if(_WIN32)
+       std::string command("creaNewProject.bat ");
+       std::string command1("creaSed.exe ");
+       std::string command2("del ");
+       
+       command  += "\"" + crea::wx2std(dir) + "\" \"" + crea::wx2std(name) + "\"";
+       command1 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\" " + "NameOfTheProject " + crea::wx2std(name) + "> \"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt\"";
+       command2 += "\"" + crea::wx2std(dir)+"\\"+crea::wx2std(name)+"\\CMakeLists.txt.in\"";
+       if ( ! system ( command.c_str() ) )
+       {
+               system ( command1.c_str() );
+               system ( command2.c_str() );
+               wxMessageBox(_T("Done !"),_T("creaNewProject"),
+                               wxOK | wxICON_INFORMATION);
+       }
+       else 
+       {
+               wxString err(_T("An error occured while running '"));
+               err +=  crea::std2wx(command) + _T("'");
+               wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);      
+       }       
+#else
+       std::string command("creaNewProject.sh ");
+       command += "\"" + crea::wx2std(dir) + "\"" +" " + crea::wx2std(name);
+       if ( ! system ( command.c_str() ) )
+       {
+               wxMessageBox(_T("Done !"),_T("creaNewProject"),
+                                       wxOK | wxICON_INFORMATION);
+       }
+       else 
+       {
+               wxString err(_T("An error occured while running '"));
+               err +=  crea::std2wx(command) + _T("'");
+               wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);      
+       }
+       
+#endif
+
+
+   return false;
+}
+
diff --git a/appli/creaNewProject/NewProject/data/CMakeLists.txt b/appli/creaNewProject/NewProject/data/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4688606
--- /dev/null
@@ -0,0 +1 @@
+# --------------------------------
diff --git a/appli/creaNewProject/NewProject/data/README.txt b/appli/creaNewProject/NewProject/data/README.txt
new file mode 100644 (file)
index 0000000..30b1f33
--- /dev/null
@@ -0,0 +1 @@
+Data...
\ No newline at end of file