// A single left click with pressed control key on a tab page first // switches to that page before the usual handling (copying with drag // and drop) takes place. elseif (rMEvt.IsLeft() && rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsShift())
{
pDrViewSh->SwitchPage (GetPageId (rMEvt.GetPosPixel()) - 1);
}
// When only the right button is pressed then first process a // synthesized left button click to make the page the current one // whose tab has been clicked. When then the actual right button // click is processed the resulting context menu relates to the // now current page. if (rMEvt.IsRight() && ! rMEvt.IsLeft())
{
MouseEvent aSyntheticEvent (
rMEvt.GetPosPixel(),
rMEvt.GetClicks(),
rMEvt.GetMode(),
MOUSE_LEFT,
rMEvt.GetModifier());
TabBar::MouseButtonDown(aSyntheticEvent);
}
case DND_ACTION_COPY:
{ // Copying the selected page to the place that rEvt points // takes place in three steps: // 1. Create a copy of the selected page. This copy will // lie directly behind the selected page. // 2. Move the copy to the desired place. // 3. Select the copy. if (pDrViewSh->IsSwitchPageAllowed())
{ // 1. Create a copy.
sal_uInt16 nPageNumOfCopy = pDoc->DuplicatePage (GetCurPageId() - 1); // 2. Move page. For this first switch to the copy: // MovePages operates on the currently selected page(s).
pDrViewSh->SwitchPage (nPageNumOfCopy); // Adapt target page id when necessary, i.e. page copy // has been inserted in front of the target page.
sal_uInt16 nPageNum = nPageId; if ((nPageNumOfCopy <= nPageNum) && (nPageNum != sal_uInt16(-1)))
nPageNum += 1; if (pDoc->MoveSelectedPages(nPageNum))
{ // 3. Switch to the copy that has been moved to its // final destination. Use an asynchron slot call to // be executed after the still pending ones. if (nPageNumOfCopy >= nPageNum || (nPageNum == sal_uInt16(-1)))
nPageNum += 1;
SetCurPageId (GetPageId(nPageNum));
SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher();
pDispatcher->Execute(SID_SWITCHPAGE,
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.