# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This is a static control which displays an animation. # {Wx::AnimationCtrl} API is as simple as possible and won't give you full control on the animation; if you need it then use {Wx::MediaCtrl}. # This control is useful to display a (small) animation while doing a long task (e.g. a "throbber"). # It is only available if {Wx::Setup::USE_ANIMATIONCTRL} is set to 1 (the default). # For the platforms where this control has a native implementation, it may have only limited support for the animation types, see {Wx::GenericAnimationCtrl} if you need to support all of them. # === Styles # # This class supports the following styles: # # - {Wx::AC_DEFAULT_STYLE}: The default style: {Wx::Border::BORDER_NONE}. # - {Wx::AC_NO_AUTORESIZE}: By default, the control will adjust its size to exactly fit to the size of the animation when SetAnimation is called. If this style flag is given, the control will not change its size # # === # # Category: {Wx::Controls} # Implementations: native under {Wx::GTK}, {Wx::MSW} ports; a generic implementation is used elsewhere. #
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# @see Wx::Animation # @see Animation Sample # # class AnimationCtrl < Control # Initializes the object and calls {Wx::AnimationCtrl#create} with all the parameters. # @param parent [Wx::Window] # @param id [Integer] # @param anim [Wx::Animation] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param name [String] # @return [AnimationCtrl] def initialize(parent, id, anim=Wx::NULL_ANIMATION, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::AC_DEFAULT_STYLE, name=Wx::ANIMATION_CTRL_NAME_STR) end # Creates the control with the given anim animation. # After control creation you must explicitly call {Wx::AnimationCtrl#play} to start to play the animation. Until that function won't be called, the first frame of the animation is displayed. # # true if the control was successfully created or false if creation failed. # @param parent [Wx::Window] Parent window, must be non-NULL. # @param id [Integer] The identifier for the control. # @param anim [Wx::Animation] The initial animation shown in the control. # @param pos [Array(Integer, Integer), Wx::Point] Initial position. # @param size [Array(Integer, Integer), Wx::Size] Initial size. # @param style [Integer] The window style, see {Wx::AC_}* flags. # @param name [String] Control name. # @return [true,false] def create(parent, id, anim=Wx::NULL_ANIMATION, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::AC_DEFAULT_STYLE, name=Wx::ANIMATION_CTRL_NAME_STR) end # Create a new animation object compatible with this control. # A {Wx::Animation} object created using this function is always compatible with controls of this type, see {Wx::Animation#is_compatible_with}. # @see Wx::AnimationCtrl.create_compatible_animation # @return [Wx::Animation] def create_animation; end # Returns the animation associated with this control. # @return [Wx::Animation] def get_animation; end alias_method :animation, :get_animation # Returns the inactive bitmap shown in this control when the; see {Wx::AnimationCtrl#set_inactive_bitmap} for more info. # @return [Wx::Bitmap] def get_inactive_bitmap; end alias_method :inactive_bitmap, :get_inactive_bitmap # Returns true if the animation is being played. # @return [true,false] def is_playing; end alias_method :playing?, :is_playing # Loads the animation from the given file and calls {Wx::AnimationCtrl#set_animation}. # See {Wx::Animation#load_file} for more info. # @param file [String] # @param animType [AnimationType] # @return [true,false] def load_file(file, animType=Wx::ANIMATION_TYPE_ANY) end # Loads the animation from the given stream and calls {Wx::AnimationCtrl#set_animation}. # See {Wx::Animation#load} for more info. # @param file [IO,Wx::InputStream] # @param animType [AnimationType] # @return [true,false] def load(file, animType=Wx::ANIMATION_TYPE_ANY) end # 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 {Wx::stopped} it while some other frame was displayed. # @return [true,false] def play; end # Sets the animation to play in this control. # If the previous animation is being played, it's {Wx::AnimationCtrl#stop} stopped. Until {Wx::AnimationCtrl#play} isn't called, a static image, the first frame of the given animation or the background colour will be shown (see {Wx::AnimationCtrl#set_inactive_bitmap} for more info). # @param anim [Wx::Animation] # @return [void] def set_animation(anim) end alias_method :animation=, :set_animation # Sets the bitmap to show on the control when it's not playing an animation. # If you set as inactive bitmap {Wx::NULL_BITMAP} (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 {Wx::AnimationCtrl#set_animation}), 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 {Wx::AnimationCtrl#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. # @param bmp [Wx::BitmapBundle,Wx::Bitmap,Wx::Icon,Wx::Image] # @return [void] def set_inactive_bitmap(bmp) end alias_method :inactive_bitmap=, :set_inactive_bitmap # 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 {Wx::AnimationCtrl#set_inactive_bitmap} call. # @return [void] def stop; end # Create a new animation object compatible with this control. # This method does the same thing as {Wx::AnimationCtrl#create_animation} but is static, i.e. can be called without creating any {Wx::AnimationCtrl} objects. # @return [Wx::Animation] def self.create_compatible_animation; end end # AnimationCtrl end