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