update dev300-m58
[ooovba.git] / vcl / source / window / scrwnd.hxx
blob1e6c1607db22b8e505aab2101d68d5ac7f9651fc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: scrwnd.hxx,v $
10 * $Revision: 1.6 $
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 #include <vcl/floatwin.hxx>
32 #include <vcl/bitmap.hxx>
33 #include <vcl/image.hxx>
35 // -----------
36 // - Defines -
37 // -----------
39 #define WHEELMODE_NONE 0x00000000UL
40 #define WHEELMODE_VH 0x00000001UL
41 #define WHEELMODE_V 0x00000002UL
42 #define WHEELMODE_H 0x00000004UL
43 #define WHEELMODE_SCROLL_VH 0x00000008UL
44 #define WHEELMODE_SCROLL_V 0x00000010UL
45 #define WHEELMODE_SCROLL_H 0x00000020UL
47 // -------------------
48 // - ImplWheelWindow -
49 // -------------------
51 class Timer;
53 class ImplWheelWindow : public FloatingWindow
55 private:
57 ImageList maImgList;
58 Bitmap maWheelBmp;
59 CommandScrollData maCommandScrollData;
60 Point maLastMousePos;
61 Point maCenter;
62 Timer* mpTimer;
63 ULONG mnRepaintTime;
64 ULONG mnTimeout;
65 ULONG mnWheelMode;
66 ULONG mnMaxWidth;
67 ULONG mnActWidth;
68 ULONG mnActDist;
69 long mnActDeltaX;
70 long mnActDeltaY;
72 void ImplCreateImageList();
73 void ImplSetRegion( const Bitmap& rRegionBmp );
74 using Window::ImplGetMousePointer;
75 PointerStyle ImplGetMousePointer( long nDistX, long nDistY );
76 void ImplDrawWheel();
77 void ImplRecalcScrollValues();
79 DECL_LINK( ImplScrollHdl, Timer* pTimer );
81 protected:
83 virtual void Paint( const Rectangle& rRect );
84 virtual void MouseMove( const MouseEvent& rMEvt );
85 virtual void MouseButtonUp( const MouseEvent& rMEvt );
87 public:
89 ImplWheelWindow( Window* pParent );
90 ~ImplWheelWindow();
92 void ImplStop();
93 void ImplSetWheelMode( ULONG nWheelMode );
94 ULONG ImplGetWheelMode() const { return mnWheelMode; }