xref: /trunk/main/sd/source/ui/func/fudraw.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sd.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <sot/object.hxx>
32*cdf0e10cSrcweir #include <editeng/eeitem.hxx>
33*cdf0e10cSrcweir #include <vcl/waitobj.hxx>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <editeng/flditem.hxx>
36*cdf0e10cSrcweir #include <svx/svdogrp.hxx>
37*cdf0e10cSrcweir #include <tools/urlobj.hxx>
38*cdf0e10cSrcweir #include <vcl/help.hxx>
39*cdf0e10cSrcweir #include <svx/bmpmask.hxx>
40*cdf0e10cSrcweir #include <svx/svdotext.hxx>
41*cdf0e10cSrcweir #include <sfx2/app.hxx>
42*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
43*cdf0e10cSrcweir #include <sfx2/bindings.hxx>
44*cdf0e10cSrcweir #include <svx/svdpagv.hxx>
45*cdf0e10cSrcweir #include <svtools/imapobj.hxx>
46*cdf0e10cSrcweir #include <svx/svxids.hrc>
47*cdf0e10cSrcweir #include <svx/obj3d.hxx>
48*cdf0e10cSrcweir #include <svx/polysc3d.hxx>
49*cdf0e10cSrcweir #include <svx/svdpagv.hxx>
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir #include "anminfo.hxx"
54*cdf0e10cSrcweir #include "anmdef.hxx"
55*cdf0e10cSrcweir #include "imapinfo.hxx"
56*cdf0e10cSrcweir #include "app.hrc"
57*cdf0e10cSrcweir #include "glob.hrc"
58*cdf0e10cSrcweir #include "strings.hrc"
59*cdf0e10cSrcweir #include "res_bmp.hrc"
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir #include "app.hxx"
62*cdf0e10cSrcweir #include "GraphicDocShell.hxx"
63*cdf0e10cSrcweir #include "fudraw.hxx"
64*cdf0e10cSrcweir #include "ViewShell.hxx"
65*cdf0e10cSrcweir #include "FrameView.hxx"
66*cdf0e10cSrcweir #include "View.hxx"
67*cdf0e10cSrcweir #ifndef SD_WINDOW_SHELL_HXX
68*cdf0e10cSrcweir #include "Window.hxx"
69*cdf0e10cSrcweir #endif
70*cdf0e10cSrcweir #include "drawdoc.hxx"
71*cdf0e10cSrcweir #include "DrawDocShell.hxx"
72*cdf0e10cSrcweir #include "Client.hxx"
73*cdf0e10cSrcweir #include "sdresid.hxx"
74*cdf0e10cSrcweir #include "drawview.hxx"
75*cdf0e10cSrcweir #include "fusel.hxx"
76*cdf0e10cSrcweir #include <svl/aeitem.hxx>
77*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
78*cdf0e10cSrcweir #include "slideshow.hxx"
79*cdf0e10cSrcweir #include <svx/sdrhittesthelper.hxx>
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir using namespace ::com::sun::star;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir namespace sd {
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir TYPEINIT1( FuDraw, FuPoor );
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir /*************************************************************************
88*cdf0e10cSrcweir |*
89*cdf0e10cSrcweir |* Base-class for all drawmodul-specific functions
90*cdf0e10cSrcweir |*
91*cdf0e10cSrcweir \************************************************************************/
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView,
94*cdf0e10cSrcweir                SdDrawDocument* pDoc, SfxRequest& rReq) :
95*cdf0e10cSrcweir     FuPoor(pViewSh, pWin, pView, pDoc, rReq),
96*cdf0e10cSrcweir     bMBDown(sal_False),
97*cdf0e10cSrcweir     bDragHelpLine(sal_False),
98*cdf0e10cSrcweir     bPermanent(sal_False)
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir }
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir /*************************************************************************
103*cdf0e10cSrcweir |*
104*cdf0e10cSrcweir |* Destruktor
105*cdf0e10cSrcweir |*
106*cdf0e10cSrcweir \************************************************************************/
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir FuDraw::~FuDraw()
109*cdf0e10cSrcweir {
110*cdf0e10cSrcweir     mpView->BrkAction();
111*cdf0e10cSrcweir }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir /*************************************************************************
114*cdf0e10cSrcweir |*
115*cdf0e10cSrcweir |* MouseButtonDown-event
116*cdf0e10cSrcweir |*
117*cdf0e10cSrcweir \************************************************************************/
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
120*cdf0e10cSrcweir {
121*cdf0e10cSrcweir     // #95491# remember button state for creation of own MouseEvents
122*cdf0e10cSrcweir     SetMouseButtonCode(rMEvt.GetButtons());
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir     sal_Bool bReturn = sal_False;
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir     bDragHelpLine = sal_False;
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir     aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir     if ( rMEvt.IsLeft() )
131*cdf0e10cSrcweir     {
132*cdf0e10cSrcweir         FrameView* pFrameView = mpViewShell->GetFrameView();
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir //        sal_Bool bOrtho = mpView->IsOrthoDesired() || pFrameView->IsOrtho();
135*cdf0e10cSrcweir //        bOrtho = bOrtho != rMEvt.IsShift();
136*cdf0e10cSrcweir         sal_Bool bOrtho = sal_False;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir         sal_Bool bRestricted = sal_True;
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir         if (mpView->IsDragObj())
141*cdf0e10cSrcweir         {
142*cdf0e10cSrcweir             // object is dragged (move, resize,...)
143*cdf0e10cSrcweir             const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir             if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
146*cdf0e10cSrcweir             {
147*cdf0e10cSrcweir                 // Move
148*cdf0e10cSrcweir                 bRestricted = sal_False;
149*cdf0e10cSrcweir             }
150*cdf0e10cSrcweir         }
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir         // #i33136#
153*cdf0e10cSrcweir         if(bRestricted && doConstructOrthogonal())
154*cdf0e10cSrcweir         {
155*cdf0e10cSrcweir             // Restrict movement:
156*cdf0e10cSrcweir             // rectangle->quadrat, ellipse->circle etc.
157*cdf0e10cSrcweir             bOrtho = !rMEvt.IsShift();
158*cdf0e10cSrcweir         }
159*cdf0e10cSrcweir         else
160*cdf0e10cSrcweir         {
161*cdf0e10cSrcweir             bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
162*cdf0e10cSrcweir         }
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir         if (!mpView->IsSnapEnabled())
165*cdf0e10cSrcweir             mpView->SetSnapEnabled(sal_True);
166*cdf0e10cSrcweir         sal_Bool bSnapModPressed = rMEvt.IsMod1();
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir         sal_Bool bGridSnap = pFrameView->IsGridSnap();
169*cdf0e10cSrcweir         bGridSnap = (bSnapModPressed != bGridSnap);
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir         if (mpView->IsGridSnap() != bGridSnap)
172*cdf0e10cSrcweir             mpView->SetGridSnap(bGridSnap);
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir         sal_Bool bBordSnap = pFrameView->IsBordSnap();
175*cdf0e10cSrcweir         bBordSnap = (bSnapModPressed != bBordSnap);
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir         if (mpView->IsBordSnap() != bBordSnap)
178*cdf0e10cSrcweir             mpView->SetBordSnap(bBordSnap);
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir         sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
181*cdf0e10cSrcweir         bHlplSnap = (bSnapModPressed != bHlplSnap);
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir         if (mpView->IsHlplSnap() != bHlplSnap)
184*cdf0e10cSrcweir             mpView->SetHlplSnap(bHlplSnap);
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir         sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
187*cdf0e10cSrcweir         bOFrmSnap = (bSnapModPressed != bOFrmSnap);
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir         if (mpView->IsOFrmSnap() != bOFrmSnap)
190*cdf0e10cSrcweir             mpView->SetOFrmSnap(bOFrmSnap);
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir         sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
193*cdf0e10cSrcweir         bOPntSnap = (bSnapModPressed != bOPntSnap);
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir         if (mpView->IsOPntSnap() != bOPntSnap)
196*cdf0e10cSrcweir             mpView->SetOPntSnap(bOPntSnap);
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir         sal_Bool bOConSnap = pFrameView->IsOConSnap();
199*cdf0e10cSrcweir         bOConSnap = (bSnapModPressed != bOConSnap);
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir         if (mpView->IsOConSnap() != bOConSnap)
202*cdf0e10cSrcweir             mpView->SetOConSnap(bOConSnap);
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir         sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir         if (mpView->IsAngleSnapEnabled() != bAngleSnap)
207*cdf0e10cSrcweir             mpView->SetAngleSnapEnabled(bAngleSnap);
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir         if (mpView->IsOrtho() != bOrtho)
210*cdf0e10cSrcweir             mpView->SetOrtho(bOrtho);
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir         sal_Bool bCenter = rMEvt.IsMod2();
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir         if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
215*cdf0e10cSrcweir              mpView->IsResizeAtCenter() != bCenter )
216*cdf0e10cSrcweir         {
217*cdf0e10cSrcweir             mpView->SetCreate1stPointAsCenter(bCenter);
218*cdf0e10cSrcweir             mpView->SetResizeAtCenter(bCenter);
219*cdf0e10cSrcweir         }
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir         SdrPageView* pPV = 0;
222*cdf0e10cSrcweir         sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir         // #76572# look only for HelpLines when they are visible (!)
225*cdf0e10cSrcweir         sal_Bool bHelpLine(sal_False);
226*cdf0e10cSrcweir         if(mpView->IsHlplVisible())
227*cdf0e10cSrcweir             bHelpLine = mpView->PickHelpLine(aMDPos, nHitLog, *mpWindow, nHelpLine, pPV);
228*cdf0e10cSrcweir         sal_Bool bHitHdl = (mpView->PickHandle(aMDPos) != NULL);
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir         if ( bHelpLine
231*cdf0e10cSrcweir             && !mpView->IsCreateObj()
232*cdf0e10cSrcweir             && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) )
233*cdf0e10cSrcweir         {
234*cdf0e10cSrcweir             mpWindow->CaptureMouse();
235*cdf0e10cSrcweir             mpView->BegDragHelpLine(nHelpLine, pPV);
236*cdf0e10cSrcweir             bDragHelpLine = mpView->IsDragHelpLine();
237*cdf0e10cSrcweir             bReturn = sal_True;
238*cdf0e10cSrcweir         }
239*cdf0e10cSrcweir     }
240*cdf0e10cSrcweir     ForcePointer(&rMEvt);
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir     return bReturn;
243*cdf0e10cSrcweir }
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir /*************************************************************************
246*cdf0e10cSrcweir |*
247*cdf0e10cSrcweir |* MouseMove-event
248*cdf0e10cSrcweir |*
249*cdf0e10cSrcweir \************************************************************************/
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
252*cdf0e10cSrcweir {
253*cdf0e10cSrcweir     FrameView* pFrameView = mpViewShell->GetFrameView();
254*cdf0e10cSrcweir     Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir //    sal_Bool bOrtho = mpView->IsOrthoDesired() || pFrameView->IsOrtho();
257*cdf0e10cSrcweir //    bOrtho = bOrtho != rMEvt.IsShift();
258*cdf0e10cSrcweir     sal_Bool bOrtho = sal_False;
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir     sal_Bool bRestricted = sal_True;
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir     if (mpView->IsDragObj())
263*cdf0e10cSrcweir     {
264*cdf0e10cSrcweir         // object is dragged (move, resize, ...)
265*cdf0e10cSrcweir         const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir         if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
268*cdf0e10cSrcweir         {
269*cdf0e10cSrcweir             // Move
270*cdf0e10cSrcweir             bRestricted = sal_False;
271*cdf0e10cSrcweir         }
272*cdf0e10cSrcweir     }
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir     if (mpView->IsAction())
275*cdf0e10cSrcweir     {
276*cdf0e10cSrcweir         // #i33136#
277*cdf0e10cSrcweir         if(bRestricted && doConstructOrthogonal())
278*cdf0e10cSrcweir         {
279*cdf0e10cSrcweir             // Restrict movement:
280*cdf0e10cSrcweir             // rectangle->quadrat, ellipse->circle etc.
281*cdf0e10cSrcweir             bOrtho = !rMEvt.IsShift();
282*cdf0e10cSrcweir         }
283*cdf0e10cSrcweir         else
284*cdf0e10cSrcweir         {
285*cdf0e10cSrcweir             bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
286*cdf0e10cSrcweir         }
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir         sal_Bool bSnapModPressed = rMEvt.IsMod2();
289*cdf0e10cSrcweir         mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir         sal_Bool bGridSnap = pFrameView->IsGridSnap();
292*cdf0e10cSrcweir         bGridSnap = (bSnapModPressed != bGridSnap);
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir         if (mpView->IsGridSnap() != bGridSnap)
295*cdf0e10cSrcweir             mpView->SetGridSnap(bGridSnap);
296*cdf0e10cSrcweir 
297*cdf0e10cSrcweir         sal_Bool bBordSnap = pFrameView->IsBordSnap();
298*cdf0e10cSrcweir         bBordSnap = (bSnapModPressed != bBordSnap);
299*cdf0e10cSrcweir 
300*cdf0e10cSrcweir         if (mpView->IsBordSnap() != bBordSnap)
301*cdf0e10cSrcweir             mpView->SetBordSnap(bBordSnap);
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir         sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
304*cdf0e10cSrcweir         bHlplSnap = (bSnapModPressed != bHlplSnap);
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir         if (mpView->IsHlplSnap() != bHlplSnap)
307*cdf0e10cSrcweir             mpView->SetHlplSnap(bHlplSnap);
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir         sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
310*cdf0e10cSrcweir         bOFrmSnap = (bSnapModPressed != bOFrmSnap);
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir         if (mpView->IsOFrmSnap() != bOFrmSnap)
313*cdf0e10cSrcweir             mpView->SetOFrmSnap(bOFrmSnap);
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir         sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
316*cdf0e10cSrcweir         bOPntSnap = (bSnapModPressed != bOPntSnap);
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir         if (mpView->IsOPntSnap() != bOPntSnap)
319*cdf0e10cSrcweir             mpView->SetOPntSnap(bOPntSnap);
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir         sal_Bool bOConSnap = pFrameView->IsOConSnap();
322*cdf0e10cSrcweir         bOConSnap = (bSnapModPressed != bOConSnap);
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir         if (mpView->IsOConSnap() != bOConSnap)
325*cdf0e10cSrcweir             mpView->SetOConSnap(bOConSnap);
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir         sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir         if (mpView->IsAngleSnapEnabled() != bAngleSnap)
330*cdf0e10cSrcweir             mpView->SetAngleSnapEnabled(bAngleSnap);
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir         if (mpView->IsOrtho() != bOrtho)
333*cdf0e10cSrcweir             mpView->SetOrtho(bOrtho);
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir         sal_Bool bCenter = rMEvt.IsMod2();
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir         if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
338*cdf0e10cSrcweir              mpView->IsResizeAtCenter() != bCenter )
339*cdf0e10cSrcweir         {
340*cdf0e10cSrcweir             mpView->SetCreate1stPointAsCenter(bCenter);
341*cdf0e10cSrcweir             mpView->SetResizeAtCenter(bCenter);
342*cdf0e10cSrcweir         }
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir         if ( mpView->IsDragHelpLine() )
345*cdf0e10cSrcweir             mpView->MovDragHelpLine(aPos);
346*cdf0e10cSrcweir     }
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir     sal_Bool bReturn = mpView->MouseMove(rMEvt, mpWindow);
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir     if (mpView->IsAction())
351*cdf0e10cSrcweir     {
352*cdf0e10cSrcweir         // Because the flag set back if necessary in MouseMove
353*cdf0e10cSrcweir         if (mpView->IsOrtho() != bOrtho)
354*cdf0e10cSrcweir             mpView->SetOrtho(bOrtho);
355*cdf0e10cSrcweir     }
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir     ForcePointer(&rMEvt);
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir     return bReturn;
360*cdf0e10cSrcweir }
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir /*************************************************************************
363*cdf0e10cSrcweir |*
364*cdf0e10cSrcweir |* MouseButtonUp-event
365*cdf0e10cSrcweir |*
366*cdf0e10cSrcweir \************************************************************************/
367*cdf0e10cSrcweir 
368*cdf0e10cSrcweir sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
369*cdf0e10cSrcweir {
370*cdf0e10cSrcweir     if ( mpView->IsDragHelpLine() )
371*cdf0e10cSrcweir         mpView->EndDragHelpLine();
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir     if ( bDragHelpLine )
374*cdf0e10cSrcweir     {
375*cdf0e10cSrcweir         Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel());
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir         if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
378*cdf0e10cSrcweir             mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir         mpWindow->ReleaseMouse();
381*cdf0e10cSrcweir     }
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir     FrameView* pFrameView = mpViewShell->GetFrameView();
384*cdf0e10cSrcweir     mpView->SetOrtho( pFrameView->IsOrtho() );
385*cdf0e10cSrcweir     mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
386*cdf0e10cSrcweir     mpView->SetSnapEnabled(sal_True);
387*cdf0e10cSrcweir     mpView->SetCreate1stPointAsCenter(sal_False);
388*cdf0e10cSrcweir     mpView->SetResizeAtCenter(sal_False);
389*cdf0e10cSrcweir     mpView->SetDragWithCopy(pFrameView->IsDragWithCopy());
390*cdf0e10cSrcweir     mpView->SetGridSnap(pFrameView->IsGridSnap());
391*cdf0e10cSrcweir     mpView->SetBordSnap(pFrameView->IsBordSnap());
392*cdf0e10cSrcweir     mpView->SetHlplSnap(pFrameView->IsHlplSnap());
393*cdf0e10cSrcweir     mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
394*cdf0e10cSrcweir     mpView->SetOPntSnap(pFrameView->IsOPntSnap());
395*cdf0e10cSrcweir     mpView->SetOConSnap(pFrameView->IsOConSnap());
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir     bIsInDragMode = sal_False;
398*cdf0e10cSrcweir     ForcePointer(&rMEvt);
399*cdf0e10cSrcweir     FuPoor::MouseButtonUp(rMEvt);
400*cdf0e10cSrcweir 
401*cdf0e10cSrcweir     return sal_False;
402*cdf0e10cSrcweir }
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir /*************************************************************************
405*cdf0e10cSrcweir |*
406*cdf0e10cSrcweir |* Process keyboard-events
407*cdf0e10cSrcweir |*
408*cdf0e10cSrcweir |* When processing a KeyEvent the returnvalue is sal_True, otherwise sal_False.
409*cdf0e10cSrcweir |*
410*cdf0e10cSrcweir \************************************************************************/
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
413*cdf0e10cSrcweir {
414*cdf0e10cSrcweir     sal_Bool bReturn = sal_False;
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir     switch ( rKEvt.GetKeyCode().GetCode() )
417*cdf0e10cSrcweir     {
418*cdf0e10cSrcweir         case KEY_ESCAPE:
419*cdf0e10cSrcweir         {
420*cdf0e10cSrcweir             bReturn = FuDraw::cancel();
421*cdf0e10cSrcweir         }
422*cdf0e10cSrcweir         break;
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir         case KEY_DELETE:
425*cdf0e10cSrcweir         case KEY_BACKSPACE:
426*cdf0e10cSrcweir         {
427*cdf0e10cSrcweir             if (!mpDocSh->IsReadOnly())
428*cdf0e10cSrcweir             {
429*cdf0e10cSrcweir                 if ( mpView && mpView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
430*cdf0e10cSrcweir                 {
431*cdf0e10cSrcweir                     InfoBox(mpWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
432*cdf0e10cSrcweir                 }
433*cdf0e10cSrcweir                 else
434*cdf0e10cSrcweir                 {
435*cdf0e10cSrcweir                     // Falls IP-Client aktiv, werden die Pointer
436*cdf0e10cSrcweir                     // auf das OLE- und das alte Graphic-Object
437*cdf0e10cSrcweir                     // am SdClient zurueckgesetzt, damit bei
438*cdf0e10cSrcweir                     // ::SelectionHasChanged nach dem Loeschen
439*cdf0e10cSrcweir                     // nicht mehr versucht wird, ein Grafik-Objekt
440*cdf0e10cSrcweir                     // zu restaurieren, das gar nicht mehr existiert.
441*cdf0e10cSrcweir                     // Alle anderen OLE-Objekte sind davon nicht
442*cdf0e10cSrcweir                     // betroffen (KA 06.10.95)
443*cdf0e10cSrcweir                     OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
444*cdf0e10cSrcweir                     Client* pIPClient = static_cast<Client*>(
445*cdf0e10cSrcweir                         mpViewShell->GetViewShell()->GetIPClient());
446*cdf0e10cSrcweir                     if (pIPClient && pIPClient->IsObjectInPlaceActive())
447*cdf0e10cSrcweir                         pIPClient->SetSdrGrafObj(NULL);
448*cdf0e10cSrcweir 
449*cdf0e10cSrcweir                     // wait-mousepointer while deleting object
450*cdf0e10cSrcweir                     WaitObject aWait( (Window*)mpViewShell->GetActiveWindow() );
451*cdf0e10cSrcweir                     // delete object
452*cdf0e10cSrcweir                     mpView->DeleteMarked();
453*cdf0e10cSrcweir                 }
454*cdf0e10cSrcweir             }
455*cdf0e10cSrcweir             bReturn = sal_True;
456*cdf0e10cSrcweir         }
457*cdf0e10cSrcweir         break;
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir         case KEY_TAB:
460*cdf0e10cSrcweir         {
461*cdf0e10cSrcweir             KeyCode aCode = rKEvt.GetKeyCode();
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir             if ( !aCode.IsMod1() && !aCode.IsMod2() )
464*cdf0e10cSrcweir             {
465*cdf0e10cSrcweir                 // #105336# Moved next line which was a bugfix itself into
466*cdf0e10cSrcweir                 // the scope which really does the object selection travel
467*cdf0e10cSrcweir                 // and thus is allowed to call SelectionHasChanged().
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir                 // Switch to FuSelect.
470*cdf0e10cSrcweir                 mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
471*cdf0e10cSrcweir                     SID_OBJECT_SELECT,
472*cdf0e10cSrcweir                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir                 // changeover to the next object
475*cdf0e10cSrcweir                 if(!mpView->MarkNextObj( !aCode.IsShift() ))
476*cdf0e10cSrcweir                 {
477*cdf0e10cSrcweir                     // #97016# No next object: go over open end and
478*cdf0e10cSrcweir                     // get first from the other side
479*cdf0e10cSrcweir                     mpView->UnmarkAllObj();
480*cdf0e10cSrcweir                     mpView->MarkNextObj(!aCode.IsShift());
481*cdf0e10cSrcweir                 }
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir                 // #97016# II
484*cdf0e10cSrcweir                 if(mpView->AreObjectsMarked())
485*cdf0e10cSrcweir                     mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
486*cdf0e10cSrcweir 
487*cdf0e10cSrcweir                 bReturn = sal_True;
488*cdf0e10cSrcweir             }
489*cdf0e10cSrcweir         }
490*cdf0e10cSrcweir         break;
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir         case KEY_END:
493*cdf0e10cSrcweir         {
494*cdf0e10cSrcweir             KeyCode aCode = rKEvt.GetKeyCode();
495*cdf0e10cSrcweir 
496*cdf0e10cSrcweir             if ( aCode.IsMod1() )
497*cdf0e10cSrcweir             {
498*cdf0e10cSrcweir                 // #97016# mark last object
499*cdf0e10cSrcweir                 mpView->UnmarkAllObj();
500*cdf0e10cSrcweir                 mpView->MarkNextObj(sal_False);
501*cdf0e10cSrcweir 
502*cdf0e10cSrcweir                 // #97016# II
503*cdf0e10cSrcweir                 if(mpView->AreObjectsMarked())
504*cdf0e10cSrcweir                     mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
505*cdf0e10cSrcweir 
506*cdf0e10cSrcweir                 bReturn = sal_True;
507*cdf0e10cSrcweir             }
508*cdf0e10cSrcweir         }
509*cdf0e10cSrcweir         break;
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir         case KEY_HOME:
512*cdf0e10cSrcweir         {
513*cdf0e10cSrcweir             KeyCode aCode = rKEvt.GetKeyCode();
514*cdf0e10cSrcweir 
515*cdf0e10cSrcweir             if ( aCode.IsMod1() )
516*cdf0e10cSrcweir             {
517*cdf0e10cSrcweir                 // #97016# mark first object
518*cdf0e10cSrcweir                 mpView->UnmarkAllObj();
519*cdf0e10cSrcweir                 mpView->MarkNextObj(sal_True);
520*cdf0e10cSrcweir 
521*cdf0e10cSrcweir                 // #97016# II
522*cdf0e10cSrcweir                 if(mpView->AreObjectsMarked())
523*cdf0e10cSrcweir                     mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir                 bReturn = sal_True;
526*cdf0e10cSrcweir             }
527*cdf0e10cSrcweir         }
528*cdf0e10cSrcweir         break;
529*cdf0e10cSrcweir 
530*cdf0e10cSrcweir         default:
531*cdf0e10cSrcweir         break;
532*cdf0e10cSrcweir     }
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir     if (!bReturn)
535*cdf0e10cSrcweir     {
536*cdf0e10cSrcweir         bReturn = FuPoor::KeyInput(rKEvt);
537*cdf0e10cSrcweir     }
538*cdf0e10cSrcweir     else
539*cdf0e10cSrcweir     {
540*cdf0e10cSrcweir         mpWindow->ReleaseMouse();
541*cdf0e10cSrcweir     }
542*cdf0e10cSrcweir 
543*cdf0e10cSrcweir     return (bReturn);
544*cdf0e10cSrcweir }
545*cdf0e10cSrcweir 
546*cdf0e10cSrcweir /*************************************************************************
547*cdf0e10cSrcweir |*
548*cdf0e10cSrcweir |* Fade out the selection-presentation before scrolling
549*cdf0e10cSrcweir |*
550*cdf0e10cSrcweir \************************************************************************/
551*cdf0e10cSrcweir 
552*cdf0e10cSrcweir void FuDraw::ScrollStart()
553*cdf0e10cSrcweir {
554*cdf0e10cSrcweir }
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir /*************************************************************************
557*cdf0e10cSrcweir |*
558*cdf0e10cSrcweir |* After scrolling show the selection-presentation again
559*cdf0e10cSrcweir |*
560*cdf0e10cSrcweir \************************************************************************/
561*cdf0e10cSrcweir 
562*cdf0e10cSrcweir void FuDraw::ScrollEnd()
563*cdf0e10cSrcweir {
564*cdf0e10cSrcweir }
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir /*************************************************************************
567*cdf0e10cSrcweir |*
568*cdf0e10cSrcweir |* Aktivate function
569*cdf0e10cSrcweir |*
570*cdf0e10cSrcweir \************************************************************************/
571*cdf0e10cSrcweir 
572*cdf0e10cSrcweir void FuDraw::Activate()
573*cdf0e10cSrcweir {
574*cdf0e10cSrcweir     FuPoor::Activate();
575*cdf0e10cSrcweir     ForcePointer();
576*cdf0e10cSrcweir }
577*cdf0e10cSrcweir 
578*cdf0e10cSrcweir /*************************************************************************
579*cdf0e10cSrcweir |*
580*cdf0e10cSrcweir |* Deaktivate function
581*cdf0e10cSrcweir |*
582*cdf0e10cSrcweir \************************************************************************/
583*cdf0e10cSrcweir 
584*cdf0e10cSrcweir void FuDraw::Deactivate()
585*cdf0e10cSrcweir {
586*cdf0e10cSrcweir     FuPoor::Deactivate();
587*cdf0e10cSrcweir }
588*cdf0e10cSrcweir 
589*cdf0e10cSrcweir 
590*cdf0e10cSrcweir /*************************************************************************
591*cdf0e10cSrcweir |*
592*cdf0e10cSrcweir |* Toggle mouse-pointer
593*cdf0e10cSrcweir |*
594*cdf0e10cSrcweir \************************************************************************/
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir void FuDraw::ForcePointer(const MouseEvent* pMEvt)
597*cdf0e10cSrcweir {
598*cdf0e10cSrcweir     Point aPnt;
599*cdf0e10cSrcweir     sal_uInt16 nModifier = 0;
600*cdf0e10cSrcweir     sal_Bool bLeftDown = sal_False;
601*cdf0e10cSrcweir     sal_Bool bDefPointer = sal_True;
602*cdf0e10cSrcweir 
603*cdf0e10cSrcweir     if (pMEvt)
604*cdf0e10cSrcweir     {
605*cdf0e10cSrcweir         aPnt = mpWindow->PixelToLogic(pMEvt->GetPosPixel());
606*cdf0e10cSrcweir         nModifier = pMEvt->GetModifier();
607*cdf0e10cSrcweir         bLeftDown = pMEvt->IsLeft();
608*cdf0e10cSrcweir     }
609*cdf0e10cSrcweir     else
610*cdf0e10cSrcweir     {
611*cdf0e10cSrcweir         aPnt = mpWindow->PixelToLogic(mpWindow->GetPointerPosPixel());
612*cdf0e10cSrcweir     }
613*cdf0e10cSrcweir 
614*cdf0e10cSrcweir     if (mpView->IsDragObj())
615*cdf0e10cSrcweir     {
616*cdf0e10cSrcweir         if (SD_MOD()->GetWaterCan() && !mpView->PickHandle(aPnt))
617*cdf0e10cSrcweir         {
618*cdf0e10cSrcweir             /******************************************************************
619*cdf0e10cSrcweir             * Giesskannenmodus
620*cdf0e10cSrcweir             ******************************************************************/
621*cdf0e10cSrcweir             bDefPointer = sal_False;
622*cdf0e10cSrcweir             mpWindow->SetPointer(Pointer(POINTER_FILL));
623*cdf0e10cSrcweir         }
624*cdf0e10cSrcweir     }
625*cdf0e10cSrcweir     else
626*cdf0e10cSrcweir     {
627*cdf0e10cSrcweir         SdrHdl* pHdl = mpView->PickHandle(aPnt);
628*cdf0e10cSrcweir 
629*cdf0e10cSrcweir         if (SD_MOD()->GetWaterCan() && !pHdl)
630*cdf0e10cSrcweir         {
631*cdf0e10cSrcweir             /******************************************************************
632*cdf0e10cSrcweir             * Giesskannenmodus
633*cdf0e10cSrcweir             ******************************************************************/
634*cdf0e10cSrcweir             bDefPointer = sal_False;
635*cdf0e10cSrcweir             mpWindow->SetPointer(Pointer(POINTER_FILL));
636*cdf0e10cSrcweir         }
637*cdf0e10cSrcweir         else if (!pHdl &&
638*cdf0e10cSrcweir                  mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()))
639*cdf0e10cSrcweir         {
640*cdf0e10cSrcweir             /******************************************************************
641*cdf0e10cSrcweir             * Pipettenmodus
642*cdf0e10cSrcweir             ******************************************************************/
643*cdf0e10cSrcweir             SvxBmpMask* pMask = (SvxBmpMask*) mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())->GetWindow();
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir             if (pMask && pMask->IsEyedropping())
646*cdf0e10cSrcweir             {
647*cdf0e10cSrcweir                 bDefPointer = sal_False;
648*cdf0e10cSrcweir                 mpWindow->SetPointer(Pointer(POINTER_REFHAND));
649*cdf0e10cSrcweir             }
650*cdf0e10cSrcweir         }
651*cdf0e10cSrcweir         else if (!mpView->IsAction())
652*cdf0e10cSrcweir         {
653*cdf0e10cSrcweir             SdrObject* pObj = NULL;
654*cdf0e10cSrcweir             SdrPageView* pPV = NULL;
655*cdf0e10cSrcweir             SdrViewEvent aVEvt;
656*cdf0e10cSrcweir             SdrHitKind eHit = SDRHIT_NONE;
657*cdf0e10cSrcweir             SdrDragMode eDragMode = mpView->GetDragMode();
658*cdf0e10cSrcweir 
659*cdf0e10cSrcweir             if (pMEvt)
660*cdf0e10cSrcweir             {
661*cdf0e10cSrcweir                 eHit = mpView->PickAnything(*pMEvt, SDRMOUSEMOVE, aVEvt);
662*cdf0e10cSrcweir             }
663*cdf0e10cSrcweir 
664*cdf0e10cSrcweir             if ((eDragMode == SDRDRAG_ROTATE) && (eHit == SDRHIT_MARKEDOBJECT))
665*cdf0e10cSrcweir             {
666*cdf0e10cSrcweir                 // The goal of this request is show always the rotation-arrow for 3D-objects at rotation-modus
667*cdf0e10cSrcweir                 // Independent of the settings at Extras->Optionen->Grafik "Objekte immer verschieben"
668*cdf0e10cSrcweir                 // 2D-objects acquit in an other way. Otherwise, the rotation of 3d-objects around any axises
669*cdf0e10cSrcweir                 // wouldn't be possible per default.
670*cdf0e10cSrcweir                 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
671*cdf0e10cSrcweir                 SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
672*cdf0e10cSrcweir                 if ((pObject->ISA(E3dObject)) && (rMarkList.GetMarkCount() == 1))
673*cdf0e10cSrcweir                 {
674*cdf0e10cSrcweir                     mpWindow->SetPointer(Pointer(POINTER_ROTATE));
675*cdf0e10cSrcweir                     bDefPointer = sal_False;     // Otherwise it'll be calles Joes routine and the mousepointer will reconfigurate again
676*cdf0e10cSrcweir                 }
677*cdf0e10cSrcweir             }
678*cdf0e10cSrcweir 
679*cdf0e10cSrcweir             if (eHit == SDRHIT_NONE)
680*cdf0e10cSrcweir             {
681*cdf0e10cSrcweir                 // found nothing -> look after at the masterpage
682*cdf0e10cSrcweir                 mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER);
683*cdf0e10cSrcweir             }
684*cdf0e10cSrcweir             else if (eHit == SDRHIT_UNMARKEDOBJECT)
685*cdf0e10cSrcweir             {
686*cdf0e10cSrcweir                 pObj = aVEvt.pObj;
687*cdf0e10cSrcweir             }
688*cdf0e10cSrcweir             else if (eHit == SDRHIT_TEXTEDITOBJ && this->ISA(FuSelection))
689*cdf0e10cSrcweir             {
690*cdf0e10cSrcweir                 sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
691*cdf0e10cSrcweir 
692*cdf0e10cSrcweir                 if ( nSdrObjKind != OBJ_TEXT        &&
693*cdf0e10cSrcweir                      nSdrObjKind != OBJ_TITLETEXT   &&
694*cdf0e10cSrcweir                      nSdrObjKind != OBJ_OUTLINETEXT &&
695*cdf0e10cSrcweir                      aVEvt.pObj->IsEmptyPresObj() )
696*cdf0e10cSrcweir                 {
697*cdf0e10cSrcweir                     pObj = NULL;
698*cdf0e10cSrcweir                     bDefPointer = sal_False;
699*cdf0e10cSrcweir                     mpWindow->SetPointer(Pointer(POINTER_ARROW));
700*cdf0e10cSrcweir                 }
701*cdf0e10cSrcweir             }
702*cdf0e10cSrcweir 
703*cdf0e10cSrcweir             if (pObj && pMEvt && !pMEvt->IsMod2() && this->ISA(FuSelection))
704*cdf0e10cSrcweir             {
705*cdf0e10cSrcweir                 // Auf Animation oder ImageMap pruefen
706*cdf0e10cSrcweir                 bDefPointer = !SetPointer(pObj, aPnt);
707*cdf0e10cSrcweir 
708*cdf0e10cSrcweir                 if (bDefPointer && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
709*cdf0e10cSrcweir                 {
710*cdf0e10cSrcweir                     // In die Gruppe hineinschauen
711*cdf0e10cSrcweir                     if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
712*cdf0e10cSrcweir                         bDefPointer = !SetPointer(pObj, aPnt);
713*cdf0e10cSrcweir                 }
714*cdf0e10cSrcweir             }
715*cdf0e10cSrcweir         }
716*cdf0e10cSrcweir     }
717*cdf0e10cSrcweir 
718*cdf0e10cSrcweir     if (bDefPointer)
719*cdf0e10cSrcweir     {
720*cdf0e10cSrcweir         mpWindow->SetPointer(mpView->GetPreferedPointer(
721*cdf0e10cSrcweir                             aPnt, mpWindow, nModifier, bLeftDown));
722*cdf0e10cSrcweir     }
723*cdf0e10cSrcweir }
724*cdf0e10cSrcweir 
725*cdf0e10cSrcweir /*************************************************************************
726*cdf0e10cSrcweir |*
727*cdf0e10cSrcweir |* Set cursor for animaton or imagemap
728*cdf0e10cSrcweir |*
729*cdf0e10cSrcweir \************************************************************************/
730*cdf0e10cSrcweir 
731*cdf0e10cSrcweir sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
732*cdf0e10cSrcweir {
733*cdf0e10cSrcweir     sal_Bool bSet = sal_False;
734*cdf0e10cSrcweir 
735*cdf0e10cSrcweir     sal_Bool bAnimationInfo = (!mpDocSh->ISA(GraphicDocShell) &&
736*cdf0e10cSrcweir                           mpDoc->GetAnimationInfo(pObj)) ? sal_True:sal_False;
737*cdf0e10cSrcweir 
738*cdf0e10cSrcweir     sal_Bool bImageMapInfo = sal_False;
739*cdf0e10cSrcweir 
740*cdf0e10cSrcweir     if (!bAnimationInfo)
741*cdf0e10cSrcweir         bImageMapInfo = mpDoc->GetIMapInfo(pObj) ? sal_True:sal_False;
742*cdf0e10cSrcweir 
743*cdf0e10cSrcweir     if (bAnimationInfo || bImageMapInfo)
744*cdf0e10cSrcweir     {
745*cdf0e10cSrcweir         const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers();
746*cdf0e10cSrcweir         sal_uInt16 nHitLog(sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width()));
747*cdf0e10cSrcweir         long  n2HitLog(nHitLog * 2);
748*cdf0e10cSrcweir         Point aHitPosR(rPos);
749*cdf0e10cSrcweir         Point aHitPosL(rPos);
750*cdf0e10cSrcweir         Point aHitPosT(rPos);
751*cdf0e10cSrcweir         Point aHitPosB(rPos);
752*cdf0e10cSrcweir 
753*cdf0e10cSrcweir         aHitPosR.X() += n2HitLog;
754*cdf0e10cSrcweir         aHitPosL.X() -= n2HitLog;
755*cdf0e10cSrcweir         aHitPosT.Y() += n2HitLog;
756*cdf0e10cSrcweir         aHitPosB.Y() -= n2HitLog;
757*cdf0e10cSrcweir 
758*cdf0e10cSrcweir         if ( !pObj->IsClosedObj() ||
759*cdf0e10cSrcweir             ( SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
760*cdf0e10cSrcweir               SdrObjectPrimitiveHit(*pObj, aHitPosL, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
761*cdf0e10cSrcweir               SdrObjectPrimitiveHit(*pObj, aHitPosT, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
762*cdf0e10cSrcweir               SdrObjectPrimitiveHit(*pObj, aHitPosB, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false)))
763*cdf0e10cSrcweir         {
764*cdf0e10cSrcweir             /**********************************************************
765*cdf0e10cSrcweir             * hit inside the object (without margin) or open object
766*cdf0e10cSrcweir             ********************************************************/
767*cdf0e10cSrcweir 
768*cdf0e10cSrcweir             if (bAnimationInfo)
769*cdf0e10cSrcweir             {
770*cdf0e10cSrcweir                 /******************************************************
771*cdf0e10cSrcweir                 * Click-Action
772*cdf0e10cSrcweir                 ******************************************************/
773*cdf0e10cSrcweir                 SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
774*cdf0e10cSrcweir 
775*cdf0e10cSrcweir                 if ((mpView->ISA(DrawView) &&
776*cdf0e10cSrcweir                       (pInfo->meClickAction == presentation::ClickAction_BOOKMARK  ||
777*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_DOCUMENT  ||
778*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_PREVPAGE  ||
779*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_NEXTPAGE  ||
780*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_FIRSTPAGE ||
781*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_LASTPAGE  ||
782*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_VERB      ||
783*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_PROGRAM   ||
784*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_MACRO     ||
785*cdf0e10cSrcweir                        pInfo->meClickAction == presentation::ClickAction_SOUND))
786*cdf0e10cSrcweir                                                                     ||
787*cdf0e10cSrcweir                     (mpView->ISA(DrawView) &&
788*cdf0e10cSrcweir                         SlideShow::IsRunning( mpViewShell->GetViewShellBase() )   &&
789*cdf0e10cSrcweir                          (pInfo->meClickAction == presentation::ClickAction_VANISH            ||
790*cdf0e10cSrcweir                           pInfo->meClickAction == presentation::ClickAction_INVISIBLE         ||
791*cdf0e10cSrcweir                           pInfo->meClickAction == presentation::ClickAction_STOPPRESENTATION ||
792*cdf0e10cSrcweir                          (pInfo->mbActive &&
793*cdf0e10cSrcweir                           ( pInfo->meEffect != presentation::AnimationEffect_NONE ||
794*cdf0e10cSrcweir                             pInfo->meTextEffect != presentation::AnimationEffect_NONE )))))
795*cdf0e10cSrcweir                     {
796*cdf0e10cSrcweir                         // Animations-Objekt
797*cdf0e10cSrcweir                         bSet = sal_True;
798*cdf0e10cSrcweir                         mpWindow->SetPointer(Pointer(POINTER_REFHAND));
799*cdf0e10cSrcweir                     }
800*cdf0e10cSrcweir             }
801*cdf0e10cSrcweir             else if (bImageMapInfo &&
802*cdf0e10cSrcweir                      mpDoc->GetHitIMapObject(pObj, rPos, *mpWindow))
803*cdf0e10cSrcweir             {
804*cdf0e10cSrcweir                 /******************************************************
805*cdf0e10cSrcweir                 * ImageMap
806*cdf0e10cSrcweir                 ******************************************************/
807*cdf0e10cSrcweir                 bSet = sal_True;
808*cdf0e10cSrcweir                 mpWindow->SetPointer(Pointer(POINTER_REFHAND));
809*cdf0e10cSrcweir             }
810*cdf0e10cSrcweir         }
811*cdf0e10cSrcweir     }
812*cdf0e10cSrcweir 
813*cdf0e10cSrcweir     return bSet;
814*cdf0e10cSrcweir }
815*cdf0e10cSrcweir 
816*cdf0e10cSrcweir 
817*cdf0e10cSrcweir 
818*cdf0e10cSrcweir /*************************************************************************
819*cdf0e10cSrcweir |*
820*cdf0e10cSrcweir |* Response of doubleclick
821*cdf0e10cSrcweir |*
822*cdf0e10cSrcweir \************************************************************************/
823*cdf0e10cSrcweir 
824*cdf0e10cSrcweir void FuDraw::DoubleClick(const MouseEvent& rMEvt)
825*cdf0e10cSrcweir {
826*cdf0e10cSrcweir     sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
827*cdf0e10cSrcweir 
828*cdf0e10cSrcweir     if ( mpView->AreObjectsMarked() )
829*cdf0e10cSrcweir     {
830*cdf0e10cSrcweir         const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
831*cdf0e10cSrcweir 
832*cdf0e10cSrcweir         if (rMarkList.GetMarkCount() == 1)
833*cdf0e10cSrcweir         {
834*cdf0e10cSrcweir             SdrMark* pMark = rMarkList.GetMark(0);
835*cdf0e10cSrcweir             SdrObject* pObj = pMark->GetMarkedSdrObj();
836*cdf0e10cSrcweir 
837*cdf0e10cSrcweir             sal_uInt32 nInv = pObj->GetObjInventor();
838*cdf0e10cSrcweir             sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
839*cdf0e10cSrcweir 
840*cdf0e10cSrcweir             if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
841*cdf0e10cSrcweir             {
842*cdf0e10cSrcweir                 DrawDocShell* pDocSh = mpDoc->GetDocSh();
843*cdf0e10cSrcweir 
844*cdf0e10cSrcweir                 if ( !pDocSh->IsUIActive() )
845*cdf0e10cSrcweir                 {
846*cdf0e10cSrcweir                     /**********************************************************
847*cdf0e10cSrcweir                     * aktivate OLE-object
848*cdf0e10cSrcweir                     **********************************************************/
849*cdf0e10cSrcweir                     //HMHmpView->HideMarkHdl();
850*cdf0e10cSrcweir                     mpViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0);
851*cdf0e10cSrcweir                 }
852*cdf0e10cSrcweir             }
853*cdf0e10cSrcweir             else if (nInv == SdrInventor &&  nSdrObjKind == OBJ_GRAF && pObj->IsEmptyPresObj() )
854*cdf0e10cSrcweir             {
855*cdf0e10cSrcweir                 mpViewShell->GetViewFrame()->
856*cdf0e10cSrcweir                     GetDispatcher()->Execute( SID_INSERT_GRAPHIC,
857*cdf0e10cSrcweir                                               SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
858*cdf0e10cSrcweir             }
859*cdf0e10cSrcweir             else if ( ( pObj->ISA(SdrTextObj) || pObj->ISA(SdrObjGroup) ) &&
860*cdf0e10cSrcweir                       !SD_MOD()->GetWaterCan()                            &&
861*cdf0e10cSrcweir                       mpViewShell->GetFrameView()->IsDoubleClickTextEdit() &&
862*cdf0e10cSrcweir                       !mpDocSh->IsReadOnly())
863*cdf0e10cSrcweir             {
864*cdf0e10cSrcweir                 SfxUInt16Item aItem(SID_TEXTEDIT, 2);
865*cdf0e10cSrcweir                 mpViewShell->GetViewFrame()->GetDispatcher()->
866*cdf0e10cSrcweir                                  Execute(SID_TEXTEDIT, SFX_CALLMODE_ASYNCHRON |
867*cdf0e10cSrcweir                                          SFX_CALLMODE_RECORD, &aItem, 0L);
868*cdf0e10cSrcweir             }
869*cdf0e10cSrcweir             else if (nInv == SdrInventor &&  nSdrObjKind == OBJ_GRUP)
870*cdf0e10cSrcweir             {
871*cdf0e10cSrcweir                 // hit group -> select subobject
872*cdf0e10cSrcweir                 mpView->UnMarkAll();
873*cdf0e10cSrcweir                 mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift(), sal_True);
874*cdf0e10cSrcweir             }
875*cdf0e10cSrcweir         }
876*cdf0e10cSrcweir     }
877*cdf0e10cSrcweir     else
878*cdf0e10cSrcweir         mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
879*cdf0e10cSrcweir }
880*cdf0e10cSrcweir 
881*cdf0e10cSrcweir /*************************************************************************
882*cdf0e10cSrcweir |*
883*cdf0e10cSrcweir |* Help-event
884*cdf0e10cSrcweir |*
885*cdf0e10cSrcweir \************************************************************************/
886*cdf0e10cSrcweir 
887*cdf0e10cSrcweir sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
888*cdf0e10cSrcweir {
889*cdf0e10cSrcweir     sal_Bool bReturn = sal_False;
890*cdf0e10cSrcweir 
891*cdf0e10cSrcweir     if (Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled())
892*cdf0e10cSrcweir     {
893*cdf0e10cSrcweir         SdrViewEvent aVEvt;
894*cdf0e10cSrcweir 
895*cdf0e10cSrcweir         MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, 0, MOUSE_LEFT);
896*cdf0e10cSrcweir 
897*cdf0e10cSrcweir         SdrHitKind eHit = mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
898*cdf0e10cSrcweir 
899*cdf0e10cSrcweir         SdrObject* pObj = aVEvt.pObj;
900*cdf0e10cSrcweir 
901*cdf0e10cSrcweir         if (eHit != SDRHIT_NONE && pObj != NULL)
902*cdf0e10cSrcweir         {
903*cdf0e10cSrcweir             Point aPosPixel = rHEvt.GetMousePosPixel();
904*cdf0e10cSrcweir 
905*cdf0e10cSrcweir             bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
906*cdf0e10cSrcweir 
907*cdf0e10cSrcweir             if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
908*cdf0e10cSrcweir             {
909*cdf0e10cSrcweir                 // In die Gruppe hineinschauen
910*cdf0e10cSrcweir                 SdrPageView* pPV = NULL;
911*cdf0e10cSrcweir 
912*cdf0e10cSrcweir                 Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(aPosPixel)));
913*cdf0e10cSrcweir 
914*cdf0e10cSrcweir                 if (mpView->PickObj(aPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
915*cdf0e10cSrcweir                     bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
916*cdf0e10cSrcweir             }
917*cdf0e10cSrcweir         }
918*cdf0e10cSrcweir     }
919*cdf0e10cSrcweir 
920*cdf0e10cSrcweir     if (!bReturn)
921*cdf0e10cSrcweir     {
922*cdf0e10cSrcweir         bReturn = FuPoor::RequestHelp(rHEvt);
923*cdf0e10cSrcweir     }
924*cdf0e10cSrcweir 
925*cdf0e10cSrcweir     return(bReturn);
926*cdf0e10cSrcweir }
927*cdf0e10cSrcweir 
928*cdf0e10cSrcweir 
929*cdf0e10cSrcweir 
930*cdf0e10cSrcweir /*************************************************************************
931*cdf0e10cSrcweir |*
932*cdf0e10cSrcweir |* Command-event
933*cdf0e10cSrcweir |*
934*cdf0e10cSrcweir \************************************************************************/
935*cdf0e10cSrcweir 
936*cdf0e10cSrcweir sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewEvent& rVEvt)
937*cdf0e10cSrcweir {
938*cdf0e10cSrcweir     sal_Bool bSet = sal_False;
939*cdf0e10cSrcweir     String aHelpText;
940*cdf0e10cSrcweir     Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(rPosPixel)));
941*cdf0e10cSrcweir 
942*cdf0e10cSrcweir     // URL fuer IMapObject unter Pointer ist Hilfetext
943*cdf0e10cSrcweir     if ( mpDoc->GetIMapInfo(pObj) )
944*cdf0e10cSrcweir     {
945*cdf0e10cSrcweir         IMapObject* pIMapObj = mpDoc->GetHitIMapObject(pObj, aPos, *mpWindow );
946*cdf0e10cSrcweir 
947*cdf0e10cSrcweir         if ( pIMapObj )
948*cdf0e10cSrcweir         {
949*cdf0e10cSrcweir             // show name
950*cdf0e10cSrcweir             aHelpText = pIMapObj->GetAltText();
951*cdf0e10cSrcweir 
952*cdf0e10cSrcweir             if (aHelpText.Len() == 0)
953*cdf0e10cSrcweir             {
954*cdf0e10cSrcweir                 // show url if no name is available
955*cdf0e10cSrcweir                 aHelpText = INetURLObject::decode( pIMapObj->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
956*cdf0e10cSrcweir             }
957*cdf0e10cSrcweir         }
958*cdf0e10cSrcweir     }
959*cdf0e10cSrcweir     else if (!mpDocSh->ISA(GraphicDocShell) && mpDoc->GetAnimationInfo(pObj))
960*cdf0e10cSrcweir     {
961*cdf0e10cSrcweir         SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
962*cdf0e10cSrcweir 
963*cdf0e10cSrcweir         switch (pInfo->meClickAction)
964*cdf0e10cSrcweir         {
965*cdf0e10cSrcweir             case presentation::ClickAction_PREVPAGE:
966*cdf0e10cSrcweir             {
967*cdf0e10cSrcweir                 // jump to the prior page
968*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_PREVPAGE));
969*cdf0e10cSrcweir             }
970*cdf0e10cSrcweir             break;
971*cdf0e10cSrcweir 
972*cdf0e10cSrcweir             case presentation::ClickAction_NEXTPAGE:
973*cdf0e10cSrcweir             {
974*cdf0e10cSrcweir                 // jump to the next page
975*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_NEXTPAGE));
976*cdf0e10cSrcweir             }
977*cdf0e10cSrcweir             break;
978*cdf0e10cSrcweir 
979*cdf0e10cSrcweir             case presentation::ClickAction_FIRSTPAGE:
980*cdf0e10cSrcweir             {
981*cdf0e10cSrcweir                 // jump to the first page
982*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_FIRSTPAGE));
983*cdf0e10cSrcweir             }
984*cdf0e10cSrcweir             break;
985*cdf0e10cSrcweir 
986*cdf0e10cSrcweir             case presentation::ClickAction_LASTPAGE:
987*cdf0e10cSrcweir             {
988*cdf0e10cSrcweir                 // jump to the last page
989*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_LASTPAGE));
990*cdf0e10cSrcweir             }
991*cdf0e10cSrcweir             break;
992*cdf0e10cSrcweir 
993*cdf0e10cSrcweir             case presentation::ClickAction_BOOKMARK:
994*cdf0e10cSrcweir             {
995*cdf0e10cSrcweir                 // jump to object/page
996*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_BOOKMARK));
997*cdf0e10cSrcweir                 aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
998*cdf0e10cSrcweir                 aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
999*cdf0e10cSrcweir             }
1000*cdf0e10cSrcweir             break;
1001*cdf0e10cSrcweir 
1002*cdf0e10cSrcweir             case presentation::ClickAction_DOCUMENT:
1003*cdf0e10cSrcweir             {
1004*cdf0e10cSrcweir                 // jump to document (object/page)
1005*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_DOCUMENT));
1006*cdf0e10cSrcweir                 aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
1007*cdf0e10cSrcweir                 aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
1008*cdf0e10cSrcweir             }
1009*cdf0e10cSrcweir             break;
1010*cdf0e10cSrcweir 
1011*cdf0e10cSrcweir             case presentation::ClickAction_PROGRAM:
1012*cdf0e10cSrcweir             {
1013*cdf0e10cSrcweir                 // execute program
1014*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_PROGRAM));
1015*cdf0e10cSrcweir                 aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
1016*cdf0e10cSrcweir                 aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
1017*cdf0e10cSrcweir             }
1018*cdf0e10cSrcweir             break;
1019*cdf0e10cSrcweir 
1020*cdf0e10cSrcweir             case presentation::ClickAction_MACRO:
1021*cdf0e10cSrcweir             {
1022*cdf0e10cSrcweir                 // execute program
1023*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_MACRO));
1024*cdf0e10cSrcweir                 aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
1025*cdf0e10cSrcweir 
1026*cdf0e10cSrcweir                 if ( SfxApplication::IsXScriptURL( pInfo->GetBookmark() ) )
1027*cdf0e10cSrcweir                 {
1028*cdf0e10cSrcweir                     aHelpText.Append( pInfo->GetBookmark() );
1029*cdf0e10cSrcweir                 }
1030*cdf0e10cSrcweir                 else
1031*cdf0e10cSrcweir                 {
1032*cdf0e10cSrcweir                     String sBookmark( pInfo->GetBookmark() );
1033*cdf0e10cSrcweir                     sal_Unicode cToken = '.';
1034*cdf0e10cSrcweir                     aHelpText.Append( sBookmark.GetToken( 2, cToken ) );
1035*cdf0e10cSrcweir                     aHelpText.Append( cToken );
1036*cdf0e10cSrcweir                     aHelpText.Append( sBookmark.GetToken( 1, cToken ) );
1037*cdf0e10cSrcweir                     aHelpText.Append( cToken );
1038*cdf0e10cSrcweir                     aHelpText.Append( sBookmark.GetToken( 0, cToken ) );
1039*cdf0e10cSrcweir                 }
1040*cdf0e10cSrcweir             }
1041*cdf0e10cSrcweir             break;
1042*cdf0e10cSrcweir 
1043*cdf0e10cSrcweir             case presentation::ClickAction_SOUND:
1044*cdf0e10cSrcweir             {
1045*cdf0e10cSrcweir                 // play-back sound
1046*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_SOUND));
1047*cdf0e10cSrcweir             }
1048*cdf0e10cSrcweir             break;
1049*cdf0e10cSrcweir 
1050*cdf0e10cSrcweir             case presentation::ClickAction_VERB:
1051*cdf0e10cSrcweir             {
1052*cdf0e10cSrcweir                 // execute OLE-verb
1053*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_VERB));
1054*cdf0e10cSrcweir             }
1055*cdf0e10cSrcweir             break;
1056*cdf0e10cSrcweir 
1057*cdf0e10cSrcweir             case presentation::ClickAction_STOPPRESENTATION:
1058*cdf0e10cSrcweir             {
1059*cdf0e10cSrcweir                 // quit presentation
1060*cdf0e10cSrcweir                 aHelpText = String(SdResId(STR_CLICK_ACTION_STOPPRESENTATION));
1061*cdf0e10cSrcweir             }
1062*cdf0e10cSrcweir             break;
1063*cdf0e10cSrcweir             default:
1064*cdf0e10cSrcweir                 break;
1065*cdf0e10cSrcweir         }
1066*cdf0e10cSrcweir     }
1067*cdf0e10cSrcweir     else if (rVEvt.pURLField)
1068*cdf0e10cSrcweir     {
1069*cdf0e10cSrcweir         /**************************************************************
1070*cdf0e10cSrcweir         * URL-Field
1071*cdf0e10cSrcweir         **************************************************************/
1072*cdf0e10cSrcweir         aHelpText = INetURLObject::decode( rVEvt.pURLField->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
1073*cdf0e10cSrcweir     }
1074*cdf0e10cSrcweir 
1075*cdf0e10cSrcweir     if (aHelpText.Len())
1076*cdf0e10cSrcweir     {
1077*cdf0e10cSrcweir         bSet = sal_True;
1078*cdf0e10cSrcweir         Rectangle aLogicPix = mpWindow->LogicToPixel(pObj->GetLogicRect());
1079*cdf0e10cSrcweir         Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
1080*cdf0e10cSrcweir                               mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
1081*cdf0e10cSrcweir 
1082*cdf0e10cSrcweir         if (Help::IsBalloonHelpEnabled())
1083*cdf0e10cSrcweir             Help::ShowBalloon( (Window*)mpWindow, rPosPixel, aScreenRect, aHelpText);
1084*cdf0e10cSrcweir         else if (Help::IsQuickHelpEnabled())
1085*cdf0e10cSrcweir             Help::ShowQuickHelp( (Window*)mpWindow, aScreenRect, aHelpText);
1086*cdf0e10cSrcweir     }
1087*cdf0e10cSrcweir 
1088*cdf0e10cSrcweir     return bSet;
1089*cdf0e10cSrcweir }
1090*cdf0e10cSrcweir 
1091*cdf0e10cSrcweir 
1092*cdf0e10cSrcweir /** is called when the currenct function should be aborted. <p>
1093*cdf0e10cSrcweir     This is used when a function gets a KEY_ESCAPE but can also
1094*cdf0e10cSrcweir     be called directly.
1095*cdf0e10cSrcweir 
1096*cdf0e10cSrcweir     @returns true if a active function was aborted
1097*cdf0e10cSrcweir */
1098*cdf0e10cSrcweir bool FuDraw::cancel()
1099*cdf0e10cSrcweir {
1100*cdf0e10cSrcweir     bool bReturn = false;
1101*cdf0e10cSrcweir 
1102*cdf0e10cSrcweir     if ( mpView->IsAction() )
1103*cdf0e10cSrcweir     {
1104*cdf0e10cSrcweir         mpView->BrkAction();
1105*cdf0e10cSrcweir         bReturn = true;
1106*cdf0e10cSrcweir     }
1107*cdf0e10cSrcweir     else if ( mpView->IsTextEdit() )
1108*cdf0e10cSrcweir     {
1109*cdf0e10cSrcweir         mpView->SdrEndTextEdit();
1110*cdf0e10cSrcweir         bReturn = true;
1111*cdf0e10cSrcweir 
1112*cdf0e10cSrcweir         SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
1113*cdf0e10cSrcweir         rBindings.Invalidate( SID_PARASPACE_INCREASE );
1114*cdf0e10cSrcweir         rBindings.Invalidate( SID_PARASPACE_DECREASE );
1115*cdf0e10cSrcweir     }
1116*cdf0e10cSrcweir     else if ( mpView->AreObjectsMarked() )
1117*cdf0e10cSrcweir     {
1118*cdf0e10cSrcweir         // #97016# II
1119*cdf0e10cSrcweir         const SdrHdlList& rHdlList = mpView->GetHdlList();
1120*cdf0e10cSrcweir         SdrHdl* pHdl = rHdlList.GetFocusHdl();
1121*cdf0e10cSrcweir 
1122*cdf0e10cSrcweir         if(pHdl)
1123*cdf0e10cSrcweir         {
1124*cdf0e10cSrcweir             ((SdrHdlList&)rHdlList).ResetFocusHdl();
1125*cdf0e10cSrcweir         }
1126*cdf0e10cSrcweir         else
1127*cdf0e10cSrcweir         {
1128*cdf0e10cSrcweir             mpView->UnmarkAll();
1129*cdf0e10cSrcweir         }
1130*cdf0e10cSrcweir 
1131*cdf0e10cSrcweir         // Switch to FuSelect.
1132*cdf0e10cSrcweir         mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
1133*cdf0e10cSrcweir             SID_OBJECT_SELECT,
1134*cdf0e10cSrcweir             SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
1135*cdf0e10cSrcweir 
1136*cdf0e10cSrcweir         bReturn = true;
1137*cdf0e10cSrcweir     }
1138*cdf0e10cSrcweir 
1139*cdf0e10cSrcweir     return bReturn;
1140*cdf0e10cSrcweir }
1141*cdf0e10cSrcweir 
1142*cdf0e10cSrcweir } // end of namespace sd
1143