Skip to content
Newer
Older
100644 142 lines (118 sloc) 5.03 KB
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23
24 /// 7 Segment styles
25 enum {
26 SEVENSEGMENT_NORMAL = 0, /// Draw segments normally
27 SEVENSEGMENT_SHADOW = 0x00080000 /// Draw shadow under the segments
28 };
29
30 %rename("text=") FX7Segment::setText(const FXString&);
31 %rename("text") FX7Segment::getText() const;
32 %rename("textColor=") FX7Segment::setTextColor(FXColor);
33 %rename("textColor") FX7Segment::getTextColor() const;
34 %rename("cellWidth=") FX7Segment::setCellWidth(FXint);
35 %rename("cellWidth") FX7Segment::getCellWidth() const;
36 %rename("cellHeight=") FX7Segment::setCellHeight(FXint);
37 %rename("cellHeight") FX7Segment::getCellHeight() const;
38 %rename("thickness=") FX7Segment::setThickness(FXint);
39 %rename("thickness") FX7Segment::getThickness() const;
40 %rename("justify=") FX7Segment::setJustify(FXuint);
41 %rename("justify") FX7Segment::getJustify() const;
42 %rename("helpText=") FX7Segment::setHelpText(const FXString&);
43 %rename("helpText") FX7Segment::getHelpText() const;
44 %rename("tipText=") FX7Segment::setTipText(const FXString&);
45 %rename("tipText") FX7Segment::getTipText() const;
46
47 /**
48 * Seven-segment (eg LCD/watch style) widget, useful for making
49 * indicators and timers. Besides numbers, the seven-segment
50 * display widget can also display some letters and punctuations.
51 */
52 class FX7Segment : public FXFrame {
53 protected:
54 FXString label; // Text being shown
55 FXColor textColor; // Text color
56 FXint thickness; // Segment thickness
57 FXint cellwidth; // Width of cell
58 FXint cellheight; // height of cell
59 protected:
60 FX7Segment();
61 public:
62 long onPaint(FXObject*,FXSelector,void* PTR_EVENT);
63 long onCmdSetValue(FXObject*,FXSelector,void*); // FIXME
64 long onCmdSetIntValue(FXObject*,FXSelector,void*); // FIXME
65 long onCmdSetRealValue(FXObject*,FXSelector,void*); // FIXME
66 long onCmdSetStringValue(FXObject*,FXSelector,void*); // FIXME
67 long onCmdGetIntValue(FXObject*,FXSelector,void*); // FIXME
68 long onCmdGetRealValue(FXObject*,FXSelector,void*); // FIXME
69 long onCmdGetStringValue(FXObject*,FXSelector,void*); // FIXME
70 long onCmdSetHelp(FXObject*,FXSelector,void*); // FIXME
71 long onCmdGetHelp(FXObject*,FXSelector,void*); // FIXME
72 long onCmdSetTip(FXObject*,FXSelector,void*); // FIXME
73 long onCmdGetTip(FXObject*,FXSelector,void*); // FIXME
74 long onQueryHelp(FXObject*,FXSelector,void*); // FIXME
75 long onQueryTip(FXObject*,FXSelector,void*); // FIXME
76 public:
77
78 %extend {
79 /// Create a seven segment display
80 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){
81 return new FXRb7Segment(p,text,opts,x,y,w,h,pl,pr,pt,pb);
82 }
83 }
84
85 /// Set the text for this label
86 void setText(const FXString& text);
87
88 /// Get the text for this label
89 FXString getText() const;
90
91 /// Change text color
92 void setTextColor(FXColor clr);
93
94 /// Return text color
95 FXColor getTextColor() const;
96
97 /// Get/set cell width
98 void setCellWidth(FXint w);
99 FXint getCellWidth() const;
100
101 /// Get/set cell height
102 void setCellHeight(FXint h);
103 FXint getCellHeight() const;
104
105 /// Get/set segment thickness
106 void setThickness(FXint t);
107 FXint getThickness() const;
108
109 /// Change 7 segment style
110 void set7SegmentStyle(FXuint style);
111
112 /// Get current 7 segment style
113 FXuint get7SegmentStyle() const;
114
115 /// Set the current text-justification mode.
116 void setJustify(FXuint mode);
117
118 /// Get the current text-justification mode.
119 FXuint getJustify() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
120
121 /// Set the status line help text
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
122 void setHelpText(const FXString& text);
123
bea4cad @larskanis Strip all whitespaces on line endings
authored
124 /// Get the status line help text
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
125 const FXString& getHelpText() const;
126
bea4cad @larskanis Strip all whitespaces on line endings
authored
127 /// Set the tool tip message
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
128 void setTipText(const FXString& text);
129
bea4cad @larskanis Strip all whitespaces on line endings
authored
130 /// Get the tool tip message
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
131 const FXString& getTipText() const;
132
133 /// Destroy
134 virtual ~FX7Segment();
135 };
136
137 DECLARE_FXOBJECT_VIRTUALS(FX7Segment)
138 DECLARE_FXID_VIRTUALS(FX7Segment)
139 DECLARE_FXDRAWABLE_VIRTUALS(FX7Segment)
140 DECLARE_FXWINDOW_VIRTUALS(FX7Segment)
141
Something went wrong with that request. Please try again.