dc->GetTextExtent(ellipsis, &base_w, &h);
// continue until we have enough space or only one character left
- drawntext = text.Left(text.Length() - 1);
- while (drawntext.Length() > 1)
+ wxCoord w_c, h_c;
+ size_t len = text.Length();
+ drawntext = text.Left(len);
+ while (len > 1)
{
- dc->GetTextExtent(drawntext, &w, &h);
+ dc->GetTextExtent(drawntext.Last(), &w_c, &h_c);
+ drawntext.RemoveLast();
+ len--;
+ w -= w_c;
if (w + base_w <= width)
break;
- drawntext = drawntext.Left(drawntext.Length() - 1);
}
// if still not enough space, remove ellipsis characters
wxListEvent le( command, GetParent()->GetId() );
le.SetEventObject( GetParent() );
+ le.m_itemIndex = current;
le.m_pointDrag = m_dragStart;
GetParent()->GetEventHandler()->ProcessEvent( le );
m_lines.Insert( line, id );
m_dirty = TRUE;
+
+ SendNotify(id, wxEVT_COMMAND_LIST_INSERT_ITEM);
+
RefreshLines(id, GetItemCount() - 1);
}
return FALSE;
// don't create the inner window with the border
- style &= ~wxSUNKEN_BORDER;
+ style &= ~wxBORDER_MASK;
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, style );
bool wxGenericListCtrl::GetItemRect( long item, wxRect &rect, int WXUNUSED(code) ) const
{
m_mainWin->GetItemRect( item, rect );
+ if ( m_mainWin->HasHeader() )
+ rect.y += HEADER_HEIGHT + 1;
return TRUE;
}