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:
@@ -123,6 +123,7 @@ wxMSW:
|
|||||||
- Fixed out by one error in wxTextCtrl::GetStyle.
|
- Fixed out by one error in wxTextCtrl::GetStyle.
|
||||||
- Fixed problem with getting input in universal/unicode build of wxMSW.
|
- Fixed problem with getting input in universal/unicode build of wxMSW.
|
||||||
- Link oleacc.lib conditionally.
|
- Link oleacc.lib conditionally.
|
||||||
|
- Drag and drop now works inside static boxes.
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -1424,6 +1424,22 @@ void wxWindowMSW::Update()
|
|||||||
// drag and drop
|
// 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
|
#if wxUSE_DRAG_AND_DROP
|
||||||
void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
|
void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
|
||||||
@@ -1435,7 +1451,10 @@ void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
|
|||||||
|
|
||||||
m_dropTarget = pDropTarget;
|
m_dropTarget = pDropTarget;
|
||||||
if ( m_dropTarget != 0 )
|
if ( m_dropTarget != 0 )
|
||||||
|
{
|
||||||
|
AdjustStaticBoxZOrder(GetParent());
|
||||||
m_dropTarget->Register(m_hWnd);
|
m_dropTarget->Register(m_hWnd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // wxUSE_DRAG_AND_DROP
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
@@ -1446,7 +1465,10 @@ void wxWindowMSW::DragAcceptFiles(bool WXUNUSED_IN_WINCE(accept))
|
|||||||
#ifndef __WXWINCE__
|
#ifndef __WXWINCE__
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
if ( hWnd )
|
if ( hWnd )
|
||||||
|
{
|
||||||
|
AdjustStaticBoxZOrder(GetParent());
|
||||||
::DragAcceptFiles(hWnd, (BOOL)accept);
|
::DragAcceptFiles(hWnd, (BOOL)accept);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user