00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FXSEVENSEGMENT_H
00023 #define FXSEVENSEGMENT_H
00024
00025
00026
00027
00028
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034
00035 #ifndef FXFRAME_H
00036
00037 #include <FXFrame.h>
00038 using namespace FX;
00039 #endif
00040 namespace FXEX {
00041
00045 class
00046 FXSevenSegment : public FXFrame {
00047 FXDECLARE(FXSevenSegment)
00048
00049 private:
00050 FXchar value;
00051 FXColor fgcolor;
00052 FXColor bgcolor;
00053 FXint hsl;
00054 FXint vsl;
00055 FXint st;
00056 FXint groove;
00057
00058 private:
00059 void checkSize();
00060
00061 protected:
00062 FXSevenSegment() {}
00063
00064
00065 void drawTopSegment(FXDCWindow &dc,FXshort x,FXshort y);
00066 void drawLeftTopSegment(FXDCWindow &dc,FXshort x,FXshort y);
00067 void drawRightTopSegment(FXDCWindow &dc,FXshort x,FXshort y);
00068 void drawMiddleSegment(FXDCWindow &dc,FXshort x,FXshort y);
00069 void drawLeftBottomSegment(FXDCWindow &dc,FXshort x,FXshort y);
00070 void drawRightBottomSegment(FXDCWindow &dc,FXshort x,FXshort y);
00071 void drawBottomSegment(FXDCWindow &dc,FXshort x,FXshort y);
00072
00073
00074 void drawSegments(FXDCWindow &dc,FXbool s1,FXbool s2,FXbool s3,FXbool s4,FXbool s5,FXbool s6,FXbool s7);
00075
00076
00077 virtual void drawFigure(FXDCWindow &dc, FXchar figure);
00078
00079 public:
00080 long onPaint(FXObject*,FXSelector,void*);
00081 long onCmdSetValue(FXObject*,FXSelector,void*);
00082 long onCmdSetIntValue(FXObject*,FXSelector,void*);
00083 long onCmdGetIntValue(FXObject*,FXSelector,void*);
00084 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00085 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00086 long onQueryTip(FXObject*,FXSelector,void*);
00087 long onQueryHelp(FXObject*,FXSelector,void*);
00088
00089 public:
00091 FXSevenSegment(FXComposite* p,FXObject *tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NONE,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00092
00094 void setText(const FXchar val);
00095
00097 FXchar getText() const {
00098 return value;
00099 }
00100
00102 void setFgColor(const FXColor clr);
00103 FXColor getFgColor() const {
00104 return fgcolor;
00105 }
00106
00108 void setBgColor(const FXColor clr);
00109 FXColor getBgColor() const {
00110 return bgcolor;
00111 }
00112
00114 void setHorizontal(const FXint len);
00115 FXint getHorizontal() const {
00116 return hsl;
00117 }
00118
00120 void setVertical(const FXint len);
00121 FXint getVertical() const {
00122 return vsl;
00123 }
00124
00126 void setThickness(const FXint width);
00127 FXint getThickness() const {
00128 return st;
00129 }
00130
00132 void setGroove(const FXint width);
00133 FXint getGroove() const {
00134 return groove;
00135 }
00136
00138 virtual FXint getDefaultWidth();
00139
00141 virtual FXint getDefaultHeight();
00142
00144 virtual void save(FXStream &store) const;
00145
00147 virtual void load(FXStream &store);
00148
00150 virtual ~FXSevenSegment() {}
00151 };
00152
00153 }
00154 #endif // FXSEVENSEGMENT_H