]>
Commit | Line | Data |
---|---|---|
8e08b761 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: No names yet. | |
3 | // Purpose: Contrib. demo | |
4 | // Author: Aleksandras Gluchovas | |
5 | // Modified by: | |
6 | // Created: 9/11/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Aleksandras Gluchovas | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __HINTANIMPL_G__ | |
13 | #define __HINTANIMPL_G__ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "hintanimpl.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/fl/controlbar.h" | |
20 | ||
21 | #include "wx/timer.h" | |
22 | ||
23 | class cbHintAnimTimer; | |
24 | ||
25 | class cbHintAnimationPlugin : public cbPluginBase | |
26 | { | |
27 | DECLARE_DYNAMIC_CLASS( cbHintAnimationPlugin ) | |
28 | protected: | |
29 | friend class cbHintAnimTimer; | |
30 | ||
31 | wxScreenDC* mpScrDc; // created while tracking hint-rect | |
32 | cbHintAnimTimer* mpAnimTimer; | |
33 | ||
34 | // FOR NOW:: try it without mutually exculisve locks | |
35 | volatile wxRect mCurRect; | |
36 | ||
37 | // state variables | |
38 | ||
39 | bool mAnimStarted; | |
40 | bool mStopPending; | |
41 | ||
42 | bool mPrevInClient; | |
43 | bool mCurInClient; | |
44 | ||
45 | wxRect mPrevRect; | |
46 | ||
47 | public: | |
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) | |
51 | ||
52 | int mInClientHintBorder; // default: 4 pixels | |
53 | ||
54 | bool mAccelerationOn; // TRUE, if morph accelerates, otherwise morph | |
55 | // speed is constant. Default: TRUE | |
56 | ||
57 | // TBD:: get/set methods for above members | |
58 | ||
59 | protected: | |
60 | void StartTracking(); | |
61 | ||
62 | void DrawHintRect ( wxRect& rect, bool isInClientRect); | |
63 | void EraseHintRect( wxRect& rect, bool isInClientRect); | |
64 | ||
65 | void FinishTracking(); | |
66 | ||
67 | void DoDrawHintRect( wxRect& rect, bool isInClientRect); | |
68 | ||
69 | void RectToScr( wxRect& frameRect, wxRect& scrRect ); | |
70 | ||
71 | public: | |
72 | cbHintAnimationPlugin(void); | |
73 | ||
74 | ~cbHintAnimationPlugin(); | |
75 | ||
76 | cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); | |
77 | ||
78 | void OnDrawHintRect( cbDrawHintRectEvent& event ); | |
79 | ||
80 | DECLARE_EVENT_TABLE() | |
81 | }; | |
82 | ||
83 | ||
84 | // helper classes | |
85 | ||
86 | struct MorphInfoT | |
87 | { | |
88 | wxPoint mFrom; | |
89 | wxPoint mTill; | |
90 | }; | |
91 | ||
92 | class cbHintAnimTimer : public wxTimer | |
93 | { | |
94 | protected: | |
95 | ||
96 | friend class cbHintAnimationPlugin; | |
97 | ||
98 | wxRect mPrevMorphed; | |
99 | ||
100 | MorphInfoT mUpperLeft; | |
101 | MorphInfoT mLowerRight; | |
102 | int mCurIter; | |
103 | ||
104 | long mLock; | |
105 | ||
106 | cbHintAnimationPlugin* mpPl; | |
107 | ||
108 | void MorphPoint( wxPoint& origin, MorphInfoT& info, wxPoint& point ); | |
109 | ||
110 | public: | |
111 | ||
112 | cbHintAnimTimer(void); | |
113 | ||
114 | virtual void Notify(void); | |
115 | ||
116 | virtual bool Init( cbHintAnimationPlugin* pAnimPl, bool reinit ); | |
117 | }; | |
118 | ||
119 | #endif /* __HINTANIMPL_G__ */ | |
120 |