# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # # NULL_CURSOR = nil # A cursor is a small bitmap usually used for denoting where the mouse pointer is, with a picture that might indicate the interpretation of a mouse click. # As with icons, cursors in X and MS Windows are created in a different manner. Therefore, separate cursors # will be created for the different environments. Platform-specific methods for creating a {Wx::Cursor} object # are catered for, and this is an occasion where conditional compilation will probably be required # (see {Wx::Icon} for an example). # A single cursor object may be used in many windows (any subwindow type). The wxWidgets convention is to set # the cursor for a window, as in X, rather than to set it globally as in MS Windows, although a global # {set_cursor} function is also available for MS Windows use. # # === # # Category: Graphics Device Interface (GDI) # Predefined objects/pointers: # - {Wx::NULL_CURSOR} # - {Wx::STANDARD_CURSOR} # - {Wx::HOURGLASS_CURSOR} # - {Wx::CROSS_CURSOR} # @see Wx::Bitmap # @see Wx::Icon # @see Wx::Window#set_cursor # @see Wx.set_cursor # @see Wx::StockCursor # # # @note This class is untracked and should not be derived from nor instances extended! class Cursor < GDIObject # @overload initialize() # Default constructor. # @return [Cursor] # @overload initialize(cursorName, type=Wx::CURSOR_DEFAULT_TYPE, hotSpotX=0, hotSpotY=0) # Constructs a cursor by passing a string resource name or filename. # The arguments hotSpotX and hotSpotY are only used when there's no hotspot info in the resource/image-file to load (e.g. when using {Wx::BitmapType::BITMAP_TYPE_ICO} under {Wx::MSW} or {Wx::BitmapType::BITMAP_TYPE_XPM} under {Wx::GTK}). # @param cursorName [String] The name of the resource or the image file to load. # @param type [BitmapType] Icon type to load. It defaults to {Wx::CURSOR_DEFAULT_TYPE}, which is a #define associated to different values on different platforms: # - under Windows, it defaults to {Wx::BITMAP_TYPE_CUR_RESOURCE}. Other permitted types under Windows are {Wx::BitmapType::BITMAP_TYPE_CUR} (to load a cursor from a .cur cursor file), {Wx::BitmapType::BITMAP_TYPE_ICO} (to load a cursor from a .ico icon file) and {Wx::BitmapType::BITMAP_TYPE_ANI} (to load a cursor from a .ani icon file).- under MacOS, it defaults to {Wx::BITMAP_TYPE_MACCURSOR_RESOURCE}; when specifying a string resource name, first the color cursors 'crsr' and then the black/white cursors 'CURS' in the resource chain are scanned through. Note that resource forks are deprecated on macOS so this is only available for legacy reasons and should not be used in new code.- under GTK, it defaults to {Wx::BitmapType::BITMAP_TYPE_XPM}. See the wxCursor(const wxImage& image) ctor for more info.- under X11, it defaults to {Wx::BitmapType::BITMAP_TYPE_XPM}.- under Motif, it defaults to {Wx::BitmapType::BITMAP_TYPE_XBM}. # @param hotSpotX [Integer] Hotspot x coordinate (relative to the top left of the image). # @param hotSpotY [Integer] Hotspot y coordinate (relative to the top left of the image). # @return [Cursor] # @overload initialize(cursorId) # Constructs a cursor using a cursor identifier. # @param cursorId [StockCursor] A stock cursor identifier. See {Wx::StockCursor}. # @return [Cursor] # @overload initialize(image) # Constructs a cursor from a {Wx::Image}. # If cursor are monochrome on the current platform, colors with the RGB elements all greater than 127 will be foreground, colors less than this background. The mask (if any) will be used to specify the transparent area. # In {Wx::MSW} the foreground will be white and the background black. If the cursor is larger than 32x32 it is resized. # In {Wx::GTK}, colour cursors and alpha channel are supported (starting from GTK+ 2.2). Otherwise the two most frequent colors will be used for foreground and background. In any case, the cursor will be displayed at the size of the image. # Under {Wx::Mac} (Cocoa), large cursors are supported. # Notice that the image can define the cursor hot spot. To set it you need to use {Wx::Image#set_option} with {Wx::IMAGE_OPTION_CUR_HOTSPOT_X} or {Wx::IMAGE_OPTION_CUR_HOTSPOT_Y}, e.g. # ```ruby # image.set_option(Wx::IMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX) # image.set_option(Wx::IMAGE_OPTION_CUR_HOTSPOT_X, hotSpotY) # ``` # @param image [Wx::Image] # @return [Cursor] # @overload initialize(xpmData) # Constructs a cursor from XPM data. # In versions of wxWidgets until 3.1.6 constructing {Wx::Cursor} from XPM data implicitly used {Wx::Image} constructor from XPM data and {Wx::Cursor} constructor from {Wx::Image}. Since 3.1.6 this constructor overload is available to allow constructing {Wx::Cursor} from XPM to still work, even though {Wx::Image} constructor from XPM is now explicit. # @param xpmData [char] # @return [Cursor] # @overload initialize(cursor) # Copy constructor, uses reference counting. # @param cursor [Wx::Cursor] Pointer or reference to a cursor to copy. # @return [Cursor] def initialize(*args) end # Returns true if cursor data is present. # @return [true,false] def is_ok; end alias_method :ok?, :is_ok # Returns the coordinates of the cursor hot spot. # The hot spot is the point at which the mouse is actually considered to be when this cursor is used. # This method is currently only implemented in {Wx::MSW} and {Wx::GTK2}+ and simply returns {Wx::DEFAULT_POSITION} in the other ports. # @return [Wx::Point] def get_hot_spot; end alias_method :hot_spot, :get_hot_spot end # Cursor end