2 #ifndef __creaWx_h__INCLUDED__
3 #define __creaWx_h__INCLUDED__
5 //===========================================================================
8 // For compilers that support precompilation, includes "wx/wx.h".
10 #include <wx/datetime.h>
25 //===========================================================================
26 #else // USE_WXWIDGETS
27 // define wxWindow as void hence wxWindow* are void*
28 typedef void wxWindow;
29 #endif // EO USE_WXWIDGETS
30 //===========================================================================
37 //===========================================================================
42 //==================================================================
43 /// Conversion std::string to wxString
44 inline wxString std2wx(const std::string& s){
46 const char* my_string=s.c_str();
47 wxMBConvUTF8 *wxconv= new wxMBConvUTF8();
48 wx=wxString(wxconv->cMB2WC(my_string),wxConvUTF8);
50 // test if conversion works of not. In case it fails convert from Ascii
52 wx=wxString(wxString::FromAscii(s.c_str()));
55 //==================================================================
57 //==================================================================
58 /// Conversion wxString to std::string
59 inline std::string wx2std(const wxString& s){
61 if(s.wxString::IsAscii()) {
62 s2=s.wxString::ToAscii();
64 const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(s);
65 const char *tmp_str = (const char*) tmp_buf;
66 s2=std::string(tmp_str, strlen(tmp_str));
70 //==================================================================
75 #endif // EO USE_WXWIDGETS