m_lastOnSame = FALSE;
m_renameTimer->Stop();
- SendNotify( line, wxEVT_COMMAND_LIST_KEY_DOWN );
+ SendNotify( line, wxEVT_COMMAND_LIST_ITEM_ACTIVATED );
return;
}
void wxListMainWindow::OnChar( wxKeyEvent &event )
{
+ wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
+ le.m_code = event.KeyCode();
+ le.SetEventObject( GetParent() );
+ GetParent()->GetEventHandler()->ProcessEvent( le );
+
/*
if (event.KeyCode() == WXK_TAB)
{
return;
}
*/
- if (!m_current) return;
+ if ( !m_current )
+ {
+ event.Skip();
+ return;
+ }
+
switch (event.KeyCode())
{
case WXK_UP:
case WXK_RETURN:
case WXK_EXECUTE:
{
- wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
+ wxListEvent le( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, GetParent()->GetId() );
le.SetEventObject( GetParent() );
le.m_itemIndex = GetIndexOfLine( m_current );
m_current->GetItem( 0, le.m_item );
int y = 1;
int entireHeight = m_lines.Number() * lineSpacing + 2;
int scroll_pos = GetScrollPos( wxVERTICAL );
- SetScrollbars( m_xScroll, m_yScroll, 0, (entireHeight+15-6) / m_yScroll, 0, scroll_pos, TRUE );
+ SetScrollbars( m_xScroll, m_yScroll, 0, (entireHeight+15) / m_yScroll, 0, scroll_pos, TRUE );
GetClientSize( &clientWidth, &clientHeight );
wxNode* node = m_lines.First();
line->GetSize( lineWidth, lineHeight );
if (lineWidth > maxWidth) maxWidth = lineWidth;
y += lineSpacing;
- if (y+lineSpacing-7 >= clientHeight) // -7 for earlier "line breaking"
+ if (y+lineSpacing-6 >= clientHeight) // -6 for earlier "line breaking"
{
y = 5;
- x += maxWidth+5;
- entireWidth += maxWidth+5;
+ x += maxWidth+6;
+ entireWidth += maxWidth+6;
maxWidth = 0;
}
node = node->Next();
if (!node) tries = 1; // everything fits, no second try required
}
}
- m_visibleLines = (clientHeight+7) / (lineSpacing); // +7 for earlier "line breaking"
+ m_visibleLines = (clientHeight+6) / (lineSpacing); // +6 for earlier "line breaking"
int scroll_pos = GetScrollPos( wxHORIZONTAL );
SetScrollbars( m_xScroll, m_yScroll, (entireWidth+15) / m_xScroll, 0, scroll_pos, 0, TRUE );
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s );
if (GetWindowStyleFlag() & wxLC_REPORT)
- m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23) );
+ m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL );
else
m_headerWin = (wxListHeaderWindow *) NULL;
// m_mainWin->SetSize( 0, 24, width, height-24 );
if (!m_headerWin)
{
- m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23) );
+ m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL );
}
else
{
return TRUE;
}
-void wxListCtrl::DeleteAllColumns()
+bool wxListCtrl::DeleteAllColumns()
{
for ( size_t n = 0; n < m_mainWin->m_columns.GetCount(); n++ )
DeleteColumn(n);
+
+ return TRUE;
+}
+
+void wxListCtrl::ClearAll()
+{
+ m_mainWin->DeleteEverything();
}
bool wxListCtrl::DeleteColumn( int col )