00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_MENU_ITEM_
00024 #define _SO_MENU_ITEM_
00025
00026 #include <DialogViz/dialog/SoDialogViz.h>
00027
00028 class SoMenuBar;
00029
00078 class SoMenuItem : public SoDialogViz
00079 {
00080
00081 SO_DG_HEADER(SoMenuItem);
00082
00083
00084 private:
00085 SoMenuItem();
00086
00087 virtual void buildMenu(void* parent, SbBool isActive2d, int index = -1);
00088 static void initClass();
00089 static void exitClass();
00090 virtual void menuEvent(void* , int ) {};
00091 virtual void updateFromSensor(SoSensor* sensor);
00092 SoMenuBar* getMenuBar();
00093 int getId();
00094 virtual void destroyNoDeleteMenuItem() {};
00095 virtual SbVec2i32 getItemInitSize();
00096 virtual void setItemSize(SbVec2i32 nSize, SbBool force = FALSE);
00097 SbVec2i32 getItemSize();
00098
00099 private:
00100 int m_id;
00101 static int ID;
00102 void* m_parentMenu;
00103 SbVec2i32 m_itemSize;
00104
00105 static char buildTitleForMotifMenu( const SbString& inString, SbString& outString);
00106 static SbString getAccelerator( const SbString& inString );
00107 static SbString getKeyCombination( const SbString& inString, SoMenuItem* mi, unsigned int id = 0);
00108
00109 virtual ~SoMenuItem();
00110
00111
00113
00114 private:
00115 static char* MenuItem;
00116 static void change3DSkin();
00117 static SbBool isSkinLoaded();
00118 static void setSkinLoaded(SbBool loaded);
00119
00120 private:
00121 SO_DG_CATALOG_ENTRY_HEADER( itemFrameSep );
00122 SO_DG_CATALOG_ENTRY_HEADER( frame );
00123 SO_DG_CATALOG_ENTRY_HEADER( labelSep );
00124 SO_DG_CATALOG_ENTRY_HEADER( labelProp );
00125
00126 SoScale* menuItemFrameScale;
00127 SoText3* menuItemLabel;
00128 SoTranslation* menuItemFrameTranslation, *menuItemLabelTranslation;
00129 SoTransform* menuItemFrameTransform;
00130
00131 virtual void change3DLabel();
00132 void get3DLabelCachedBBox(SbVec3f& min, SbVec3f& max);
00133
00134 private:
00135 static SbBool m_isSkinLoaded;
00136
00137 void create3DItem(int index);
00138 void update3DItem();
00139
00140 private:
00141 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
00142
00144
00145 };
00146
00147 #endif // _SO_MENU_ITEM_
00148
00149
00150