]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/fl/hintanimpl.h
implement wxColourDialog::Move() (patch 548048)
[wxWidgets.git] / contrib / include / wx / fl / hintanimpl.h
CommitLineData
8e08b761 1/////////////////////////////////////////////////////////////////////////////
4cbc57f0
JS
2// Name: hintanimpl.h
3// Purpose: Header for cbHintAnimationPlugin class.
8e08b761
JS
4// Author: Aleksandras Gluchovas
5// Modified by:
6// Created: 9/11/98
7// RCS-ID: $Id$
8// Copyright: (c) Aleksandras Gluchovas
4cbc57f0 9// Licence: wxWindows licence
8e08b761
JS
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
23class cbHintAnimTimer;
24
4cbc57f0
JS
25/*
26A plugin to draw animated hints when the user drags a pane.
27*/
28
8e08b761
JS
29class cbHintAnimationPlugin : public cbPluginBase
30{
4cbc57f0 31 DECLARE_DYNAMIC_CLASS( cbHintAnimationPlugin )
8e08b761 32protected:
4cbc57f0 33 friend class cbHintAnimTimer;
8e08b761 34
4cbc57f0
JS
35 wxScreenDC* mpScrDc; // created while tracking hint-rect
36 cbHintAnimTimer* mpAnimTimer;
8e08b761 37
4cbc57f0
JS
38 // FOR NOW:: try it without mutually exculisve locks
39 volatile wxRect mCurRect;
8e08b761 40
4cbc57f0 41 // state variables
8e08b761 42
4cbc57f0
JS
43 bool mAnimStarted;
44 bool mStopPending;
8e08b761 45
4cbc57f0
JS
46 bool mPrevInClient;
47 bool mCurInClient;
8e08b761 48
4cbc57f0 49 wxRect mPrevRect;
8e08b761
JS
50
51public:
4cbc57f0
JS
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)
8e08b761 55
4cbc57f0 56 int mInClientHintBorder; // default: 4 pixels
8e08b761 57
4cbc57f0
JS
58 bool mAccelerationOn; // TRUE, if morph accelerates, otherwise morph
59 // speed is constant. Default: TRUE
8e08b761 60
4cbc57f0 61 // TBD:: get/set methods for above members
8e08b761
JS
62
63protected:
8e08b761 64
4cbc57f0
JS
65 // Internal function for starting tracking.
66 void StartTracking();
67
68 // Internal function for drawing a hint rectangle.
69 void DrawHintRect ( wxRect& rect, bool isInClientRect);
8e08b761 70
4cbc57f0
JS
71 // Internal function for erasing a hint rectangle.
72 void EraseHintRect( wxRect& rect, bool isInClientRect);
8e08b761 73
4cbc57f0
JS
74 // Internal function for finishing tracking.
75 void FinishTracking();
8e08b761 76
4cbc57f0
JS
77 // Internal function for drawing a hint rectangle.
78 void DoDrawHintRect( wxRect& rect, bool isInClientRect);
79
80 // Internal function for translating coordinates.
81 void RectToScr( wxRect& frameRect, wxRect& scrRect );
8e08b761
JS
82
83public:
4cbc57f0
JS
84 // Default constructor.
85 cbHintAnimationPlugin();
8e08b761 86
4cbc57f0
JS
87 // Constructor, taking a layout panel and pane mask.
88 cbHintAnimationPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES );
8e08b761 89
4cbc57f0
JS
90 // Destructor.
91 ~cbHintAnimationPlugin();
8e08b761 92
4cbc57f0
JS
93 // Event handler respoding to hint draw events.
94 void OnDrawHintRect( cbDrawHintRectEvent& event );
8e08b761 95
4cbc57f0 96 DECLARE_EVENT_TABLE()
8e08b761
JS
97};
98
99
4cbc57f0
JS
100/*
101A private helper class.
102*/
8e08b761
JS
103
104struct MorphInfoT
105{
4cbc57f0
JS
106 wxPoint mFrom;
107 wxPoint mTill;
8e08b761
JS
108};
109
4cbc57f0
JS
110/*
111A private helper class.
112*/
113
8e08b761
JS
114class cbHintAnimTimer : public wxTimer
115{
116protected:
117
4cbc57f0 118 friend class cbHintAnimationPlugin;
8e08b761 119
4cbc57f0 120 wxRect mPrevMorphed;
8e08b761 121
4cbc57f0
JS
122 MorphInfoT mUpperLeft;
123 MorphInfoT mLowerRight;
124 int mCurIter;
8e08b761 125
4cbc57f0 126 long mLock;
8e08b761 127
4cbc57f0 128 cbHintAnimationPlugin* mpPl;
8e08b761 129
4cbc57f0 130 void MorphPoint( wxPoint& origin, MorphInfoT& info, wxPoint& point );
8e08b761
JS
131
132public:
133
4cbc57f0 134 cbHintAnimTimer(void);
8e08b761 135
4cbc57f0 136 virtual void Notify(void);
8e08b761 137
4cbc57f0 138 virtual bool Init( cbHintAnimationPlugin* pAnimPl, bool reinit );
8e08b761
JS
139};
140
141#endif /* __HINTANIMPL_G__ */
142