public:
wxCursor();
- wxCursor(const char bits[], int width, int height,
- int hotSpotX = -1, int hotSpotY = -1,
- const char maskBits[] = NULL);
-
- wxCursor(const wxString& name, long flags = 0,
+ wxCursor(const wxString& name, wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
- wxCursor(wxStockCursor cursor_type);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
virtual ~wxCursor();
// FIXME: operator==() is wrong!
WX_NSCursor GetNSCursor() const { return M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0; }
+private:
+ void InitFromStock(wxStockCursor);
DECLARE_DYNAMIC_CLASS(wxCursor)
};
#include "wx/defs.h"
#if defined(__WXPALMOS__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/palmos/cursor.h"
#elif defined(__WXMSW__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/msw/cursor.h"
#elif defined(__WXMOTIF__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XBM
#include "wx/motif/cursor.h"
#elif defined(__WXGTK20__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/gtk/cursor.h"
#elif defined(__WXGTK__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/gtk1/cursor.h"
#elif defined(__WXX11__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/x11/cursor.h"
#elif defined(__WXMGL__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/mgl/cursor.h"
#elif defined(__WXDFB__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/dfb/cursor.h"
#elif defined(__WXMAC__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE
#include "wx/osx/cursor.h"
#elif defined(__WXCOCOA__)
+ #define wxCURSOR_DEFAULT_TYPE 0
#include "wx/cocoa/cursor.h"
#elif defined(__WXPM__)
+ #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/os2/cursor.h"
#endif
{
public:
wxCursor() {}
- wxCursor(wxStockCursor cursorId);
- wxCursor(const char bits[], int width, int height,
- int hotSpotX=-1, int hotSpotY=-1,
- const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
wxCursor(const wxString& name,
- long flags = wxBITMAP_TYPE_CUR_RESOURCE,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
// implementation
wxBitmap GetBitmap() const;
protected:
+ void InitFromStock(wxStockCursor);
+
// ref counting code
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
{
public:
wxCursor();
- wxCursor( wxStockCursor cursorId );
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL,
const wxColour* fg = NULL, const wxColour* bg = NULL);
+ wxCursor(const wxString& name,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
+ int hotSpotX = 0, int hotSpotY = 0);
virtual ~wxCursor();
// implementation
GdkCursor *GetCursor() const;
protected:
+ void InitFromStock(wxStockCursor);
+
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
{
public:
wxCursor();
- wxCursor( wxStockCursor cursorId );
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
wxCursor( const char bits[], int width, int height,
int hotSpotX=-1, int hotSpotY=-1,
- const char maskBits[] = NULL, const wxColour *fg = NULL, const wxColour *bg = NULL );
+ const char maskBits[] = NULL,
+ const wxColour* fg = NULL, const wxColour* bg = NULL);
+
+ /* WARNING: the following ctor is missing:
+
+ wxCursor(const wxString& name,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
+ int hotSpotX = 0, int hotSpotY = 0);
+ */
+
virtual ~wxCursor();
// implementation
GdkCursor *GetCursor() const;
protected:
+ void InitFromStock(wxStockCursor);
+
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
public:
wxCursor();
- wxCursor(wxStockCursor cursorId);
- wxCursor(const char bits[], int width, int height,
- int hotSpotX=-1, int hotSpotY=-1,
- const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
wxCursor(const wxString& name,
- long flags = wxBITMAP_TYPE_CUR_RESOURCE,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
virtual ~wxCursor();
MGLCursor *GetMGLCursor() const;
private:
+ void InitFromStock(wxStockCursor);
+
DECLARE_DYNAMIC_CLASS(wxCursor)
};
wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
- const char maskBits[] = NULL);
+ const char maskBits[] = NULL,
+ const wxColour* fg = NULL, const wxColour* bg = NULL);
- wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM,
- int hotSpotX = 0, int hotSpotY = 0);
+ wxCursor(const wxString& name,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
+ int hotSpotX = 0, int hotSpotY = 0);
#if wxUSE_IMAGE
wxCursor(const wxImage& image);
#endif
- wxCursor(wxStockCursor id);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
+
virtual ~wxCursor();
// Motif-specific.
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
private:
+ void InitFromStock(wxStockCursor);
+
void Create(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
// constructors
wxCursor();
wxCursor(const wxImage& image);
- wxCursor(const char bits[], int width, int height,
- int hotSpotX = -1, int hotSpotY = -1,
- const char maskBits[] = NULL);
wxCursor(const wxString& name,
- wxBitmapType flags = wxBITMAP_TYPE_CUR_RESOURCE,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
- wxCursor(wxStockCursor idCursor);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
virtual ~wxCursor();
// implementation only
WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); }
protected:
+ void InitFromStock(wxStockCursor);
+
virtual wxGDIImageRefData *CreateData() const;
private:
wxCursor(const wxImage& rImage);
- wxCursor( const char acBits[]
- ,int nWidth
- ,int nHeight
- ,int nHotSpotX = -1
- ,int nHotSpotY = -1
- ,const char zMaskBits[] = NULL
- );
wxCursor( const wxString& rsName
- ,long lFlags = wxBITMAP_TYPE_CUR_RESOURCE
+ ,wxBitmapType lType = wxCURSOR_DEFAULT_TYPE
,int nHotSpotX = 0
,int nHotSpotY = 0
);
- wxCursor(wxStockCursor nCursorType);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
inline ~wxCursor() { }
inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
inline void SetHCURSOR(WXHCURSOR hCursor) { SetHandle((WXHANDLE)hCursor); }
protected:
+ void InitFromStock(wxStockCursor);
inline virtual wxGDIImageRefData* CreateData(void) const { return (new wxCursorRefData); }
private:
public:
wxCursor();
- wxCursor(const char bits[], int width, int height,
- int hotSpotX = -1, int hotSpotY = -1,
- const char maskBits[] = NULL);
-
wxCursor(const wxImage & image) ;
wxCursor(const char* const* bits);
wxCursor(const wxString& name,
- wxBitmapType flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
- wxCursor(wxStockCursor cursor_type);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
virtual ~wxCursor();
bool CreateFromXpm(const char* const* bits);
WXHCURSOR GetHCURSOR() const;
private:
+ void InitFromStock(wxStockCursor);
+
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
// constructors
wxCursor();
wxCursor(const wxImage& image);
- wxCursor(const char bits[], int width, int height,
- int hotSpotX = -1, int hotSpotY = -1,
- const char maskBits[] = NULL);
wxCursor(const wxString& name,
- long flags = wxBITMAP_TYPE_CUR_RESOURCE,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
- wxCursor(wxStockCursor idCursor);
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
virtual ~wxCursor();
// implementation only
WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); }
protected:
+ void InitFromStock(wxStockCursor);
virtual wxGDIImageRefData *CreateData() const;
private:
{
public:
wxCursor();
- wxCursor( wxStockCursor cursorId );
+ wxCursor(wxStockCursor id) { InitFromStock(id); }
+#if WXWIN_COMPATIBILITY_2_8
+ wxCursor(int id) { InitFromStock((wxStockCursor)id); }
+#endif
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
- wxCursor( const char bits[], int width, int height,
- int hotSpotX=-1, int hotSpotY=-1,
- const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
+ wxCursor(const wxString& name,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
+ int hotSpotX = 0, int hotSpotY = 0);
virtual ~wxCursor();
// implementation
WXCursor GetCursor() const;
protected:
+ void InitFromStock(wxStockCursor);
+
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
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 wxCursor
+ different environments. Platform-specific methods for creating a wxCursor
object are catered for, and this is an occasion where conditional
compilation will probably be required (see wxIcon for an example).
The following is an example of creating a cursor from 32x32 bitmap data
(down_bits) and a mask (down_mask) where 1 is black and 0 is white for the
- bits, and 1 is opaque and 0 is transparent for the mask. It works on
- Windows and GTK+.
+ bits, and 1 is opaque and 0 is transparent for the mask.
+ It works on Windows and GTK+.
@code
static char down_bits[] = { 255, 255, 255, 255, 31,
down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 6);
down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, 14);
wxCursor down_cursor = wxCursor(down_image);
- #else
+ #elif defined(__WXGTK__) or defined(__WXMOTIF__)
wxCursor down_cursor = wxCursor(down_bits, 32, 32, 6, 14,
down_mask, wxWHITE, wxBLACK);
#endif
- ::wxHOURGLASS_CURSOR
- ::wxCROSS_CURSOR
- @see wxBitmap, wxIcon, wxWindow::SetCursor(), wxSetCursor(),
- ::wxStockCursor
+ @see wxBitmap, wxIcon, wxWindow::SetCursor(), wxSetCursor(), ::wxStockCursor
*/
class wxCursor : public wxBitmap
{
Default constructor.
*/
wxCursor();
+
/**
- Constructs a cursor by passing an array of bits (Motif and GTK+ only).
- @a maskBits is used only under Motif and GTK+. The parameters @a fg and
- @a bg are only present on GTK+, and force the cursor to use particular
- background and foreground colours.
+ Constructs a cursor by passing an array of bits (XBM data).
+
+ The parameters @a fg and @a bg have an effect only on GTK+, and force
+ the cursor to use particular background and foreground colours.
If either @a hotSpotX or @a hotSpotY is -1, the hotspot will be the
centre of the cursor image (Motif only).
@param bits
- An array of bits.
- @param maskBits
- Bits for a mask bitmap.
+ An array of XBM data bits.
@param width
Cursor width.
@param height
Hotspot x coordinate.
@param hotSpotY
Hotspot y coordinate.
+ @param maskBits
+ Bits for a mask bitmap.
+
+ @onlyfor{wxgtk,wxmotif}
*/
wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
- const char maskBits[] = NULL,
- wxColour* fg = NULL, wxColour* bg = NULL);
+ const char maskBits[] = NULL);
+
/**
Constructs a cursor by passing a string resource name or filename.
+ @note
On MacOS 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.
loading from an icon file, to specify the cursor hotspot relative to
the top left of the image.
+ @param cursorName
+ The name of the resource or the image file to load.
+
@param type
- Icon type to load. Under Motif, type defaults to wxBITMAP_TYPE_XBM.
- Under Windows, it defaults to wxBITMAP_TYPE_CUR_RESOURCE. Under
- MacOS, it defaults to wxBITMAP_TYPE_MACCURSOR_RESOURCE.
- Under X, the permitted cursor types are:
- <ul>
- <li>wxBITMAP_TYPE_XBM - Load an X bitmap file.</li>
- </ul>
+ Icon type to load. It defaults to wxCURSOR_DEFAULT_TYPE,
+ which is a #define associated to different values on different
+ platforms:
+ - under Windows, it defaults to wxBITMAP_TYPE_CUR_RESOURCE.
+ - under MacOS, it defaults to wxBITMAP_TYPE_MACCURSOR_RESOURCE.
+ - under GTK, it defaults to wxBITMAP_TYPE_XPM.
+ - under X11, it defaults to wxBITMAP_TYPE_XPM.
+ - under Motif, type defaults to wxBITMAP_TYPE_XBM.
Under Windows, the permitted types are:
- wxBITMAP_TYPE_CUR - Load a cursor from a .cur cursor file (only
if USE_RESOURCE_LOADING_IN_MSW is enabled in
setup.h).
- - wxBITMAP_TYPE_CUR_RESOURCE - Load a Windows resource (as
- specified in the .rc file).
+ - wxBITMAP_TYPE_CUR_RESOURCE - Load a Windows resource
+ (as specified in the .rc file).
- wxBITMAP_TYPE_ICO - Load a cursor from a .ico icon file (only if
USE_RESOURCE_LOADING_IN_MSW is enabled in
setup.h). Specify @a hotSpotX and @a hotSpotY.
@param hotSpotY
Hotspot y coordinate.
*/
- wxCursor(const wxString& cursorName, long type,
+ wxCursor(const wxString& cursorName,
+ wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
+
/**
Constructs a cursor using a cursor identifier.
A stock cursor identifier. See ::wxStockCursor.
*/
wxCursor(wxStockCursor cursorId);
+
/**
Constructs a cursor from a wxImage. 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 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.
+ foreground and background. In any case, the cursor will be displayed
+ at the size of the image.
In wxMac, if the cursor is larger than 16x16 it is resized and
currently only shown as black/white (mask respected).
*/
wxCursor(const wxImage& image);
+
/**
Copy constructor, uses @ref overview_refcount "reference counting".
/**
Assignment operator, using @ref overview_refcount "reference counting".
*/
- wxCursor operator =(const wxCursor& cursor);
+ wxCursor& operator =(const wxCursor& cursor);
};
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject)
-wxCursor::wxCursor(wxStockCursor cursorId)
+void wxCursor::InitFromStock(wxStockCursor cursorId)
{
#warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
}
-wxCursor::wxCursor(const char WXUNUSED(bits)[],
- int WXUNUSED(width),
- int WXUNUSED(height),
- int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
- const char WXUNUSED(maskBits)[],
- wxColour * WXUNUSED(fg), wxColour * WXUNUSED(bg) )
-{
-#warning "FIXME"
-}
-
wxCursor::wxCursor(const wxString& cursor_file,
- long flags,
+ wxBitmapType type,
int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY))
{
#warning "FIXME"
{
}
-wxCursor::wxCursor( wxStockCursor cursorId )
+void wxCursor::InitFromStock( wxStockCursor cursorId )
{
m_refData = new wxCursorRefData();
M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur );
}
+
+// used in the following two ctors
extern GtkWidget *wxGetRootWindow();
-wxCursor::wxCursor(const char bits[], int width, int height,
+wxCursor::wxCursor(const wxString& cursor_file,
+ wxBitmapType type,
+ int hotSpotX, int hotSpotY)
+{
+ /* TODO: test this code! */
+
+ // Must be an XBM file
+ if (type != wxBITMAP_TYPE_XPM) {
+ wxLogError("Invalid cursor bitmap type '%d'", type);
+ return;
+ }
+
+ // load the XPM
+ GdkBitmap *mask = NULL;
+ GdkBitmap *data = gdk_pixmap_create_from_xpm( wxGetRootWindow()->window,
+ &mask, NULL, cursor_file.mb_str() );
+ if (!data)
+ return;
+
+ // check given hotspot
+ gint w, h;
+ gdk_drawable_get_size( data, &w, &h );
+ if (hotSpotX < 0 || hotSpotX >= w)
+ hotSpotX = 0;
+ if (hotSpotY < 0 || hotSpotY >= h)
+ hotSpotY = 0;
+
+ // create the real cursor
+ m_refData = new wxCursorRefData;
+ M_CURSORDATA->m_cursor =
+ gdk_cursor_new_from_pixmap( data, mask,
+ wxBLACK->GetColor(), wxWHITE->GetColor(),
+ hotSpotX, hotSpotY );
+
+ g_object_unref (data);
+ g_object_unref (mask);
+}
+
+wxCursor::wxCursor(const char bits[], int width, int height,
int hotSpotX, int hotSpotY,
const char maskBits[], const wxColour *fg, const wxColour *bg)
{
}
-wxCursor::wxCursor( wxStockCursor cursorId )
+void wxCursor::InitFromStock( wxStockCursor cursorId )
{
m_refData = new wxCursorRefData();
{
}
-wxCursor::wxCursor(wxStockCursor cursorId)
+void wxCursor::InitFromStock(wxStockCursor cursorId)
{
if ( !gs_cursorsHash )
gs_cursorsHash = new wxCursorsHash;
}
}
-wxCursor::wxCursor(const char WXUNUSED(bits)[],
- int WXUNUSED(width),
- int WXUNUSED(height),
- int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
- const char WXUNUSED(maskBits)[],
- wxColour * WXUNUSED(fg), wxColour * WXUNUSED(bg) )
-{
- //FIXME_MGL
-}
-
wxCursor::wxCursor(const wxString& cursor_file,
- long flags,
+ wxBitmapType type,
int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY))
{
- if ( flags == wxBITMAP_TYPE_CUR || flags == wxBITMAP_TYPE_CUR_RESOURCE )
+ if ( type == wxBITMAP_TYPE_CUR || type == wxBITMAP_TYPE_CUR_RESOURCE )
{
m_refData = new wxCursorRefData();
M_CURSORDATA->m_cursor = new MGLCursor(cursor_file.mb_str());
Create(bits, width, height, hotSpotX, hotSpotY, maskBits);
}
-wxCursor::wxCursor(const wxString& name, long flags, int hotSpotX, int hotSpotY)
+wxCursor::wxCursor(const wxString& name, wxBitmapType type, int hotSpotX, int hotSpotY,
+ const wxColour* WXUNUSED(fg), const wxColour* WXUNUSED(bg))
{
// Must be an XBM file
- if (flags != wxBITMAP_TYPE_XBM)
+ if (type != wxBITMAP_TYPE_XBM) {
+ wxLogError("Invalid cursor bitmap type '%d'", type);
return;
+ }
m_refData = new wxCursorRefData;
}
// Cursors by stock number
-wxCursor::wxCursor(wxStockCursor id)
+void wxCursor::InitFromStock(wxStockCursor id)
{
m_refData = new wxCursorRefData;
M_CURSORDATA->m_cursorId = id;
}
#endif // wxUSE_IMAGE
-wxCursor::wxCursor(const char WXUNUSED(bits)[],
- int WXUNUSED(width),
- int WXUNUSED(height),
- int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
- const char WXUNUSED(maskBits)[])
-{
-}
-
// MicroWin doesn't have support needed for the other ctors
#ifdef __WXMICROWIN__
-wxCursor::wxCursor(const wxString& WXUNUSED(filename),
- wxBitmapType WXUNUSED(kind),
- int WXUNUSED(hotSpotX),
- int WXUNUSED(hotSpotY))
-{
-}
-
-wxCursor::wxCursor(int WXUNUSED(cursor_type))
+wxCursor::InitFromStock(wxStockCursor WXUNUSED(cursor_type))
{
}
break;
default:
- wxFAIL_MSG( _T("unknown cursor resource type") );
+ wxLogError( _T("unknown cursor resource type '%d'"), kind );
hcursor = NULL;
}
}
// Cursors by stock number
-wxCursor::wxCursor(wxStockCursor idCursor)
+void wxCursor::InitFromStock(wxStockCursor idCursor)
{
// all wxWidgets standard cursors
static const struct StdCursor
{
}
-wxCursor::wxCursor(const char WXUNUSED(bits)[],
- int WXUNUSED(width),
- int WXUNUSED(height),
- int WXUNUSED(hotSpotX),
- int WXUNUSED(hotSpotY),
- const char WXUNUSED(maskBits)[])
-{
-}
-
wxCursor::wxCursor(const wxImage& rImage)
{
wxImage vImage32 = rImage.Scale(32,32);
} // end of wxCursor::wxCursor
wxCursor::wxCursor( const wxString& WXUNUSED(rsCursorFile),
- long lFlags,
+ wxBitmapType type,
int WXUNUSED(nHotSpotX),
int WXUNUSED(nHotSpotY) )
{
pRefData = new wxCursorRefData;
m_refData = pRefData;
pRefData->m_bDestroyCursor = false;
- if (lFlags == wxBITMAP_TYPE_CUR_RESOURCE)
+ if (type == wxBITMAP_TYPE_CUR_RESOURCE)
{
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
- ,(ULONG)lFlags // if OS/2 this should be the resource Id
+ ,(ULONG)type // if OS/2 this should be the resource Id
);
}
+ else
+ wxLogError("Invalid cursor bitmap type '%d'", type);
} // end of wxCursor::wxCursor
// Cursors by stock number
-wxCursor::wxCursor(wxStockCursor nCursorType)
+void wxCursor::InitFromStock(wxStockCursor nCursorType)
{
wxCursorRefData* pRefData = new wxCursorRefData;
{
}
-wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height),
- int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[])
-{
-}
-
wxCursor::wxCursor( const wxImage &image )
{
#if wxUSE_IMAGE
}
// Cursors by stock number
-wxCursor::wxCursor(wxStockCursor cursor_type)
+wxCursor::InitFromStock(wxStockCursor cursor_type)
{
m_refData = new wxCursorRefData;
#if wxOSX_USE_COCOA
}
#endif
-wxCursor::wxCursor(const char WXUNUSED(bits)[],
- int WXUNUSED(width),
- int WXUNUSED(height),
- int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
- const char WXUNUSED(maskBits)[])
-{
-}
-
wxCursor::wxCursor(const wxString& filename,
- long kind,
+ wxBitmapType kind,
int hotSpotX,
int hotSpotY)
{
}
// Cursors by stock number
-wxCursor::wxCursor(wxStockCursor idCursor)
+void wxCursor::InitFromStock(wxStockCursor idCursor)
{
}
}
-wxCursor::wxCursor( wxStockCursor cursorId )
+void wxCursor::InitFromStock( wxStockCursor cursorId )
{
m_refData = new wxCursorRefData();
#endif
}
-wxCursor::wxCursor(const char WXUNUSED(bits)[],
- int WXUNUSED(width), int WXUNUSED(height),
- int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
- const char WXUNUSED(maskBits)[],
- wxColour *WXUNUSED(fg), wxColour *WXUNUSED(bg))
+wxCursor::wxCursor(const wxString& name,
+ wxBitmapType type,
+ int hotSpotX, int hotSpotY)
{
- wxFAIL_MSG( wxT("wxCursor creation from bits not yet implemented") );
+ wxFAIL_MSG( wxT("wxCursor creation from file not yet implemented") );
}
#if wxUSE_IMAGE