]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Fix wxTextFile::GetLine() documentation.
[wxWidgets.git] / src / generic / listctrl.cpp
index f95abdb06f02fd967c5860e19cb8dd21d1a34731..834eac9ac3f49c2350b5da6409fbc82e207617d5 100644 (file)
@@ -342,12 +342,23 @@ bool wxListHeaderData::IsHit( int x, int y ) const
 
 void wxListHeaderData::GetItem( wxListItem& item )
 {
-    item.m_mask = m_mask;
-    item.m_text = m_text;
-    item.m_image = m_image;
-    item.m_format = m_format;
-    item.m_width = m_width;
-    item.m_state = m_state;
+    long mask = item.m_mask;
+    if ( !mask )
+    {
+        // by default, get everything for backwards compatibility
+        mask = -1;
+    }
+
+    if ( mask & wxLIST_MASK_STATE )
+        item.m_state = m_state;
+    if ( mask & wxLIST_MASK_TEXT )
+        item.m_text = m_text;
+    if ( mask & wxLIST_MASK_IMAGE )
+        item.m_image = m_image;
+    if ( mask & wxLIST_MASK_WIDTH )
+        item.m_width = m_width;
+    if ( mask & wxLIST_MASK_FORMAT )
+        item.m_format = m_format;
 }
 
 int wxListHeaderData::GetImage() const
@@ -923,7 +934,6 @@ void wxListLineData::ReverseHighlight( void )
 BEGIN_EVENT_TABLE(wxListHeaderWindow,wxWindow)
     EVT_PAINT         (wxListHeaderWindow::OnPaint)
     EVT_MOUSE_EVENTS  (wxListHeaderWindow::OnMouse)
-    EVT_SET_FOCUS     (wxListHeaderWindow::OnSetFocus)
 END_EVENT_TABLE()
 
 void wxListHeaderWindow::Init()
@@ -1330,12 +1340,6 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
     }
 }
 
-void wxListHeaderWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
-{
-    m_owner->SetFocus();
-    m_owner->Update();
-}
-
 bool wxListHeaderWindow::SendListEvent(wxEventType type, const wxPoint& pos)
 {
     wxWindow *parent = GetParent();
@@ -2412,12 +2416,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
         int command = event.RightIsDown() ? wxEVT_COMMAND_LIST_BEGIN_RDRAG
                                           : wxEVT_COMMAND_LIST_BEGIN_DRAG;
 
-        wxListEvent le( command, GetParent()->GetId() );
-        le.SetEventObject( GetParent() );
-        le.m_item.m_itemId =
-        le.m_itemIndex = m_lineLastClicked;
-        le.m_pointDrag = m_dragStart;
-        GetParent()->GetEventHandler()->ProcessEvent( le );
+        SendNotify( m_lineLastClicked, command, m_dragStart );
 
         return;
     }
@@ -5148,14 +5147,6 @@ void wxGenericListCtrl::DoScreenToClient( int *x, int *y ) const
         wxListCtrlBase::DoScreenToClient(x, y);
 }
 
-void wxGenericListCtrl::SetFocus()
-{
-    // The test in window.cpp fails as we are a composite
-    // window, so it checks against "this", but not m_mainWin.
-    if ( DoFindFocus() != this )
-        m_mainWin->SetFocus();
-}
-
 wxSize wxGenericListCtrl::DoGetBestClientSize() const
 {
     // Something is better than nothing even if this is completely arbitrary.