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
}
35 \helpref{wxAdv
}{librarieslist
}
37 \wxheading{Window styles
}
40 \begin{twocollist
}\itemsep=
0pt
41 \twocolitem{\windowstyle{wxAC
\_DEFAULT\_STYLE}}{The default style: wxBORDER
\_NONE.
}
42 \twocolitem{\windowstyle{wxAC
\_NO\_AUTORESIZE}}{By default, the control will adjust
43 its size to exactly fit to the size of the animation when
\helpref{SetAnimation
}{wxanimationctrlsetanimation
}
44 is called. If this style flag is given, the control will not change its size
}
47 %\wxheading{Event handling}
50 %\begin{twocollist}\itemsep=0pt
51 %\twocolitem{{\bf EVT\_ANIMATION\_END(id, func)}}{}
56 \helpref{wxAnimation
}{wxanimation
}
59 \latexignore{\rtfignore{\wxheading{Members
}}}
61 \membersection{wxAnimationCtrl::wxAnimationCtrl
}\label{wxanimationctrlctor
}
63 \func{}{wxAnimationCtrl
}{\param{wxWindow *
}{parent
},
\rtfsp
64 \param{wxWindowID
}{ id
},
\rtfsp
65 \param{const wxAnimation\&
}{anim
},
\rtfsp
66 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
67 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
68 \param{long
}{ style = wxAC
\_DEFAULT\_STYLE},
\rtfsp
69 \param{const wxString\&
}{name = ``animationctrl"
}}
71 Initializes the object and calls
\helpref{Create
}{wxanimationctrlcreate
} with
75 \membersection{wxAnimationCtrl::Create
}\label{wxanimationctrlcreate
}
77 \func{bool
}{Create
}{\param{wxWindow *
}{parent
},
\rtfsp
78 \param{wxWindowID
}{ id
},
\rtfsp
79 \param{const wxAnimation\&
}{anim
},
\rtfsp
80 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
81 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
82 \param{long
}{ style = wxAC
\_DEFAULT\_STYLE},
\rtfsp
83 \param{const wxString\&
}{name = ``animationctrl"
}}
85 After control creation you must explicitely call
\helpref{Play
}{wxanimationctrlplay
}
86 to start to play the animation. Until that function won't be called, the first frame
87 of the animation is displayed.
89 \wxheading{Parameters
}
91 \docparam{parent
}{Parent window, must be non-
\NULL.
}
93 \docparam{id
}{The identifier for the control.
}
95 \docparam{anim
}{The initial animation shown in the control.
}
97 \docparam{pos
}{Initial position.
}
99 \docparam{size
}{Initial size.
}
101 \docparam{style
}{The window style, see
{\tt wxAC
\_*
} flags.
}
103 \docparam{name
}{Control name.
}
106 \wxheading{Return value
}
108 \true if the control was successfully created or
\false if creation failed.
111 \membersection{wxAnimationCtrl::GetAnimation
}\label{wxanimationctrlgetanimation
}
113 \constfunc{wxAnimation
}{GetAnimation
}{\void}
115 Returns the animation associated with this control.
118 \membersection{wxAnimationCtrl::GetInactiveBitmap
}\label{wxanimationctrlgetinactivebitmap
}
120 \constfunc{wxBitmap
}{GetInactiveBitmap
}{\void}
122 Returns the inactive bitmap shown in this control when the;
123 see
\helpref{SetInactiveBitmap
}{wxanimationctrlsetinactivebitmap
} for more info.
126 \membersection{wxAnimationCtrl::IsPlaying
}\label{wxanimationctrlisplaying
}
128 \constfunc{bool
}{IsPlaying
}{\void}
130 Returns
\true if the animation is being played.
133 \membersection{wxAnimationCtrl::LoadFile
}\label{wxanimationctrlloadfile
}
135 \func{bool
}{LoadFile
}{\param{const wxString \&
}{ file
},
\param{wxAnimationType
}{ animType = wxANIMATION
\_TYPE\_ANY}}
137 Loads the animation from the given file and calls
\helpref{SetAnimation
}{wxanimationctrlsetanimation
}.
138 See
\helpref{wxAnimation::LoadFile
}{wxanimationloadfile
} for more info.
141 \membersection{wxAnimationCtrl::Play
}\label{wxanimationctrlplay
}
143 \func{bool
}{Play
}{\void}
145 Starts playing the animation.
146 The animation is always played in loop mode (unless the last frame of the animation
147 has an infinite delay time) and always start from the first frame
148 (even if you
\helpref{stopped
}{wxanimationctrlstop
} it while some other frame was
152 \membersection{wxAnimationCtrl::SetAnimation
}\label{wxanimationctrlsetanimation
}
154 \func{void
}{SetAnimation
}{\param{const wxAnimation \&
}{ anim
}}
156 Sets the animation to play in this control.
157 If the previous animation is being played, it's
\helpref{Stopped
}{wxanimationctrlstop
}.
159 Until
\helpref{Play
}{wxanimationctrlplay
} isn't called, a static image, the first
160 frame of the given animation or the background colour will be shown
161 (see
\helpref{SetInactiveBitmap
}{wxanimationctrlsetinactivebitmap
} for more info).
164 \membersection{wxAnimationCtrl::SetInactiveBitmap
}\label{wxanimationctrlsetinactivebitmap
}
166 \func{void
}{SetInactiveBitmap
}{\param{const wxBitmap\&
}{bmp
}}
168 Sets the bitmap to show on the control when it's not playing an animation.
169 If you set as inactive bitmap
{\tt wxNullBitmap
} (which is the default), then the
170 first frame of the animation is instead shown when the control is inactive; in this case,
171 if there's no valid animation associated with the control (see
\helpref{SetAnimation
}{wxanimationctrlsetanimation
}),
172 then the background colour of the window is shown.
174 If the control is not playing the animation, the given bitmap will be immediately
175 shown, otherwise it will be shown as soon as
\helpref{Stop
}{wxanimationctrlstop
}
178 Note that the inactive bitmap, if smaller than the control's size, will be centered in
179 the control; if bigger, it will be stretched to fit it.
182 \membersection{wxAnimationCtrl::Stop
}\label{wxanimationctrlstop
}
184 \func{void
}{Stop
}{\void}
186 Stops playing the animation.
187 The control will show the first frame of the animation, a custom static image or
188 the window's background colour as specified by the
189 last
\helpref{SetInactiveBitmap
}{wxanimationctrlsetinactivebitmap
} call.