Code cleaning: wxID_ANY, wxDefaultSize, wxDefaultPosition, true, false, wxEmptyString, tabs and white spaces.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-17 16:22:36 +00:00
parent f938940e09
commit ca65c0440a
76 changed files with 2347 additions and 2332 deletions

View File

@@ -534,14 +534,14 @@ public:
// all these functions only do something if the line is currently visible
// change the line "selected" state, return TRUE if it really changed
bool HighlightLine( size_t line, bool highlight = TRUE);
// change the line "selected" state, return true if it really changed
bool HighlightLine( size_t line, bool highlight = true);
// as HighlightLine() but do it for the range of lines: this is incredibly
// more efficient for virtual list controls!
//
// NB: unlike HighlightLine() this one does refresh the lines on screen
void HighlightLines( size_t lineFrom, size_t lineTo, bool on = TRUE );
void HighlightLines( size_t lineFrom, size_t lineTo, bool on = true );
// toggle the line state and refresh it
void ReverseHighlight( size_t line )
@@ -623,8 +623,8 @@ public:
int GetTextLength( const wxString &s ) const;
void SetImageList( wxImageListType *imageList, int which );
void SetItemSpacing( int spacing, bool isSmall = FALSE );
int GetItemSpacing( bool isSmall = FALSE );
void SetItemSpacing( int spacing, bool isSmall = false );
int GetItemSpacing( bool isSmall = false );
void SetColumn( int col, wxListItem &item );
void SetColumnWidth( int col, int width );
@@ -664,7 +664,7 @@ public:
}
// set the scrollbars and update the positions of the items
void RecalculatePositions(bool noRefresh = FALSE);
void RecalculatePositions(bool noRefresh = false);
// refresh the window and the header
void RefreshAll();
@@ -675,7 +675,7 @@ public:
void DeleteColumn( int col );
void DeleteEverything();
void EnsureVisible( long index );
long FindItem( long start, const wxString& str, bool partial = FALSE );
long FindItem( long start, const wxString& str, bool partial = false );
long FindItem( long start, long data);
long HitTest( int x, int y, int &flags );
void InsertItem( wxListItem &item );
@@ -700,11 +700,11 @@ public:
virtual bool SetFont(const wxFont& font)
{
if ( !wxScrolledWindow::SetFont(font) )
return FALSE;
return false;
m_lineHeight = 0;
return TRUE;
return true;
}
// these are for wxListLineData usage only
@@ -937,7 +937,7 @@ void wxListItemData::SetSize( int width, int height )
bool wxListItemData::IsHit( int x, int y ) const
{
wxCHECK_MSG( m_rect, FALSE, _T("can't be called in this mode") );
wxCHECK_MSG( m_rect, false, _T("can't be called in this mode") );
return wxRect(GetX(), GetY(), GetWidth(), GetHeight()).Inside(x, y);
}
@@ -1122,7 +1122,7 @@ wxListLineData::wxListLineData( wxListMainWindow *owner )
m_gi = new GeometryInfo;
}
m_highlighted = FALSE;
m_highlighted = false;
InitItems( GetMode() == wxLC_REPORT ? m_owner->GetColumnCount() : 1 );
}
@@ -1438,10 +1438,10 @@ bool wxListLineData::SetAttributes(wxDC *dc,
dc->SetPen( *wxTRANSPARENT_PEN );
return TRUE;
return true;
}
return FALSE;
return false;
}
void wxListLineData::Draw( wxDC *dc )
@@ -1608,14 +1608,14 @@ void wxListLineData::DrawTextFormatted(wxDC *dc,
bool wxListLineData::Highlight( bool on )
{
wxCHECK_MSG( !IsVirtual(), FALSE, _T("unexpected call to Highlight") );
wxCHECK_MSG( !IsVirtual(), false, _T("unexpected call to Highlight") );
if ( on == m_highlighted )
return FALSE;
return false;
m_highlighted = on;
return TRUE;
return true;
}
void wxListLineData::ReverseHighlight( void )
@@ -1638,8 +1638,8 @@ END_EVENT_TABLE()
void wxListHeaderWindow::Init()
{
m_currentCursor = (wxCursor *) NULL;
m_isDragging = FALSE;
m_dirty = FALSE;
m_isDragging = false;
m_dirty = false;
}
wxListHeaderWindow::wxListHeaderWindow()
@@ -1665,7 +1665,7 @@ wxListHeaderWindow::wxListHeaderWindow( wxWindow *win,
m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE );
#if _USE_VISATTR
wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
SetDefaultForegroundColour( attr.colFg );
SetDefaultBackgroundColour( attr.colBg );
SetDefaultFont( attr.font );
@@ -1719,7 +1719,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetTextForeground(GetForegroundColour());
int x = HEADER_OFFSET_X;
int numColumns = m_owner->GetColumnCount();
@@ -1746,7 +1746,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
// for this we need the width of the text
wxCoord wLabel;
wxCoord hLabel;
wxCoord hLabel;
dc.GetTextExtent(item.GetText(), &wLabel, &hLabel);
wLabel += 2*EXTRA_WIDTH;
@@ -1871,8 +1871,8 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
if (event.ButtonUp())
{
ReleaseMouse();
m_isDragging = FALSE;
m_dirty = TRUE;
m_isDragging = false;
m_dirty = true;
m_owner->SetColumnWidth( m_column, m_currentX - m_minX );
SendListEvent(wxEVT_COMMAND_LIST_COL_END_DRAG, event.GetPosition());
}
@@ -1891,7 +1891,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
else // not dragging
{
m_minX = 0;
bool hit_border = FALSE;
bool hit_border = false;
// end of the current column
int xpos = 0;
@@ -1907,7 +1907,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
if ( (abs(x-xpos) < 3) && (y < 22) )
{
// near the column border
hit_border = TRUE;
hit_border = true;
break;
}
@@ -1930,7 +1930,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
if ( SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
event.GetPosition()) )
{
m_isDragging = TRUE;
m_isDragging = true;
m_currentX = x;
CaptureMouse();
DrawCurrent();
@@ -2017,7 +2017,7 @@ wxListTextCtrl::wxListTextCtrl(wxListMainWindow *owner, size_t itemEdit)
m_itemEdited(itemEdit)
{
m_owner = owner;
m_finished = FALSE;
m_finished = false;
wxRect rectLabel = owner->GetLineLabelRect(itemEdit);
@@ -2035,7 +2035,7 @@ void wxListTextCtrl::Finish()
{
wxPendingDelete.Append(this);
m_finished = TRUE;
m_finished = true;
m_owner->SetFocus();
}
@@ -2048,19 +2048,19 @@ bool wxListTextCtrl::AcceptChanges()
if ( value == m_startValue )
{
// nothing changed, always accept
return TRUE;
return true;
}
if ( !m_owner->OnRenameAccept(m_itemEdited, value) )
{
// vetoed by the user
return FALSE;
return false;
}
// accepted, do rename the item
m_owner->SetItemText(m_itemEdited, value);
return TRUE;
return true;
}
void wxListTextCtrl::OnChar( wxKeyEvent &event )
@@ -2103,7 +2103,7 @@ void wxListTextCtrl::OnKeyUp( wxKeyEvent &event )
sx = parentSize.x - myPos.x;
if (mySize.x > sx)
sx = mySize.x;
SetSize(sx, -1);
SetSize(sx, wxDefaultSize.y);
event.Skip();
}
@@ -2140,7 +2140,7 @@ END_EVENT_TABLE()
void wxListMainWindow::Init()
{
m_dirty = TRUE;
m_dirty = true;
m_countVirt = 0;
m_lineFrom =
m_lineTo = (size_t)-1;
@@ -2155,11 +2155,11 @@ void wxListMainWindow::Init()
m_small_spacing = 30;
m_normal_spacing = 40;
m_hasFocus = FALSE;
m_hasFocus = false;
m_dragCount = 0;
m_isCreated = FALSE;
m_isCreated = false;
m_lastOnSame = FALSE;
m_lastOnSame = false;
m_renameTimer = new wxListRenameTimer( this );
m_current =
@@ -2211,7 +2211,7 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent,
SetScrollbars( 0, 0, 0, 0, 0, 0 );
wxVisualAttributes attr = wxGenericListCtrl::GetClassDefaultAttributes();
wxVisualAttributes attr = wxGenericListCtrl::GetClassDefaultAttributes();
SetDefaultForegroundColour( attr.colFg );
SetDefaultBackgroundColour( attr.colBg );
SetDefaultFont( attr.font );
@@ -2400,7 +2400,7 @@ bool wxListMainWindow::IsHighlighted(size_t line) const
else // !virtual
{
wxListLineData *ld = GetLine(line);
wxCHECK_MSG( ld, FALSE, _T("invalid index in IsHighlighted") );
wxCHECK_MSG( ld, false, _T("invalid index in IsHighlighted") );
return ld->IsHighlighted();
}
@@ -2451,7 +2451,7 @@ bool wxListMainWindow::HighlightLine( size_t line, bool highlight )
else // !virtual
{
wxListLineData *ld = GetLine(line);
wxCHECK_MSG( ld, FALSE, _T("invalid index in HighlightLine") );
wxCHECK_MSG( ld, false, _T("invalid index in HighlightLine") );
changed = ld->Highlight(highlight);
}
@@ -2545,7 +2545,7 @@ void wxListMainWindow::RefreshAfter( size_t lineFrom )
else // !report
{
// TODO: how to do it more efficiently?
m_dirty = TRUE;
m_dirty = true;
}
}
@@ -2740,7 +2740,7 @@ void wxListMainWindow::HighlightAll( bool on )
// we just have one item to turn off
if ( HasCurrent() && IsHighlighted(m_current) )
{
HighlightLine(m_current, FALSE);
HighlightLine(m_current, false);
RefreshLine(m_current);
}
}
@@ -2829,7 +2829,7 @@ bool wxListMainWindow::OnRenameAccept(size_t itemEdit, const wxString& value)
le.m_itemIndex = itemEdit;
wxListLineData *data = GetLine(itemEdit);
wxCHECK_MSG( data, FALSE, _T("invalid index in OnRenameAccept()") );
wxCHECK_MSG( data, false, _T("invalid index in OnRenameAccept()") );
data->GetItem( 0, le.m_item );
le.m_item.m_text = value;
@@ -2842,7 +2842,7 @@ void wxListMainWindow::OnRenameCancelled(size_t itemEdit)
// let owner know that the edit was cancelled
wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() );
le.SetEditCanceled(TRUE);
le.SetEditCanceled(true);
le.SetEventObject( GetParent() );
le.m_itemIndex = itemEdit;
@@ -2936,11 +2936,11 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
return;
}
bool forceClick = FALSE;
bool forceClick = false;
if (event.ButtonDClick())
{
m_renameTimer->Stop();
m_lastOnSame = FALSE;
m_lastOnSame = false;
if ( current == m_lineLastClicked )
{
@@ -2952,7 +2952,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
{
// the first click was on another item, so don't interpret this as
// a double click, but as a simple click instead
forceClick = TRUE;
forceClick = true;
}
}
@@ -2962,9 +2962,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
(hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
HasFlag(wxLC_EDIT_LABELS) )
{
m_renameTimer->Start( 100, TRUE );
m_renameTimer->Start( 100, true );
}
m_lastOnSame = FALSE;
m_lastOnSame = false;
}
else if (event.RightDown())
{
@@ -2984,7 +2984,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
if ( IsSingleSel() || !(event.ControlDown() || event.ShiftDown()) )
{
HighlightAll( FALSE );
HighlightAll( false );
ChangeCurrent(current);
@@ -3098,19 +3098,19 @@ void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
{
// all previously selected items are unselected unless ctrl is held
if ( !event.ControlDown() )
HighlightAll(FALSE);
HighlightAll(false);
ChangeCurrent(newCurrent);
// refresh the old focus to remove it
RefreshLine( oldCurrent );
if ( !event.ControlDown() )
{
HighlightLine( m_current, TRUE );
HighlightLine( m_current, true );
}
}
RefreshLine( m_current );
MoveToFocus();
@@ -3319,7 +3319,7 @@ void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
// it
if ( !m_hasFocus )
{
m_hasFocus = TRUE;
m_hasFocus = true;
RefreshSelected();
}
@@ -3334,7 +3334,7 @@ void wxListMainWindow::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
if ( GetParent()->GetEventHandler()->ProcessEvent( event) )
return;
}
m_hasFocus = FALSE;
m_hasFocus = false;
RefreshSelected();
}
@@ -3396,7 +3396,7 @@ int wxListMainWindow::GetTextLength( const wxString &s ) const
void wxListMainWindow::SetImageList( wxImageListType *imageList, int which )
{
m_dirty = TRUE;
m_dirty = true;
// calc the spacing from the icon size
int width = 0,
@@ -3422,7 +3422,7 @@ void wxListMainWindow::SetImageList( wxImageListType *imageList, int which )
void wxListMainWindow::SetItemSpacing( int spacing, bool isSmall )
{
m_dirty = TRUE;
m_dirty = true;
if (isSmall)
{
m_small_spacing = spacing;
@@ -3456,9 +3456,9 @@ void wxListMainWindow::SetColumn( int col, wxListItem &item )
wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
if ( headerWin )
headerWin->m_dirty = TRUE;
headerWin->m_dirty = true;
m_dirty = TRUE;
m_dirty = true;
// invalidate it as it has to be recalculated
m_headerWidth = 0;
@@ -3472,10 +3472,10 @@ void wxListMainWindow::SetColumnWidth( int col, int width )
wxCHECK_RET( InReportView(),
_T("SetColumnWidth() can only be called in report mode.") );
m_dirty = TRUE;
m_dirty = true;
wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
if ( headerWin )
headerWin->m_dirty = TRUE;
headerWin->m_dirty = true;
wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col );
wxCHECK_RET( node, _T("no column?") );
@@ -3618,7 +3618,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
{
if ( IsSingleSel() )
{
HighlightLine(oldCurrent, FALSE);
HighlightLine(oldCurrent, false);
}
RefreshLine(oldCurrent);
@@ -3639,7 +3639,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
// we must unselect the old current item as well or we
// might end up with more than one selected item in a
// single selection control
HighlightLine(oldCurrent, FALSE);
HighlightLine(oldCurrent, false);
}
RefreshLine( oldCurrent );
@@ -3664,7 +3664,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
if ( oldCurrent != (size_t)-1 )
{
HighlightLine( oldCurrent, FALSE );
HighlightLine( oldCurrent, false );
RefreshLine( oldCurrent );
}
}
@@ -3732,7 +3732,7 @@ void wxListMainWindow::SetItemCount(long count)
ResetVisibleLinesRange();
// scrollbars must be reset
m_dirty = TRUE;
m_dirty = true;
}
int wxListMainWindow::GetSelectedItemCount() const
@@ -3740,7 +3740,7 @@ int wxListMainWindow::GetSelectedItemCount() const
// deal with the quick case first
if ( IsSingleSel() )
{
return HasCurrent() ? IsHighlighted(m_current) : FALSE;
return HasCurrent() ? IsHighlighted(m_current) : false;
}
// virtual controls remmebers all its selections itself
@@ -3813,7 +3813,7 @@ void wxListMainWindow::GetItemRect( long index, wxRect &rect ) const
if ( m_dirty )
{
wxConstCast(this, wxListMainWindow)->
RecalculatePositions(TRUE /* no refresh */);
RecalculatePositions(true /* no refresh */);
}
rect = GetLineRect((size_t)index);
@@ -3829,7 +3829,7 @@ bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos) const
pos.x = rect.x;
pos.y = rect.y;
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -3887,7 +3887,7 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
(entireHeight + lineHeight - 1) / lineHeight,
GetScrollPos(wxHORIZONTAL),
GetScrollPos(wxVERTICAL),
TRUE );
true );
}
else // !report
{
@@ -3944,7 +3944,7 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
(y + lineHeight) / lineHeight,
GetScrollPos( wxHORIZONTAL ),
GetScrollPos( wxVERTICAL ),
TRUE
true
);
}
else // "flowed" arrangement, the most complicated case
@@ -4025,7 +4025,7 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
0,
GetScrollPos( wxHORIZONTAL ),
0,
TRUE
true
);
}
}
@@ -4041,13 +4041,13 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
void wxListMainWindow::RefreshAll()
{
m_dirty = FALSE;
m_dirty = false;
Refresh();
wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
if ( headerWin && headerWin->m_dirty )
{
headerWin->m_dirty = FALSE;
headerWin->m_dirty = false;
headerWin->Refresh();
}
}
@@ -4141,7 +4141,7 @@ void wxListMainWindow::DeleteItem( long lindex )
}
// we need to refresh the (vert) scrollbar as the number of items changed
m_dirty = TRUE;
m_dirty = true;
SendNotify( index, wxEVT_COMMAND_LIST_DELETE_ITEM );
@@ -4154,7 +4154,7 @@ void wxListMainWindow::DeleteColumn( int col )
wxCHECK_RET( node, wxT("invalid column index in DeleteColumn()") );
m_dirty = TRUE;
m_dirty = true;
delete node->GetData();
m_columns.Erase( node );
@@ -4235,7 +4235,7 @@ void wxListMainWindow::EnsureVisible( long index )
// been added and its position is not known yet
if ( m_dirty )
{
RecalculatePositions(TRUE /* no refresh */);
RecalculatePositions(true /* no refresh */);
}
MoveToItem((size_t)index);
@@ -4323,7 +4323,7 @@ void wxListMainWindow::InsertItem( wxListItem &item )
size_t id = item.m_itemId;
m_dirty = TRUE;
m_dirty = true;
#if 0
// this is unused variable
@@ -4369,7 +4369,7 @@ void wxListMainWindow::InsertItem( wxListItem &item )
m_lines.Insert( line, id );
m_dirty = TRUE;
m_dirty = true;
// If an item is selected at or below the point of insertion, we need to
// increment the member variables because the current row's index has gone
@@ -4386,7 +4386,7 @@ void wxListMainWindow::InsertItem( wxListItem &item )
void wxListMainWindow::InsertColumn( long col, wxListItem &item )
{
m_dirty = TRUE;
m_dirty = true;
if ( InReportView() )
{
if (item.m_width == wxLIST_AUTOSIZE_USEHEADER)
@@ -4447,7 +4447,7 @@ void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
list_ctrl_compare_func_2 = fn;
list_ctrl_compare_data = data;
m_lines.Sort( list_ctrl_compare_func_1 );
m_dirty = TRUE;
m_dirty = true;
}
// ----------------------------------------------------------------------------
@@ -4544,7 +4544,7 @@ wxGenericListCtrl::wxGenericListCtrl()
m_ownsImageListNormal =
m_ownsImageListSmall =
m_ownsImageListState = FALSE;
m_ownsImageListState = false;
m_mainWin = (wxListMainWindow*) NULL;
m_headerWin = (wxListHeaderWindow*) NULL;
@@ -4578,7 +4578,7 @@ void wxGenericListCtrl::CalculateAndSetHeaderHeight()
m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight);
if ( HasHeader() )
ResizeReportView(TRUE);
ResizeReportView(true);
}
}
}
@@ -4587,7 +4587,7 @@ void wxGenericListCtrl::CreateHeaderWindow()
{
m_headerWin = new wxListHeaderWindow
(
this, -1, m_mainWin,
this, wxID_ANY, m_mainWin,
wxPoint(0, 0),
wxSize(GetClientSize().x, m_headerHeight),
wxTAB_TRAVERSAL
@@ -4608,7 +4608,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
m_imageListState = (wxImageListType *) NULL;
m_ownsImageListNormal =
m_ownsImageListSmall =
m_ownsImageListState = FALSE;
m_ownsImageListState = false;
m_mainWin = (wxListMainWindow*) NULL;
m_headerWin = (wxListHeaderWindow*) NULL;
@@ -4621,12 +4621,12 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
}
if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) )
return FALSE;
return false;
// don't create the inner window with the border
style &= ~wxBORDER_MASK;
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, style );
m_mainWin = new wxListMainWindow( this, wxID_ANY, wxPoint(0,0), size, style );
#if defined( __WXMAC__ ) && __WXMAC_CARBON__
wxFont font ;
@@ -4640,13 +4640,13 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
if ( HasFlag(wxLC_NO_HEADER) )
{
// VZ: why do we create it at all then?
m_headerWin->Show( FALSE );
m_headerWin->Show( false );
}
}
SetBestSize(size);
return TRUE;
return true;
}
void wxGenericListCtrl::SetSingleStyle( long style, bool add )
@@ -4696,7 +4696,7 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
if ( m_headerWin )
{
// don't delete, just hide, as we can reuse it later
m_headerWin->Show(FALSE);
m_headerWin->Show(false);
}
//else: nothing to do
}
@@ -4708,7 +4708,7 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
}
else // already have it, just show
{
m_headerWin->Show( TRUE );
m_headerWin->Show( true );
}
}
@@ -4722,13 +4722,13 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const
{
m_mainWin->GetColumn( col, item );
return TRUE;
return true;
}
bool wxGenericListCtrl::SetColumn( int col, wxListItem& item )
{
m_mainWin->SetColumn( col, item );
return TRUE;
return true;
}
int wxGenericListCtrl::GetColumnWidth( int col ) const
@@ -4739,7 +4739,7 @@ int wxGenericListCtrl::GetColumnWidth( int col ) const
bool wxGenericListCtrl::SetColumnWidth( int col, int width )
{
m_mainWin->SetColumnWidth( col, width );
return TRUE;
return true;
}
int wxGenericListCtrl::GetCountPerPage() const
@@ -4750,13 +4750,13 @@ int wxGenericListCtrl::GetCountPerPage() const
bool wxGenericListCtrl::GetItem( wxListItem &info ) const
{
m_mainWin->GetItem( info );
return TRUE;
return true;
}
bool wxGenericListCtrl::SetItem( wxListItem &info )
{
m_mainWin->SetItem( info );
return TRUE;
return true;
}
long wxGenericListCtrl::SetItem( long index, int col, const wxString& label, int imageId )
@@ -4772,7 +4772,7 @@ long wxGenericListCtrl::SetItem( long index, int col, const wxString& label, int
info.m_mask |= wxLIST_MASK_IMAGE;
};
m_mainWin->SetItem(info);
return TRUE;
return true;
}
int wxGenericListCtrl::GetItemState( long item, long stateMask ) const
@@ -4783,7 +4783,7 @@ int wxGenericListCtrl::GetItemState( long item, long stateMask ) const
bool wxGenericListCtrl::SetItemState( long item, long state, long stateMask )
{
m_mainWin->SetItemState( item, state, stateMask );
return TRUE;
return true;
}
bool wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) )
@@ -4793,7 +4793,7 @@ bool wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImag
info.m_mask = wxLIST_MASK_IMAGE;
info.m_itemId = item;
m_mainWin->SetItem( info );
return TRUE;
return true;
}
wxString wxGenericListCtrl::GetItemText( long item ) const
@@ -4821,7 +4821,7 @@ bool wxGenericListCtrl::SetItemData( long item, long data )
info.m_itemId = item;
info.m_data = data;
m_mainWin->SetItem( info );
return TRUE;
return true;
}
wxRect wxGenericListCtrl::GetViewRect() const
@@ -4834,13 +4834,13 @@ bool wxGenericListCtrl::GetItemRect( long item, wxRect &rect, int WXUNUSED(code
m_mainWin->GetItemRect( item, rect );
if ( m_mainWin->HasHeader() )
rect.y += m_headerHeight + 1;
return TRUE;
return true;
}
bool wxGenericListCtrl::GetItemPosition( long item, wxPoint& pos ) const
{
m_mainWin->GetItemPosition( item, pos );
return TRUE;
return true;
}
bool wxGenericListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) )
@@ -4957,19 +4957,19 @@ void wxGenericListCtrl::SetImageList( wxImageListType *imageList, int which )
{
if (m_ownsImageListNormal) delete m_imageListNormal;
m_imageListNormal = imageList;
m_ownsImageListNormal = FALSE;
m_ownsImageListNormal = false;
}
else if ( which == wxIMAGE_LIST_SMALL )
{
if (m_ownsImageListSmall) delete m_imageListSmall;
m_imageListSmall = imageList;
m_ownsImageListSmall = FALSE;
m_ownsImageListSmall = false;
}
else if ( which == wxIMAGE_LIST_STATE )
{
if (m_ownsImageListState) delete m_imageListState;
m_imageListState = imageList;
m_ownsImageListState = FALSE;
m_ownsImageListState = false;
}
m_mainWin->SetImageList( imageList, which );
@@ -4979,11 +4979,11 @@ void wxGenericListCtrl::AssignImageList(wxImageListType *imageList, int which)
{
SetImageList(imageList, which);
if ( which == wxIMAGE_LIST_NORMAL )
m_ownsImageListNormal = TRUE;
m_ownsImageListNormal = true;
else if ( which == wxIMAGE_LIST_SMALL )
m_ownsImageListSmall = TRUE;
m_ownsImageListSmall = true;
else if ( which == wxIMAGE_LIST_STATE )
m_ownsImageListState = TRUE;
m_ownsImageListState = true;
}
bool wxGenericListCtrl::Arrange( int WXUNUSED(flag) )
@@ -4994,13 +4994,13 @@ bool wxGenericListCtrl::Arrange( int WXUNUSED(flag) )
bool wxGenericListCtrl::DeleteItem( long item )
{
m_mainWin->DeleteItem( item );
return TRUE;
return true;
}
bool wxGenericListCtrl::DeleteAllItems()
{
m_mainWin->DeleteAllItems();
return TRUE;
return true;
}
bool wxGenericListCtrl::DeleteAllColumns()
@@ -5009,7 +5009,7 @@ bool wxGenericListCtrl::DeleteAllColumns()
for ( size_t n = 0; n < count; n++ )
DeleteColumn(0);
return TRUE;
return true;
}
void wxGenericListCtrl::ClearAll()
@@ -5024,10 +5024,10 @@ bool wxGenericListCtrl::DeleteColumn( int col )
// if we don't have the header any longer, we need to relayout the window
if ( !GetColumnCount() )
{
ResizeReportView(FALSE /* no header */);
ResizeReportView(false /* no header */);
}
return TRUE;
return true;
}
void wxGenericListCtrl::Edit( long item )
@@ -5038,7 +5038,7 @@ void wxGenericListCtrl::Edit( long item )
bool wxGenericListCtrl::EnsureVisible( long item )
{
m_mainWin->EnsureVisible( item );
return TRUE;
return true;
}
long wxGenericListCtrl::FindItem( long start, const wxString& str, bool partial )
@@ -5106,7 +5106,7 @@ long wxGenericListCtrl::InsertColumn( long col, wxListItem &item )
// window
if ( GetColumnCount() == 1 && m_mainWin->HasHeader() )
{
ResizeReportView(TRUE /* have header */);
ResizeReportView(true /* have header */);
}
m_headerWin->Refresh();
@@ -5148,7 +5148,7 @@ bool wxGenericListCtrl::ScrollList( int WXUNUSED(dx), int WXUNUSED(dy) )
bool wxGenericListCtrl::SortItems( wxListCtrlCompare fn, long data )
{
m_mainWin->SortItems( fn, data );
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -5201,21 +5201,21 @@ bool wxGenericListCtrl::SetBackgroundColour( const wxColour &colour )
if (m_mainWin)
{
m_mainWin->SetBackgroundColour( colour );
m_mainWin->m_dirty = TRUE;
m_mainWin->m_dirty = true;
}
return TRUE;
return true;
}
bool wxGenericListCtrl::SetForegroundColour( const wxColour &colour )
{
if ( !wxWindow::SetForegroundColour( colour ) )
return FALSE;
return false;
if (m_mainWin)
{
m_mainWin->SetForegroundColour( colour );
m_mainWin->m_dirty = TRUE;
m_mainWin->m_dirty = true;
}
if (m_headerWin)
@@ -5223,18 +5223,18 @@ bool wxGenericListCtrl::SetForegroundColour( const wxColour &colour )
m_headerWin->SetForegroundColour( colour );
}
return TRUE;
return true;
}
bool wxGenericListCtrl::SetFont( const wxFont &font )
{
if ( !wxWindow::SetFont( font ) )
return FALSE;
return false;
if (m_mainWin)
{
m_mainWin->SetFont( font );
m_mainWin->m_dirty = TRUE;
m_mainWin->m_dirty = true;
}
if (m_headerWin)
@@ -5245,7 +5245,7 @@ bool wxGenericListCtrl::SetFont( const wxFont &font )
Refresh();
return TRUE;
return true;
}
@@ -5291,7 +5291,7 @@ wxDropTarget *wxGenericListCtrl::GetDropTarget() const
bool wxGenericListCtrl::SetCursor( const wxCursor &cursor )
{
return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : FALSE;
return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : false;
}
wxColour wxGenericListCtrl::GetBackgroundColour() const
@@ -5309,7 +5309,7 @@ bool wxGenericListCtrl::DoPopupMenu( wxMenu *menu, int x, int y )
#if wxUSE_MENUS
return m_mainWin->PopupMenu( menu, x, y );
#else
return FALSE;
return false;
#endif // wxUSE_MENUS
}