Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 167 lines (138 sloc) 6.736 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 /// Slider Control styles
24 enum {
25 REALSLIDER_HORIZONTAL = 0, /// Slider shown horizontally
26 REALSLIDER_VERTICAL = 0x00008000, /// Slider shown vertically
27 REALSLIDER_ARROW_UP = 0x00010000, /// Slider has arrow head pointing up
28 REALSLIDER_ARROW_DOWN = 0x00020000, /// Slider has arrow head pointing down
29 REALSLIDER_ARROW_LEFT = REALSLIDER_ARROW_UP, /// Slider has arrow head pointing left
30 REALSLIDER_ARROW_RIGHT = REALSLIDER_ARROW_DOWN, /// Slider has arrow head pointing right
31 REALSLIDER_INSIDE_BAR = 0x00040000, /// Slider is inside the slot rather than overhanging
32 REALSLIDER_TICKS_TOP = 0x00080000, /// Ticks on the top of horizontal slider
33 REALSLIDER_TICKS_BOTTOM = 0x00100000, /// Ticks on the bottom of horizontal slider
34 REALSLIDER_TICKS_LEFT = REALSLIDER_TICKS_TOP, /// Ticks on the left of vertical slider
35 REALSLIDER_TICKS_RIGHT = REALSLIDER_TICKS_BOTTOM, /// Ticks on the right of vertical slider
36 REALSLIDER_NORMAL = REALSLIDER_HORIZONTAL
37 };
38
39
40 /**
41 * The real slider widget is a valuator widget which provides simple linear value range.
42 * Two visual appearances are supported:- the sunken look, which is enabled with
43 * the SLIDER_INSIDE_BAR option and the regular look. The latter may have optional
44 * arrows on the slider thumb.
45 * While being moved, the real slider sends a SEL_CHANGED message to its target;
46 * at the end of the interaction, a SEL_COMMAND message is sent.
47 * The message data represents the current slider value, of type pointer to FXdouble.
48 */
49 class FXRealSlider : public FXFrame {
50 public:
51 long onPaint(FXObject*,FXSelector,void* PTR_EVENT);
52 long onMotion(FXObject*,FXSelector,void* PTR_EVENT);
53 long onMouseWheel(FXObject*,FXSelector,void* PTR_EVENT);
54 long onLeftBtnPress(FXObject*,FXSelector,void* PTR_EVENT);
55 long onLeftBtnRelease(FXObject*,FXSelector,void* PTR_EVENT);
56 long onMiddleBtnPress(FXObject*,FXSelector,void* PTR_EVENT);
57 long onMiddleBtnRelease(FXObject*,FXSelector,void* PTR_EVENT);
58 long onKeyPress(FXObject*,FXSelector,void* PTR_EVENT);
59 long onKeyRelease(FXObject*,FXSelector,void* PTR_EVENT);
60 long onUngrabbed(FXObject*,FXSelector,void* PTR_EVENT);
61 long onAutoSlide(FXObject*,FXSelector,void* PTR_INT);
62 long onCmdSetValue(FXObject*,FXSelector,void* PTR_INT);
63 long onCmdSetIntValue(FXObject*,FXSelector,void* PTR_PINT);
64 long onCmdGetIntValue(FXObject*,FXSelector,void* PTR_IGNORE); // FIXME
65 long onCmdSetRealValue(FXObject*,FXSelector,void* PTR_PDOUBLE);
66 long onCmdGetRealValue(FXObject*,FXSelector,void* PTR_IGNORE); // FIXME
67 long onCmdSetIntRange(FXObject*,FXSelector,void* PTR_INTRANGE_IN);
68 long onCmdGetIntRange(FXObject*,FXSelector,void* PTR_INTRANGE_OUT);
69 long onCmdSetRealRange(FXObject*,FXSelector,void* PTR_DBLRANGE_IN);
70 long onCmdGetRealRange(FXObject*,FXSelector,void* PTR_DBLRANGE_OUT);
71 long onCmdSetHelp(FXObject*,FXSelector,void* PTR_STRING);
72 long onCmdGetHelp(FXObject*,FXSelector,void* PTR_IGNORE); // FIXME
73 long onCmdSetTip(FXObject*,FXSelector,void* PTR_STRING);
74 long onCmdGetTip(FXObject*,FXSelector,void* PTR_IGNORE); // FIXME
75 long onQueryHelp(FXObject*,FXSelector,void* PTR_IGNORE);
76 long onQueryTip(FXObject*,FXSelector,void* PTR_IGNORE);
77 public:
78 enum{
79 ID_AUTOSLIDE=FXFrame::ID_LAST,
80 ID_LAST
81 };
82 public:
bea4cad @larskanis Strip all whitespaces on line endings
authored
83
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
84 /// Construct a slider widget
85 %extend {
86 FXRealSlider(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=REALSLIDER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0){
87 return new FXRbRealSlider(p,tgt,sel,opts,x,y,w,h,pl,pr,pt,pb);
88 }
89 }
90
91 /// Change slider value
92 void setValue(FXdouble value,FXbool notify=FALSE);
bea4cad @larskanis Strip all whitespaces on line endings
authored
93
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
94 /// Return slider value
95 FXdouble getValue() const;
96
97 /// Change the slider's range
98 void setRange(FXdouble lo,FXdouble hi,FXbool notify=FALSE);
99
100 %extend {
101 /// Get the slider's current range
102 VALUE getRange() const {
103 FXdouble lo,hi;
104 self->getRange(lo,hi);
105 return rb_ary_new3(2,rb_float_new(lo),rb_float_new(hi));
106 }
107 }
108
109 /// Change the slider style
110 FXuint getSliderStyle() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
111
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
112 /// Get the current slider style
113 void setSliderStyle(FXuint style);
bea4cad @larskanis Strip all whitespaces on line endings
authored
114
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
115 /// Get the slider's head size
116 FXint getHeadSize() const;
117
118 /// Change the slider's head size
119 void setHeadSize(FXint hs);
bea4cad @larskanis Strip all whitespaces on line endings
authored
120
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
121 /// Get the slider's current slot size
122 FXint getSlotSize() const;
123
124 /// Change the slider's slot size
125 void setSlotSize(FXint bs);
bea4cad @larskanis Strip all whitespaces on line endings
authored
126
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
127 /// Get the slider's auto-increment/decrement value
128 FXdouble getIncrement() const;
129
130 /// Change the slider's auto-increment/decrement value
131 void setIncrement(FXdouble inc);
132
133 /// Change the delta between ticks
134 void setTickDelta(FXdouble dist);
135
136 /// Get delta between ticks
137 FXdouble getTickDelta() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
138
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
139 /// Change the color of the slot the slider head moves in
140 void setSlotColor(FXColor clr);
bea4cad @larskanis Strip all whitespaces on line endings
authored
141
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
142 /// Get the current slot color
143 FXColor getSlotColor() const;
144
145 /// Set the help text to be displayed on the status line
146 void setHelpText(const FXString& text);
bea4cad @larskanis Strip all whitespaces on line endings
authored
147
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
148 /// Get the current help text
149 const FXString& getHelpText() const;
150
151 /// Set the tip text to be displayed in the tooltip
152 void setTipText(const FXString& text);
bea4cad @larskanis Strip all whitespaces on line endings
authored
153
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
154 /// Get the current tooltip text value
155 const FXString& getTipText() const;
156
157 /// Destroy the slider
158 virtual ~FXRealSlider();
159 };
160
161
162 DECLARE_FXOBJECT_VIRTUALS(FXRealSlider)
163 DECLARE_FXID_VIRTUALS(FXRealSlider)
164 DECLARE_FXDRAWABLE_VIRTUALS(FXRealSlider)
165 DECLARE_FXWINDOW_VIRTUALS(FXRealSlider)
166
Something went wrong with that request. Please try again.