# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This class is used when you wish to drag an object on the screen, and a simple cursor is not enough. # On Windows, the Win32 API is used to achieve smooth dragging. On other platforms, {Wx::GenericDragImage} is used. Applications may also prefer to use {Wx::GenericDragImage} on Windows, too. # To use this class, when you wish to start dragging an image, create a {Wx::DragImage} object and store it somewhere you can access it as the drag progresses. Call {Wx::DragImage#begin_drag} to start, and {Wx::DragImage#end_drag} to stop the drag. To move the image, initially call {Wx::DragImage#show} and then {Wx::DragImage#move}. If you wish to update the screen contents during the drag (for example, highlight an item as in the dragimag sample), first call {Wx::DragImage#hide}, update the screen, call {Wx::DragImage#move}, and then call {Wx::DragImage#show}. # You can drag within one window, or you can use full-screen dragging either across the whole screen, or just restricted to one area of the screen to save resources. If you want the user to drag between two windows, then you will need to use full-screen dragging. # If you wish to draw the image yourself, use {Wx::GenericDragImage} and override {Wx::DragImage#do_draw_image} and {Wx::DragImage#get_image_rect}. # === # # Category: Clipboard and Drag & Drop # @see Drag Image Sample # # class DragImage < Object # @overload initialize() # Default constructor. # @return [Wx::DragImage] # @overload initialize(image, cursor=Wx::NULL_CURSOR) # Constructs a drag image from a bitmap and optional cursor. # @param image [Wx::Bitmap] Bitmap to be used as the drag image. The bitmap can have a mask. # @param cursor [Wx::Cursor] Optional cursor to combine with the image. # @return [Wx::DragImage] # @overload initialize(image, cursor=Wx::NULL_CURSOR) # Constructs a drag image from an icon and optional cursor. # @param image [Wx::Icon] Icon to be used as the drag image. # @param cursor [Wx::Cursor] Optional cursor to combine with the image. # @return [Wx::DragImage] # @overload initialize(text, cursor=Wx::NULL_CURSOR) # Constructs a drag image from a text string and optional cursor. # @param text [String] Text used to construct a drag image. # @param cursor [Wx::Cursor] Optional cursor to combine with the image. # @return [Wx::DragImage] # @overload initialize(treeCtrl, id) # Constructs a drag image from the text in the given tree control item, and optional cursor. # @param treeCtrl [Wx::TreeCtrl] Tree control for constructing a tree drag image. # @param id [Wx::TreeItemId] Tree control item id. # @return [Wx::DragImage] # @overload initialize(listCtrl, id) # Constructs a drag image from the text in the given list control item, and optional cursor. # @param listCtrl [Wx::ListCtrl] List control for constructing a list drag image. # @param id [Integer] List control item id. # @return [Wx::DragImage] def initialize(*args) end # @overload begin_drag(hotspot, window, fullScreen=false, rect=nil) # Start dragging the image, in a window or full screen. # You need to then call {Wx::DragImage#show} and {Wx::DragImage#move} to show the image on the screen. Call {Wx::DragImage#end_drag} when the drag has finished. # Note that this call automatically calls CaptureMouse(). # @param hotspot [Array(Integer, Integer), Wx::Point] The location of the drag position relative to the upper-left corner of the image. # @param window [Wx::Window] The window that captures the mouse, and within which the dragging is limited unless fullScreen is true. # @param fullScreen [Boolean] If true, specifies that the drag will be visible over the full screen, or over as much of the screen as is specified by rect. Note that the mouse will still be captured in window. # @param rect [Wx::Rect] If non-NULL, specifies the rectangle (in screen coordinates) that bounds the dragging operation. Specifying this can make the operation more efficient by cutting down on the area under consideration, and it can also make a visual difference since the drag is clipped to this area. # @return [Boolean] # @overload begin_drag(hotspot, window, boundingWindow) # Start dragging the image, using the first window to capture the mouse and the second to specify the bounding area. # This form is equivalent to using the first form, but more convenient than working out the bounding rectangle explicitly. # You need to then call {Wx::DragImage#show} and {Wx::DragImage#move} to show the image on the screen. Call {Wx::DragImage#end_drag} when the drag has finished. # Note that this call automatically calls CaptureMouse(). # @param hotspot [Array(Integer, Integer), Wx::Point] The location of the drag position relative to the upper-left corner of the image. # @param window [Wx::Window] The window that captures the mouse, and within which the dragging is limited. # @param boundingWindow [Wx::Window] Specifies the area within which the drag occurs. # @return [Boolean] def begin_drag(*args) end # Call this when the drag has finished. # This function automatically releases mouse capture. # @return [Boolean] def end_drag; end # Hides the image. # You may wish to call this before updating the window contents (perhaps highlighting an item). Then call {Wx::DragImage#move} and {Wx::DragImage#show}. # @return [Boolean] def hide; end # Call this to move the image to a new position. # The image will only be shown if {Wx::DragImage#show} has been called previously (for example at the start of the drag). # # You can move the image either when the image is hidden or shown, but in general dragging will be smoother if you move the image when it is shown. # @param pt [Array(Integer, Integer), Wx::Point] The position in client coordinates (relative to the window specified in {Wx::DragImage#begin_drag}). # @return [Boolean] def move(pt) end # Shows the image. # Call this at least once when dragging. # @return [Boolean] def show; end end # DragImage end