/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
EditEngine& rEditEngine = pEditView->getEditEngine(); // For tdf#143443 note we want an 'infinite' height initially (which is the // editengines default). For tdf#144686 it is helpful if the initial width // is the "SidebarWidth" so the calculated text height is always meaningful // for layout in the sidebar.
Size aPaperSize(mrPostItMgr.GetSidebarWidth(), rEditEngine.GetPaperSize().Height());
rEditEngine.SetPaperSize(aPaperSize);
rEditEngine.SetRefDevice(mrDocView.GetWrtShell().getIDocumentDeviceAccess().getReferenceDevice(false));
void SidebarTextControl::LoseFocus()
{ // write the visible text back into the SwField
mrSidebarWin.UpdateData();
WeldEditView::LoseFocus(); if ( !mrSidebarWin.IsMouseOver() )
{
Invalidate();
} // set false for autoscroll to typing location
mrSidebarWin.LockView(false);
}
OUString SidebarTextControl::RequestHelp(tools::Rectangle& rHelpRect)
{ if (EditView* pEditView = GetEditView())
{
Point aPos = rHelpRect.TopLeft();
void SidebarTextControl::DrawForPage(OutputDevice* pDev, const Point& rPt)
{ //Take the control's height, but overwrite the scrollbar area if there was one
OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
Size aSize(rDevice.PixelToLogic(GetOutputSizePixel()));
if (OutlinerView* pOutlinerView = mrSidebarWin.GetOutlinerView())
{
pOutlinerView->GetOutliner().Draw(*pDev, tools::Rectangle(rPt, aSize));
}
if ( mrSidebarWin.GetLayoutStatus()!=SwPostItHelper::DELETED ) return;
pDev->Push(vcl::PushFlags::LINECOLOR);
pDev->SetLineColor(mrSidebarWin.GetChangeColor());
Point aBottomRight(rPt);
aBottomRight.Move(aSize);
pDev->DrawLine(rPt, aBottomRight);
Point aTopRight(rPt);
aTopRight.Move(Size(aSize.Width(), 0));
Point aBottomLeft(rPt);
aBottomLeft.Move(Size(0, aSize.Height()));
// tdf#164072: don't use SwAnnotationWin itself as popup parent because it // may get disposed while the popup menu is still executed
vcl::Window* pParentWin = mrSidebarWin.GetParent();
assert(pParentWin);
aPos += mrSidebarWin.GetWindowExtentsRelative(*pParentWin).TopLeft();
SfxDispatcher::ExecutePopup(pParentWin, &aPos);
} returntrue;
} elseif (rCEvt.GetCommand() == CommandEventId::Wheel)
{ // if no scrollbar, or extra keys held scroll the document and consume // this event, otherwise don't consume and let the event get to the // surrounding scrolled window if (!mrSidebarWin.IsScrollbarVisible())
{
mrDocView.HandleWheelCommands(rCEvt); returntrue;
} else
{ const CommandWheelData* pData = rCEvt.GetWheelData(); if (pData->IsShift() || pData->IsMod1() || pData->IsMod2())
{
mrDocView.HandleWheelCommands(rCEvt); returntrue;
}
}
}
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.