Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoMenuItem.h
Go to the documentation of this file.
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-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Oct 2002)
22**=======================================================================*/
23#ifndef _SO_MENU_ITEM_
24#define _SO_MENU_ITEM_
25
27
28class SoMenuBar;
29
78class SoMenuItem : public SoDialogViz
79{
80
82
83/*==============================================================================*/
84private:
85 SoMenuItem();
86
87 virtual void buildMenu(void* parent, SbBool isActive2d, int index = -1);
88 static void initClass();
89 static void exitClass();
90 virtual void menuEvent(void* , int ) {};
91 virtual void updateFromSensor(SoSensor* sensor);
92 SoMenuBar* getMenuBar();
93 int getId();
94 virtual void destroyNoDeleteMenuItem() {};
95 virtual SbVec2i32 getItemInitSize();
96 virtual void setItemSize(SbVec2i32 nSize, SbBool force = FALSE);
97 SbVec2i32 getItemSize();
98
99private:
100 int m_id;
101 static int ID; // windows only
102 void* m_parentMenu;
103 SbVec2i32 m_itemSize;
104
105 static char buildTitleForMotifMenu( const SbString& inString, SbString& outString);
106 static SbString getAccelerator( const SbString& inString );
107 static SbString getKeyCombination( const SbString& inString, SoMenuItem* mi, unsigned int id = 0);
108
109 virtual ~SoMenuItem();
110
111
113// 3D methods
114private:
115 static char* MenuItem; //Internal default skin.
116 static void change3DSkin();
117 static SbBool isSkinLoaded();
118 static void setSkinLoaded(SbBool loaded);
119
120private:
121 SO_DG_CATALOG_ENTRY_HEADER( itemFrameSep );
123 SO_DG_CATALOG_ENTRY_HEADER( labelSep );
124 SO_DG_CATALOG_ENTRY_HEADER( labelProp );
125
126 SoScale* menuItemFrameScale;
127 SoText3* menuItemLabel;
128 SoTranslation* menuItemFrameTranslation, *menuItemLabelTranslation;
129 SoTransform* menuItemFrameTransform;
130
131 virtual void change3DLabel();
132 void get3DLabelCachedBBox(SbVec3f& min, SbVec3f& max);
133
134private:
135 static SbBool m_isSkinLoaded;
136
137 void create3DItem(int index);
138 void update3DItem();
139
140private:
141 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
142
144
145};
146
147#endif // _SO_MENU_ITEM_
148
149
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
#define SO_DG_HEADER(className)
#define SO_DG_CATALOG_ENTRY_HEADER(resource)
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:517
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Computes bounding box of a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Menu bar node.
Definition SoMenuBar.h:77
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract class f...
Definition SoMenuItem.h:79
Node representing a 3D geometric scaling.
Definition SoScale.h:96
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:97
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