File: animatctrl.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (185 lines) | stat: -rw-r--r-- 6,493 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name:        animatctrl.tex
%% Purpose:     wxAnimationCtrl documentation
%% Author:      Francesco Montorsi
%% Created:     24-9-2006
%% RCS-ID:      $Id: animatctrl.tex 48887 2007-09-21 17:53:07Z JS $
%% Copyright:   (c) 2006 Francesco Montorsi
%% License:     wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{\class{wxAnimationCtrl}}\label{wxanimationctrl}

This is a static control which displays an animation.
wxAnimationCtrl API is simple as possible and won't give you full control on the
animation; if you need it then use \helpref{wxMediaCtrl}{wxmediactrl}.

This control is useful to display a (small) animation while doing a long task
(e.g. a "throbber").

It is only available if \texttt{wxUSE\_ANIMATIONCTRL} is set to $1$ (the default).

\wxheading{Derived from}

\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/animate.h>

\wxheading{Window styles}

\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxAC\_DEFAULT\_STYLE}}{The default style: wxNO\_BORDER.}
\twocolitem{\windowstyle{wxAC\_NO\_AUTORESIZE}}{By default, the control will adjust
its size to exactly fit to the size of the animation when \helpref{SetAnimation}{wxanimationctrlsetanimation}
is called. If this style flag is given, the control will not change its size}
\end{twocollist}

%\wxheading{Event handling}
%
%\twocolwidtha{7cm}%
%\begin{twocollist}\itemsep=0pt
%\twocolitem{{\bf EVT\_ANIMATION\_END(id, func)}}{}
%\end{twocollist}

\wxheading{See also}

\helpref{wxAnimation}{wxanimation}


\latexignore{\rtfignore{\wxheading{Members}}}

\membersection{wxAnimationCtrl::wxAnimationCtrl}\label{wxanimationctrlctor}

\func{}{wxAnimationCtrl}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxAnimation\& }{anim},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxAC\_DEFAULT\_STYLE},\rtfsp
\param{const wxString\& }{name = ``animationctrl"}}

Initializes the object and calls \helpref{Create}{wxanimationctrlcreate} with
all the parameters.


\membersection{wxAnimationCtrl::Create}\label{wxanimationctrlcreate}

\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxAnimation\& }{anim},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxAC\_DEFAULT\_STYLE},\rtfsp
\param{const wxString\& }{name = ``animationctrl"}}

\wxheading{Parameters}

\docparam{parent}{Parent window, must be non-\NULL.}

\docparam{id}{The identifier for the control.}

\docparam{anim}{The initial animation shown in the control.}

\docparam{pos}{Initial position.}

\docparam{size}{Initial size.}

\docparam{style}{The window style, see {\tt wxAC\_*} flags.}

\docparam{name}{Control name.}

After control creation you must explicitely call \helpref{Play}{wxanimationctrlplay}
to start to play the animation. Until that function won't be called, the first frame
of the animation is displayed.

\wxheading{Return value}

\true if the control was successfully created or \false if creation failed.


\membersection{wxAnimationCtrl::GetAnimation}\label{wxanimationctrlgetanimation}

\constfunc{wxAnimation}{GetAnimation}{\void}

Returns the animation associated with this control.


\membersection{wxAnimationCtrl::GetInactiveBitmap}\label{wxanimationctrlgetinactivebitmap}

\constfunc{wxBitmap}{GetInactiveBitmap}{\void}

Returns the inactive bitmap shown in this control when the;
see \helpref{SetInactiveBitmap}{wxanimationctrlsetinactivebitmap} for more info.


\membersection{wxAnimationCtrl::IsPlaying}\label{wxanimationctrlisplaying}

\constfunc{bool}{IsPlaying}{\void}

Returns \true if the animation is being played.


\membersection{wxAnimationCtrl::LoadFile}\label{wxanimationctrlloadfile}

\func{bool}{LoadFile}{\param{const wxString \&}{ file}, \param{wxAnimationType }{ animType = wxANIMATION\_TYPE\_ANY}}

Loads the animation from the given file and calls \helpref{SetAnimation}{wxanimationctrlsetanimation}.
See \helpref{wxAnimation::LoadFile}{wxanimationloadfile} for more info.


\membersection{wxAnimationCtrl::Play}\label{wxanimationctrlplay}

\func{bool}{Play}{\void}

Starts playing the animation.
The animation is always played in loop mode (unless the last frame of the animation
has an infinite delay time) and always start from the first frame
(even if you \helpref{stopped}{wxanimationctrlstop} it while some other frame was
displayed).


\membersection{wxAnimationCtrl::SetAnimation}\label{wxanimationctrlsetanimation}

\func{void}{SetAnimation}{\param{const wxAnimation \&}{ anim}}

Sets the animation to play in this control.
If the previous animation is being played, it's \helpref{Stopped}{wxanimationctrlstop}.

Until \helpref{Play}{wxanimationctrlplay} isn't called, a static image, the first
frame of the given animation or the background colour will be shown
(see \helpref{SetInactiveBitmap}{wxanimationctrlsetinactivebitmap} for more info).


\membersection{wxAnimationCtrl::SetInactiveBitmap}\label{wxanimationctrlsetinactivebitmap}

\func{void}{SetInactiveBitmap}{\param{const wxBitmap\& }{bmp}}

Sets the bitmap to show on the control when it's not playing an animation.
If you set as inactive bitmap {\tt wxNullBitmap} (which is the default), then the
first frame of the animation is instead shown when the control is inactive; in this case,
if there's no valid animation associated with the control (see \helpref{SetAnimation}{wxanimationctrlsetanimation}),
then the background colour of the window is shown.

If the control is not playing the animation, the given bitmap will be immediately
shown, otherwise it will be shown as soon as \helpref{Stop}{wxanimationctrlstop}
is called.

Note that the inactive bitmap, if smaller than the control's size, will be centered in
the control; if bigger, it will be stretched to fit it.


\membersection{wxAnimationCtrl::Stop}\label{wxanimationctrlstop}

\func{void}{Stop}{\void}

Stops playing the animation.
The control will show the first frame of the animation, a custom static image or
the window's background colour as specified by the
last \helpref{SetInactiveBitmap}{wxanimationctrlsetinactivebitmap} call.