25#ifndef _SO_WIN_COLOR_EDITOR_
26#define _SO_WIN_COLOR_EDITOR_
28#include <Inventor/sys/port.h>
30# include <Inventor/Win/SoWinBeginStrict.h>
34#include <Inventor/SbColor.h>
35#include <Inventor/misc/SoCallbackList.h>
36#include <Inventor/Win/SoWinComponent.h>
48class SoWinColorSlider;
52struct ColorEditorCBData;
149 SoWidget parent = NULL,
150 const char *name = NULL,
151 SbBool buildInsideParent = TRUE);
202 void *userData = NULL);
209 void *userData = NULL);
258 {
return updateFreq; }
276 virtual SbString getDefaultWidgetName()
const;
277 virtual SbString getDefaultTitle()
const;
278 virtual SbString getDefaultIconTitle()
const;
284 POINT sliderLabPos[6] ;
285 POINT sliderValPos[6] ;
289 unsigned long sliderId[6] ;
290 unsigned long sliderLabId[6] ;
291 unsigned long sliderValId[6] ;
292 unsigned long areaId[6] ;
293 unsigned long nCurrSliderId ;
294 unsigned long nCurrEditId ;
297 HGLOBAL hDlgTemplate;
299 CBitButton *lpleftButton ;
300 CBitButton *lprightButton ;
301 CBitButton *lpswitchButton ;
304 void getControlPositions() ;
305 void hideAllSliders() ;
306 void showAllSliders() ;
307 void moveSlider(
int nSlider,
int nPos) ;
308 void showSlider(
int nSlider) ;
309 void hideSlider(
int nSlider) ;
310 void showControl(
int nId) ;
311 void hideControl(
int nId) ;
312 void sizeToArea(
int n) ;
313 void layoutAccept(WBOOL nReduceOk) ;
321 static WBOOL CALLBACK mgrDlgProc( Hwnd hdlg, UINT message,
322 WPARAM wParam, LPARAM lParam );
323 static void onCommand(
334 WBOOL handleDrawItem(
342 SoWidget buildWidget(SoWidget parent);
343 static void visibilityChangeCB(
void *pt,
SbBool visible);
352 SoWinColorSlider *sliders[6];
353 SoWinColorWheel *wheel;
354 SoWinColorPatch *current, *previous;
355 ColorEditorCBData *dataId;
374 void copy(Time eventTime);
375 void paste(Time eventTime);
378 static void pasteDoneCB(
void *userData,
SoPathList *pathList);
381 SoWidget acceptButton, slidersForm, buttonsForm, wheelForm;
384 SoWidget buildPulldownMenu(SoWidget parent);
385 SoWidget buildControls(SoWidget parent);
386 SoWidget buildSlidersForm(SoWidget parent);
388 void doSliderLayout();
389 void doDynamicTopLevelLayout();
398 static void fieldChangedCB(
void *,
SoSensor *);
401 static void wheelCallback(
void *,
const float hsv[3]);
402 void wheelChanged(
const float hsv[3]);
403 static void sliderCallback(
void *,
float);
404 void sliderChanged(
short id,
float value);
407 void buttonsCallback(
int id);
409 static void buttonsCallback(SoWidget, ColorEditorCBData *,
XtPointer);
411 void buttonPressed(
short id);
414 void editMenuCallback(
int id);
415 void sliderMenuCallback(
int id);
417 static void editMenuCallback(SoWidget, ColorEditorCBData *, XmAnyCallbackStruct *);
418 static void sliderMenuCallback(SoWidget, ColorEditorCBData *,
XtPointer);
424 void constructorCommon(
SbBool buildNow);
431 SoWinColorEditorCB *f,
433{ callbackList->
addCallback((SoCallbackListCB *) f, userData); }
437 SoWinColorEditorCB *f,
439{ callbackList->
removeCallback((SoCallbackListCB *) f, userData); }
443#include <Inventor/Win/SoWinEndStrict.h>
List of generic (void *) pointers.
Class for smart character strings.
Base class for all nodes, paths, and engines.
Manages a list of callbacks and associated data.
void addCallback(SoCallbackListCB *f, void *userData=NULL)
Adds a function to the list of callback functions.
void removeCallback(SoCallbackListCB *f, void *userData=NULL)
Removes a function from the list of callback functions.
Multiple-value field containing any number of RGB colors stored as three floats.
Multiple-value field containing any number of uint32_t integers.
Sensor class that can be attached to Open Inventor nodes.
Maintains a list of pointers to paths.
Field containing an RGB color.
Abstract base class for Open Inventor sensors.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Supports copy/pa...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component that l...
Sliders
list of possible slider combinations, which is used to specify which sliders should be displayed at a...
@ RGB_HSV
Display RGB and HSV sliders.
@ NONE
Display no sliders.
@ HSV
Display HSV sliders.
@ RGB
Display RGB sliders.
@ RGB_V
Display RGB and value sliders.
@ INTENSITY
Display intensity slider (default)
void attach(SoMFColor *color, int index, SoBase *node)
Attaches the editor to a color node and edits the specified color.
void setColor(const SbColor &color)
Sets a new color value.
SoWinColorEditor::UpdateFrequency getUpdateFrequency()
Gets the update frequency.
void attach(SoMFUInt32 *color, int index, SoBase *node)
Handles attaching to an "orderedRGBA" field (e.g. SoVertexProperty)
void setWYSIWYG(SbBool trueOrFalse)
Sets the WYSIWYG (what-you-see-is-what-you-get) mode on/off for the colored backgrounds of the slider...
void removeColorChangedCallback(SoWinColorEditorCB *f, void *userData=NULL)
Removes colorChanged callback.
void setCurrentSliders(SoWinColorEditor::Sliders whichSliders)
Sets which slider(s) should be displayed.
void detach()
Detaches the editor from a color node.
void addColorChangedCallback(SoWinColorEditorCB *f, void *userData=NULL)
Additional way of using the color editor, by registering a callback which will be called whenever the...
SoWinColorEditor(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
const SbColor & getColor()
Gets the current color value.
void attach(SoSFColor *color, SoBase *node)
Attaches the editor to a color node and edits the specified color.
UpdateFrequency
UpdateFrequency is how often new values should be sent to the node or the callback routine.
@ CONTINUOUS
Send updates with every mouse motion.
@ AFTER_ACCEPT
Only send updates after user hits accept button.
SbBool isAttached()
Returns TRUE if the editor is attached.
void setUpdateFrequency(SoWinColorEditor::UpdateFrequency freq)
Sets the update frequency.
SbBool isWYSIWYG()
Gets the WYSIWYG mode.
void SoWinColorEditorCB(void *userData, const SbColor *color)
SoWinColorEditor::Sliders getCurrentSliders()
Gets which slider(s) should be displayed.
~SoWinColorEditor()
Destructor.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...