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