# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # IMAGELIST_DRAW_NORMAL = 1 # IMAGELIST_DRAW_TRANSPARENT = 2 # IMAGELIST_DRAW_SELECTED = 4 # IMAGELIST_DRAW_FOCUSED = 8 # # IMAGE_LIST_NORMAL = 0 # # IMAGE_LIST_SMALL = 1 # # IMAGE_LIST_STATE = 2 # A {Wx::ImageList} contains a list of images, which are stored in an unspecified form. # Images can use alpha channel or masks for transparent drawing, and can be made from a variety of sources including bitmaps and icons. # {Wx::ImageList} is used principally in conjunction with {Wx::TreeCtrl} and {Wx::ListCtrl} classes. # Use of this class is not recommended in the new code as it doesn't support showing DPI-dependent bitmaps. Please use {Wx::WithImages#set_images} instead of {Wx::WithImages#set_image_list}. # === # # Category: Graphics Device Interface (GDI) # @see Wx::TreeCtrl # @see Wx::ListCtrl # # class ImageList < Object # @overload initialize() # Default ctor. # @return [ImageList] # @overload initialize(width, height, mask=true, initialCount=1) # Constructor specifying the image size, whether image masks should be created, and the initial size of the list. # Note that the size is specified in logical pixels. # @see Wx::ImageList#create # @param width [Integer] Width of the images in the list. # @param height [Integer] Height of the images in the list. # @param mask [true,false] If true, all images will have masks, with the mask being created from the light grey pixels if not specified otherwise, i.e. if the image doesn't have neither alpha channel nor mask and no mask is explicitly specified when adding it. Note that if an image does have alpha channel or mask, it will always be used, whether this parameter is true or false. # @param initialCount [Integer] The initial size of the list. # @return [ImageList] def initialize(*args) end # @overload add(bitmap, mask=Wx::NULL_BITMAP) # Adds a new image or images using a bitmap and optional mask bitmap. # The logical size of the bitmap should be the same as the size specified when constructing {Wx::ImageList}. If the logical width of the bitmap is greater than the image list width, bitmap is split into smaller images of the required width. # # The new zero-based image index. # @param bitmap [Wx::Bitmap] Bitmap representing the opaque areas of the image. # @param mask [Wx::Bitmap] Monochrome mask bitmap, representing the transparent areas of the image. # @return [Integer] # @overload add(bitmap, maskColour) # Adds a new image or images using a bitmap and mask colour. # The logical size of the bitmap should be the same as the size specified when constructing {Wx::ImageList}. If the logical width of the bitmap is greater than the image list width, bitmap is split into smaller images of the required width. # # The new zero-based image index. # @param bitmap [Wx::Bitmap] Bitmap representing the opaque areas of the image. # @param maskColour [Wx::Colour,String,Symbol] Colour indicating which parts of the image are transparent. # @return [Integer] # @overload add(icon) # Adds a new image using an icon. # The logical size of the icon should be the same as the size specified when constructing {Wx::ImageList}. # # The new zero-based image index. # # Availability: only available for the {Wx::MSW}, {Wx::OSX/Cocoa} ports. {Wx::msw},{Wx::osx} # @param icon [Wx::Icon] Icon to use as the image. # @return [Integer] def add(*args) end # Initializes the list. # See {Wx::ImageList#image_list} for details. # This function can be called only once after creating the object using its default ctor or after calling {Wx::ImageList#destroy}. # @param width [Integer] # @param height [Integer] # @param mask [true,false] # @param initialCount [Integer] # @return [true,false] def create(width, height, mask=true, initialCount=1) end # Destroys the current list. # This function resets the object to its initial state and does more than just {Wx::ImageList#remove_all} in the native {Wx::MSW} version. # After calling it, {Wx::ImageList#create} may be called again to recreate the image list, e.g. using a different size. # @return [void] def destroy; end # Draws a specified image onto a device context. # @param index [Integer] Image index, starting from zero. # @param dc [Wx::DC] Device context to draw on. # @param x [Integer] X position on the device context. # @param y [Integer] Y position on the device context. # @param flags [Integer] How to draw the image. A bitlist of a selection of the following: # - {Wx::IMAGELIST_DRAW_NORMAL}: Draw the image normally.- {Wx::IMAGELIST_DRAW_TRANSPARENT}: Draw the image with transparency.- {Wx::IMAGELIST_DRAW_SELECTED}: Draw the image in selected state.- {Wx::IMAGELIST_DRAW_FOCUSED}: Draw the image in a focused state. # @param solidBackground [true,false] For optimisation - drawing can be faster if the function is told that the background is solid. # @return [true,false] def draw(index, dc, x, y, flags=Wx::IMAGELIST_DRAW_NORMAL, solidBackground=false) end # Returns the bitmap corresponding to the given index. # @param index [Integer] # @return [Wx::Bitmap] def get_bitmap(index) end alias_method :bitmap, :get_bitmap # Returns the icon corresponding to the given index. # @param index [Integer] # @return [Wx::Icon] def get_icon(index) end alias_method :icon, :get_icon # Returns the number of images in the list. # @return [Integer] def get_image_count; end alias_method :image_count, :get_image_count # @overload get_size(index, width, height) # Retrieves the size of the images in the list. # Currently, the index parameter is ignored as all images in the list have the same size. # # true if the function succeeded, false if it failed (for example, if the image list was not yet initialized). # @param index [Integer] currently unused, should be 0 # @param width [int] receives the width of the images in the list # @param height [int] receives the height of the images in the list # @return [true,false] # @overload get_size() # Retrieves the size of the image list as passed to {Wx::ImageList#create}. # the size of the image list, which may be zero if the image list was not yet initialised. # @return [Wx::Size] def get_size(*args) end alias_method :size, :get_size # Removes the image at the given position. # @param index [Integer] # @return [true,false] def remove(index) end # Removes all the images in the list. # @return [true,false] def remove_all; end # @overload replace(index, bitmap, mask=Wx::NULL_BITMAP) # Replaces the existing image with the new image. # true if the replacement was successful, false otherwise. # # The original bitmap or icon is not affected by the {Wx::ImageList#replace} operation, and can be deleted afterwards. # @param index [Integer] The index of the bitmap to be replaced. # @param bitmap [Wx::Bitmap] Bitmap representing the opaque areas of the image. # @param mask [Wx::Bitmap] Monochrome mask bitmap, representing the transparent areas of the image. # @return [true,false] # @overload replace(index, icon) # Replaces the existing image with the new image. # true if the replacement was successful, false otherwise. # # The original bitmap or icon is not affected by the {Wx::ImageList#replace} operation, and can be deleted afterwards. # # Availability: only available for the {Wx::MSW}, {Wx::OSX/Cocoa} ports. {Wx::msw},{Wx::osx} # @param index [Integer] The index of the bitmap to be replaced. # @param icon [Wx::Icon] Icon to use as the image. # @return [true,false] def replace(*args) end end # ImageList end