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_RADIO_BUTTONS_
00024 #define _SO_MENU_RADIO_BUTTONS_
00025
00026 #include <DialogViz/dialog/SoMenuItem.h>
00027 #include <Inventor/fields/SoMFString.h>
00028 #include <Inventor/fields/SoSFInt32.h>
00029
00030 class SoMenuRadioButtonsAuditor;
00031
00075 class SoMenuRadioButtons : public SoMenuItem
00076 {
00077 SO_DG_HEADER(SoMenuRadioButtons);
00078
00079 public:
00080
00084 SoMFString items;
00085
00089 SoSFInt32 selectedItem;
00090
00094 SoMFString accelerators;
00095
00099 SoMenuRadioButtons();
00100
00104 void addAuditor(SoMenuRadioButtonsAuditor* auditor);
00105
00109 void removeAuditor(SoMenuRadioButtonsAuditor* auditor);
00110
00111
00112 private:
00113 virtual void buildMenu(void* parent, SbBool isActive2d, int index = -1);
00114 static void initClass();
00115 static void exitClass();
00116 void menuEvent(void* parent, int itemId);
00117 virtual void updateFromSensor(SoSensor* sensor);
00118 virtual void destroyNoDeleteMenuItem();
00119 void applyDlgCptAuditor();
00120
00121 private:
00122
00123 virtual ~SoMenuRadioButtons();
00124
00125 private:
00126
00127 int m_numItems;
00128 int m_oldNumItems;
00129 int m_index;
00130
00131 FIELD_SENSOR(selectedItem);
00132 FIELD_SENSOR(items);
00133 FIELD_SENSOR(accelerators);
00134
00135 virtual SbVec2i32 getItemInitSize();
00136 virtual void setItemSize(SbVec2i32 nSize, SbBool force = FALSE);
00137
00138 virtual void changeLabel();
00139 virtual void changeEnable();
00140 void changeSelectedItem();
00141 void changeItems();
00142 void changeAccelerators();
00143
00144 void** m_radioButtonsMenuWin;
00145 void insertMenuItem(int index);
00146 void updateMenuItem();
00147 void verifySelectedItem();
00148
00150
00151 private:
00152 static char* MenuRadioButtons;
00153 static void change3DSkin();
00154 static SbBool isSkinLoaded();
00155 static void setSkinLoaded(SbBool loaded);
00156
00157 private:
00158 SO_DG_CATALOG_ENTRY_HEADER( radioSep );
00159 SO_DG_CATALOG_ENTRY_HEADER( itemsSep );
00160 SO_DG_CATALOG_ENTRY_HEADER( itemSwtch );
00161 SO_DG_CATALOG_ENTRY_HEADER( stateOff );
00162 SO_DG_CATALOG_ENTRY_HEADER( stateOn );
00163
00164 SoTranslation* menuRadioButtonsShapeTranslation;
00165 SoScale* menuRadioButtonsShapeScale;
00166
00167 private:
00168 SoNodeList m_item3DList;
00169 SoNodeList m_item3DSwitchList;
00170 SoNodeList m_item3DTextList;
00171 SoNodeList m_item3DLabelTranslList;
00172 static SbBool m_isSkinLoaded;
00173
00174 void create3DRadioButtons(int index);
00175 void update3DRadioButtons();
00176 void add3DItem(int index);
00177
00178 void change3DItems();
00179 void change3DSelectedItem();
00180
00181 static void finishCB3D( void *, SoDragger *inDragger );
00182 virtual void draggerFinishCallback3D();
00183
00185
00186 };
00187
00188 #endif // _SO_MENU_RADIO_BUTTONS_
00189
00190
00191