]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/animatctrl.tex
Ref counting overview.
[wxWidgets.git] / docs / latex / wx / animatctrl.tex
CommitLineData
72045d57
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: animatctrl.tex
3%% Purpose: wxAnimationCtrl documentation
4%% Author: Francesco Montorsi
5%% Created: 24-9-2006
6%% RCS-ID: $Id$
7%% Copyright: (c) 2006 Francesco Montorsi
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11\section{\class{wxAnimationCtrl}}\label{wxanimationctrl}
12
13This is a static control which displays an animation.
14wxAnimationCtrl API is simple as possible and won't give you full control on the
15animation; if you need it then use \helpref{wxMediaCtrl}{wxmediactrl}.
16
17This control is useful to display a (small) animation while doing a long task
18(e.g. a "throbber").
19
20It is only available if \texttt{wxUSE\_ANIMATIONCTRL} is set to $1$ (the default).
21
22\wxheading{Derived from}
23
24\helpref{wxControl}{wxcontrol}\\
25\helpref{wxWindow}{wxwindow}\\
26\helpref{wxEvtHandler}{wxevthandler}\\
27\helpref{wxObject}{wxobject}
28
29\wxheading{Include files}
30
31<wx/animate.h>
32
33\wxheading{Window styles}
34
35\twocolwidtha{5cm}%
36\begin{twocollist}\itemsep=0pt
c2f12218
PC
37\twocolitem{\windowstyle{wxAC\_DEFAULT\_STYLE}}{The default style: wxNO\_BORDER.}
38\twocolitem{\windowstyle{wxAC\_NO\_AUTORESIZE}}{By default, the control will adjust
72045d57
VZ
39its size to exactly fit to the size of the animation when \helpref{SetAnimation}{wxanimationctrlsetanimation}
40is called. If this style flag is given, the control will not change its size}
41\end{twocollist}
42
43%\wxheading{Event handling}
44%
45%\twocolwidtha{7cm}%
46%\begin{twocollist}\itemsep=0pt
47%\twocolitem{{\bf EVT\_ANIMATION\_END(id, func)}}{}
48%\end{twocollist}
49
50\wxheading{See also}
51
52\helpref{wxAnimation}{wxanimation}
53
54
55\latexignore{\rtfignore{\wxheading{Members}}}
56
57\membersection{wxAnimationCtrl::wxAnimationCtrl}\label{wxanimationctrl}
58
59\func{}{wxAnimationCtrl}{\param{wxWindow *}{parent},\rtfsp
60\param{wxWindowID}{ id},\rtfsp
61\param{const wxAnimation\& }{anim},\rtfsp
62\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
63\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
64\param{long}{ style = wxAC\_DEFAULT\_STYLE},\rtfsp
65\param{const wxString\& }{name = ``animationctrl"}}
66
67Initializes the object and calls \helpref{Create}{wxanimationctrlcreate} with
68all the parameters.
69
70
71\membersection{wxAnimationCtrl::Create}\label{wxanimationctrlcreate}
72
73\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
74\param{wxWindowID}{ id},\rtfsp
75\param{const wxAnimation\& }{anim},\rtfsp
76\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
77\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
78\param{long}{ style = wxAC\_DEFAULT\_STYLE},\rtfsp
79\param{const wxString\& }{name = ``animationctrl"}}
80
81\wxheading{Parameters}
82
83\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
84
85\docparam{id}{The identifier for the control.}
86
87\docparam{anim}{The initial animation shown in the control.}
88
89\docparam{pos}{Initial position.}
90
91\docparam{size}{Initial size.}
92
93\docparam{style}{The window style, see {\tt wxAC\_*} flags.}
94
95\docparam{name}{Control name.}
96
97After control creation you must explicitely call \helpref{Play}{wxanimationctrlplay}
98to start to play the animation. Until that function won't be called, the first frame
99of the animation is displayed.
100
101\wxheading{Return value}
102
103\true if the control was successfully created or \false if creation failed.
104
105
106\membersection{wxAnimationCtrl::GetAnimation}\label{wxanimationctrlgetanimation}
107
108\constfunc{wxAnimation}{GetAnimation}{\void}
109
110Returns the animation associated with this control.
111
112
113\membersection{wxAnimationCtrl::IsPlaying}\label{wxanimationctrlisplaying}
114
115\constfunc{bool}{IsPlaying}{\void}
116
117Returns \true if the animation is being played.
118
119
120\membersection{wxAnimationCtrl::LoadFile}\label{wxanimationctrlloadfile}
121
122\func{bool}{LoadFile}{\param{const wxString \&}{ file}, \param{wxAnimationType }{ animType = wxANIMATION\_TYPE\_ANY}}
123
124Loads the animation from the given file and calls \helpref{SetAnimation}{wxanimationctrlsetanimation}.
125See \helpref{wxAnimation::LoadFile}{wxanimationloadfile} for more info.
126
127
128\membersection{wxAnimationCtrl::Play}\label{wxanimationctrlplay}
129
130\func{bool}{Play}{\void}
131
132Starts playing the animation.
133The animation is always played in loop mode (unless the last frame of the animation
134has an infinite delay time) and always start from the first frame
135(even if you \helpref{atopped}{wxanimationctrlstop} it while some other frame was
136displayed).
137
138
139\membersection{wxAnimationCtrl::SetAnimation}\label{wxanimationctrlsetanimation}
140
141\func{void}{SetAnimation}{\param{const wxAnimation \&}{ anim}}
142
143Sets the animation to play in this control.
144If the previous animation is being played, it's \helpref{Stopped}{wxanimationctrlstop}.
145
146Until \helpref{Play}{wxanimationctrlplay} isn't called, the first frame
147of the animation is displayed.
148
149If {\tt wxNullAnimation} is given as animation, the control will be cleared to display
150the background colour (see \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour}).
151
152
153\membersection{wxAnimationCtrl::Stop}\label{wxanimationctrlstop}
154
155\func{void}{Stop}{\void}
156
157Stops playing the animation.
b67a86d5
JS
158The control will show the last frame rendered of the current animation until \helpref{Play}{wxanimationctrlplay} is called.
159