1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fudspord.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
36 #include "fudspord.hxx"
38 #include <svx/svxids.hrc>
39 #include <vcl/pointr.hxx>
43 #include "ViewShell.hxx"
45 #ifndef SD_WINDOW_SHELL_HXX
48 #include "drawdoc.hxx"
52 TYPEINIT1( FuDisplayOrder
, FuPoor
);
54 /*************************************************************************
58 \************************************************************************/
60 FuDisplayOrder::FuDisplayOrder( ViewShell
* pViewSh
, ::sd::Window
* pWin
, ::sd::View
* pView
, SdDrawDocument
* pDoc
, SfxRequest
& rReq
)
61 : FuPoor(pViewSh
, pWin
, pView
, pDoc
, rReq
)
67 /*************************************************************************
71 \************************************************************************/
73 FuDisplayOrder::~FuDisplayOrder()
78 void FuDisplayOrder::implClearOverlay()
87 FunctionReference
FuDisplayOrder::Create( ViewShell
* pViewSh
, ::sd::Window
* pWin
, ::sd::View
* pView
, SdDrawDocument
* pDoc
, SfxRequest
& rReq
)
89 FunctionReference
xFunc( new FuDisplayOrder( pViewSh
, pWin
, pView
, pDoc
, rReq
) );
93 /*************************************************************************
95 |* MouseButtonDown-event
97 \************************************************************************/
99 BOOL
FuDisplayOrder::MouseButtonDown(const MouseEvent
& rMEvt
)
101 // #95491# remember button state for creation of own MouseEvents
102 SetMouseButtonCode(rMEvt
.GetButtons());
107 /*************************************************************************
111 \************************************************************************/
113 BOOL
FuDisplayOrder::MouseMove(const MouseEvent
& rMEvt
)
117 Point
aPnt( mpWindow
->PixelToLogic( rMEvt
.GetPosPixel() ) );
119 if ( mpView
->PickObj(aPnt
, mpView
->getHitTolLog(), pPickObj
, pPV
) )
121 if (mpRefObj
!= pPickObj
)
123 // delete current overlay
127 mpOverlay
= new SdrDropMarkerOverlay(*mpView
, *pPickObj
);
129 // remember referenced object
142 /*************************************************************************
144 |* MouseButtonUp-event
146 \************************************************************************/
148 BOOL
FuDisplayOrder::MouseButtonUp(const MouseEvent
& rMEvt
)
150 // #95491# remember button state for creation of own MouseEvents
151 SetMouseButtonCode(rMEvt
.GetButtons());
153 SdrPageView
* pPV
= NULL
;
154 Point
aPnt( mpWindow
->PixelToLogic( rMEvt
.GetPosPixel() ) );
156 if ( mpView
->PickObj(aPnt
, mpView
->getHitTolLog(), mpRefObj
, pPV
) )
158 if (nSlotId
== SID_BEFORE_OBJ
)
160 mpView
->PutMarkedInFrontOfObj(mpRefObj
);
164 mpView
->PutMarkedBehindObj(mpRefObj
);
168 mpViewShell
->Cancel();
173 /*************************************************************************
175 |* Function aktivieren
177 \************************************************************************/
179 void FuDisplayOrder::Activate()
181 maPtr
= mpWindow
->GetPointer();
182 mpWindow
->SetPointer( Pointer( POINTER_REFHAND
) );
185 /*************************************************************************
187 |* Function deaktivieren
189 \************************************************************************/
191 void FuDisplayOrder::Deactivate()
193 mpWindow
->SetPointer( maPtr
);
197 } // end of namespace sd