]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
source compatible way to solve the background problem
[wxWidgets.git] / src / common / event.cpp
index d126c48550ab7048d7f721908177a3e615e5ee76..bab410244b6e3799296b279321e431cab39fec1b 100644 (file)
@@ -44,6 +44,7 @@
         #include "wx/control.h"
         #include "wx/utils.h"
         #include "wx/dc.h"
+        #include "wx/textctrl.h"
     #endif // wxUSE_GUI
 #endif
 
@@ -380,6 +381,11 @@ wxEvent::wxEvent(const wxEvent &src)
  *
  */
 
+#ifdef __VISUALC__
+    // 'this' : used in base member initializer list (for m_commandString)
+    #pragma warning(disable:4355)
+#endif
+
 wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
               : wxEvent(theId, commandType)
 #if WXWIN_COMPATIBILITY_2_4
@@ -396,16 +402,22 @@ wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
     m_propagationLevel = wxEVENT_PROPAGATE_MAX;
 }
 
+#ifdef __VISUALC__
+    #pragma warning(default:4355)
+#endif
+
 wxString wxCommandEvent::GetString() const
 {
     if(m_eventType != wxEVT_COMMAND_TEXT_UPDATED || !m_eventObject)
         return m_cmdString;
     else
     {
+#if wxUSE_TEXTCTRL
         wxTextCtrl *txt = wxDynamicCast(m_eventObject, wxTextCtrl);
         if(txt)
             return txt->GetValue();
         else
+#endif // wxUSE_TEXTCTRL
             return m_cmdString;
     }
 }