00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00017 *** MERIGNAC, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_WIN_COLOR_PATCH_ 00026 #define _SO_WIN_COLOR_PATCH_ 00027 00028 #include <Inventor/Win/SoWinBeginStrict.h> 00029 #include <Inventor/Win/SoWinGDIWidget.h> 00030 #include <Inventor/SbColor.h> 00031 00032 00034 // 00035 // Class: SoWinColorPatch 00036 // 00037 // This class simply draws a 3D looking patch of color. 00038 // 00040 00041 { 00042 00043 00044 public: 00045 00046 SoWinColorPatch( 00047 SoWidget parent = NULL, 00048 const char *name = NULL, 00049 SbBool buildInsideParent = TRUE); 00050 ~SoWinColorPatch(); 00051 00052 // 00053 // set/get routines to specify the patch top color 00054 // 00055 void setColor(const SbColor &rgb); 00056 const SbColor & getColor() { return color; } 00057 00058 private: 00059 00060 // This constructor takes a boolean whether to build the widget now. 00061 // Subclasses can pass FALSE, then call SoWinSlider::buildWidget() 00062 // when they are ready for it to be built. 00063 SoEXTENDER 00064 SoWinColorPatch( 00065 SoWidget parent, 00066 const char *name, 00067 SbBool buildInsideParent, 00068 SbBool buildNow); 00069 00070 private: 00071 00072 // redefine to do ColorPatch specific things 00073 virtual void redraw(); 00074 virtual void sizeChanged(const SbVec2s &newSize); 00075 00076 // local variables 00077 SbColor color; 00078 00079 // this is called by both constructors 00080 void constructorCommon(SbBool buildNow); 00081 }; 00082 00083 #include <Inventor/Win/SoWinEndStrict.h> 00084 00085 #endif // _SO_WIN_COLOR_PATCH_ 00086 00087 00088