]> git.saurik.com Git - wxWidgets.git/commitdiff
Write directly to log target wxTextCtrl to avoid crash
authorRobert Roebling <robert@roebling.de>
Thu, 16 Oct 2008 18:27:16 +0000 (18:27 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 16 Oct 2008 18:27:16 +0000 (18:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dataview/dataview.cpp

index 4ff3a96798cb822356d768d628f777a641374a69..4d24a1ea48e822818882e7b0835205476d936582 100644 (file)
@@ -1032,6 +1032,10 @@ void MyFrame::OnSelectionChanged( wxDataViewEvent &event )
 
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, First selected Item: %s"), title );
 
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, First selected Item: %s"), title );
+#else
+    wxString text;
+    text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, Item: %s\n"), title );
+    m_log->WriteText( text );
 #endif
 }
 
 #endif
 }
 
@@ -1043,6 +1047,10 @@ void MyFrame::OnExpanding( wxDataViewEvent &event )
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, Item: %s"), title );
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, Item: %s"), title );
+#else
+    wxString text;
+    text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, Item: %s\n"), title );
+    m_log->WriteText( text );
 #endif
 }
 
 #endif
 }
 
@@ -1077,6 +1085,10 @@ void MyFrame::OnExpanded( wxDataViewEvent &event )
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, Item: %s"), title );
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, Item: %s"), title );
+#else
+    wxString text;
+    text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, Item: %s\n"), title );
+    m_log->WriteText( text );
 #endif
 }
 
 #endif
 }
 
@@ -1088,6 +1100,10 @@ void MyFrame::OnCollapsing( wxDataViewEvent &event )
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, Item: %s"), title );
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, Item: %s"), title );
+#else
+    wxString text;
+    text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, Item: %s\n"), title );
+    m_log->WriteText( text );
 #endif
 }
 
 #endif
 }
 
@@ -1099,6 +1115,10 @@ void MyFrame::OnCollapsed( wxDataViewEvent &event )
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s"),title);
     wxString title = m_music_model->GetTitle( event.GetItem() );
 #ifdef ENABLE_LOGGING
     wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s"),title);
+#else
+    wxString text;
+    text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s\n"), title );
+    m_log->WriteText( text );
 #endif
 }
 
 #endif
 }