// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
{
wxListItemData *item = (wxListItemData*)node->Data();
item->SetPosition( x, m_bound_all.y+1 );
- }
+ }
}
void wxListLineData::GetSize( int &width, int &height )
long dev_w = dc->LogicalToDeviceXRel( m_bound_all.width+4 );
long dev_h = dc->LogicalToDeviceYRel( m_bound_all.height+4 );
if (!m_owner->IsExposed( dev_x, dev_y, dev_w, dev_h ) ) return;
-
+
if (paintBG)
{
if (hilight)
{
int y = 0;
m_owner->DrawImage( item->GetImage(), dc, x, item->GetY() );
- m_owner->GetImageSize( item->GetImage(), x, y );
- x += item->GetX() + 5;
+ m_owner->GetImageSize( item->GetImage(), x, y );
+ x += item->GetX() + 5;
}
if (item->HasText())
{
item->GetText( s );
- if (hilight)
- dc->SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
- else
+ if (hilight)
+ dc->SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
+ else
dc->SetTextForeground( *item->GetColour() );
dc->DrawText( s, x, item->GetY() );
}
{
wxString s;
item->GetText( s );
- if (hilight)
- dc->SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
- else
+ if (hilight)
+ dc->SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
+ else
dc->SetTextForeground( * item->GetColour() );
dc->DrawText( s, m_bound_label.x, m_bound_label.y );
}
void wxListLineData::Hilight( bool on )
{
if (on == m_hilighted) return;
- if (on)
+ if (on)
m_owner->SelectLine( this );
else
m_owner->DeselectLine( this );
void wxListLineData::ReverseHilight( void )
{
m_hilighted = !m_hilighted;
- if (m_hilighted)
+ if (m_hilighted)
m_owner->SelectLine( this );
else
m_owner->DeselectLine( this );
m_isDraging = FALSE;
}
-wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
+wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) :
wxWindow( win, id, pos, size, style, name )
dc->SetPen( *wxBLACK_PEN );
dc->DrawLine( x+w-m_corner+1, y, x+w, y+h ); // right (outer)
dc->DrawRectangle( x, y+h, w, 1 ); // bottom (outer)
-
+
dc->SetPen( *wxMEDIUM_GREY_PEN );
dc->DrawLine( x+w-m_corner, y, x+w-1, y+h ); // right (inner)
dc->DrawRectangle( x+1, y+h-1, w-2, 1 ); // bottom (inner)
-
+
dc->SetPen( *wxWHITE_PEN );
dc->DrawRectangle( x, y, w-m_corner+1, 1 ); // top (outer)
// dc->DrawRectangle( x, y+1, w-m_corner, 1 ); // top (inner)
{
wxPaintDC dc( this );
PrepareDC( dc );
-
+
dc.BeginDrawing();
-
+
dc.SetFont( *GetFont() );
int w = 0;
int cw = item.m_width-2;
if ((i+1 == numColumns) || (x+item.m_width > w-5)) cw = w-x-1;
dc.SetPen( *wxWHITE_PEN );
-
+
DoDrawRect( &dc, x, y, cw, h-2 );
dc.SetClippingRegion( x, y, cw-5, h-4 );
dc.DrawText( item.m_text, x+4, y+3 );
dc.DestroyClippingRegion();
x += item.m_width;
if (x > w+5) break;
- }
+ }
dc.EndDrawing();
}
}
return;
}
-
+
m_minX = 0;
bool hit_border = FALSE;
int xpos = 0;
for (int j = 0; j < m_owner->GetColumnCount(); j++)
{
xpos += m_owner->GetColumnWidth( j );
- if ((abs(x-xpos) < 3) && (y < 22))
- {
+ if ((abs(x-xpos) < 3) && (y < 22))
+ {
hit_border = TRUE;
m_column = j;
break;
}
m_minX = xpos;
}
-
+
if (event.LeftDown() && hit_border)
{
m_isDraging = TRUE;
CaptureMouse();
return;
}
-
+
if (event.Moving())
{
if (hit_border)
// wxListRenameTimer (internal)
//-----------------------------------------------------------------------------
-wxListRenameTimer::wxListRenameTimer( wxListMainWindow *owner )
-{
- m_owner = owner;
+wxListRenameTimer::wxListRenameTimer( wxListMainWindow *owner )
+{
+ m_owner = owner;
}
-void wxListRenameTimer::Notify()
-{
+void wxListRenameTimer::Notify()
+{
m_owner->OnRenameTimer();
}
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxListTextCtrl,wxTextCtrl);
-
+
BEGIN_EVENT_TABLE(wxListTextCtrl,wxTextCtrl)
EVT_CHAR (wxListTextCtrl::OnChar)
EVT_KILL_FOCUS (wxListTextCtrl::OnKillFocus)
END_EVENT_TABLE()
-wxListTextCtrl::wxListTextCtrl( wxWindow *parent, const wxWindowID id,
+wxListTextCtrl::wxListTextCtrl( wxWindow *parent, const wxWindowID id,
bool *accept, wxString *res, wxListMainWindow *owner,
const wxString &value, const wxPoint &pos, const wxSize &size,
int style, const wxValidator& validator, const wxString &name ) :
return;
}
if (event.m_keyCode == WXK_ESCAPE)
- {
+ {
(*m_accept) = FALSE;
(*m_res) = "";
// Show( FALSE );
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxListMainWindow,wxScrolledWindow);
-
+
BEGIN_EVENT_TABLE(wxListMainWindow,wxScrolledWindow)
EVT_PAINT (wxListMainWindow::OnPaint)
EVT_SIZE (wxListMainWindow::OnSize)
m_dragCount = 0;
}
-wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id,
+wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) :
wxScrolledWindow( parent, id, pos, size, style, name )
m_isCreated = FALSE;
wxSize sz = size;
sz.y = 25;
-
+
if (m_mode & wxLC_REPORT)
{
m_xScroll = 0;
m_yScroll = 0;
}
SetScrollbars( m_xScroll, m_yScroll, 0, 0, 0, 0 );
-
+
m_usedKeys = TRUE;
m_lastOnSame = FALSE;
m_renameTimer = new wxListRenameTimer( this );
wxClientDC dc(this);
PrepareDC( dc );
line->GetExtent( x, y, w, h );
- wxRectangle rect(
- dc.LogicalToDeviceX(x-3),
- dc.LogicalToDeviceY(y-3),
- dc.LogicalToDeviceXRel(w+6),
+ wxRectangle rect(
+ dc.LogicalToDeviceX(x-3),
+ dc.LogicalToDeviceY(y-3),
+ dc.LogicalToDeviceXRel(w+6),
dc.LogicalToDeviceXRel(h+6) );
Refresh( TRUE, &rect );
}
void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
{
if (m_dirty) return;
-
+
wxPaintDC dc( this );
PrepareDC( dc );
-
+
dc.BeginDrawing();
dc.SetFont( *GetFont() );
wxNode *node = m_lines.First();
- while (node)
+ while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
line->Draw( &dc );
void wxListMainWindow::RenameLine( wxListLineData *line, const wxString &newName )
{
if (!GetParent()) return;
-
+
wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() );
le.SetEventObject( GetParent() );
le.m_code = 0;
int w = 0;
int h = 0;
m_current->GetLabelExtent( x, y, w, h );
-
+
wxClientDC dc(this);
PrepareDC( dc );
x = dc.LogicalToDeviceX( x );
y = dc.LogicalToDeviceY( y );
-
- wxListTextCtrl *text = new wxListTextCtrl(
+
+ wxListTextCtrl *text = new wxListTextCtrl(
this, -1, &m_renameAccept, &m_renameRes, this, s, wxPoint(x-4,y-4), wxSize(w+11,h+8) );
text->SetFocus();
/*
PrepareDC(dc);
long x = dc.DeviceToLogicalX( (long)event.GetX() );
long y = dc.DeviceToLogicalY( (long)event.GetY() );
-
+
long hitResult = 0;
wxNode *node = m_lines.First();
wxListLineData *line = (wxListLineData *) NULL;
line = (wxListLineData *) NULL;
node = node->Next();
}
-
+
if (!event.Dragging())
m_dragCount = 0;
else
m_dragCount++;
-
+
if (event.Dragging() && (m_dragCount > 3))
{
m_dragCount = 0;
le.m_col = 0;
OnListNotify( le );
}
-
+
if (!line) return;
-
+
if (event.ButtonDClick())
{
m_usedKeys = FALSE;
ActivateLine( line );
return;
}
-
+
if (event.LeftUp() && m_lastOnSame)
{
m_usedKeys = FALSE;
if ((line == m_current) &&
- (hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
-// (m_mode & wxLC_ICON) &&
- (m_mode & wxLC_EDIT_LABELS) )
+ (hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
+// (m_mode & wxLC_ICON) &&
+ (m_mode & wxLC_EDIT_LABELS) )
{
m_renameTimer->Start( 100, TRUE );
}
m_lastOnSame = FALSE;
return;
}
-
+
if (event.LeftDown())
{
m_usedKeys = FALSE;
while (node)
{
wxListLineData *test_line = (wxListLineData*)node->Data();
- numOfCurrent++;
- if (test_line == oldCurrent) break;
+ numOfCurrent++;
+ if (test_line == oldCurrent) break;
node = node->Next();
}
int numOfLine = -1;
while (node)
{
wxListLineData *test_line = (wxListLineData*)node->Data();
- numOfLine++;
- if (test_line == line) break;
+ numOfLine++;
+ if (test_line == line) break;
node = node->Next();
}
-
- if (numOfLine < numOfCurrent)
- { int i = numOfLine; numOfLine = numOfCurrent; numOfCurrent = i; }
- wxNode *node = m_lines.Nth( numOfCurrent );
- for (int i = 0; i <= numOfLine-numOfCurrent; i++)
- {
- wxListLineData *test_line= (wxListLineData*)node->Data();
- test_line->Hilight(TRUE);
- RefreshLine( test_line );
- node = node->Next();
- }
+
+ if (numOfLine < numOfCurrent)
+ { int i = numOfLine; numOfLine = numOfCurrent; numOfCurrent = i; }
+ wxNode *node = m_lines.Nth( numOfCurrent );
+ for (int i = 0; i <= numOfLine-numOfCurrent; i++)
+ {
+ wxListLineData *test_line= (wxListLineData*)node->Data();
+ test_line->Hilight(TRUE);
+ RefreshLine( test_line );
+ node = node->Next();
+ }
}
- else
+ else
{
m_current = line;
HilightAll( FALSE );
m_lastOnSame = (m_current == oldCurrent);
return;
}
-
+
}
void wxListMainWindow::MoveToFocus( void )
{
if (GetScrollPos( wxHORIZONTAL ) != 0) SetScrollPos( wxHORIZONTAL, 0);
int y_s = m_yScroll*GetScrollPos( wxVERTICAL );
- if ((y > y_s) && (y+h < y_s+h_p)) return;
+ if ((y > y_s) && (y+h < y_s+h_p)) return;
if (y-y_s < 5) SetScrollPos( wxVERTICAL, (y-5)/m_yScroll );
if (y+h+5 > y_s+h_p) SetScrollPos( wxVERTICAL, (y+h-h_p+h+5)/m_yScroll );
}
if (m_mode & wxLC_REPORT) { steps = m_visibleLines-1; }
else
{
- int pos = 0;
+ int pos = 0;
wxNode *node = m_lines.First();
for (;;) { if (m_current == (wxListLineData*)node->Data()) break; pos++; node = node->Next(); }
steps = pos % m_visibleLines;
{
wxListLineData *oldCurrent = m_current;
m_current->ReverseHilight();
- wxNode *node = m_lines.Member( m_current )->Next();
+ wxNode *node = m_lines.Member( m_current )->Next();
if (node) m_current = (wxListLineData*)node->Data();
MoveToFocus();
- RefreshLine( oldCurrent );
- RefreshLine( m_current );
+ RefreshLine( oldCurrent );
+ RefreshLine( m_current );
UnfocusLine( oldCurrent );
FocusLine( m_current );
}
{
m_hasFocus = TRUE;
RefreshLine( m_current );
-
+
if (!GetParent()) return;
-
+
wxFocusEvent event( wxEVT_SET_FOCUS, GetParent()->GetId() );
event.SetEventObject( GetParent() );
GetParent()->GetEventHandler()->ProcessEvent( event );
{
m_dirty = TRUE;
if (isSmall)
- {
+ {
m_small_spacing = spacing;
}
else
if (!(m_mode & wxLC_REPORT)) return;
m_dirty = TRUE;
-
+
wxNode *node = m_columns.Nth( col );
if (node)
{
wxListHeaderData *column = (wxListHeaderData*)node->Data();
column->SetWidth( width );
}
-
+
node = m_lines.First();
- while (node)
+ while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
wxNode *n = line->m_items.Nth( col );
}
node = node->Next();
}
-
+
wxListCtrl *lc = (wxListCtrl*) GetParent();
if (lc->m_headerWin) lc->m_headerWin->Refresh();
}
}
}
-int wxListMainWindow::GetColumnWidth( int col )
+int wxListMainWindow::GetColumnWidth( int col )
{
wxNode *node = m_columns.Nth( col );
if (node)
{
m_dirty = TRUE;
wxNode *node = m_lines.Nth( item.m_itemId );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
if (m_mode & wxLC_REPORT) item.m_width = GetColumnWidth( item.m_col )-3;
void wxListMainWindow::SetItemState( long item, long state, long stateMask )
{
// m_dirty = TRUE; no recalcs needed
-
+
wxListLineData *oldCurrent = m_current;
-
- if (stateMask & wxLIST_STATE_FOCUSED)
+
+ if (stateMask & wxLIST_STATE_FOCUSED)
{
wxNode *node = m_lines.Nth( item );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
UnfocusLine( m_current );
RefreshLine( oldCurrent );
}
}
-
+
if (stateMask & wxLIST_STATE_SELECTED)
{
bool on = state & wxLIST_STATE_SELECTED;
- if (!on && (m_mode & wxLC_SINGLE_SEL)) return;
-
+ if (!on && (m_mode & wxLC_SINGLE_SEL)) return;
+
wxNode *node = m_lines.Nth( item );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
if (m_mode & wxLC_SINGLE_SEL)
{
UnfocusLine( m_current );
- m_current = line;
+ m_current = line;
FocusLine( m_current );
oldCurrent->Hilight( FALSE );
RefreshLine( m_current );
if (stateMask & wxLIST_STATE_FOCUSED)
{
wxNode *node = m_lines.Nth( item );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
if (line == m_current) ret |= wxLIST_STATE_FOCUSED;
if (stateMask & wxLIST_STATE_SELECTED)
{
wxNode *node = m_lines.Nth( item );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
if (line->IsHilighted()) ret |= wxLIST_STATE_FOCUSED;
void wxListMainWindow::GetItem( wxListItem &item )
{
wxNode *node = m_lines.Nth( item.m_itemId );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
line->GetItem( item.m_col, item );
void wxListMainWindow::GetItemRect( long index, wxRectangle &rect )
{
wxNode *node = m_lines.Nth( index );
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
line->GetRect( rect );
bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos)
{
wxNode *node = m_lines.Nth( item );
- if (node)
+ if (node)
{
wxRectangle rect;
wxListLineData *line = (wxListLineData*)node->Data();
{
m_dirty = TRUE;
m_mode = mode;
-
+
DeleteEverything();
-
+
if (m_mode & wxLC_REPORT)
{
m_xScroll = 0;
if (m_mode & wxLC_ICON) iconSpacing = m_normal_spacing;
if (m_mode & wxLC_SMALL_ICON) iconSpacing = m_small_spacing;
wxNode *node = m_lines.First();
- while (node)
+ while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
line->CalculateSize( &dc, iconSpacing );
int lineWidth = 0;
int lineHeight = 0;
- int lineSpacing = 0;
+ int lineSpacing = 0;
node = m_lines.First();
- if (node)
+ if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
int dummy = 0;
else
{
// just in case
- lineSpacing = 4 + (int)dc.GetCharHeight();
+ lineSpacing = 4 + (int)dc.GetCharHeight();
}
-
+
int clientWidth = 0;
int clientHeight = 0;
-
+
if (m_mode & wxLC_REPORT)
{
int x = 4;
int entireHeight = m_lines.Number() * lineSpacing + 10;
SetScrollbars( m_xScroll, m_yScroll, 0, (entireHeight+10) / m_yScroll, 0, 0, TRUE );
GetClientSize( &clientWidth, &clientHeight );
-
+
node = m_lines.First();
while (node)
{
{
// At first, we try without any scrollbar
GetSize( &clientWidth, &clientHeight );
-
+
int entireWidth = 0;
-
+
for (int tries = 0; tries < 2; tries++)
{
entireWidth = 0;
line->GetSize( lineWidth, lineHeight );
if (lineWidth > maxWidth) maxWidth = lineWidth;
y += lineSpacing;
- if (y+lineHeight > clientHeight-4)
+ if (y+lineHeight > clientHeight-4)
{
y = 6;
x += maxWidth+13;
maxWidth = 0;
}
node = node->Next();
- if (!node) entireWidth += maxWidth;
- if ((tries == 0) && (entireWidth > clientWidth))
- {
- clientHeight -= 14; // scrollbar height
- break;
- }
- if (!node) tries = 1;
+ if (!node) entireWidth += maxWidth;
+ if ((tries == 0) && (entireWidth > clientWidth))
+ {
+ clientHeight -= 14; // scrollbar height
+ break;
+ }
+ if (!node) tries = 1;
}
}
SetScrollbars( m_xScroll, m_yScroll, (entireWidth+15) / m_xScroll, 0, 0, 0, TRUE );
if (node) m_current = (wxListLineData*)node->Data();
}
if (m_current)
- {
+ {
FocusLine( m_current );
if (m_mode & wxLC_SINGLE_SEL) m_current->Hilight( TRUE );
}
void wxListMainWindow::DeleteColumn( int col )
{
+ wxCHECK_RET( col < m_columns.GetCount(),
+ "attempting to delete inexistent column in wxListView" );
+
m_dirty = TRUE;
wxNode *node = m_columns.Nth( col );
if (node) m_columns.DeleteNode( node );
line->InitItems( GetColumnCount() );
item.m_width = GetColumnWidth( 0 )-3;
}
- else
+ else
line->InitItems( 1 );
line->SetItem( 0, item );
if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount()))
{
}
-bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
+bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
- long style, const wxValidator &validator,
+ long style, const wxValidator &validator,
const wxString &name )
{
m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL;
m_imageListState = (wxImageList *) NULL;
-
+
long s = style;
-
+
if ((s & wxLC_REPORT == 0) &&
(s & wxLC_LIST == 0) &&
(s & wxLC_ICON == 0))
s = s | wxLC_LIST;
-
+
bool ret = wxControl::Create( parent, id, pos, size, s, name );
-
+
SetValidator( validator );
-
+
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) );
else
m_headerWin = (wxListHeaderWindow *) NULL;
-
+
return ret;
}
void wxListCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
{
// handled in OnIdle
-
+
if (m_mainWin) m_mainWin->m_dirty = TRUE;
}
void wxListCtrl::SetSingleStyle( long style, bool add )
{
long flag = GetWindowStyleFlag();
-
+
if (add)
{
- if (style & wxLC_MASK_TYPE) flag = flag & ~wxLC_MASK_TYPE;
+ if (style & wxLC_MASK_TYPE) flag = flag & ~wxLC_MASK_TYPE;
if (style & wxLC_MASK_ALIGN) flag = flag & ~wxLC_MASK_ALIGN;
if (style & wxLC_MASK_SORT) flag = flag & ~wxLC_MASK_SORT;
}
{
if (flag & style) flag -= style;
}
-
+
SetWindowStyleFlag( flag );
}
GetClientSize( &width, &height );
m_mainWin->SetMode( flag );
-
+
if (flag & wxLC_REPORT)
{
if (!(GetWindowStyleFlag() & wxLC_REPORT))
// m_mainWin->SetSize( 0, 0, width, height );
m_headerWin->Show( FALSE );
}
- }
-
+ }
+
wxWindow::SetWindowStyleFlag( flag );
}
-bool wxListCtrl::GetColumn(int col, wxListItem &item)
+bool wxListCtrl::GetColumn(int col, wxListItem &item)
{
m_mainWin->GetColumn( col, item );
return TRUE;
return TRUE;
}
-int wxListCtrl::GetColumnWidth( int col )
+int wxListCtrl::GetColumnWidth( int col )
{
return m_mainWin->GetColumnWidth( col );
}
return TRUE;
}
-int wxListCtrl::GetCountPerPage(void)
+int wxListCtrl::GetCountPerPage(void)
{
return m_mainWin->GetCountPerPage(); // different from Windows ?
}
}
*/
-bool wxListCtrl::GetItem( wxListItem &info )
+bool wxListCtrl::GetItem( wxListItem &info )
{
m_mainWin->GetItem( info );
return TRUE;
int wxListCtrl::GetItemState( long item, long stateMask )
{
- return m_mainWin->GetItemState( item, stateMask );
+ return m_mainWin->GetItemState( item, stateMask );
}
bool wxListCtrl::SetItemState( long item, long state, long stateMask )
return TRUE;
}
-wxString wxListCtrl::GetItemText( long item )
+wxString wxListCtrl::GetItemText( long item )
{
wxListItem info;
info.m_itemId = item;
return 0;
}
-int wxListCtrl::GetItemCount(void)
+int wxListCtrl::GetItemCount(void)
{
return m_mainWin->GetItemCount();
}
return m_mainWin->GetItemSpacing( isSmall );
}
-int wxListCtrl::GetSelectedItemCount(void)
+int wxListCtrl::GetSelectedItemCount(void)
{
return m_mainWin->GetSelectedItemCount();
}
return TRUE;
}
+void wxListCtrl::DeleteAllColumns()
+{
+ for ( size_t n = 0; n < m_mainWin->m_columns.GetCount(); n++ )
+ DeleteColumn(n);
+}
+
bool wxListCtrl::DeleteColumn( int col )
{
m_mainWin->DeleteColumn( col );
return m_mainWin->FindItem( start, data );
}
-long wxListCtrl::FindItem( long WXUNUSED(start), const wxPoint& WXUNUSED(pt),
+long wxListCtrl::FindItem( long WXUNUSED(start), const wxPoint& WXUNUSED(pt),
int WXUNUSED(direction))
{
return 0;
int cw = 0;
int ch = 0;
GetClientSize( &cw, &ch );
-
+
int x = 0;
int y = 0;
int w = 0;
int h = 0;
-
+
if (GetWindowStyleFlag() & wxLC_REPORT)
{
m_headerWin->GetPosition( &x, &y );
m_headerWin->GetSize( &w, &h );
if ((x != 0) || (y != 0) || (w != cw) || (h != 23))
m_headerWin->SetSize( 0, 0, cw, 23 );
-
+
m_mainWin->GetPosition( &x, &y );
m_mainWin->GetSize( &w, &h );
if ((x != 0) || (y != 24) || (w != cw) || (h != ch-24))
if ((x != 0) || (y != 24) || (w != cw) || (h != ch))
m_mainWin->SetSize( 0, 0, cw, ch );
}
-
+
m_mainWin->CalculatePositions();
m_mainWin->RealizeChanges();
m_mainWin->m_dirty = FALSE;
}
void wxListCtrl::SetBackgroundColour( const wxColour &colour )
-{
+{
m_mainWin->SetBackgroundColour( colour );
- m_headerWin->SetBackgroundColour( colour );
+ m_headerWin->SetBackgroundColour( colour );
m_mainWin->m_dirty = TRUE;
}
void wxListCtrl::SetForegroundColour( const wxColour &colour )
-{
- m_mainWin->SetForegroundColour( colour );
- m_headerWin->SetForegroundColour( colour );
+{
+ m_mainWin->SetForegroundColour( colour );
+ m_headerWin->SetForegroundColour( colour );
m_mainWin->m_dirty = TRUE;
}
-
+
void wxListCtrl::SetFont( const wxFont &font )
-{
+{
m_mainWin->SetFont( font );
- m_headerWin->SetFont( font );
+ m_headerWin->SetFont( font );
m_mainWin->m_dirty = TRUE;
}