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