-// ---------------------------------------------------------
-// wxDataViewColumn
-// ---------------------------------------------------------
-
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
-
-wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell,
- unsigned int model_column,
- int width, wxAlignment align, int flags ) :
- wxDataViewColumnBase( title, cell, model_column, width, align, flags )
-{
- SetAlignment(align);
- SetTitle(title);
- SetFlags(flags);
-
- m_autosize = width < 0; // TODO
-
- Init(width < 0 ? wxDVC_DEFAULT_WIDTH : width);
-}
-
-wxDataViewColumn::wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *cell,
- unsigned int model_column,
- int width, wxAlignment align, int flags ) :
- wxDataViewColumnBase( bitmap, cell, model_column, width, align, flags )
-{
- SetAlignment(align);
- SetFlags(flags);
-
- Init(width < 0 ? wxDVC_DEFAULT_WIDTH : width);
-}
-
-wxDataViewColumn::~wxDataViewColumn()
-{
-}
-
-void wxDataViewColumn::Init( int width )
-{
- m_width = width;
- m_minWidth = wxDVC_DEFAULT_MINWIDTH;
- m_ascending = true;
-}
-
-void wxDataViewColumn::SetResizeable( bool resizeable )
-{
- if (resizeable)
- m_flags |= wxDATAVIEW_COL_RESIZABLE;
- else
- m_flags &= ~wxDATAVIEW_COL_RESIZABLE;
-}
-
-void wxDataViewColumn::SetHidden( bool hidden )
-{
- if (hidden)
- m_flags |= wxDATAVIEW_COL_HIDDEN;
- else
- m_flags &= ~wxDATAVIEW_COL_HIDDEN;
-
- // tell our owner to e.g. update its scrollbars:
- if (GetOwner())
- GetOwner()->OnColumnChange();
-}
-
-void wxDataViewColumn::SetSortable( bool sortable )
-{
- if (sortable)
- m_flags |= wxDATAVIEW_COL_SORTABLE;
- else
- m_flags &= ~wxDATAVIEW_COL_SORTABLE;
-
- // Update header button
- if (GetOwner())
- GetOwner()->OnColumnChange();
-}
-
-void wxDataViewColumn::SetReorderable( bool reorderable )
-{
- if (reorderable)
- m_flags |= wxDATAVIEW_COL_REORDERABLE;
- else
- m_flags &= ~wxDATAVIEW_COL_REORDERABLE;
-}
-
-void wxDataViewColumn::SetSortOrder( bool ascending )
-{
- m_ascending = ascending;
-
- // Update header button
- if (GetOwner())
- GetOwner()->OnColumnChange();
-}
-
-bool wxDataViewColumn::IsSortOrderAscending() const
-{
- return m_ascending;
-}
-
-void wxDataViewColumn::SetInternalWidth( int width )
-{
- m_width = width;
-
- // the scrollbars of the wxDataViewCtrl needs to be recalculated!
- if (m_owner && m_owner->m_clientArea)
- m_owner->m_clientArea->RecalculateDisplay();
-}
-
-void wxDataViewColumn::SetWidth( int width )
-{
- if (m_owner->m_headerArea) m_owner->m_headerArea->UpdateDisplay();
-
- SetInternalWidth(width);
-}
-
-