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