animate.h

Clase wxAnimationCtrl

Este es un control estático que muestra una animación.

Jerarquía:

Jerarquía de la clase wxAnimationCtrl

La API de wxAnimationCtrl es lo más simple posible y no dará un control total sobre la animación; si se necesita utilizar wxMediaCtrl.

Este control es útil para mostrar una (pequeña) animación mientras se realiza una tarea larga (por ejemplo, un «throbber»).

Solo está disponible si wxUSE_ANIMATIONCTRL está a 1 (por defecto).

Para las plataformas donde este control tiene una implementación nativa, puede que solo tenga soporte limitado para los tipos de animación, ver wxGenericAnimationCtrl si se necesita soporte para todos ellos.

Estilos

Esta clase soporta los siguientes estilos:

wxAC_DEFAULT_STYLE
El estilo por defecto: wxBORDER_NONE.
wxAC_NO_AUTORESIZE
Por defecto, el control ajustará su tamaño exactamente al tamaño de la animación cuando se llame a SetAnimation. Si se indica esta bandera de estilo, el control no cambiará su tamaño.

Funciones miembro

wxAnimationCtrl()

wxAnimationCtrl::wxAnimationCtrl( wxWindow * parent, wxWindowID id, const wxAnimation & anim = wxNullAnimation, const wxPoint & pos = wxDefaultPosition, const wxSize & size = wxDefaultSize, long style = wxAC_DEFAULT_STYLE, const wxString & name = wxAnimationCtrlNameStr )

Inicializa el objeto y llama a Create() con todos los parámetros.

Create()

bool wxAnimationCtrl::Create( wxWindow * parent, wxWindowID id, const wxAnimation & anim = wxNullAnimation, const wxPoint & pos = wxDefaultPosition, const wxSize & size = wxDefaultSize, long style = wxAC_DEFAULT_STYLE, const wxString & name = wxAnimationCtrlNameStr )

Crea el control con la animación dada.

Después de la creación del control se debe llamar explícitamente a Play() para comenzar a reproducir la animación. Hasta que no se llame a esa función, se mostrará el primer fotograma de la animación.

Parámetros
parent
Ventana padre, debe ser no NULL.
id
El identificador del control.
anim
La animación inicial mostrada en el control.
pos
Posición inicial.
size
Tamaño inicial.
style
El estilo de la ventana, ver wxAC_* flags.
name
Nombre del control.
Devuelve

true si el control fue creado con éxito o false si la creación falló.

CreateAnimation()

wxAnimation wxAnimationCtrl::CreateAnimation() const

Crea un nuevo objeto de animación compatible con este control.

Un objeto wxAnimation creado usando esta función es siempre compatible con controles de este tipo, ver wxAnimation::IsCompatibleWith().

CreateCompatibleAnimation()

static wxAnimation wxAnimationCtrl::CreateCompatibleAnimation()

Crea un nuevo objeto de animación compatible con este control.

Este método hace lo mismo que CreateAnimation() pero es estático, es decir, puede ser llamado sin crear ningún objeto wxAnimationCtrl.

GetAnimation()

virtual wxAnimation wxAnimationCtrl::GetAnimation() const

Devuelve la animación asociada con este control.

GetInactiveBitmap()

wxBitmap wxAnimationCtrl::GetInactiveBitmap() const

Devuelve el bitmap inactivo que se muestra en este control cuando el control esté inactivo. Ver SetInactiveBitmap() para más información.

IsPlaying()

virtual bool wxAnimationCtrl::IsPlaying() const

Devuelve true si la animación se está ejecutando.

Load()

virtual bool wxAnimationCtrl::Load( wxInputStream & file, wxAnimationType animType = wxANIMATION_TYPE_ANY )

Carga la animación desde el flujo dado y llama a SetAnimation().

Ver wxAnimation::Load() para más información.

LoadFile()

virtual bool wxAnimationCtrl::LoadFile( const wxString & file, wxAnimationType animType = wxANIMATION_TYPE_ANY )

Carga la animación desde el archivo dado y llama a SetAnimation().

Ver wxAnimation::LoadFile() para más información.

Play()

virtual bool wxAnimationCtrl::Play()

Inicia la reproducción de la animación.

La animación siempre se reproduce en modo bucle (a menos que el último fotograma de la animación tenga un tiempo de retardo infinito) y siempre comienza desde el primer fotograma, incluso si se detuvo mientras se mostraba algún otro fotograma.

SetAnimation()

virtual void wxAnimationCtrl::SetAnimation(const wxAnimation & anim)

Establece la animación a reproducir en este control.

Si se está reproduciendo la animación anterior, se detiene con Stop(). Hasta que no se llame a Play(), se mostrará una imagen estática, el primer fotograma de la animación dada o el color de fondo (ver SetInactiveBitmap() para más información).

SetInactiveBitmap()

virtual void wxAnimationCtrl::SetInactiveBitmap(const wxBitmapBundle & bmp)

Establece el mapa de bits que se mostrará en el control cuando no esté reproduciendo una animación.

Si establece como bitmap inactivo wxNullBitmap (que es el predeterminado), entonces se mostrará en su lugar el primer fotograma de la animación cuando el control esté inactivo; en este caso, si no hay ninguna animación válida asociada al control (véase SetAnimation()), entonces se mostrará el color de fondo de la ventana.

Si el control no está reproduciendo la animación, el bitmap dado se mostrará inmediatamente, en caso contrario se mostrará en cuanto se llame a Stop().

Hay que tener en cuenta que el mapa de bits inactivo, si es más pequeño que el tamaño del control, se centrará en el control; si es más grande, se escalará para ajustarse a él.

Stop()

virtual void wxAnimationCtrl::Stop()

Detiene la reproducción de la animación.

El control mostrará el primer fotograma de la animación, una imagen estática personalizada o el color de fondo de la ventana especificado por la última llamada a SetInactiveBitmap().

Métodos y datos heredados

Esta clase hereda los métodos y datos miembro públicos y protegidos de wxControl, wxWindow y wxEvtHandler.