# :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 [Wx::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 WXMSW or {Wx::BitmapType::BITMAP_TYPE_XPM} under WXGTK). # @param cursorName [String] The name of the resource or the image file to load. # @param type [Wx::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 [Wx::Cursor] # @overload initialize(cursorId) # Constructs a cursor using a cursor identifier. # @param cursorId [Wx::StockCursor] A stock cursor identifier. See {Wx::StockCursor}. # @return [Wx::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 WXMSW the foreground will be white and the background black. If the cursor is larger than 32x32 it is resized. # In WXGTK, 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 WXOSX (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 [Wx::Cursor] # @overload initialize(cursor) # Copy constructor, uses reference counting. # @param cursor [Wx::Cursor] Pointer or reference to a cursor to copy. # @return [Wx::Cursor] def initialize(*args) end # Returns true if cursor data is present. # @return [Boolean] 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 WXMSW and WXGTK2+ 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