diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-03-23 10:40:35 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-03-23 10:40:35 +0000 |
commit | e930c1d75657b038de4870070a23afe587beda6a (patch) | |
tree | 2b5d60d30732377c288537e6524ba49f91210265 | |
parent | 686ee973d91df37e37899282aa973e8cfbcc6a48 (diff) |
new DnD (not finished, yet)
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index fbbe14dc791c..2c45bae62e07 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: gridctrl.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: fs $ $Date: 2001-03-15 08:58:26 $ + * last change: $Author: fs $ $Date: 2001-03-23 11:40:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -964,22 +964,23 @@ DbGridControl::DbGridControl( BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTO_VSCROLL) + ,DragSourceHelper(this) #pragma warning (disable : 4355) - ,m_aBar(this) + ,m_aBar(this) #pragma warning (default : 4355) - ,m_bSynchDisplay(sal_True) - ,m_bForceROController(sal_False) - ,m_bHandle(sal_False) - ,m_aNullDate(DBTypeConversion::getStandardDate()) - ,m_nAsynAdjustEvent(0) - ,m_pDataSourcePropMultiplexer(NULL) - ,m_pDataSourcePropListener(NULL) - ,m_pFieldListeners(NULL) - ,m_pCursorDisposeListener(NULL) - ,m_bWantDestruction(sal_False) - ,m_bInAdjustDataSource(sal_False) - ,m_bPendingAdjustRows(sal_False) - ,m_xServiceFactory(_rxFactory) + ,m_bSynchDisplay(sal_True) + ,m_bForceROController(sal_False) + ,m_bHandle(sal_False) + ,m_aNullDate(DBTypeConversion::getStandardDate()) + ,m_nAsynAdjustEvent(0) + ,m_pDataSourcePropMultiplexer(NULL) + ,m_pDataSourcePropListener(NULL) + ,m_pFieldListeners(NULL) + ,m_pCursorDisposeListener(NULL) + ,m_bWantDestruction(sal_False) + ,m_bInAdjustDataSource(sal_False) + ,m_bPendingAdjustRows(sal_False) + ,m_xServiceFactory(_rxFactory) { DBG_CTOR(DbGridControl,NULL); @@ -999,20 +1000,21 @@ DbGridControl::DbGridControl( BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTO_VSCROLL) + ,DragSourceHelper(this) #pragma warning (disable : 4355) - ,m_aBar(this) + ,m_aBar(this) #pragma warning (default : 4355) - ,m_bSynchDisplay(sal_True) - ,m_bForceROController(sal_False) - ,m_bHandle(sal_False) - ,m_aNullDate(DBTypeConversion::getStandardDate()) - ,m_pDataSourcePropMultiplexer(NULL) - ,m_pDataSourcePropListener(NULL) - ,m_pFieldListeners(NULL) - ,m_bWantDestruction(sal_False) - ,m_bInAdjustDataSource(sal_False) - ,m_bPendingAdjustRows(sal_False) - ,m_xServiceFactory(_rxFactory) + ,m_bSynchDisplay(sal_True) + ,m_bForceROController(sal_False) + ,m_bHandle(sal_False) + ,m_aNullDate(DBTypeConversion::getStandardDate()) + ,m_pDataSourcePropMultiplexer(NULL) + ,m_pDataSourcePropListener(NULL) + ,m_pFieldListeners(NULL) + ,m_bWantDestruction(sal_False) + ,m_bInAdjustDataSource(sal_False) + ,m_bPendingAdjustRows(sal_False) + ,m_xServiceFactory(_rxFactory) { DBG_CTOR(DbGridControl,NULL); @@ -2715,35 +2717,31 @@ void DbGridControl::DataSourcePropertyChanged(const ::com::sun::star::beans::Pro } //------------------------------------------------------------------------------ -void DbGridControl::Command(const CommandEvent& rEvt) +void DbGridControl::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) { - switch (rEvt.GetCommand()) + if (!m_pSeekCursor || IsResizing()) + return; + + sal_uInt16 nColId = GetColumnAtXPosPixel(rPosPixel.X()); + long nRow = GetRowAtYPosPixel(rPosPixel.Y()); + if (nColId != HANDLE_ID && nRow >= 0) { - case COMMAND_STARTDRAG: - { - if (!rEvt.IsMouseEvent() || !m_pSeekCursor || IsResizing()) - { - DbBrowseBox::Command(rEvt); - return; - } - sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); - long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); - if (nColId != HANDLE_ID && nRow >= 0) - { - DbGridColumn* pColumn = m_aColumns.GetObject(GetModelColumnPos(nColId)); - DragServer::Clear(); - DragServer::CopyString(GetCellText(pColumn)); + DbGridColumn* pColumn = m_aColumns.GetObject(GetModelColumnPos(nColId)); + DragServer::CopyString(GetCellText(pColumn)); + // TODO DND - Pointer aMovePtr(POINTER_MOVEDATA), - aCopyPtr(POINTER_COPYDATA); + if (GetDataWindow().IsMouseCaptured()) + GetDataWindow().ReleaseMouse(); - if (GetDataWindow().IsMouseCaptured()) - GetDataWindow().ReleaseMouse(); - ExecuteDrag(aMovePtr, aCopyPtr, DRAG_COPYABLE); - } - else - DbBrowseBox::Command(rEvt); - } break; + StartDrag(DND_ACTION_COPY, rPosPixel); + } +} + +//------------------------------------------------------------------------------ +void DbGridControl::Command(const CommandEvent& rEvt) +{ + switch (rEvt.GetCommand()) + { case COMMAND_CONTEXTMENU: { if (!rEvt.IsMouseEvent() || !m_pSeekCursor) |