// do *not* use the listctrl colour for headers - one day we will have a
// function to set it separately
- dc.SetTextForeground( *wxBLACK );
+ //dc.SetTextForeground( *wxBLACK );
+ dc.SetTextForeground(wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOWTEXT ));
int x = 1; // left of the header rect
const int y = 1; // top
{
// we want to work with logical coords
#if wxUSE_GENERIC_LIST_EXTENSIONS
- int x, y;
- m_owner->CalcUnscrolledPosition(event.GetX(), event.GetY(), &x, &y);
+ int x;
+ m_owner->CalcUnscrolledPosition(event.GetX(), 0, &x, NULL);
#else // !wxUSE_GENERIC_LIST_EXTENSIONS
int x = event.GetX();
- int y = event.GetY();
#endif // wxUSE_GENERIC_LIST_EXTENSIONS
+ int y = event.GetY();
if (m_isDragging)
{
if (m_mode & wxLC_REPORT)
{
+ wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
+ dc.SetPen(pen);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
+
+ wxSize clientSize = GetClientSize();
+ wxRect itemRect;
+
int lineSpacing = 0;
wxListLineData *line = &m_lines[0];
int dummy = 0;
size_t i_to = y_s / lineSpacing + m_visibleLines+2;
if (i_to >= m_lines.GetCount()) i_to = m_lines.GetCount();
- for (size_t i = y_s / lineSpacing; i < i_to; i++)
+ size_t i;
+ for (i = y_s / lineSpacing; i < i_to; i++)
{
m_lines[i].Draw( &dc );
+ // Draw horizontal rule if required
+ if (GetWindowStyle() & wxLC_HRULES)
+ dc.DrawLine(0, i*lineSpacing, clientSize.x, i*lineSpacing);
}
+
+ // Draw last horizontal rule
+ if ((i > (size_t) (y_s / lineSpacing)) && (GetWindowStyle() & wxLC_HRULES))
+ dc.DrawLine(0, i*lineSpacing, clientSize.x, i*lineSpacing);
+
+ // Draw vertical rules if required
+ if ((GetWindowStyle() & wxLC_VRULES) && (GetItemCount() > 0))
+ {
+ int col = 0;
+ wxRect firstItemRect;
+ wxRect lastItemRect;
+ GetItemRect(0, firstItemRect);
+ GetItemRect(GetItemCount() - 1, lastItemRect);
+ int x = firstItemRect.GetX();
+ for (col = 0; col < GetColumnCount(); col++)
+ {
+ int colWidth = GetColumnWidth(col);
+ x += colWidth ;
+ dc.DrawLine(x, firstItemRect.GetY() - 1, x, lastItemRect.GetBottom() + 1);
+ }
+ }
}
else
{
void wxListMainWindow::EditLabel( long item )
{
- wxCHECK_RET( ((size_t)item < m_lines.GetCount()),
+ wxCHECK_RET( ((size_t)item < m_lines.GetCount()),
wxT("wrong index in wxListCtrl::Edit()") );
m_currentEdit = &m_lines[(size_t)item];
void wxListMainWindow::OnMouse( wxMouseEvent &event )
{
+ event.SetEventObject( GetParent() );
if (GetParent()->GetEventHandler()->ProcessEvent( event)) return;
if (!m_current) return;
else if (event.ShiftDown())
{
size_t j;
-
+
m_current = line;
int numOfCurrent = -1;
if (index != wxNOT_FOUND)
{
index -= steps;
- if (index < 0) index = 0;
+ if (index < 0) index = 0;
OnArrowChar( &m_lines[index], event.ShiftDown() );
}
break;
if (index != wxNOT_FOUND)
{
index += steps;
- if ((size_t)index >= m_lines.GetCount())
+ if ((size_t)index >= m_lines.GetCount())
index = m_lines.GetCount()-1;
OnArrowChar( &m_lines[index], event.ShiftDown() );
}
if (index != wxNOT_FOUND)
{
index += m_visibleLines;
- if ((size_t)index >= m_lines.GetCount())
+ if ((size_t)index >= m_lines.GetCount())
index = m_lines.GetCount()-1;
OnArrowChar( &m_lines[index], event.ShiftDown() );
}
wxClientDC dc(this);
dc.SetFont( GetFont() );
int max = 10;
-
+
for (size_t i = 0; i < m_lines.GetCount(); i++)
{
wxListLineData *line = &m_lines[i];
UnfocusLine( m_current );
m_current = line;
FocusLine( m_current );
+ if ((m_mode & wxLC_SINGLE_SEL) && oldCurrent) oldCurrent->Hilight( FALSE );
RefreshLine( m_current );
if (oldCurrent) RefreshLine( oldCurrent );
}
long pos = start;
wxString tmp = str;
if (pos < 0) pos = 0;
- for (size_t i = pos; i < m_lines.GetCount(); i++)
+ for (size_t i = (size_t)pos; i < m_lines.GetCount(); i++)
{
wxListLineData *line = &m_lines[i];
wxString s = "";
{
long pos = start;
if (pos < 0) pos = 0;
- for (size_t i = pos; i < m_lines.GetCount(); i++)
+ for (size_t i = (size_t)pos; i < m_lines.GetCount(); i++)
{
wxListLineData *line = &m_lines[i];
wxListItem item;
else
{
m_lines.Add( line );
+ item.m_itemId = m_lines.GetCount();
}
}