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
00034
00035
enum {
00036
SEVENSEGMENT_NORMAL = 0,
00037
SEVENSEGMENT_SHADOW = 0x00080000
00038 };
00039
00040
00041
00042
00043
00044
00045
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 protected:
00055 FX7Segment();
00056 private:
00057 FX7Segment(const FX7Segment&);
00058 FX7Segment &operator=(const FX7Segment&);
00059
void drawCells(
FXDCWindow &dc,FXint x,FXint y,FXint cw,FXint ch);
00060
void drawSegments(
FXDCWindow &dc,FXint x,FXint y,FXint w,FXint h,FXuint segments);
00061 public:
00062
long onPaint(
FXObject*,FXSelector,
void*);
00063
long onCmdSetValue(FXObject*,FXSelector,
void*);
00064
long onCmdSetIntValue(FXObject*,FXSelector,
void*);
00065
long onCmdSetRealValue(FXObject*,FXSelector,
void*);
00066
long onCmdSetStringValue(FXObject*,FXSelector,
void*);
00067
long onCmdGetIntValue(FXObject*,FXSelector,
void*);
00068
long onCmdGetRealValue(FXObject*,FXSelector,
void*);
00069
long onCmdGetStringValue(FXObject*,FXSelector,
void*);
00070 public:
00071
00072
00073 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);
00074
00075
00076 virtual FXint getDefaultWidth();
00077
00078
00079 virtual FXint getDefaultHeight();
00080
00081
00082
void setText(const
FXString& text);
00083
00084
00085 FXString getText()
const {
return label; }
00086
00087
00088
void setTextColor(FXColor clr);
00089
00090
00091 FXColor getTextColor()
const {
return textColor; }
00092
00093
00094
void setCellWidth(FXint w);
00095 FXint getCellWidth()
const {
return cellwidth; }
00096
00097
00098
void setCellHeight(FXint h);
00099 FXint getCellHeight()
const {
return cellheight; }
00100
00101
00102
void setThickness(FXint t);
00103 FXint getThickness()
const {
return thickness; }
00104
00105
00106
void set7SegmentStyle(FXuint style);
00107
00108
00109 FXuint get7SegmentStyle() const;
00110
00111
00112
void setJustify(FXuint mode);
00113
00114
00115 FXuint getJustify() const;
00116
00117
00118 virtual
void save(FXStream &store) const;
00119
00120
00121 virtual
void load(FXStream &store);
00122 };
00123
00124 }
00125
00126 #endif