Prevent the user from resizing the last wxDataViewCtrl column
This is useless as this column will be automatically expanded to fill all the available space anyhow. See #18295.
This commit is contained in:
@@ -107,6 +107,8 @@ public:
|
||||
return m_flags;
|
||||
}
|
||||
|
||||
virtual bool IsResizeable() const wxOVERRIDE;
|
||||
|
||||
virtual bool IsSortKey() const wxOVERRIDE
|
||||
{
|
||||
return m_sort;
|
||||
|
@@ -256,6 +256,17 @@ void wxDataViewColumn::SetSortOrder(bool ascending)
|
||||
m_owner->OnColumnChange(idx);
|
||||
}
|
||||
|
||||
bool wxDataViewColumn::IsResizeable() const
|
||||
{
|
||||
// The last column in generic wxDataViewCtrl is never resizeable by the
|
||||
// user because it's always automatically expanded to consume all the
|
||||
// available space, so prevent the user from resizing it.
|
||||
if ( this == GetOwner()->GetColumn(GetOwner()->GetColumnCount() - 1) )
|
||||
return false;
|
||||
|
||||
return wxDataViewColumnBase::IsResizeable();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDataViewHeaderWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user