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_DIALOG_RADIO_BUTTONS_
00024 #define _SO_DIALOG_RADIO_BUTTONS_
00025
00026 #include <DialogViz/dialog/SoDialogChoice.h>
00027 #include <DialogViz/SoDialogWidgetList.h>
00028
00109 class SoDialogRadioButtons : public SoDialogChoice
00110 {
00111 SO_DG_HEADER(SoDialogRadioButtons);
00112
00113 public:
00114
00118 SoDialogRadioButtons();
00119
00120
00121 private:
00122 virtual void buildWidget(SoWidget parent, SbVec2i32 &rSize, SbVec2i32 & pos, SbBool isActive2d);
00123 virtual void destroyWidget();
00124 void eventNotify(unsigned int event, uintptr_t lParam);
00125 static void initClass();
00126 static void exitClass();
00127 virtual void updateFromSensor(SoSensor* sensor);
00128 void drawLabel();
00129 virtual void resetSize();
00130
00131 void updateLabelWidget();
00132 void updateRadioButtonsWidget();
00133
00134 private:
00135
00136 SoDialogWidgetList m_rbWidgetList;
00137
00138 SbVec2i32* m_buttonSize;
00139 SbVec2i32* m_buttonMin;
00140 SbVec2i32* m_buttonMax;
00141 int m_arrayNumButtons;
00142 int m_cptToResize;
00143
00144 virtual ~SoDialogRadioButtons();
00145
00146 private:
00147 SbVec2i32 m_orSize;
00148 SoWidget m_labelTextWidget;
00149 SoWidget m_labelFrameWidget;
00150 SbBool m_itemsChangeFromSensor;
00151
00152 void computeNewButtonsHeight(SbVec2i32 &rSize);
00153 void createLabelWidget();
00154 void createRadioButtonsWidget(int index);
00155 virtual SbVec2i32 getComponentInitSize();
00156 virtual SbVec2i32 getLabelInitSize();
00157 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00158
00159
00160 virtual void changeLabelVisibility();
00161 virtual void changeLabelAlignment();
00162 virtual void changeEnable();
00163 virtual void changeWidgetEnable(SbBool state);
00164 virtual void changeLabel();
00165 virtual void changeEdgeStyle();
00166 virtual void changeSelectedItem();
00167 void changeItems();
00168 void changeItemText(int index, SbString newText);
00169
00171
00172 private:
00173 static char* DialogRadioButtons;
00174 static void change3DSkin();
00175 static SbBool isSkinLoaded();
00176 static void setSkinLoaded(SbBool loaded);
00177
00178 private:
00179 SO_DG_CATALOG_ENTRY_HEADER( frameSep );
00180 SO_DG_CATALOG_ENTRY_HEADER( frame );
00181 SO_DG_CATALOG_ENTRY_HEADER( labelSep );
00182 SO_DG_CATALOG_ENTRY_HEADER( labelSwitch );
00183 SO_DG_CATALOG_ENTRY_HEADER( labelProp );
00184 SO_DG_CATALOG_ENTRY_HEADER( itemsSep );
00185 SO_DG_CATALOG_ENTRY_HEADER( itemSep );
00186 SO_DG_CATALOG_ENTRY_HEADER( itemFrameSep );
00187 SO_DG_CATALOG_ENTRY_HEADER( itemFrame );
00188 SO_DG_CATALOG_ENTRY_HEADER( itemBtnSep );
00189 SO_DG_CATALOG_ENTRY_HEADER( itemBtnSwtch );
00190 SO_DG_CATALOG_ENTRY_HEADER( stateOff );
00191 SO_DG_CATALOG_ENTRY_HEADER( stateOn );
00192 SO_DG_CATALOG_ENTRY_HEADER( itemTextSep );
00193 SO_DG_CATALOG_ENTRY_HEADER( itemTextProp );
00194
00195 SoScale *radioLabelFrameScale, *radioItemFrameScale, *radioItemButtonScale;
00196 SoText3 *radioItemText;
00197 SoTranslation *radioLabelFrameTranslation, *radioTranslation, *radioItemTranslation;
00198 SoTranslation *radioItemButtonTranslation, *radioItemTextTranslation;
00199 SoTransform *radioLabelFrameTransform, *radioItemFrameTransform;
00200
00201 private:
00202 SoNodeList m_item3DTextList;
00203 SoNodeList m_item3DItemList;
00204 SoNodeList m_item3DSwList;
00205 static SbBool m_isSkinLoaded;
00206
00207 SbBox3f m_itemTextCachedBBox;
00208
00209 void create3DDialogRadioButtons();
00210 void update3DRadioButtons();
00211 void update3DLabel();
00212
00213
00214 void change3DItems();
00215 virtual void change3DSelectedItem();
00216
00217
00218 virtual void change3DLabelVisibility();
00219
00220
00221 virtual void change3DLabel();
00222 virtual void change3DLabelAlignment();
00223
00224 static void finishCB3D( void *, SoDragger *inDragger );
00225 void draggerFinishCallback3D();
00226
00228 };
00229
00230 #endif // _SO_DIALOG_RADIO_BUTTONS_
00231
00232
00233