00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXCURSOR_H
00025 #define FXCURSOR_H
00026
00027 #ifndef FXID_H
00028 #include "FXId.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00034
00035 enum FXStockCursor {
00036 CURSOR_ARROW=1,
00037 CURSOR_RARROW,
00038 CURSOR_IBEAM,
00039 CURSOR_WATCH,
00040 CURSOR_CROSS,
00041 CURSOR_UPDOWN,
00042 CURSOR_LEFTRIGHT,
00043 CURSOR_MOVE
00044 };
00045
00046
00048 enum {
00049 CURSOR_KEEP = 0x00000100,
00050 CURSOR_OWNED = 0x00000200
00051 };
00052
00053
00055 class FXAPI FXCursor : public FXId {
00056 FXDECLARE(FXCursor)
00057 protected:
00058 FXColor *data;
00059 FXint width;
00060 FXint height;
00061 FXint hotx;
00062 FXint hoty;
00063 FXuint options;
00064 protected:
00065 FXCursor();
00066 private:
00067 FXCursor(const FXCursor&);
00068 FXCursor &operator=(const FXCursor&);
00069 public:
00070
00072 FXCursor(FXApp* a,FXStockCursor curid=CURSOR_ARROW);
00073
00075 FXCursor(FXApp* a,const FXuchar* src,const FXuchar* msk,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0,FXint options=0);
00076
00078 FXCursor(FXApp* a,const FXColor* pix,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0,FXint options=0);
00079
00081 FXint getWidth() const { return width; }
00082
00084 FXint getHeight() const { return height; }
00085
00087 void setHotX(FXint x){ hotx=x; }
00088
00090 FXint getHotX() const { return hotx; }
00091
00093 void setHotY(FXint y){ hoty=y; }
00094
00096 FXint getHotY() const { return hoty; }
00097
00099 bool isColor() const;
00100
00102 virtual void create();
00103
00105 virtual void detach();
00106
00108 virtual void destroy();
00109
00111 virtual void release();
00112
00114 virtual bool savePixels(FXStream& store) const;
00115
00117 virtual bool loadPixels(FXStream& store);
00118
00120 virtual void save(FXStream& store) const;
00121
00123 virtual void load(FXStream& store);
00124
00126 virtual ~FXCursor();
00127 };
00128
00129 }
00130
00131 #endif