summaryrefslogtreecommitdiff
path: root/vcl/source/control/lstbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/lstbox.cxx')
-rw-r--r--vcl/source/control/lstbox.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index eb8c20d1d803..03527bf083a7 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -44,9 +44,10 @@
#include "tools/debug.hxx"
+#include <vcl/dndevdis.hxx>
+#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
-
- // =======================================================================
+// =======================================================================
ListBox::ListBox( WindowType nType ) : Control( nType )
{
@@ -119,6 +120,8 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
Control::ImplInit( pParent, nStyle, NULL );
SetBackground();
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener> xDrop = new DNDEventDispatcher(this);
+
if( nStyle & WB_DROPDOWN )
{
sal_Int32 nLeft, nTop, nRight, nBottom;
@@ -145,16 +148,19 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpFloatWin = new ImplListBoxFloatingWindow( this );
mpFloatWin->SetAutoWidth( TRUE );
mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
+ mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop);
mpImplWin = new ImplWin( this, (nStyle & (WB_LEFT|WB_RIGHT|WB_CENTER))|WB_NOBORDER );
mpImplWin->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
mpImplWin->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
mpImplWin->Show();
+ mpImplWin->GetDropTarget()->addDropTargetListener(xDrop);
mpBtn = new ImplBtn( this, WB_NOLIGHTBORDER | WB_RECTSTYLE );
ImplInitDropDownButton( mpBtn );
mpBtn->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
mpBtn->Show();
+ mpBtn->GetDropTarget()->addDropTargetListener(xDrop);
}
@@ -170,6 +176,9 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetPosPixel( Point() );
mpImplLB->Show();
+ mpImplLB->GetDropTarget()->addDropTargetListener(xDrop);
+ mpImplLB->SetDropTraget(xDrop);
+
if ( mpFloatWin )
{
mpFloatWin->SetImplListBox( mpImplLB );
@@ -1612,7 +1621,6 @@ const Wallpaper& ListBox::GetDisplayBackground() const
}
// =======================================================================
-
MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
ListBox( WINDOW_MULTILISTBOX )
{