1*0d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*0d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*0d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*0d63794cSAndrew Rist * distributed with this work for additional information 6*0d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*0d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*0d63794cSAndrew Rist * "License"); you may not use this file except in compliance 9*0d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 10*0d63794cSAndrew Rist * 11*0d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*0d63794cSAndrew Rist * 13*0d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*0d63794cSAndrew Rist * software distributed under the License is distributed on an 15*0d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*0d63794cSAndrew Rist * KIND, either express or implied. See the License for the 17*0d63794cSAndrew Rist * specific language governing permissions and limitations 18*0d63794cSAndrew Rist * under the License. 19*0d63794cSAndrew Rist * 20*0d63794cSAndrew Rist *************************************************************/ 21*0d63794cSAndrew Rist 22*0d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <vcl/floatwin.hxx> 25cdf0e10cSrcweir #include <vcl/bitmap.hxx> 26cdf0e10cSrcweir #include <vcl/image.hxx> 27cdf0e10cSrcweir 28cdf0e10cSrcweir // ----------- 29cdf0e10cSrcweir // - Defines - 30cdf0e10cSrcweir // ----------- 31cdf0e10cSrcweir 32cdf0e10cSrcweir #define WHEELMODE_NONE 0x00000000UL 33cdf0e10cSrcweir #define WHEELMODE_VH 0x00000001UL 34cdf0e10cSrcweir #define WHEELMODE_V 0x00000002UL 35cdf0e10cSrcweir #define WHEELMODE_H 0x00000004UL 36cdf0e10cSrcweir #define WHEELMODE_SCROLL_VH 0x00000008UL 37cdf0e10cSrcweir #define WHEELMODE_SCROLL_V 0x00000010UL 38cdf0e10cSrcweir #define WHEELMODE_SCROLL_H 0x00000020UL 39cdf0e10cSrcweir 40cdf0e10cSrcweir // ------------------- 41cdf0e10cSrcweir // - ImplWheelWindow - 42cdf0e10cSrcweir // ------------------- 43cdf0e10cSrcweir 44cdf0e10cSrcweir class Timer; 45cdf0e10cSrcweir 46cdf0e10cSrcweir class ImplWheelWindow : public FloatingWindow 47cdf0e10cSrcweir { 48cdf0e10cSrcweir private: 49cdf0e10cSrcweir 50cdf0e10cSrcweir ImageList maImgList; 51cdf0e10cSrcweir Bitmap maWheelBmp; 52cdf0e10cSrcweir CommandScrollData maCommandScrollData; 53cdf0e10cSrcweir Point maLastMousePos; 54cdf0e10cSrcweir Point maCenter; 55cdf0e10cSrcweir Timer* mpTimer; 56cdf0e10cSrcweir sal_uLong mnRepaintTime; 57cdf0e10cSrcweir sal_uLong mnTimeout; 58cdf0e10cSrcweir sal_uLong mnWheelMode; 59cdf0e10cSrcweir sal_uLong mnMaxWidth; 60cdf0e10cSrcweir sal_uLong mnActWidth; 61cdf0e10cSrcweir sal_uLong mnActDist; 62cdf0e10cSrcweir long mnActDeltaX; 63cdf0e10cSrcweir long mnActDeltaY; 64cdf0e10cSrcweir 65cdf0e10cSrcweir void ImplCreateImageList(); 66cdf0e10cSrcweir void ImplSetRegion( const Bitmap& rRegionBmp ); 67cdf0e10cSrcweir using Window::ImplGetMousePointer; 68cdf0e10cSrcweir PointerStyle ImplGetMousePointer( long nDistX, long nDistY ); 69cdf0e10cSrcweir void ImplDrawWheel(); 70cdf0e10cSrcweir void ImplRecalcScrollValues(); 71cdf0e10cSrcweir 72cdf0e10cSrcweir DECL_LINK( ImplScrollHdl, Timer* pTimer ); 73cdf0e10cSrcweir 74cdf0e10cSrcweir protected: 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual void Paint( const Rectangle& rRect ); 77cdf0e10cSrcweir virtual void MouseMove( const MouseEvent& rMEvt ); 78cdf0e10cSrcweir virtual void MouseButtonUp( const MouseEvent& rMEvt ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir public: 81cdf0e10cSrcweir 82cdf0e10cSrcweir ImplWheelWindow( Window* pParent ); 83cdf0e10cSrcweir ~ImplWheelWindow(); 84cdf0e10cSrcweir 85cdf0e10cSrcweir void ImplStop(); 86cdf0e10cSrcweir void ImplSetWheelMode( sal_uLong nWheelMode ); ImplGetWheelMode() const87cdf0e10cSrcweir sal_uLong ImplGetWheelMode() const { return mnWheelMode; } 88cdf0e10cSrcweir }; 89