Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoDialogRadioButtons.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Oct 2002)
22**=======================================================================*/
23#ifndef _SO_DIALOG_RADIO_BUTTONS_
24#define _SO_DIALOG_RADIO_BUTTONS_
25
26#include <DialogViz/dialog/SoDialogChoice.h>
27#include <DialogViz/SoDialogWidgetList.h>
28
109{
110 SO_DG_HEADER(SoDialogRadioButtons);
111
112 public:
113
118
119 /*==============================================================================*/
120 private:
121 virtual void buildWidget(SoWidget parent, SbVec2i32 &rSize, SbVec2i32 & pos, SbBool isActive2d);
122 virtual void destroyWidget();
123 void eventNotify(unsigned int event, uintptr_t lParam);
124 static void initClass();
125 static void exitClass();
126 virtual void updateFromSensor(SoSensor* sensor);
127 void drawLabel();
128 virtual void resetSize();
129
130 void updateLabelWidget();
131 void updateRadioButtonsWidget();
132
133 private:
134
135 SoDialogWidgetList m_rbWidgetList;
136
137 SbVec2i32* m_buttonSize;
138 SbVec2i32* m_buttonMin;
139 SbVec2i32* m_buttonMax;
140 int m_arrayNumButtons;
141 int m_cptToResize;
142
143 virtual ~SoDialogRadioButtons();
144
145 private:
146 SbVec2i32 m_orSize;
147 SoWidget m_labelTextWidget;
148 SoWidget m_labelFrameWidget;
149 SbBool m_itemsChangeFromSensor;
150
151 void computeNewButtonsHeight(SbVec2i32 &rSize);
152 void createLabelWidget();
153 void createRadioButtonsWidget(int index);
154 virtual SbVec2i32 getComponentInitSize();
155 virtual SbVec2i32 getLabelInitSize();
156 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
157
158 // reflex function when fields change
159 virtual void changeLabelVisibility();
160 virtual void changeLabelAlignment();
161 virtual void changeEnable();
162 virtual void changeWidgetEnable(SbBool state);
163 virtual void changeLabel();
164 virtual void changeEdgeStyle();
165 virtual void changeSelectedItem();
166 void changeItems();
167 void changeItemText(int index, SbString newText);
168
170// 3D methods
171private:
172 static char* DialogRadioButtons; // Internal default skins.
173 static void change3DSkin();
174 static SbBool isSkinLoaded();
175 static void setSkinLoaded(SbBool loaded);
176
177 private:
178 SO_DG_CATALOG_ENTRY_HEADER( frameSep );
179 SO_DG_CATALOG_ENTRY_HEADER( frame );
180 SO_DG_CATALOG_ENTRY_HEADER( labelSep );
181 SO_DG_CATALOG_ENTRY_HEADER( labelSwitch );
182 SO_DG_CATALOG_ENTRY_HEADER( labelProp );
183 SO_DG_CATALOG_ENTRY_HEADER( itemsSep );
184 SO_DG_CATALOG_ENTRY_HEADER( itemSep );
185 SO_DG_CATALOG_ENTRY_HEADER( itemFrameSep );
186 SO_DG_CATALOG_ENTRY_HEADER( itemFrame );
187 SO_DG_CATALOG_ENTRY_HEADER( itemBtnSep );
188 SO_DG_CATALOG_ENTRY_HEADER( itemBtnSwtch );
189 SO_DG_CATALOG_ENTRY_HEADER( stateOff );
190 SO_DG_CATALOG_ENTRY_HEADER( stateOn );
191 SO_DG_CATALOG_ENTRY_HEADER( itemTextSep );
192 SO_DG_CATALOG_ENTRY_HEADER( itemTextProp );
193
194 SoScale *radioLabelFrameScale, *radioItemFrameScale, *radioItemButtonScale;
195 SoText3 *radioItemText;
196 SoTranslation *radioLabelFrameTranslation, *radioTranslation, *radioItemTranslation;
197 SoTranslation *radioItemButtonTranslation, *radioItemTextTranslation;
198 SoTransform *radioLabelFrameTransform, *radioItemFrameTransform;
199
200 private:
201 SoNodeList m_item3DTextList;
202 SoNodeList m_item3DItemList;
203 SoNodeList m_item3DSwList;
204 static SbBool m_isSkinLoaded;
205
206 SbBox3f m_itemTextCachedBBox;
207
208 void create3DDialogRadioButtons();
209 void update3DRadioButtons();
210 void update3DLabel();
211
212 // local change methods
213 void change3DItems();
214 virtual void change3DSelectedItem();
215
216 // inherited change methods from SoDialogComponent
217 virtual void change3DLabelVisibility();
218
219 // inherited change methods from SoDialogViz
220 virtual void change3DLabel();
221 virtual void change3DLabelAlignment();
222
223 static void finishCB3D( void *, SoDragger *inDragger );
224 void draggerFinishCallback3D();
225
227};
228
229#endif // _SO_DIALOG_RADIO_BUTTONS_
230
231
3D box class.
Definition SbBox.h:649
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:517
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract class f...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog radio but...
SoDialogRadioButtons()
Constructor.
Base class for nodekits that move in response to click-drag-release mouse events.
Definition SoDragger.h:537
Maintains a list of pointers to nodes.
Definition SoNodeList.h:74
Node representing a 3D geometric scaling.
Definition SoScale.h:96
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
3D text shape node.
Definition SoText3.h:204
General 3D geometric transformation node.
Node representing a 3D translation.
int SbBool
Boolean type.
Definition SbBase.h:87