1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Header for cbHintAnimationPlugin class.
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __HINTANIMPL_G__
13 #define __HINTANIMPL_G__
15 #include "wx/fl/controlbar.h"
19 class WXDLLIMPEXP_FL cbHintAnimTimer
;
22 A plugin to draw animated hints when the user drags a pane.
25 class WXDLLIMPEXP_FL cbHintAnimationPlugin
: public cbPluginBase
27 DECLARE_DYNAMIC_CLASS( cbHintAnimationPlugin
)
29 friend class cbHintAnimTimer
;
31 wxScreenDC
* mpScrDc
; // created while tracking hint-rect
32 cbHintAnimTimer
* mpAnimTimer
;
34 // FOR NOW:: try it without mutually exculisve locks
35 volatile wxRect mCurRect
;
48 int mMorphDelay
; // delay between frames in miliseconds, default: 20
49 int mMaxFrames
; // number of iterations for hint morphing, default: 30
50 // (morph duration = mMorphDelay * mMaxFrames msec)
52 int mInClientHintBorder
; // default: 4 pixels
54 bool mAccelerationOn
; // true, if morph accelerates, otherwise morph
55 // speed is constant. Default: true
57 // TBD:: get/set methods for above members
61 // Internal function for starting tracking.
64 // Internal function for drawing a hint rectangle.
65 void DrawHintRect ( wxRect
& rect
, bool isInClientRect
);
67 // Internal function for erasing a hint rectangle.
68 void EraseHintRect( wxRect
& rect
, bool isInClientRect
);
70 // Internal function for finishing tracking.
71 void FinishTracking();
73 // Internal function for drawing a hint rectangle.
74 void DoDrawHintRect( wxRect
& rect
, bool isInClientRect
);
76 // Internal function for translating coordinates.
77 void RectToScr( wxRect
& frameRect
, wxRect
& scrRect
);
80 // Default constructor.
81 cbHintAnimationPlugin();
83 // Constructor, taking a layout panel and pane mask.
84 cbHintAnimationPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
87 ~cbHintAnimationPlugin();
89 // Event handler respoding to hint draw events.
90 void OnDrawHintRect( cbDrawHintRectEvent
& event
);
97 A private helper class.
100 struct WXDLLIMPEXP_FL MorphInfoT
107 A private helper class.
110 class WXDLLIMPEXP_FL cbHintAnimTimer
: public wxTimer
114 friend class cbHintAnimationPlugin
;
118 MorphInfoT mUpperLeft
;
119 MorphInfoT mLowerRight
;
124 cbHintAnimationPlugin
* mpPl
;
126 void MorphPoint( wxPoint
& origin
, MorphInfoT
& info
, wxPoint
& point
);
130 cbHintAnimTimer(void);
132 virtual void Notify(void);
134 virtual bool Init( cbHintAnimationPlugin
* pAnimPl
, bool reinit
);
137 #endif /* __HINTANIMPL_G__ */