X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56873923f39af96aac6bfc5776d2637b8c4623ca..cc2aecdef579e57f84eaa07cc72f62a43fc474ba:/src/common/headercolcmn.cpp diff --git a/src/common/headercolcmn.cpp b/src/common/headercolcmn.cpp index 1a6a3cc0ba..8537970fa5 100644 --- a/src/common/headercolcmn.cpp +++ b/src/common/headercolcmn.cpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // Name: src/common/headercolcmn.cpp -// Purpose: wxHeaderColumnBase implementation +// Purpose: wxHeaderColumn implementation // Author: Vadim Zeitlin // Created: 2008-12-02 // RCS-ID: $Id$ @@ -23,24 +23,15 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP -#endif // WX_PRECOMP +#if wxUSE_HEADERCTRL #include "wx/headercol.h" // ============================================================================ -// wxHeaderColumnBase implementation +// wxHeaderColumn implementation // ============================================================================ -void wxHeaderColumnBase::SetIndividualFlags(int flags) -{ - SetResizeable((flags & wxCOL_RESIZABLE) != 0); - SetSortable((flags & wxCOL_SORTABLE) != 0); - SetReorderable((flags & wxCOL_REORDERABLE) != 0); - SetHidden((flags & wxCOL_HIDDEN) != 0); -} - -int wxHeaderColumnBase::GetFromIndividualFlags() const +int wxHeaderColumn::GetFromIndividualFlags() const { int flags = 0; @@ -56,27 +47,39 @@ int wxHeaderColumnBase::GetFromIndividualFlags() const return flags; } -void wxHeaderColumnBase::ChangeFlag(int flag, bool set) +// ============================================================================ +// wxSettableHeaderColumn implementation +// ============================================================================ + +void wxSettableHeaderColumn::SetIndividualFlags(int flags) +{ + SetResizeable((flags & wxCOL_RESIZABLE) != 0); + SetSortable((flags & wxCOL_SORTABLE) != 0); + SetReorderable((flags & wxCOL_REORDERABLE) != 0); + SetHidden((flags & wxCOL_HIDDEN) != 0); +} + +void wxSettableHeaderColumn::ChangeFlag(int flag, bool set) { if ( HasFlag(flag) != set ) ToggleFlag(flag); } -void wxHeaderColumnBase::SetFlag(int flag) +void wxSettableHeaderColumn::SetFlag(int flag) { int flags = GetFlags(); if ( !(flags & flag) ) SetFlags(flags | flag); } -void wxHeaderColumnBase::ClearFlag(int flag) +void wxSettableHeaderColumn::ClearFlag(int flag) { int flags = GetFlags(); if ( flags & flag ) SetFlags(flags & ~flag); } -void wxHeaderColumnBase::ToggleFlag(int flag) +void wxSettableHeaderColumn::ToggleFlag(int flag) { int flags = GetFlags(); if ( flags & flag ) @@ -87,4 +90,5 @@ void wxHeaderColumnBase::ToggleFlag(int flag) SetFlags(flags); } +#endif // wxUSE_HEADERCTRL