23#ifndef _SO_WIN_GDI_THUMB_WHEEL_
24#define _SO_WIN_GDI_THUMB_WHEEL_
26#include <Inventor/Win/SoWinBeginStrict.h>
28#include <Inventor/Win/SoWinGDIWidget.h>
29#include <Inventor/misc/SoCallbackList.h>
33class SoDataCallbackList;
35class SgThumbWheelPart ;
36class XmPrimitivePart ;
40typedef void SoWinGDIThumbWheelCB(
void *userData,
void *data );
46} SoWinGDIThumbWheelCBData;
50#define THUMBWHEEL_START 0
51#define THUMBWHEEL_DRAG 1
52#define THUMBWHEEL_FINISH 2
53#define THUMBWHEEL_VALUE_CHANGE 3
56#define XmCR_DRAG THUMBWHEEL_DRAG
57#define XmCR_VALUE_CHANGED THUMBWHEEL_VALUE_CHANGE
60class SoWinGDIThumbWheel ;
61typedef SoWinGDIThumbWheel *SgThumbWheelWidget ;
74 SoWinGDIThumbWheel(
SbBool horizontal);
76 SoWidget parent = NULL,
77 const char *name = NULL,
78 SbBool buildInsideParent = TRUE,
91 ~SoWinGDIThumbWheel();
93 void realizeWidget() ;
101 void setValue(
float v);
102 float getValue() {
return (
float)thumbWheel.value; }
111 void addStartCallback(
112 SoWinGDIThumbWheelCB *f,
113 void *userData = NULL);
114 void addValueChangedCallback(
115 SoWinGDIThumbWheelCB *f,
116 void *userData = NULL);
118 void addDragCallback(
119 SoWinGDIThumbWheelCB *f,
120 void *userData = NULL);
123 void addFinishCallback(
124 SoWinGDIThumbWheelCB *f,
125 void *userData = NULL);
127 void removeStartCallback(
128 SoWinGDIThumbWheelCB *f,
129 void *userData = NULL);
130 void removeValueChangedCallback(
131 SoWinGDIThumbWheelCB *f,
132 void *userData = NULL);
134 void removeDragCallback(
135 SoWinGDIThumbWheelCB *f,
136 void *userData = NULL);
138 void removeFinishCallback(
139 SoWinGDIThumbWheelCB *f,
140 void *userData = NULL);
143 SbBool isInteractive() {
return interactive; }
146 void setBounds(
int nLower,
int nUpper)
147 { thumbWheel.lower_bound = nLower ;
148 thumbWheel.upper_bound = nUpper ; } ;
150 void setHomePosition(
int n)
151 { thumbWheel.home_position = n; } ;
153 void setAngleRange(
int n)
154 { thumbWheel.angle_range = n; } ;
156 void setUnitsPerRotation(
int n)
157 { thumbWheel.angle_factor = n; } ;
159 void setHighlightThickness(
int n)
160 { primitive.highlight_thickness = n; } ;
162 void setShadowThickness(
int n)
163 { primitive.shadow_thickness = n; } ;
167 { thumbWheel.value = n; } ;
169 void setOrientation(
unsigned char n)
170 { thumbWheel.orientation = n; } ;
173 { thumbWheel.animate = n; } ;
175 void setShowHomeButton(
SbBool n)
176 { thumbWheel.show_home_button = n; } ;
183 SoWidget buildWidget(SoWidget parent);
187 virtual void redraw();
188 virtual void processEvent(XAnyEvent *anyevent);
189 virtual void sizeChanged(
const SbVec2s &newSize);
197 SoDataCallbackList *startCallbacks;
198 SoDataCallbackList *finishCallbacks;
199 SoDataCallbackList *changedCallbacks;
200 SoDataCallbackList *dragCallbacks;
204 void constructorCommon(
SbBool horizontal,
SbBool buildNow);
208 typedef struct _XmPrimitivePart
210 int highlight_thickness ;
211 int shadow_thickness ;
214 typedef struct _XmCorePart
221 typedef int Dimension ;
222 typedef int Cardinal ;
223 typedef void XtString ;
226 typedef struct _SgThumbWheelPart {
234 unsigned char orientation;
241 int drag_begin_value;
242 int last_mouse_position;
244 int pegged_mouse_position;
245 Dimension viewable_pixels;
255 Pixmap current_quiet_pixmap;
256 Pixmap current_hilite_pixmap;
259 Pixmap button_quiet_pixmap;
260 Pixmap button_hilite_pixmap;
280 XmPrimitivePart primitive;
281 SgThumbWheelPart thumbWheel;
290 void GetForegroundGC() ;
291 int ConvertPixelsToUserUnits(
int pixels);
292 int ConvertUserUnitsToPixels(
int uu);
293 void CreateAndRenderPixmaps() ;
296 HDC SetupGC(
int nGC) ;
298 void RenderPixmap(
int which);
299 void RenderButtonPixmaps();
303 void SetCurrentPixmap(
SbBool value_increased) ;
307 SbBool MouseIsInWheel(
int event_x,
int event_y);
308 SbBool MouseIsInButton(
int event_x,
int event_y);
310 void Motion(
XEvent *event, XtString *params, Cardinal *num_params);
311 void Btn1Down(
XEvent *event, XtString *params, Cardinal *num_params);
312 void Btn2Down(
XEvent *event, XtString *params, Cardinal *num_params);
313 void Btn3Down(
XEvent *event, XtString *params, Cardinal *num_params);
314 void Btn1Motion(
XEvent *event, XtString *params, Cardinal *num_params);
315 void Btn2Motion(
XEvent *event, XtString *params, Cardinal *num_params);
316 void Btn3Motion(
XEvent *event, XtString *params, Cardinal *num_params);
317 void Btn1Up(
XEvent *event, XtString *params, Cardinal *num_params) ;
318 void Btn2Up(
XEvent *event, XtString *params, Cardinal *num_params) ;
319 void Btn3Up(
XEvent *event, XtString *params, Cardinal *num_params) ;
320 void Enter(
XEvent *event, XtString *params, Cardinal *num_params);
321 void Leave(
XEvent *event, XtString *params, Cardinal *num_params);
323 void PageUp(
XEvent *event, XtString *params, Cardinal *num_params);
324 void PageDown(
XEvent *event, XtString *params, Cardinal *num_params);
325 void Up(
XEvent *event, XtString *params, Cardinal *num_params);
326 void Down(
XEvent *event, XtString *params, Cardinal *num_params);
327 void Left(
XEvent *event, XtString *params, Cardinal *num_params);
328 void Right(
XEvent *event, XtString *params, Cardinal *num_params);
329 void Help(
XEvent *event, XtString *params, Cardinal *num_params);
330 void BeginLine(
XEvent *event, XtString *params, Cardinal *num_params);
331 void EndLine(
XEvent *event, XtString *params, Cardinal *num_params);
332 void ArmHomeButton() ;
333 void DisarmHomeButton() ;
334 void RenderButtonShadows() ;
335 int ProcessMouseEvent(
int event_x,
int event_y) ;
336 void IssueCallback(
int reason,
int value,
XEvent *event) ;
338 Boolean SetValues(SgThumbWheelWidget rw, SgThumbWheelWidget nw, ArgList args, Cardinal *num_args);
339 Boolean ValidateFields(SgThumbWheelWidget req_w,
340 SgThumbWheelWidget new_w) ;
346#include <Inventor/Win/SoWinEndStrict.h>
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Translates and r...