]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/cursor.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor base header
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CURSOR_H_BASE_
13 #define _WX_CURSOR_H_BASE_
18 wxCursor classes should have the following public API:
20 class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
24 wxCursor(const wxImage& image);
25 wxCursor(const wxString& name,
26 wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
27 int hotSpotX = 0, int hotSpotY = 0);
28 wxCursor(wxStockCursor id) { InitFromStock(id); }
29 #if WXWIN_COMPATIBILITY_2_8
30 wxCursor(int id) { InitFromStock((wxStockCursor)id); }
37 #if defined(__WXMSW__)
38 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
39 #include "wx/msw/cursor.h"
40 #elif defined(__WXMOTIF__)
41 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XBM
42 #include "wx/motif/cursor.h"
43 #elif defined(__WXGTK20__)
45 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
47 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
49 #include "wx/gtk/cursor.h"
50 #elif defined(__WXGTK__)
51 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
52 #include "wx/gtk1/cursor.h"
53 #elif defined(__WXX11__)
54 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
55 #include "wx/x11/cursor.h"
56 #elif defined(__WXDFB__)
57 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
58 #include "wx/dfb/cursor.h"
59 #elif defined(__WXMAC__)
60 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE
61 #include "wx/osx/cursor.h"
62 #elif defined(__WXCOCOA__)
63 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE
64 #include "wx/cocoa/cursor.h"
65 #elif defined(__WXPM__)
66 #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
67 #include "wx/os2/cursor.h"
72 /* This is a small class which can be used by all ports
73 to temporarily suspend the busy cursor. Useful in modal
76 Actually that is not (any longer) quite true.. currently it is
77 only used in wxGTK Dialog::ShowModal() and now uses static
78 wxBusyCursor methods that are only implemented for wxGTK so far.
79 The BusyCursor handling code should probably be implemented in
80 common code somewhere instead of the separate implementations we
81 currently have. Also the name BusyCursorSuspender is a little
82 misleading since it doesn't actually suspend the BusyCursor, just
83 masks one that is already showing.
84 If another call to wxBeginBusyCursor is made while this is active
85 the Busy Cursor will again be shown. But at least now it doesn't
86 interfere with the state of wxIsBusy() -- RL
89 class wxBusyCursorSuspender
92 wxBusyCursorSuspender()
96 wxSetCursor( wxBusyCursor::GetStoredCursor() );
99 ~wxBusyCursorSuspender()
103 wxSetCursor( wxBusyCursor::GetBusyCursor() );
108 // _WX_CURSOR_H_BASE_