allow vetoing wxEVT_COMMAND_LIST_COL_BEGIN_DRAG (backported from HEAD)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -495,7 +495,9 @@ private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
void SendListEvent(wxEventType type, wxPoint pos);
|
||||
// generate and process the list event of the given type, return true if
|
||||
// it wasn't vetoed, i.e. if we should proceed
|
||||
bool SendListEvent(wxEventType type, wxPoint pos);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxListHeaderWindow)
|
||||
DECLARE_EVENT_TABLE()
|
||||
@@ -2151,12 +2153,15 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
if (hit_border && event.LeftDown())
|
||||
{
|
||||
m_isDragging = TRUE;
|
||||
m_currentX = x;
|
||||
DrawCurrent();
|
||||
CaptureMouse();
|
||||
SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
|
||||
event.GetPosition());
|
||||
if ( SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
|
||||
event.GetPosition()) )
|
||||
{
|
||||
m_isDragging = TRUE;
|
||||
m_currentX = x;
|
||||
DrawCurrent();
|
||||
CaptureMouse();
|
||||
}
|
||||
//else: column resizing was vetoed by the user code
|
||||
}
|
||||
else // click on a column
|
||||
{
|
||||
@@ -2191,7 +2196,7 @@ void wxListHeaderWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
|
||||
m_owner->SetFocus();
|
||||
}
|
||||
|
||||
void wxListHeaderWindow::SendListEvent(wxEventType type, wxPoint pos)
|
||||
bool wxListHeaderWindow::SendListEvent(wxEventType type, wxPoint pos)
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
wxListEvent le( type, parent->GetId() );
|
||||
@@ -2205,7 +2210,7 @@ void wxListHeaderWindow::SendListEvent(wxEventType type, wxPoint pos)
|
||||
le.m_pointDrag.y -= GetSize().y;
|
||||
|
||||
le.m_col = m_column;
|
||||
parent->GetEventHandler()->ProcessEvent( le );
|
||||
return !parent->GetEventHandler()->ProcessEvent( le ) || le.IsAllowed();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user