00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXBITMAPVIEW_H
00022 #define FXBITMAPVIEW_H
00023
00024 #ifndef FXSCROLLAREA_H
00025 #include "FXScrollArea.h"
00026 #endif
00027
00028 namespace FX {
00029
00030
00031 class FXBitmap;
00032
00034 enum {
00035 BITMAPVIEW_NORMAL = 0,
00036 BITMAPVIEW_CENTER_X = 0,
00037 BITMAPVIEW_LEFT = 0x00100000,
00038 BITMAPVIEW_RIGHT = 0x00200000,
00039 BITMAPVIEW_CENTER_Y = 0,
00040 BITMAPVIEW_TOP = 0x00400000,
00041 BITMAPVIEW_BOTTOM = 0x00800000
00042 };
00043
00050 class FXAPI FXBitmapView : public FXScrollArea {
00051 FXDECLARE(FXBitmapView)
00052 protected:
00053 FXBitmap *bitmap;
00054 FXColor onColor;
00055 FXColor offColor;
00056 FXint grabx;
00057 FXint graby;
00058 protected:
00059 FXBitmapView();
00060 private:
00061 FXBitmapView(const FXBitmapView&);
00062 FXBitmapView &operator=(const FXBitmapView&);
00063 public:
00064 long onPaint(FXObject*,FXSelector,void*);
00065 long onMotion(FXObject*,FXSelector,void*);
00066 long onRightBtnPress(FXObject*,FXSelector,void*);
00067 long onRightBtnRelease(FXObject*,FXSelector,void*);
00068 public:
00069 enum {
00070 ID_XYZ=FXScrollArea::ID_LAST,
00071 ID_LAST
00072 };
00073 public:
00074
00076 FXBitmapView(FXComposite* p,FXBitmap* bmp=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00077
00079 virtual void create();
00080
00082 virtual void detach();
00083
00085 virtual void layout();
00086
00088 virtual FXbool canFocus() const;
00089
00091 virtual FXint getContentWidth();
00092
00094 virtual FXint getContentHeight();
00095
00097 void setBitmap(FXBitmap* bmp);
00098
00100 FXBitmap* getBitmap() const { return bitmap; }
00101
00103 void setOnColor(FXColor clr);
00104
00106 FXColor getOnColor() const { return onColor; }
00107
00109 void setOffColor(FXColor clr);
00110
00112 FXColor getOffColor() const { return offColor; }
00113
00115 void setAlignment(FXuint mode);
00116
00118 FXuint getAlignment() const;
00119
00121 virtual void save(FXStream& store) const;
00122
00124 virtual void load(FXStream& store);
00125
00127 virtual ~FXBitmapView();
00128 };
00129
00130 }
00131
00132 #endif