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/svtools | |
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/svtools')
-rw-r--r-- | include/svtools/ruler.hxx | 43 |
1 files changed, 29 insertions, 14 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; |