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 23 24 #ifndef SC_PRIVSPLT_HXX 25 #define SC_PRIVSPLT_HXX 26 27 #include <vcl/ctrl.hxx> 28 29 enum SC_SPLIT_DIRECTION {SC_SPLIT_HORZ,SC_SPLIT_VERT }; 30 31 class ScPrivatSplit : public Control 32 { 33 private: 34 35 Link aCtrModifiedLink; 36 sal_Bool aMovingFlag; 37 Pointer aWinPointer; 38 SC_SPLIT_DIRECTION eScSplit; 39 short nOldX; 40 short nOldY; 41 short nNewX; 42 short nNewY; 43 short nMinPos; 44 short nMaxPos; 45 Range aXMovingRange; 46 Range aYMovingRange; 47 short nDeltaX; 48 short nDeltaY; 49 50 using Control::ImplInitSettings; 51 void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); 52 53 54 55 protected: 56 virtual void MouseMove( const MouseEvent& rMEvt ); 57 virtual void MouseButtonDown( const MouseEvent& rMEvt ); 58 virtual void MouseButtonUp( const MouseEvent& rMEvt); 59 60 public: 61 62 ScPrivatSplit( Window* pWindow, const ResId& rResId, 63 SC_SPLIT_DIRECTION eScSplit); 64 65 virtual short GetDeltaX(); 66 virtual short GetDeltaY(); 67 68 virtual void CtrModified(); 69 70 void SetYRange(Range cRgeY); 71 72 void MoveSplitTo(Point aPos); 73 74 virtual void StateChanged( StateChangedType nType ); 75 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 76 SetCtrModifiedHdl(const Link & rLink)77 void SetCtrModifiedHdl( const Link& rLink ) { aCtrModifiedLink = rLink; } GetCtrModifiedHdl() const78 const Link& GetCtrModifiedHdl() const { return aCtrModifiedLink; } 79 }; 80 81 82 #endif 83