1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: animatctrl.tex
3 %% Purpose: wxAnimationCtrl documentation
4 %% Author: Francesco Montorsi
7 %% Copyright: (c) 2006 Francesco Montorsi
8 %% License: wxWindows license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{\class{wxAnimationCtrl
}}\label{wxanimationctrl
}
13 This is a static control which displays an animation.
14 wxAnimationCtrl API is simple as possible and won't give you full control on the
15 animation; if you need it then use
\helpref{wxMediaCtrl
}{wxmediactrl
}.
17 This control is useful to display a (small) animation while doing a long task
20 It is only available if
\texttt{wxUSE
\_ANIMATIONCTRL} is set to $
1$ (the default).
22 \wxheading{Derived from
}
24 \helpref{wxControl
}{wxcontrol
}\\
25 \helpref{wxWindow
}{wxwindow
}\\
26 \helpref{wxEvtHandler
}{wxevthandler
}\\
27 \helpref{wxObject
}{wxobject
}
29 \wxheading{Include files
}
33 \wxheading{Window styles
}
36 \begin{twocollist
}\itemsep=
0pt
37 \twocolitem{\windowstyle{wxAC
\_DEFAULT\_STYLE}}{The default style: wxNO
\_BORDER.
}
38 \twocolitem{\windowstyle{wxAC
\_NO\_AUTORESIZE}}{By default, the control will adjust
39 its size to exactly fit to the size of the animation when
\helpref{SetAnimation
}{wxanimationctrlsetanimation
}
40 is called. If this style flag is given, the control will not change its size
}
43 %\wxheading{Event handling}
46 %\begin{twocollist}\itemsep=0pt
47 %\twocolitem{{\bf EVT\_ANIMATION\_END(id, func)}}{}
52 \helpref{wxAnimation
}{wxanimation
}
55 \latexignore{\rtfignore{\wxheading{Members
}}}
57 \membersection{wxAnimationCtrl::wxAnimationCtrl
}\label{wxanimationctrl
}
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"
}}
67 Initializes the object and calls
\helpref{Create
}{wxanimationctrlcreate
} with
71 \membersection{wxAnimationCtrl::Create
}\label{wxanimationctrlcreate
}
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"
}}
81 \wxheading{Parameters
}
83 \docparam{parent
}{Parent window, must not be non-
\texttt{NULL
}.
}
85 \docparam{id
}{The identifier for the control.
}
87 \docparam{anim
}{The initial animation shown in the control.
}
89 \docparam{pos
}{Initial position.
}
91 \docparam{size
}{Initial size.
}
93 \docparam{style
}{The window style, see
{\tt wxAC
\_*
} flags.
}
95 \docparam{name
}{Control name.
}
97 After control creation you must explicitely call
\helpref{Play
}{wxanimationctrlplay
}
98 to start to play the animation. Until that function won't be called, the first frame
99 of the animation is displayed.
101 \wxheading{Return value
}
103 \true if the control was successfully created or
\false if creation failed.
106 \membersection{wxAnimationCtrl::GetAnimation
}\label{wxanimationctrlgetanimation
}
108 \constfunc{wxAnimation
}{GetAnimation
}{\void}
110 Returns the animation associated with this control.
113 \membersection{wxAnimationCtrl::IsPlaying
}\label{wxanimationctrlisplaying
}
115 \constfunc{bool
}{IsPlaying
}{\void}
117 Returns
\true if the animation is being played.
120 \membersection{wxAnimationCtrl::LoadFile
}\label{wxanimationctrlloadfile
}
122 \func{bool
}{LoadFile
}{\param{const wxString \&
}{ file
},
\param{wxAnimationType
}{ animType = wxANIMATION
\_TYPE\_ANY}}
124 Loads the animation from the given file and calls
\helpref{SetAnimation
}{wxanimationctrlsetanimation
}.
125 See
\helpref{wxAnimation::LoadFile
}{wxanimationloadfile
} for more info.
128 \membersection{wxAnimationCtrl::Play
}\label{wxanimationctrlplay
}
130 \func{bool
}{Play
}{\void}
132 Starts playing the animation.
133 The animation is always played in loop mode (unless the last frame of the animation
134 has an infinite delay time) and always start from the first frame
135 (even if you
\helpref{atopped
}{wxanimationctrlstop
} it while some other frame was
139 \membersection{wxAnimationCtrl::SetAnimation
}\label{wxanimationctrlsetanimation
}
141 \func{void
}{SetAnimation
}{\param{const wxAnimation \&
}{ anim
}}
143 Sets the animation to play in this control.
144 If the previous animation is being played, it's
\helpref{Stopped
}{wxanimationctrlstop
}.
146 Until
\helpref{Play
}{wxanimationctrlplay
} isn't called, the first frame
147 of the animation is displayed.
149 If
{\tt wxNullAnimation
} is given as animation, the control will be cleared to display
150 the background colour (see
\helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}).
153 \membersection{wxAnimationCtrl::Stop
}\label{wxanimationctrlstop
}
155 \func{void
}{Stop
}{\void}
157 Stops playing the animation.
158 The control will show the last frame rendered of the current animation until
\helpref{Play
}{wxanimationctrlplay
} is called.