wxListItemData *item = (wxListItemData*)node->Data();
wxString s;
item->GetText( s );
- if (s.IsEmpty()) s = _T("H");
+ if (s.IsEmpty()) s = wxT("H");
long lw,lh;
dc->GetTextExtent( s, &lw, &lh );
m_bound_label.width = lw;
for (int j = 0; j < m_owner->GetColumnCount(); j++)
{
xpos += m_owner->GetColumnWidth( j );
+ m_column = j;
if ((abs(x-xpos) < 3) && (y < 22))
{
hit_border = TRUE;
- m_column = j;
break;
}
+ if (x-xpos < 0)
+ {
+ break;
+ }
m_minX = xpos;
}
- if (event.LeftDown() && hit_border)
+ if (event.LeftDown())
{
- m_isDragging = TRUE;
- m_currentX = x;
- DrawCurrent();
- CaptureMouse();
- return;
+ if (hit_border)
+ {
+ m_isDragging = TRUE;
+ m_currentX = x;
+ DrawCurrent();
+ CaptureMouse();
+ return;
+ }
+ else
+ {
+ wxListEvent le( wxEVT_COMMAND_LIST_COL_CLICK, GetParent()->GetId() );
+ le.SetEventObject( GetParent() );
+ le.m_col = m_column;
+ GetParent()->GetEventHandler()->ProcessEvent( le );
+ return;
+ }
}
if (event.Moving())
void wxListMainWindow::EditLabel( long item )
{
wxNode *node = m_lines.Nth( item );
- wxCHECK_RET( node, _T("wrong index in wxListCtrl::Edit()") );
+ wxCHECK_RET( node, wxT("wrong index in wxListCtrl::Edit()") );
m_currentEdit = (wxListLineData*) node->Data();
void wxListMainWindow::OnRenameTimer()
{
- wxCHECK_RET( m_current, _T("invalid m_current") );
+ wxCHECK_RET( m_current, wxT("invalid m_current") );
Edit( m_lines.IndexOf( m_current ) );
}
{
int y_s = m_yScroll*GetScrollPos( wxVERTICAL );
if ((y > y_s) && (y+h < y_s+h_p)) return;
- if (y-y_s < 5) { Scroll( -1, (y-5-h_p/2)/m_yScroll ); Refresh(); }
- if (y+h+5 > y_s+h_p) { Scroll( -1, (y+h-h_p/2+h+15)/m_yScroll); Refresh(); }
+ if (y-y_s < 5) { Scroll( -1, (y-5-h_p/2)/m_yScroll ); }
+ if (y+h+5 > y_s+h_p) { Scroll( -1, (y+h-h_p/2+h+15)/m_yScroll); }
}
else
{
int x_s = m_xScroll*GetScrollPos( wxHORIZONTAL );
if ((x > x_s) && (x+w < x_s+w_p)) return;
- if (x-x_s < 5) { Scroll( (x-5)/m_xScroll, -1 ); Refresh(); }
- if (x+w-5 > x_s+w_p) { Scroll( (x+w-w_p+15)/m_xScroll, -1 ); Refresh(); }
+ if (x-x_s < 5) { Scroll( (x-5)/m_xScroll, -1 ); }
+ if (x+w-5 > x_s+w_p) { Scroll( (x+w-w_p+15)/m_xScroll, -1 ); }
}
}
void wxListMainWindow::DeleteColumn( int col )
{
wxCHECK_RET( col < (int)m_columns.GetCount(),
- _T("attempting to delete inexistent column in wxListView") );
+ wxT("attempting to delete inexistent column in wxListView") );
m_dirty = TRUE;
wxNode *node = m_columns.Nth( col );
{
m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin,
wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL );
+ if (HasFlag(wxLC_NO_HEADER))
+ m_headerWin->Show( FALSE );
}
else
{
- m_headerWin->Show( TRUE );
+ if (flag & wxLC_NO_HEADER)
+ m_headerWin->Show( FALSE );
+ else
+ m_headerWin->Show( TRUE );
}
}
}
else
{
- if (HasFlag(wxLC_REPORT))
+ if (HasFlag(wxLC_REPORT) && !(HasFlag(wxLC_NO_HEADER)))
{
m_headerWin->Show( FALSE );
}
long wxListCtrl::InsertItem( wxListItem& info )
{
m_mainWin->InsertItem( info );
- return 0;
+ return info.m_itemId;
}
long wxListCtrl::InsertItem( long index, const wxString &label )
int w = 0;
int h = 0;
- if (HasFlag(wxLC_REPORT))
+ if (HasFlag(wxLC_REPORT) && !HasFlag(wxLC_NO_HEADER))
{
m_headerWin->GetPosition( &x, &y );
m_headerWin->GetSize( &w, &h );