diff options
-rw-r--r-- | svtools/source/contnr/svlbox.cxx | 11 | ||||
-rw-r--r-- | vcl/inc/vcl/dndevdis.hxx (renamed from vcl/source/window/dndevdis.hxx) | 0 | ||||
-rw-r--r-- | vcl/inc/vcl/dndlcon.hxx (renamed from vcl/source/window/dndlcon.hxx) | 0 | ||||
-rw-r--r-- | vcl/inc/vcl/ilstbox.hxx | 2 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/dndevdis.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dndlcon.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 2 |
9 files changed, 30 insertions, 9 deletions
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index fb71f64772ad..a69253c69629 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -1518,6 +1518,13 @@ void SvLBox::MakeVisible( SvLBoxEntry* ) void SvLBox::Command( const CommandEvent& i_rCommandEvent ) { DBG_CHKTHIS(SvLBox,0); + + if ( COMMAND_STARTDRAG == i_rCommandEvent.GetCommand() ) + { + Point aEventPos( i_rCommandEvent.GetMousePosPixel() ); + MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseButtonUp( aMouseEvt ); + } Control::Command( i_rCommandEvent ); } @@ -1775,6 +1782,10 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) { DBG_CHKTHIS(SvLBox,0); + Point aEventPos( rPosPixel ); + MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseButtonUp( aMouseEvt ); + nOldDragMode = GetDragDropMode(); if ( !nOldDragMode ) return; diff --git a/vcl/source/window/dndevdis.hxx b/vcl/inc/vcl/dndevdis.hxx index 5b91bd0713ec..5b91bd0713ec 100644 --- a/vcl/source/window/dndevdis.hxx +++ b/vcl/inc/vcl/dndevdis.hxx diff --git a/vcl/source/window/dndlcon.hxx b/vcl/inc/vcl/dndlcon.hxx index 5a41a20e4271..5a41a20e4271 100644 --- a/vcl/source/window/dndlcon.hxx +++ b/vcl/inc/vcl/dndlcon.hxx diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx index 33f60a1e8a2f..ac278f76f65b 100644 --- a/vcl/inc/vcl/ilstbox.hxx +++ b/vcl/inc/vcl/ilstbox.hxx @@ -396,6 +396,7 @@ private: mbHScroll : 1, // HScroll an oder aus mbAutoHScroll : 1; // AutoHScroll an oder aus Link maScrollHdl; // Weil der vom ImplListBoxWindow selbst benoetigt wird. + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer; protected: virtual void GetFocus(); @@ -500,6 +501,7 @@ public: // pb: #106948# explicit mirroring for calc inline void EnableMirroring() { maLBWindow.EnableMirroring(); } + inline void SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; } }; // ----------------------------- 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 ) { diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx index efc49be6fbf8..e4d5a8c4c0eb 100644 --- a/vcl/source/window/dndevdis.cxx +++ b/vcl/source/window/dndevdis.cxx @@ -28,8 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <dndevdis.hxx> -#include <dndlcon.hxx> +#include <vcl/dndevdis.hxx> +#include <vcl/dndlcon.hxx> #include <vcl/window.h> #include <vos/mutex.hxx> diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx index c5d78dd6bae3..07819e76f957 100644 --- a/vcl/source/window/dndlcon.cxx +++ b/vcl/source/window/dndlcon.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include<dndlcon.hxx> +#include <vcl/dndlcon.hxx> using namespace ::cppu; using namespace ::com::sun::star::uno; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 35641ab8d6f9..adedbde4c0f2 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -88,8 +88,8 @@ #include "vcl/dialog.hxx" #include "vcl/unowrap.hxx" -#include "dndlcon.hxx" -#include "dndevdis.hxx" +#include "vcl/dndlcon.hxx" +#include "vcl/dndevdis.hxx" #include "vcl/impbmpconv.hxx" #include "unotools/confignode.hxx" #include "vcl/gdimtf.hxx" diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 7b0512a1320b..c964ad0d739b 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -62,7 +62,7 @@ #include <vcl/salgdi.hxx> #include <vcl/menu.hxx> -#include <dndlcon.hxx> +#include <vcl/dndlcon.hxx> #include <com/sun/star/datatransfer/dnd/XDragSource.hpp> #include <com/sun/star/awt/MouseEvent.hpp> |