don't allow resizing non-resizeable columns in wxHeaderCtrl itself, no need to do it in wxDataViewCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-08 17:36:11 +00:00
parent a45caa71bf
commit 0b2e14832a
2 changed files with 9 additions and 7 deletions

View File

@@ -137,12 +137,6 @@ private:
event.Skip(); event.Skip();
} }
void OnBeginResize(wxHeaderCtrlEvent& event)
{
if ( !GetColumn(event.GetColumn()).IsResizeable() )
event.Veto();
}
void OnEndResize(wxHeaderCtrlEvent& event) void OnEndResize(wxHeaderCtrlEvent& event)
{ {
if ( !event.IsCancelled() ) if ( !event.IsCancelled() )
@@ -161,7 +155,6 @@ BEGIN_EVENT_TABLE(wxDataViewHeaderWindow, wxHeaderCtrl)
EVT_HEADER_CLICK(wxID_ANY, wxDataViewHeaderWindow::OnClick) EVT_HEADER_CLICK(wxID_ANY, wxDataViewHeaderWindow::OnClick)
EVT_HEADER_RIGHT_CLICK(wxID_ANY, wxDataViewHeaderWindow::OnRClick) EVT_HEADER_RIGHT_CLICK(wxID_ANY, wxDataViewHeaderWindow::OnRClick)
EVT_HEADER_BEGIN_RESIZE(wxID_ANY, wxDataViewHeaderWindow::OnBeginResize)
EVT_HEADER_END_RESIZE(wxID_ANY, wxDataViewHeaderWindow::OnEndResize) EVT_HEADER_END_RESIZE(wxID_ANY, wxDataViewHeaderWindow::OnEndResize)
END_EVENT_TABLE() END_EVENT_TABLE()

View File

@@ -333,6 +333,15 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
// ASCII and Unicode versions of this message // ASCII and Unicode versions of this message
case HDN_BEGINTRACKA: case HDN_BEGINTRACKA:
case HDN_BEGINTRACKW: case HDN_BEGINTRACKW:
// non-resizeable columns can't be resized no matter what, don't
// even generate any events for them
if ( !GetColumn(idx).IsResizeable() )
{
*result = TRUE;
return true;
}
evtType = wxEVT_COMMAND_HEADER_BEGIN_RESIZE; evtType = wxEVT_COMMAND_HEADER_BEGIN_RESIZE;
// fall through // fall through