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
00079 class SoMenuItem : public SoDialogViz
00080 {
00081
00082 SO_DG_HEADER(SoMenuItem);
00083
00084
00085 private:
00086 SoMenuItem();
00087
00088 virtual void buildMenu(void* parent, SbBool isActive2d, int index = -1);
00089 static void initClass();
00090 static void exitClass();
00091 virtual void menuEvent(void* , int ) {};
00092 virtual void updateFromSensor(SoSensor* sensor);
00093 SoMenuBar* getMenuBar();
00094 int getId();
00095 virtual void destroyNoDeleteMenuItem() {};
00096 virtual SbVec2i32 getItemInitSize();
00097 virtual void setItemSize(SbVec2i32 nSize, SbBool force = FALSE);
00098 SbVec2i32 getItemSize();
00099
00100 private:
00101 int m_id;
00102 static int ID;
00103 void* m_parentMenu;
00104 SbVec2i32 m_itemSize;
00105
00106 static char buildTitleForMotifMenu( const SbString& inString, SbString& outString);
00107 static SbString getAccelerator( const SbString& inString );
00108 static SbString getKeyCombination( const SbString& inString, SoMenuItem* mi, unsigned int id = 0);
00109
00110 virtual ~SoMenuItem();
00111
00112
00114
00115 private:
00116 static char* MenuItem;
00117 static void change3DSkin();
00118 static SbBool isSkinLoaded();
00119 static void setSkinLoaded(SbBool loaded);
00120
00121 private:
00122 SO_DG_CATALOG_ENTRY_HEADER( itemFrameSep );
00123 SO_DG_CATALOG_ENTRY_HEADER( frame );
00124 SO_DG_CATALOG_ENTRY_HEADER( labelSep );
00125 SO_DG_CATALOG_ENTRY_HEADER( labelProp );
00126
00127 SoScale* menuItemFrameScale;
00128 SoText3* menuItemLabel;
00129 SoTranslation* menuItemFrameTranslation, *menuItemLabelTranslation;
00130 SoTransform* menuItemFrameTransform;
00131
00132 virtual void change3DLabel();
00133 void get3DLabelCachedBBox(SbVec3f& min, SbVec3f& max);
00134
00135 private:
00136 static SbBool m_isSkinLoaded;
00137
00138 void create3DItem(int index);
00139 void update3DItem();
00140
00141 private:
00142 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
00143
00145
00146 };
00147
00148 #endif // _SO_MENU_ITEM_
00149
00150
00151