1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface for wxCursor
 
   7 // Created:     7-July-1997
 
   9 // Copyright:   (c) 2003 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 //---------------------------------------------------------------------------
 
  20 "A cursor is a small bitmap usually used for denoting where the mouse
 
  21 pointer is, with a picture that might indicate the interpretation of a
 
  24 A single cursor object may be used in many windows (any subwindow
 
  25 type). The wxWindows convention is to set the cursor for a window, as
 
  26 in X, rather than to set it globally as in MS Windows, although a
 
  27 global `wx.SetCursor` function is also available for use on MS Windows.
 
  32     ========================    ======================================
 
  33     wx.CURSOR_ARROW             A standard arrow cursor.
 
  34     wx.CURSOR_RIGHT_ARROW       A standard arrow cursor pointing to the right.
 
  35     wx.CURSOR_BLANK             Transparent cursor.
 
  36     wx.CURSOR_BULLSEYE          Bullseye cursor.
 
  37     wx.CURSOR_CHAR              Rectangular character cursor.
 
  38     wx.CURSOR_CROSS             A cross cursor.
 
  39     wx.CURSOR_HAND              A hand cursor.
 
  40     wx.CURSOR_IBEAM             An I-beam cursor (vertical line).
 
  41     wx.CURSOR_LEFT_BUTTON       Represents a mouse with the left button depressed.
 
  42     wx.CURSOR_MAGNIFIER         A magnifier icon.
 
  43     wx.CURSOR_MIDDLE_BUTTON     Represents a mouse with the middle button depressed.
 
  44     wx.CURSOR_NO_ENTRY          A no-entry sign cursor.
 
  45     wx.CURSOR_PAINT_BRUSH       A paintbrush cursor.
 
  46     wx.CURSOR_PENCIL            A pencil cursor.
 
  47     wx.CURSOR_POINT_LEFT        A cursor that points left.
 
  48     wx.CURSOR_POINT_RIGHT       A cursor that points right.
 
  49     wx.CURSOR_QUESTION_ARROW    An arrow and question mark.
 
  50     wx.CURSOR_RIGHT_BUTTON      Represents a mouse with the right button depressed.
 
  51     wx.CURSOR_SIZENESW          A sizing cursor pointing NE-SW.
 
  52     wx.CURSOR_SIZENS            A sizing cursor pointing N-S.
 
  53     wx.CURSOR_SIZENWSE          A sizing cursor pointing NW-SE.
 
  54     wx.CURSOR_SIZEWE            A sizing cursor pointing W-E.
 
  55     wx.CURSOR_SIZING            A general sizing cursor.
 
  56     wx.CURSOR_SPRAYCAN          A spraycan cursor.
 
  57     wx.CURSOR_WAIT              A wait cursor.
 
  58     wx.CURSOR_WATCH             A watch cursor.
 
  59     wx.CURSOR_ARROWWAIT         A cursor with both an arrow and an hourglass, (windows.)
 
  60     ========================    ======================================
 
  64 MustHaveApp(wxCursor);
 
  66 class wxCursor : public wxGDIObject
 
  72                "Construct a Cursor from a file.  Specify the type of file using
 
  73 wx.BITAMP_TYPE* constants, and specify the hotspot if not using a .cur
 
  75 :see: Alternate constructors `wx.StockCursor`,`wx.CursorFromImage`");
 
  76         wxCursor(const wxString& cursorName, long type, int hotSpotX=0, int hotSpotY=0) {
 
  78             wxImage img(cursorName, type);
 
  79             img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX);
 
  80             img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY);
 
  81             return new wxCursor(img);
 
  83             return new wxCursor(cursorName, type, hotSpotX, hotSpotY);
 
  92         "Create a cursor using one of the stock cursors.  Note that not all
 
  93 stock cursors are available on all platforms.", "",
 
  98         wxCursor(const wxImage& image),
 
  99         "Constructs a cursor from a `wx.Image`. The mask (if any) will be used
 
 100 for setting the transparent portions of the cursor.",
 
 102 In MSW the cursor is resized to 32x32 if it was larger.
 
 104 In GTK the cursor will be displayed at the size of the image.
 
 106 On MacOS the cursor is resized to 16x16 if it was larger.",
 
 113 //         %RenameCtor(CursorFromBits,  wxCursor(PyObject* bits, int width, int  height,
 
 114 //                                          int hotSpotX=-1, int hotSpotY=-1,
 
 115 //                                          PyObject* maskBits=NULL))
 
 118 //             char* maskbuf = NULL;
 
 120 //             PyString_AsStringAndSize(bits, &bitsbuf, &length);
 
 122 //                 PyString_AsStringAndSize(maskBits, &maskbuf, &length);
 
 123 //             return new wxCursor(bitsbuf, width, height, hotSpotX, hotSpotY, maskbuf);
 
 132         "Get the MS Windows handle for the cursor", "");
 
 136         "Set the MS Windows handle to use for the cursor", "");
 
 137         void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
 
 145     %pythoncode { Ok = IsOk }
 
 147     %pythoncode { def __nonzero__(self): return self.IsOk() }
 
 164         void , SetWidth(int w),
 
 168         void , SetHeight(int h),
 
 172         void , SetDepth(int d),
 
 176         void , SetSize(const wxSize& size),
 
 184 //---------------------------------------------------------------------------
 
 185 //---------------------------------------------------------------------------