summaryrefslogtreecommitdiff
path: root/svx/inc/svx/dialcontrol.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/inc/svx/dialcontrol.hxx')
-rw-r--r--svx/inc/svx/dialcontrol.hxx65
1 files changed, 58 insertions, 7 deletions
diff --git a/svx/inc/svx/dialcontrol.hxx b/svx/inc/svx/dialcontrol.hxx
index 8234abe797af..2e80ad289666 100644
--- a/svx/inc/svx/dialcontrol.hxx
+++ b/svx/inc/svx/dialcontrol.hxx
@@ -29,13 +29,42 @@
#include <sfx2/itemconnect.hxx>
#include "svx/svxdllapi.h"
+#include <boost/scoped_ptr.hpp>
+
class NumericField;
namespace svx {
// ============================================================================
-struct DialControl_Impl;
+class DialControlBmp : public VirtualDevice
+{
+public:
+ explicit DialControlBmp( Window& rParent );
+
+ void InitBitmap( const Size& rSize, const Font& rFont );
+ void CopyBackground( const DialControlBmp& rSrc );
+ void DrawBackground( const Size& rSize, bool bEnabled );
+ virtual void DrawBackground();
+ virtual void DrawElements( const String& rText, sal_Int32 nAngle );
+
+protected:
+ Rectangle maRect;
+ bool mbEnabled;
+
+private:
+ const Color& GetBackgroundColor() const;
+ const Color& GetTextColor() const;
+ const Color& GetScaleLineColor() const;
+ const Color& GetButtonLineColor() const;
+ const Color& GetButtonFillColor( bool bMain ) const;
+
+ void Init( const Size& rSize );
+
+ Window& mrParent;
+ long mnCenterX;
+ long mnCenterY;
+};
/** This control allows to input a rotation angle, visualized by a dial.
@@ -90,20 +119,42 @@ public:
/** Returns the current modify handler. */
const Link& GetModifyHdl() const;
-private:
+protected:
+ struct DialControl_Impl
+ {
+ ::boost::scoped_ptr<DialControlBmp> mpBmpEnabled;
+ ::boost::scoped_ptr<DialControlBmp> mpBmpDisabled;
+ ::boost::scoped_ptr<DialControlBmp> mpBmpBuffered;
+ Link maModifyHdl;
+ NumericField* mpLinkField;
+ Size maWinSize;
+ Font maWinFont;
+ sal_Int32 mnAngle;
+ sal_Int32 mnOldAngle;
+ long mnCenterX;
+ long mnCenterY;
+ bool mbNoRot;
+
+ explicit DialControl_Impl( Window& rParent );
+ void Init( const Size& rWinSize, const Font& rWinFont );
+ };
+ std::auto_ptr< DialControl_Impl > mpImpl;
+
+ virtual void HandleMouseEvent( const Point& rPos, bool bInitial );
+ virtual void HandleEscapeEvent();
+
+ void SetRotation( sal_Int32 nAngle, bool bBroadcast );
+
void Init( const Size& rWinSize, const Font& rWinFont );
void Init( const Size& rWinSize );
+
+private:
void InvalidateControl();
- void ImplSetRotation( sal_Int32 nAngle, bool bBroadcast );
void ImplSetFieldLink( const Link& rLink );
- void HandleMouseEvent( const Point& rPos, bool bInitial );
- void HandleEscapeEvent();
DECL_LINK( LinkedFieldModifyHdl, NumericField* );
-
- std::auto_ptr< DialControl_Impl > mpImpl;
};
// ============================================================================