00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013 #ifndef _gnDebug_h_
00014 #define _gnDebug_h_
00015
00016 #ifdef GN_GUI
00017
00018 #include "wx/wxprec.h"
00019 #ifdef __BORLANDC__
00020 #pragma hdrstop
00021 #endif
00022
00023
00024
00025 #ifndef WX_PRECOMP
00026 #include "wx/wx.h"
00027 #endif
00028 #endif //GN_GUI
00029
00030 #include "gn/gnDefs.h"
00031 #include <string>
00032 #include <iostream>
00033
00034 #ifdef COMMAND_LINE
00035
00036 const boolean USE_COMMAND_LINE = true;
00037 const boolean USE_GUI = false;
00038
00039 #elif defined(GN_GUI)
00040
00041 const boolean USE_COMMAND_LINE = false;
00042 const boolean USE_GUI = true;
00043
00044 #else
00045
00046 const boolean USE_COMMAND_LINE = false;
00047 const boolean USE_GUI = false;
00048
00049 #endif
00050 GNDLLEXPORT void DebugMsg(string a);
00051 inline
00052 void DebugMsg(string a){
00053 if(USE_COMMAND_LINE){
00054 cout << a;
00055 }else if(USE_GUI){
00056 #ifdef GN_GUI
00057 wxString debugstring = a.c_str();
00058 wxMessageDialog wxmd2(NULL, debugstring, "Debug Message", wxOK | wxCENTRE | wxICON_INFORMATION);
00059 wxmd2.ShowModal();
00060 #endif
00061 }
00062 }
00063
00064 GNDLLEXPORT void ErrorMsg(string a);
00065 inline
00066 void ErrorMsg(string a){
00067 if(USE_COMMAND_LINE){
00068 cout << a;
00069 }else if(USE_GUI){
00070 #ifdef GN_GUI
00071 wxString errorstring = a.c_str();
00072 wxMessageDialog wxmd2(NULL, errorstring, "Error Message", wxOK | wxCENTRE | wxICON_HAND);
00073 wxmd2.ShowModal();
00074 #endif
00075 }
00076 }
00077
00078 #endif
00079