Class: Wx::CursorBundle

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/cursor.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

A cursor bundle is a set of different versions of the same cursor at different sizes.

This class relationship with Cursor is similar to that of BitmapBundle with Bitmap, but it has a simpler interface because cursors are never scaled and always use the closest available size. It is typically used like the following:

MyFrame::MyFrame()
  {
      SetCursorBundle(wxCursorBundle(wxBitmapBundle::FromResources("mycursor"),
                                     wxPoint(1, 1)));
  }

Please see BitmapBundle documentation for more information about different ways of creating it.

Category: Graphics Device Interface (GDI)

Instance Method Summary collapse

Constructor Details

#initializeWx::CursorBundle #initialize(bitmaps, hotSpot) ⇒ Wx::CursorBundle #initialize(bitmaps, hotSpotX = 0, hotSpotY = 0) ⇒ Wx::CursorBundle #initialize(other) ⇒ Wx::CursorBundle

Returns a new instance of CursorBundle.

Overloads:

  • #initializeWx::CursorBundle

    Default ctor constructs an empty bundle.

    Such bundle represents the absence of any custom cursor but not an empty cursor (StockCursor::CURSOR_BLANK can be used if this is really needed). You can use the assignment operator to set the bundle contents later.

  • #initialize(bitmaps, hotSpot) ⇒ Wx::CursorBundle

    Create a cursor bundle from the given bitmap bundle.

    Parameters:

    • bitmaps (Wx::BitmapBundle, Wx::Bitmap, Wx::Icon, Wx::Image)

      The bitmap bundle to use for the cursor, typically containing bitmap in at least two sizes.

    • hotSpot (Array(Integer, Integer), Wx::Point)

      Hotspot coordinates (relative to the top left of the image). The coordinates are relative to the default size of the bitmap bundle and are scaled by wxWidgets for other sizes.

  • #initialize(bitmaps, hotSpotX = 0, hotSpotY = 0) ⇒ Wx::CursorBundle

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

  • #initialize(other) ⇒ Wx::CursorBundle

    Copy constructor performs a shallow copy of the bundle.

    This operation is cheap as it doesn’t copy any bitmaps.

    Parameters:



155
# File 'lib/wx/doc/gen/cursor.rb', line 155

def initialize(*args) end

Instance Method Details

#clearvoid

This method returns an undefined value.

Clear the bundle contents.

#is_ok will return false after doing this. Use the assignment operator to set the bundle contents later.



167
# File 'lib/wx/doc/gen/cursor.rb', line 167

def clear; end

#get_cursor_for(window) ⇒ Wx::Cursor Also known as: cursor_for

Get the cursor of the size suitable for the given window.

Parameters:

Returns:



172
# File 'lib/wx/doc/gen/cursor.rb', line 172

def get_cursor_for(window) end

#get_cursor_for_main_windowWx::Cursor Also known as: cursor_for_main_window

Get the cursor of the default size.

Prefer to use #get_cursor_for instead if there is a suitable window available, this function only exists as last resort.

Returns:



179
# File 'lib/wx/doc/gen/cursor.rb', line 179

def get_cursor_for_main_window; end

#is_okBoolean Also known as: ok?

Check if cursor bundle is non-empty.

Returns:

  • (Boolean)


159
# File 'lib/wx/doc/gen/cursor.rb', line 159

def is_ok; end

#is_same_as(other) ⇒ Boolean Also known as: same_as?

Check if two objects refer to the same bundle.

Note that this compares the object identity, i.e. this function returns true only for copies of the same bundle, but false for two bundles created from the same bitmap bundle and same hotspot coordinates.

Parameters:

Returns:

  • (Boolean)


187
# File 'lib/wx/doc/gen/cursor.rb', line 187

def is_same_as(other) end