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