]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Damn broken pipes.
[wxWidgets.git] / src / generic / listctrl.cpp
index a23b73b1c37e0dc270618f8e312d7126af9d0539..ec4f79d94afa882e4cea4d146e241bfdfa517fe1 100644 (file)
@@ -981,11 +981,7 @@ wxListTextCtrl::wxListTextCtrl( wxWindow *parent, const wxWindowID id,
     bool *accept, wxString *res, wxListMainWindow *owner,
     const wxString &value, const wxPoint &pos, const wxSize &size,
 #if wxUSE_VALIDATORS
-#  if defined(__VISAGECPP__)
-    int style, const wxValidator* validator, const wxString &name ) :
-#  else
     int style, const wxValidator& validator, const wxString &name ) :
-#  endif
 #endif
   wxTextCtrl( parent, id, value, pos, size, style, validator, name )
 {
@@ -1211,7 +1207,8 @@ void wxListMainWindow::SendNotify( wxListLineData *line, wxEventType command )
     le.SetEventObject( GetParent() );
     le.m_itemIndex = GetIndexOfLine( line );
     line->GetItem( 0, le.m_item );
-    GetParent()->GetEventHandler()->ProcessEvent( le );
+//    GetParent()->GetEventHandler()->ProcessEvent( le );
+    GetParent()->GetEventHandler()->AddPendingEvent( le );
 }
 
 void wxListMainWindow::FocusLine( wxListLineData *WXUNUSED(line) )
@@ -2164,8 +2161,8 @@ void wxListMainWindow::CalculatePositions()
         int y = 1;
         int entireHeight = m_lines.Number() * lineSpacing + 2;
         int scroll_pos = GetScrollPos( wxVERTICAL );
-        int x_scroll_pos = GetScrollPos( wxHORIZONTAL );
 #if wxUSE_GENERIC_LIST_EXTENSIONS
+        int x_scroll_pos = GetScrollPos( wxHORIZONTAL );
 #else
         SetScrollbars( m_xScroll, m_yScroll, 0, (entireHeight+15) / m_yScroll, 0, scroll_pos, TRUE );
 #endif
@@ -2312,18 +2309,22 @@ void wxListMainWindow::DeleteAllItems( void )
 {
     m_dirty = TRUE;
     m_current = (wxListLineData *) NULL;
+
+    // to make the deletion of all items faster, we don't send the
+    // notifications in this case: this is compatible with wxMSW and
+    // documented in DeleteAllItems() description
+#if 0
     wxNode *node = m_lines.First();
     while (node)
     {
         wxListLineData *line = (wxListLineData*)node->Data();
 
-        // to make the deletion of all items faster, we don't send the
-        // notifications in this case: this is compatible with wxMSW and
-        // documented in DeleteAllItems() description
-        //DeleteLine( line );
+        DeleteLine( line );
 
         node = node->Next();
     }
+#endif // 0
+
     m_lines.Clear();
 }
 
@@ -2545,6 +2546,31 @@ wxListEvent::wxListEvent( wxEventType commandType, int id ):
     m_pointDrag.y = 0;
 }
 
+void wxListEvent::CopyObject(wxObject& object_dest) const
+{
+    wxListEvent *obj = (wxListEvent *)&object_dest;
+
+    wxNotifyEvent::CopyObject(object_dest);
+
+    obj->m_code = m_code;
+    obj->m_itemIndex = m_itemIndex;
+    obj->m_oldItemIndex = m_oldItemIndex;
+    obj->m_col = m_col;
+    obj->m_cancelled = m_cancelled;
+    obj->m_pointDrag = m_pointDrag;
+    obj->m_item.m_mask = m_item.m_mask;
+    obj->m_item.m_itemId = m_item.m_itemId;
+    obj->m_item.m_col = m_item.m_col;
+    obj->m_item.m_state = m_item.m_state;
+    obj->m_item.m_stateMask = m_item.m_stateMask;
+    obj->m_item.m_text = m_item.m_text;
+    obj->m_item.m_image = m_item.m_image;
+    obj->m_item.m_data = m_item.m_data;
+    obj->m_item.m_format = m_item.m_format;
+    obj->m_item.m_width = m_item.m_width;
+    obj->m_item.m_colour = m_item.m_colour;
+}
+
 // -------------------------------------------------------------------------------------
 // wxListCtrl
 // -------------------------------------------------------------------------------------
@@ -2572,11 +2598,7 @@ wxListCtrl::~wxListCtrl()
 bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
       const wxPoint &pos, const wxSize &size,
 #if wxUSE_VALIDATORS
-#  if defined(__VISAGECPP__)
-      long style, const wxValidator *validator,
-#  else
       long style, const wxValidator &validator,
-#  endif
 #endif
       const wxString &name )
 {
@@ -2588,12 +2610,20 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
 
     long s = style;
 
-    if ((s & wxLC_REPORT == 0) &&
+#ifdef __VMS__
+#pragma message disable codcauunr
+   // VMS reports on this part the warning:
+   // statement either is unreachable or causes unreachable code
+#endif
+   if ((s & wxLC_REPORT == 0) &&
         (s & wxLC_LIST == 0) &&
         (s & wxLC_ICON == 0))
     {
         s = s | wxLC_LIST;
     }
+#ifdef __VMS__
+#pragma message enable codcauunr
+#endif
 
     bool ret = wxControl::Create( parent, id, pos, size, s, name );