wxanimationctrlthis 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 wxmediactrl. this control is useful to display a (small) animation while doing a long task (e.g. a "throbber"). it is only available if wxuse_animationctrl is set to 1 (the default). derived from
wxcontrol include files <wx/animate.h> window styles
see also members
wxanimationctrl::wxanimationctrl
wxanimationctrl::wxanimationctrlwxanimationctrl(wxwindow *parent, wxwindowid id, const wxanimation& anim, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxac_default_style, const wxstring& name = "animationctrl") initializes the object and calls create with all the parameters.
wxanimationctrl::createbool create(wxwindow *parent, wxwindowid id, const wxanimation& anim, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxac_default_style, const wxstring& name = "animationctrl") parameters parent
id
anim
pos
size
style
name
after control creation you must explicitely call play to start to play the animation. until that function won't be called, the first frame of the animation is displayed. return value true if the control was successfully created or false if creation failed.
wxanimationctrl::getanimationwxanimation getanimation() const returns the animation associated with this control.
wxanimationctrl::getinactivebitmapwxbitmap getinactivebitmap() const returns the inactive bitmap shown in this control when the; see setinactivebitmap for more info.
wxanimationctrl::isplayingbool isplaying() const returns true if the animation is being played.
wxanimationctrl::loadfilebool loadfile(const wxstring & file, wxanimationtype animtype = wxanimation_type_any) loads the animation from the given file and calls setanimation. see wxanimation::loadfile for more info.
wxanimationctrl::playbool play() 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 stopped it while some other frame was displayed).
wxanimationctrl::setanimationvoid setanimation(const wxanimation & anim) sets the animation to play in this control. if the previous animation is being played, it's stopped. until play isn't called, a static image, the first frame of the given animation or the background colour will be shown (see setinactivebitmap for more info).
wxanimationctrl::setinactivebitmapvoid setinactivebitmap(const wxbitmap& bmp) sets the bitmap to show on the control when it's not playing an animation. if you set as inactive bitmap 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 setanimation), 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 stop 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.
wxanimationctrl::stopvoid stop() 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 setinactivebitmap call.
|