00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FX7SEGMENT_H
00022 #define FX7SEGMENT_H
00023
00024 #ifndef FXFRAME_H
00025 #include "FXFrame.h"
00026 #endif
00027
00028
00029 namespace FX {
00030
00032 enum {
00033 SEVENSEGMENT_NORMAL = 0,
00034 SEVENSEGMENT_SHADOW = 0x00080000
00035 };
00036
00037
00043 class FXAPI FX7Segment : public FXFrame {
00044 FXDECLARE(FX7Segment)
00045 protected:
00046 FXString label;
00047 FXColor textColor;
00048 FXint thickness;
00049 FXint cellwidth;
00050 FXint cellheight;
00051 FXString tip;
00052 FXString help;
00053 protected:
00054 FX7Segment();
00055 private:
00056 FX7Segment(const FX7Segment&);
00057 FX7Segment &operator=(const FX7Segment&);
00058 void drawCells(FXDCWindow &dc,FXint x,FXint y,FXint cw,FXint ch);
00059 void drawSegments(FXDCWindow &dc,FXint x,FXint y,FXint w,FXint h,FXuint segments);
00060 public:
00061 long onPaint(FXObject*,FXSelector,void*);
00062 long onCmdSetValue(FXObject*,FXSelector,void*);
00063 long onCmdSetIntValue(FXObject*,FXSelector,void*);
00064 long onCmdGetIntValue(FXObject*,FXSelector,void*);
00065 long onCmdSetLongValue(FXObject*,FXSelector,void*);
00066 long onCmdGetLongValue(FXObject*,FXSelector,void*);
00067 long onCmdSetRealValue(FXObject*,FXSelector,void*);
00068 long onCmdGetRealValue(FXObject*,FXSelector,void*);
00069 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00070 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00071 long onCmdSetHelp(FXObject*,FXSelector,void*);
00072 long onCmdGetHelp(FXObject*,FXSelector,void*);
00073 long onCmdSetTip(FXObject*,FXSelector,void*);
00074 long onCmdGetTip(FXObject*,FXSelector,void*);
00075 long onQueryHelp(FXObject*,FXSelector,void*);
00076 long onQueryTip(FXObject*,FXSelector,void*);
00077 public:
00078
00080 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);
00081
00083 virtual FXint getDefaultWidth();
00084
00086 virtual FXint getDefaultHeight();
00087
00089 void setText(const FXString& text);
00090
00092 FXString getText() const { return label; }
00093
00095 void setTextColor(FXColor clr);
00096
00098 FXColor getTextColor() const { return textColor; }
00099
00101 void setCellWidth(FXint w);
00102 FXint getCellWidth() const { return cellwidth; }
00103
00105 void setCellHeight(FXint h);
00106 FXint getCellHeight() const { return cellheight; }
00107
00109 void setThickness(FXint t);
00110 FXint getThickness() const { return thickness; }
00111
00113 void set7SegmentStyle(FXuint style);
00114
00116 FXuint get7SegmentStyle() const;
00117
00119 void setJustify(FXuint mode);
00120
00122 FXuint getJustify() const;
00123
00125 void setHelpText(const FXString& text){ help=text; }
00126
00128 const FXString& getHelpText() const { return help; }
00129
00131 void setTipText(const FXString& text){ tip=text; }
00132
00134 const FXString& getTipText() const { return tip; }
00135
00137 virtual void save(FXStream &store) const;
00138
00140 virtual void load(FXStream &store);
00141 };
00142
00143 }
00144
00145 #endif