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 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "hintanimpl.h"
19 #include "wx/fl/controlbar.h"
23 class WXDLLIMPEXP_FL cbHintAnimTimer
;
26 A plugin to draw animated hints when the user drags a pane.
29 class WXDLLIMPEXP_FL cbHintAnimationPlugin
: public cbPluginBase
31 DECLARE_DYNAMIC_CLASS( cbHintAnimationPlugin
)
33 friend class cbHintAnimTimer
;
35 wxScreenDC
* mpScrDc
; // created while tracking hint-rect
36 cbHintAnimTimer
* mpAnimTimer
;
38 // FOR NOW:: try it without mutually exculisve locks
39 volatile wxRect mCurRect
;
52 int mMorphDelay
; // delay between frames in miliseconds, default: 20
53 int mMaxFrames
; // number of iterations for hint morphing, default: 30
54 // (morph duration = mMorphDelay * mMaxFrames msec)
56 int mInClientHintBorder
; // default: 4 pixels
58 bool mAccelerationOn
; // TRUE, if morph accelerates, otherwise morph
59 // speed is constant. Default: TRUE
61 // TBD:: get/set methods for above members
65 // Internal function for starting tracking.
68 // Internal function for drawing a hint rectangle.
69 void DrawHintRect ( wxRect
& rect
, bool isInClientRect
);
71 // Internal function for erasing a hint rectangle.
72 void EraseHintRect( wxRect
& rect
, bool isInClientRect
);
74 // Internal function for finishing tracking.
75 void FinishTracking();
77 // Internal function for drawing a hint rectangle.
78 void DoDrawHintRect( wxRect
& rect
, bool isInClientRect
);
80 // Internal function for translating coordinates.
81 void RectToScr( wxRect
& frameRect
, wxRect
& scrRect
);
84 // Default constructor.
85 cbHintAnimationPlugin();
87 // Constructor, taking a layout panel and pane mask.
88 cbHintAnimationPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
91 ~cbHintAnimationPlugin();
93 // Event handler respoding to hint draw events.
94 void OnDrawHintRect( cbDrawHintRectEvent
& event
);
101 A private helper class.
104 struct WXDLLIMPEXP_FL MorphInfoT
111 A private helper class.
114 class WXDLLIMPEXP_FL cbHintAnimTimer
: public wxTimer
118 friend class cbHintAnimationPlugin
;
122 MorphInfoT mUpperLeft
;
123 MorphInfoT mLowerRight
;
128 cbHintAnimationPlugin
* mpPl
;
130 void MorphPoint( wxPoint
& origin
, MorphInfoT
& info
, wxPoint
& point
);
134 cbHintAnimTimer(void);
136 virtual void Notify(void);
138 virtual bool Init( cbHintAnimationPlugin
* pAnimPl
, bool reinit
);
141 #endif /* __HINTANIMPL_G__ */