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_CHECK_BOX_
00024 #define _SO_DIALOG_CHECK_BOX_
00025
00026 #include <DialogViz/dialog/SoDialogComponent.h>
00027
00028 class SoDialogCheckBoxAuditor;
00029 class SoText3;
00030 class SoSeparator;
00031 class SoSwitch;
00032
00112 class SoDialogCheckBox : public SoDialogComponent
00113 {
00114 SO_DG_HEADER(SoDialogCheckBox);
00115
00116 public:
00117
00121 SoSFBool state;
00122
00126 SoSFString onString;
00127
00131 SoSFString offString;
00132
00136 SoDialogCheckBox();
00137
00141 void addAuditor(SoDialogCheckBoxAuditor* auditor);
00142
00146 void removeAuditor(SoDialogCheckBoxAuditor* auditor);
00147
00148
00149
00150 private:
00151 static void initClass();
00152 static void exitClass();
00153 virtual void buildWidget(SoWidget parent, SbVec2i32 &rSize, SbVec2i32 & pos, SbBool isActive2d);
00154 virtual void destroyWidget();
00155 virtual void eventNotify(unsigned int event, uintptr_t param);
00156 virtual SoWidget getLabelWidget();
00157 virtual void updateFromSensor(SoSensor* sensor);
00158
00159 void updateLabelWidget();
00160 void updateCheckBoxWidget();
00161
00162 void applyDlgCptAuditor();
00163
00164 private:
00165 SoWidget m_checkBoxWidget;
00166
00167 virtual ~SoDialogCheckBox();
00168
00169
00170 FIELD_SENSOR(state);
00171 FIELD_SENSOR(onString);
00172 FIELD_SENSOR(offString);
00173
00174
00175 void changeOnOffString();
00176
00177 private:
00178
00179 SbVec2i32 m_oonSize, m_ooffSize, m_olSize;
00180
00181
00182
00183 virtual SbVec2i32 getComponentInitSize();
00184 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00185
00186
00187 void createLabelWidget();
00188 void createCheckBoxWidget();
00189
00190
00191 void changeState();
00192
00193
00194 virtual void changeLabelVisibility();
00195 virtual void changeEdgeStyle();
00196
00197
00198 virtual void changeEnable();
00199 virtual void changeWidgetEnable(SbBool state);
00200 virtual void changeLabel();
00201 virtual void changeLabelAlignment();
00202
00204
00205 private:
00206 static char* DialogCheckBox;
00207 static void change3DSkin();
00208 static SbBool isSkinLoaded();
00209 static void setSkinLoaded(SbBool loaded);
00210
00211 private:
00212 SO_DG_CATALOG_ENTRY_HEADER(frameSep);
00213 SO_DG_CATALOG_ENTRY_HEADER(frame);
00214 SO_DG_CATALOG_ENTRY_HEADER(stateSep);
00215 SO_DG_CATALOG_ENTRY_HEADER(stateSwitch);
00216 SO_DG_CATALOG_ENTRY_HEADER(stateOn);
00217 SO_DG_CATALOG_ENTRY_HEADER(stateOff);
00218 SO_DG_CATALOG_ENTRY_HEADER(labelSep);
00219 SO_DG_CATALOG_ENTRY_HEADER(labelSwitch);
00220 SO_DG_CATALOG_ENTRY_HEADER(labelProp);
00221 SO_DG_CATALOG_ENTRY_HEADER(onOffStringSep);
00222 SO_DG_CATALOG_ENTRY_HEADER(onOffStringProp);
00223
00224 SoText3 *checkBoxString, *checkBoxLabel;
00225 SoTranslation *checkBoxLabelTranslation, *checkBoxButtonTranslation;
00226 SoTranslation *checkBoxStringTranslation, *checkBoxFrameTranslation;
00227 SoScale *checkBoxFrameScale;
00228 SoTransform *checkBoxFrameTransform;
00229
00230 virtual void change3DState();
00231 void change3DOnOffString();
00232
00233 private:
00234 SbBox3f m_checkStringCachedBBox;
00235
00236 void create3DDialogCheckBox();
00237 void update3DCheckBox();
00238 void update3DLabel();
00239
00240 virtual void change3DLabelVisibility();
00241 void change3DLabel();
00242 virtual void change3DLabelAlignment();
00243
00244 static void finishCB3D( void *, SoDragger *inDragger );
00245 virtual void draggerFinishCallback3D();
00246
00247 static SbBool m_isSkinLoaded;
00248
00250
00251 };
00252
00253 #endif // _SO_DIALOG_CHECK_BOX_
00254
00255
00256