Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoDialogPushButton.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_PUSH_BUTTON_
24#define _SO_DIALOG_PUSH_BUTTON_
25
26#include <DialogViz/dialog/SoDialogComponent.h>
27
29
108{
109 SO_DG_HEADER(SoDialogPushButton);
110
111 public:
112
117
122
127
132
133 /*==============================================================================*/
134 private:
135 static void initClass();
136 static void exitClass();
137 virtual void buildWidget(SoWidget parent, SbVec2i32 &rSize, SbVec2i32 & pos, SbBool isActive2d);
138 virtual void destroyWidget();
139 virtual SoWidget getLabelWidget();
140 virtual void updateFromSensor(SoSensor* sensor);
141 virtual void eventNotify(unsigned int event, uintptr_t param);
142
143 void activateButton();
144 void updateLabelWidget();
145 void updateButtonWidget();
146 void applyDlgCptAuditor();
147
148 private:
149 SoWidget m_buttonWidget;
150
151 virtual ~SoDialogPushButton();
152
153 // reflex function when fields change
154 virtual void changeEdgeStyle();
155 virtual void changeLabelVisibility();
156 virtual void changeEnable();
157 virtual void changeWidgetEnable(SbBool state);
158 virtual void changeLabel();
159 virtual void changeLabelAlignment();
160 void changeButtonLabel();
161 void changeButtonState(SbBool state);
162
163 private:
164
165 SbVec2i32 m_obSize; // original button size function of button text
166
167 FIELD_SENSOR(buttonLabel);
168 void createLabelWidget();
169 void createButtonWidget();
170 virtual SbVec2i32 getComponentInitSize();
171 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
172
174// 3D methods
175private:
176 static char* DialogPushButton; // Internal default skins.
177 static void change3DSkin();
178 static SbBool isSkinLoaded();
179 static void setSkinLoaded(SbBool loaded);
180
181 void set3DPressedGeometry(SoNode* node);
182 void set3DReleasedGeometry(SoNode* node);
183
184private:
185 SO_DG_CATALOG_ENTRY_HEADER(labelSep);
186 SO_DG_CATALOG_ENTRY_HEADER(labelSwitch);
187 SO_DG_CATALOG_ENTRY_HEADER(labelProp);
188 SO_DG_CATALOG_ENTRY_HEADER(frameSep);
189 SO_DG_CATALOG_ENTRY_HEADER(frameSwitch);
190 SO_DG_CATALOG_ENTRY_HEADER(released);
191 SO_DG_CATALOG_ENTRY_HEADER(pressed);
192 SO_DG_CATALOG_ENTRY_HEADER(buttonLabelSep);
193 SO_DG_CATALOG_ENTRY_HEADER(buttonLabelProp);
194
195 SoText3 *pushButtonButtonLabel, *pushButtonLabel;
196 SoTranslation *pushButtonLabelTranslation, *pushButtonFrameTranslation;
197 SoTranslation *pushButtonButtonLabelTranslation;
198 SoScale *pushButtonFrameScale;
199 SoTransform *pushButtonFrameTransform;
200
201private:
202 SbBox3f m_buttonLabelCachedBBox;
203 static SbBool m_isSkinLoaded;
204
205 void create3DDialogPushButton();
206 void update3DButton();
207 void update3DLabel();
208
209 void change3DButtonLabel();
210 virtual void change3DLabelVisibility();
211 virtual void change3DLabel();
212 virtual void change3DLabelAlignment();
213 void change3DButtonState(SbBool state);
214
215 static void startCB3D( void *, SoDragger *inDragger );
216 static void finishCB3D( void *, SoDragger *inDragger );
217 void draggerStartCallback3D();
218 void draggerFinishCallback3D();
219
221};
222
223#endif // _SO_DIALOG_PUSH_BUTTON_
224
225
3D box class.
Definition SbBox.h:649
2D vector class.
Definition SbVec.h:517
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog PushButto...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog push butt...
void removeAuditor(SoDialogPushButtonAuditor *auditor)
Removes the specified pushButtonAuditor from the auditor list.
SoSFString buttonLabel
Specifies the label of the button.
void addAuditor(SoDialogPushButtonAuditor *auditor)
Adds a dialogPushButtonAuditor to the current PushButton component.
SoDialogPushButton()
Constructor.
Base class for nodekits that move in response to click-drag-release mouse events.
Definition SoDragger.h:537
Abstract base class for all database nodes.
Definition SoNode.h:145
Field containing a string.
Definition SoSFString.h:117
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