Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoDialogChoice.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_CHOICE_
24#define _SO_DIALOG_CHOICE_
25
26#include <DialogViz/dialog/SoDialogComponent.h>
27#include <Inventor/fields/SoMFString.h>
28
30
46{
47 SO_DG_HEADER(SoDialogChoice);
48
49 public:
50
55
60
65
70
74 void addItem(SbString newItem);
75
79 void insertItem(int index, SbString newItem);
80
84 void removeItem(int index);
85
86/*==============================================================================*/
87private:
88 virtual SoWidget getLabelWidget();
89 static void initClass();
90 static void exitClass();
91 virtual void updateFromSensor(SoSensor* sensor);
92 virtual void buildWidget(SoWidget parent, SbVec2i32 &rSize, SbVec2i32 & pos, SbBool isActive2d);
93 virtual void destroyWidget();
94
95 void applyDlgCptAuditor();
96
97 private:
98 int m_numItems;
99
101 virtual ~SoDialogChoice();
102
103 // reflex function when fields change
104 virtual void changeEnable() {};
105 virtual void changeWidgetEnable(SbBool ) {};
106 virtual void changeItems() {};
107 virtual void changeLabel();
108 virtual void changeLabelAlignment() {};
109 virtual void changeLabelVisibility() {};
110 virtual void changeSelectedItem() {};
111 void fixItemsNumber();
112
113 /* === FIELDS DECLARATION === */
114 FIELD_SENSOR(items);
115 FIELD_SENSOR(selectedItem);
116
118// 3D methods
119private:
120
121private:
122 SoText3 *choiceLabel;
123 SoTranslation* choiceLabelTranslation;
124 int m_initItem;
125 int m_prevNumItems;
126 int m_prevSelectedItem;
127 SbBool m_needUpdate;
128
129 virtual void change3DSelectedItem() {};
130 virtual void change3DItems() {};
131
133
134};
135
136#endif // _SO_DIALOG_CHOICE_
137
138
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> Dialog Choice au...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract class f...
void addItem(SbString newItem)
Convenient method for adding a new item.
SoMFString items
List of strings appearing in the component.
SoSFInt32 selectedItem
Selected choice.
void addAuditor(SoDialogChoiceAuditor *auditor)
Adds a dialogChoiceAuditor to the current Choice component.
void removeItem(int index)
Convenient method for removing a new item.
void insertItem(int index, SbString newItem)
Convenient method for inserting a new item.
void removeAuditor(SoDialogChoiceAuditor *auditor)
Removes the specified choiceAuditor from the auditor list.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Multiple-value field containing any number of strings.
Definition SoMFString.h:116
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
3D text shape node.
Definition SoText3.h:204
Node representing a 3D translation.
int SbBool
Boolean type.
Definition SbBase.h:87