diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-09-10 08:33:24 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-09-15 15:34:15 +0200 |
commit | 47a77d7dbc427e51421e2df8d59695834cb74980 (patch) | |
tree | 2c01a8d974bde307b2c1d1754c45716720ac8e7b /include | |
parent | b44a8ddc26aa5010112a5bf1d93fcc99350b37f4 (diff) |
Ruler: disable snapping, tooltips
It is now possible to disable snapping of the ruler at dragging
with holding the ALT key and coarse snapping with ALT+SHIFT key.
Tooltips are shown when hovering over indents and borders.
Change-Id: Ib1e9639e1e2824f2a75b5abd35765bbbd02c87f7
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/ruler.hxx | 43 | ||||
-rw-r--r-- | include/svx/ruler.hxx | 7 |
2 files changed, 35 insertions, 15 deletions
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx index 77cc9583fa9d..9382cb0fa2db 100644 --- a/include/svtools/ruler.hxx +++ b/include/svtools/ruler.hxx @@ -474,16 +474,11 @@ Tips zur Benutzung des Lineals: *************************************************************************/ -// ----------- // - WinBits - -// ----------- - -#define WB_EXTRAFIELD ((WinBits)0x00004000) -#define WB_RIGHT_ALIGNED ((WinBits)0x00008000) -#define WB_STDRULER WB_HORZ - -struct ImplRulerHitTest; +#define WB_EXTRAFIELD ((WinBits)0x00004000) +#define WB_RIGHT_ALIGNED ((WinBits)0x00008000) +#define WB_STDRULER WB_HORZ // - Ruler-Type - @@ -541,7 +536,7 @@ struct RulerBorder struct RulerIndent { - long nPos; + long nPos; sal_uInt16 nStyle; }; @@ -572,6 +567,21 @@ struct RulerLine sal_uInt16 nStyle; }; +struct RulerSelection +{ + long nPos; + RulerType eType; + sal_uInt16 nAryPos; + sal_uInt16 mnDragSize; + bool bSize; + bool bSizeBar; + bool bExpandTest; + + RulerSelection() : + bExpandTest( false ) + {} +}; + struct RulerUnitData { MapUnit eMapUnit; // MAP_UNIT for calculaion @@ -635,6 +645,9 @@ private: sal_Bool mbAutoWinWidth; sal_Bool mbActive; sal_uInt8 mnUpdateFlags; + + RulerSelection maHoverSelection; + Link maStartDragHdl; Link maDragHdl; Link maEndDragHdl; @@ -642,8 +655,8 @@ private: Link maDoubleClickHdl; Link maExtraDownHdl; - boost::scoped_ptr<ImplRulerHitTest> mpCurrentHitTest; - boost::scoped_ptr<ImplRulerHitTest> mpPreviousHitTest; + boost::scoped_ptr<RulerSelection> mpCurrentHitTest; + boost::scoped_ptr<RulerSelection> mpPreviousHitTest; SVT_DLLPRIVATE void ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 ); SVT_DLLPRIVATE void ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 ); @@ -669,11 +682,11 @@ private: using Window::ImplHitTest; SVT_DLLPRIVATE sal_Bool ImplHitTest( const Point& rPosition, - ImplRulerHitTest* pHitTest, + RulerSelection* pHitTest, sal_Bool bRequiredStyle = sal_False, sal_uInt16 nRequiredStyle = 0 ) const; - SVT_DLLPRIVATE sal_Bool ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const; - SVT_DLLPRIVATE sal_Bool ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier ); + SVT_DLLPRIVATE sal_Bool ImplDocHitTest( const Point& rPos, RulerType eDragType, RulerSelection* pHitTest ) const; + SVT_DLLPRIVATE sal_Bool ImplStartDrag( RulerSelection* pHitTest, sal_uInt16 nModifier ); SVT_DLLPRIVATE void ImplDrag( const Point& rPos ); SVT_DLLPRIVATE void ImplEndDrag(); @@ -751,6 +764,8 @@ public: RulerType GetClickType() const { return meDragType; } sal_uInt16 GetClickAryPos() const { return mnDragAryPos; } + RulerSelection GetHoverSelection() const { return maHoverSelection; } + using Window::GetType; RulerType GetType( const Point& rPos, sal_uInt16* pAryPos = NULL ) const; diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx index 1044c8922987..55dea876a22e 100644 --- a/include/svx/ruler.hxx +++ b/include/svx/ruler.hxx @@ -101,6 +101,9 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener sal_Bool bListening; sal_Bool bActive; + bool mbCoarseSnapping; + bool mbSnapping; + void StartListening_Impl(); long GetCorrectedDragPos(sal_Bool bLeft = sal_True, sal_Bool bRight = sal_True ); void DrawLine_Impl(long &lTabPos, int, sal_Bool Horizontal=sal_True); @@ -135,7 +138,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener void UpdateObject(); // Convert position to stick to ruler ticks - long MakePositionSticky(long rValue, bool aSnapToFrameMargin = true) const; + long MakePositionSticky(long rValue, long aPointOfReference, bool aSnapToFrameMargin = true) const; long PixelHAdjust(long lPos, long lPos2) const; long PixelVAdjust(long lPos, long lPos2) const; @@ -157,6 +160,8 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener long ConvertPosLogic(long lPos) const; long ConvertSizeLogic(long lSize) const; + long RoundToCurrentMapMode(long lValue) const; + long GetFirstLineIndent() const; long GetLeftIndent() const; long GetRightIndent() const; |