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