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 FX7SEGMENT_H
00025 #define FX7SEGMENT_H
00026
00027 #ifndef FXFRAME_H
00028 #include "FXFrame.h"
00029 #endif
00030
00031
00032 namespace FX {
00033
00035 enum {
00036 SEVENSEGMENT_NORMAL = 0,
00037 SEVENSEGMENT_SHADOW = 0x00080000
00038 };
00039
00040
00046 class FXAPI FX7Segment : public FXFrame {
00047 FXDECLARE(FX7Segment)
00048 protected:
00049 FXString label;
00050 FXColor textColor;
00051 FXint thickness;
00052 FXint cellwidth;
00053 FXint cellheight;
00054 FXString tip;
00055 FXString help;
00056 protected:
00057 FX7Segment();
00058 private:
00059 FX7Segment(const FX7Segment&);
00060 FX7Segment &operator=(const FX7Segment&);
00061 void drawCells(FXDCWindow &dc,FXint x,FXint y,FXint cw,FXint ch);
00062 void drawSegments(FXDCWindow &dc,FXint x,FXint y,FXint w,FXint h,FXuint segments);
00063 public:
00064 long onPaint(FXObject*,FXSelector,void*);
00065 long onCmdSetValue(FXObject*,FXSelector,void*);
00066 long onCmdSetIntValue(FXObject*,FXSelector,void*);
00067 long onCmdSetRealValue(FXObject*,FXSelector,void*);
00068 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00069 long onCmdGetIntValue(FXObject*,FXSelector,void*);
00070 long onCmdGetRealValue(FXObject*,FXSelector,void*);
00071 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00072 long onCmdSetHelp(FXObject*,FXSelector,void*);
00073 long onCmdGetHelp(FXObject*,FXSelector,void*);
00074 long onCmdSetTip(FXObject*,FXSelector,void*);
00075 long onCmdGetTip(FXObject*,FXSelector,void*);
00076 long onQueryHelp(FXObject*,FXSelector,void*);
00077 long onQueryTip(FXObject*,FXSelector,void*);
00078 public:
00079
00081 FX7Segment(FXComposite* p,const FXString& text,FXuint opts=SEVENSEGMENT_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00082
00084 virtual FXint getDefaultWidth();
00085
00087 virtual FXint getDefaultHeight();
00088
00090 void setText(const FXString& text);
00091
00093 FXString getText() const { return label; }
00094
00096 void setTextColor(FXColor clr);
00097
00099 FXColor getTextColor() const { return textColor; }
00100
00102 void setCellWidth(FXint w);
00103 FXint getCellWidth() const { return cellwidth; }
00104
00106 void setCellHeight(FXint h);
00107 FXint getCellHeight() const { return cellheight; }
00108
00110 void setThickness(FXint t);
00111 FXint getThickness() const { return thickness; }
00112
00114 void set7SegmentStyle(FXuint style);
00115
00117 FXuint get7SegmentStyle() const;
00118
00120 void setJustify(FXuint mode);
00121
00123 FXuint getJustify() const;
00124
00126 void setHelpText(const FXString& text){ help=text; }
00127
00129 const FXString& getHelpText() const { return help; }
00130
00132 void setTipText(const FXString& text){ tip=text; }
00133
00135 const FXString& getTipText() const { return tip; }
00136
00138 virtual void save(FXStream &store) const;
00139
00141 virtual void load(FXStream &store);
00142 };
00143
00144 }
00145
00146 #endif