Fix drag and drop inside static boxes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1424,6 +1424,22 @@ void wxWindowMSW::Update()
|
||||
// drag and drop
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// we need to lower the sibling static boxes so controls contained within can be
|
||||
// a drop target
|
||||
static inline void AdjustStaticBoxZOrder(wxWindow *parent)
|
||||
{
|
||||
for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
wxStaticBox *statbox = wxDynamicCast(node->GetData(), wxStaticBox);
|
||||
if ( statbox )
|
||||
{
|
||||
::SetWindowPos(GetHwndOf(statbox), HWND_BOTTOM, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
|
||||
@@ -1435,7 +1451,10 @@ void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
|
||||
|
||||
m_dropTarget = pDropTarget;
|
||||
if ( m_dropTarget != 0 )
|
||||
{
|
||||
AdjustStaticBoxZOrder(GetParent());
|
||||
m_dropTarget->Register(m_hWnd);
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
@@ -1446,7 +1465,10 @@ void wxWindowMSW::DragAcceptFiles(bool WXUNUSED_IN_WINCE(accept))
|
||||
#ifndef __WXWINCE__
|
||||
HWND hWnd = GetHwnd();
|
||||
if ( hWnd )
|
||||
{
|
||||
AdjustStaticBoxZOrder(GetParent());
|
||||
::DragAcceptFiles(hWnd, (BOOL)accept);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user