git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8188
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_maximumPaneSizeY = 10000;
m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
m_maximumPaneSizeY = 10000;
m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
+ m_mouseCaptured = FALSE;
// Eventually, we'll respond to colour change messages
InitColours();
// Eventually, we'll respond to colour change messages
InitColours();
if (event.LeftDown())
{
CaptureMouse();
if (event.LeftDown())
{
CaptureMouse();
+ m_mouseCaptured = TRUE;
if ( sashHit != wxSASH_NONE )
{
if ( sashHit != wxSASH_NONE )
{
else if ( event.LeftUp() && m_dragMode == wxSASH_DRAG_LEFT_DOWN )
{
// Wasn't a proper drag
else if ( event.LeftUp() && m_dragMode == wxSASH_DRAG_LEFT_DOWN )
{
// Wasn't a proper drag
+ if (m_mouseCaptured)
+ ReleaseMouse();
+ m_mouseCaptured = FALSE;
+
wxScreenDC::EndDrawingOnTop();
m_dragMode = wxSASH_DRAG_NONE;
m_draggingEdge = wxSASH_NONE;
wxScreenDC::EndDrawingOnTop();
m_dragMode = wxSASH_DRAG_NONE;
m_draggingEdge = wxSASH_NONE;
{
// We can stop dragging now and see what we've got.
m_dragMode = wxSASH_DRAG_NONE;
{
// We can stop dragging now and see what we've got.
m_dragMode = wxSASH_DRAG_NONE;
+ if (m_mouseCaptured)
+ ReleaseMouse();
+ m_mouseCaptured = FALSE;
+
// Erase old tracker
DrawSashTracker(m_draggingEdge, m_oldX, m_oldY);
// Erase old tracker
DrawSashTracker(m_draggingEdge, m_oldX, m_oldY);
}
else if ( event.LeftUp() )
{
}
else if ( event.LeftUp() )
{
+ if (m_mouseCaptured)
+ ReleaseMouse();
+ m_mouseCaptured = FALSE;
}
else if (event.Moving() && !event.Dragging())
{
}
else if (event.Moving() && !event.Dragging())
{
+ data->m_pItem = (long) item;
}
parent->Insert( item, previous );
}
parent->Insert( item, previous );
image, selImage, data);
if ( data != NULL )
{
image, selImage, data);
if ( data != NULL )
{
- data->m_pItem = m_anchor;
+ data->m_pItem = (long) m_anchor;
}
if (!HasFlag(wxTR_MULTIPLE))
}
if (!HasFlag(wxTR_MULTIPLE))
void wxGenericTreeCtrl::SendDeleteEvent(wxGenericTreeItem *item)
{
wxTreeEvent event( wxEVT_COMMAND_TREE_DELETE_ITEM, GetId() );
void wxGenericTreeCtrl::SendDeleteEvent(wxGenericTreeItem *item)
{
wxTreeEvent event( wxEVT_COMMAND_TREE_DELETE_ITEM, GetId() );
+ event.m_item = (long) item;
event.SetEventObject( this );
ProcessEvent( event );
}
event.SetEventObject( this );
ProcessEvent( event );
}
return;
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_EXPANDING, GetId() );
return;
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_EXPANDING, GetId() );
+ event.m_item = (long) item;
event.SetEventObject( this );
if ( ProcessEvent( event ) && !event.IsAllowed() )
event.SetEventObject( this );
if ( ProcessEvent( event ) && !event.IsAllowed() )
return;
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_COLLAPSING, GetId() );
return;
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_COLLAPSING, GetId() );
+ event.m_item = (long) item;
event.SetEventObject( this );
if ( ProcessEvent( event ) && !event.IsAllowed() )
{
event.SetEventObject( this );
if ( ProcessEvent( event ) && !event.IsAllowed() )
{
}
wxTreeEvent event( wxEVT_COMMAND_TREE_SEL_CHANGING, GetId() );
}
wxTreeEvent event( wxEVT_COMMAND_TREE_SEL_CHANGING, GetId() );
- event.m_item = item;
- event.m_itemOld = m_current;
+ event.m_item = (long) item;
+ event.m_itemOld = (long) m_current;
event.SetEventObject( this );
// TODO : Here we don't send any selection mode yet !
event.SetEventObject( this );
// TODO : Here we don't send any selection mode yet !
case WXK_RETURN:
{
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
case WXK_RETURN:
{
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
- event.m_item = m_current;
+ event.m_item = (long) m_current;
event.m_code = 0;
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
event.m_code = 0;
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
m_currentEdit = (wxGenericTreeItem*) item.m_pItem;
wxTreeEvent te( wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, GetId() );
m_currentEdit = (wxGenericTreeItem*) item.m_pItem;
wxTreeEvent te( wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, GetId() );
- te.m_item = m_currentEdit;
+ te.m_item = (long) m_currentEdit;
te.SetEventObject( this );
GetEventHandler()->ProcessEvent( te );
te.SetEventObject( this );
GetEventHandler()->ProcessEvent( te );
void wxGenericTreeCtrl::OnRenameAccept()
{
wxTreeEvent le( wxEVT_COMMAND_TREE_END_LABEL_EDIT, GetId() );
void wxGenericTreeCtrl::OnRenameAccept()
{
wxTreeEvent le( wxEVT_COMMAND_TREE_END_LABEL_EDIT, GetId() );
- le.m_item = m_currentEdit;
+ le.m_item = (long) m_currentEdit;
le.SetEventObject( this );
le.m_label = m_renameRes;
GetEventHandler()->ProcessEvent( le );
le.SetEventObject( this );
le.m_label = m_renameRes;
GetEventHandler()->ProcessEvent( le );
: wxEVT_COMMAND_TREE_BEGIN_DRAG;
wxTreeEvent nevent( command, GetId() );
: wxEVT_COMMAND_TREE_BEGIN_DRAG;
wxTreeEvent nevent( command, GetId() );
- nevent.m_item = m_current;
+ nevent.m_item = (long) m_current;
nevent.SetEventObject(this);
// by default the dragging is not supported, the user code must
nevent.SetEventObject(this);
// by default the dragging is not supported, the user code must
// generate the drag end event
wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, GetId());
// generate the drag end event
wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, GetId());
+ event.m_item = (long) item;
event.m_pointDrag = wxPoint(x, y);
event.SetEventObject(this);
event.m_pointDrag = wxPoint(x, y);
event.SetEventObject(this);
if ( event.RightDown() )
{
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId());
if ( event.RightDown() )
{
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId());
+ nevent.m_item = (long) item;
nevent.m_code = 0;
nevent.SetEventObject(this);
GetEventHandler()->ProcessEvent(nevent);
nevent.m_code = 0;
nevent.SetEventObject(this);
GetEventHandler()->ProcessEvent(nevent);
m_lastOnSame = FALSE;
wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
m_lastOnSame = FALSE;
wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
+ nevent.m_item = (long) item;
nevent.m_code = 0;
nevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( nevent );
nevent.m_code = 0;
nevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( nevent );