| 1 |
/* |
| 2 |
* |
| 3 |
* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* Further, this software is distributed without any warranty that it is |
| 16 |
* free of the rightful claim of any third person regarding infringement |
| 17 |
* or the like. Any license provided herein, whether implied or |
| 18 |
* otherwise, applies only to this software file. Patent licenses, if |
| 19 |
* any, provided herein do not apply to combinations of this program with |
| 20 |
* other software, or any other product whatsoever. |
| 21 |
* |
| 22 |
* You should have received a copy of the GNU Lesser General Public |
| 23 |
* License along with this library; if not, write to the Free Software |
| 24 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 |
* |
| 26 |
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, |
| 27 |
* Mountain View, CA 94043, or: |
| 28 |
* |
| 29 |
* http://www.sgi.com |
| 30 |
* |
| 31 |
* For further information regarding this notice, see: |
| 32 |
* |
| 33 |
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/ |
| 34 |
* |
| 35 |
*/ |
| 36 |
|
| 37 |
/* |
| 38 |
* Copyright (C) 1990-93 Silicon Graphics, Inc. |
| 39 |
* |
| 40 |
_______________________________________________________________________ |
| 41 |
______________ S I L I C O N G R A P H I C S I N C . ____________ |
| 42 |
| |
| 43 |
| $Revision: 1.3 $ |
| 44 |
| |
| 45 |
| Classes: |
| 46 |
| Subclasses of modules used for specific fields of specific types |
| 47 |
| of nodes. |
| 48 |
| |
| 49 |
| Author(s) : Paul Isaacs |
| 50 |
| |
| 51 |
______________ S I L I C O N G R A P H I C S I N C . ____________ |
| 52 |
_______________________________________________________________________ |
| 53 |
*/ |
| 54 |
|
| 55 |
#include <inttypes.h> |
| 56 |
#include "SoXtSliderModules.h" |
| 57 |
#include "SoXtMultiSliders.h" |
| 58 |
#include <X11/StringDefs.h> |
| 59 |
#include <Xm/Xm.h> |
| 60 |
#include <Inventor/Xt/SoXtResource.h> |
| 61 |
|
| 62 |
static XtResource _labelResource[] = { |
| 63 |
{ XmNlabelString, XmCLabelString, XmRXmString, sizeof( char * ), |
| 64 |
0, |
| 65 |
XtRString, (XtPointer) NULL } |
| 66 |
}; |
| 67 |
|
| 68 |
static char *transSliderTitles[] = { |
| 69 |
SO_TRANSLATE_MODULE_LABEL, SO_TRANSLATE_MODULE_SLIDER1_LABEL, |
| 70 |
SO_TRANSLATE_MODULE_SLIDER2_LABEL, SO_TRANSLATE_MODULE_SLIDER3_LABEL, |
| 71 |
}; |
| 72 |
|
| 73 |
SoXtTransSliderModule::SoXtTransSliderModule( |
| 74 |
Widget parent, |
| 75 |
const char *name, |
| 76 |
SbBool buildInsideParent) |
| 77 |
: SoXtSliderModule( |
| 78 |
parent, |
| 79 |
name, |
| 80 |
buildInsideParent, |
| 81 |
FALSE) // tell parent class not to build just yet |
| 82 |
{ |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
// OK, we will build right now. |
| 87 |
Widget form = buildForm(getParentWidget()); |
| 88 |
_sliderModuleSliders = new SoXtTransMultiSlider(form, "Trans"); |
| 89 |
SoXtSliderModule::buildWidget(form); |
| 90 |
// |
| 91 |
SoXtResource xr(form); |
| 92 |
char *tmp; |
| 93 |
if (xr.getResource( "transSliderLabel", "TransSliderLabel", tmp )) |
| 94 |
transSliderTitles[0] = tmp; |
| 95 |
if (xr.getResource( "transSlider1", "TransSlider1", tmp )) |
| 96 |
transSliderTitles[1] = tmp; |
| 97 |
if (xr.getResource( "transSlider2", "TransSlider2", tmp )) |
| 98 |
transSliderTitles[2] = tmp; |
| 99 |
if (xr.getResource( "transSlider3", "TransSlider3", tmp )) |
| 100 |
transSliderTitles[3] = tmp; |
| 101 |
// |
| 102 |
initLabels(); |
| 103 |
setBaseWidget(form); |
| 104 |
} |
| 105 |
|
| 106 |
SoXtTransSliderModule::~SoXtTransSliderModule() {} |
| 107 |
|
| 108 |
void |
| 109 |
SoXtTransSliderModule::initLabels() |
| 110 |
{ |
| 111 |
Arg wargs[10]; |
| 112 |
XmString newString; |
| 113 |
Widget theWidget; |
| 114 |
|
| 115 |
/* label for the title in the control bar */ |
| 116 |
_labelResource[0].default_addr = (XtPointer) transSliderTitles[0]; |
| 117 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 118 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 119 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 120 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 121 |
XtSetValues( theWidget, wargs, 1 ); |
| 122 |
|
| 123 |
_sliderModuleSliders->initTitles( &(transSliderTitles[1]) ); |
| 124 |
} |
| 125 |
|
| 126 |
static char *scaleSliderTitles[] = { |
| 127 |
SO_SCALE_MODULE_LABEL, SO_SCALE_MODULE_SLIDER1_LABEL, |
| 128 |
SO_SCALE_MODULE_SLIDER2_LABEL, SO_SCALE_MODULE_SLIDER3_LABEL, |
| 129 |
}; |
| 130 |
|
| 131 |
SoXtScaleSliderModule::SoXtScaleSliderModule( |
| 132 |
Widget parent, |
| 133 |
const char *name, |
| 134 |
SbBool buildInsideParent) |
| 135 |
: SoXtSliderModule( |
| 136 |
parent, |
| 137 |
name, |
| 138 |
buildInsideParent, |
| 139 |
FALSE) // tell parent class not to build just yet |
| 140 |
{ |
| 141 |
// OK, we will build right now. |
| 142 |
Widget form = buildForm(getParentWidget()); |
| 143 |
_sliderModuleSliders = new SoXtScaleMultiSlider(form, "Scale"); |
| 144 |
SoXtSliderModule::buildWidget(form); |
| 145 |
// |
| 146 |
SoXtResource xr(form); |
| 147 |
char *tmp; |
| 148 |
if (xr.getResource( "scaleSliderLabel", "ScaleSliderLabel", tmp )) |
| 149 |
scaleSliderTitles[0] = tmp; |
| 150 |
if (xr.getResource( "scaleSlider1", "ScaleSlider1", tmp )) |
| 151 |
scaleSliderTitles[1] = tmp; |
| 152 |
if (xr.getResource( "scaleSlider2", "ScaleSlider2", tmp )) |
| 153 |
scaleSliderTitles[2] = tmp; |
| 154 |
if (xr.getResource( "scaleSlider3", "ScaleSlider3", tmp )) |
| 155 |
scaleSliderTitles[3] = tmp; |
| 156 |
// |
| 157 |
initLabels(); |
| 158 |
setBaseWidget(form); |
| 159 |
} |
| 160 |
|
| 161 |
SoXtScaleSliderModule::~SoXtScaleSliderModule() {} |
| 162 |
|
| 163 |
void |
| 164 |
SoXtScaleSliderModule::initLabels() |
| 165 |
{ |
| 166 |
Arg wargs[10]; |
| 167 |
XmString newString; |
| 168 |
Widget theWidget; |
| 169 |
|
| 170 |
/* label for the title in the control bar */ |
| 171 |
_labelResource[0].default_addr = (XtPointer) scaleSliderTitles[0]; |
| 172 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 173 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 174 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 175 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 176 |
XtSetValues( theWidget, wargs, 1 ); |
| 177 |
|
| 178 |
_sliderModuleSliders->initTitles( &(scaleSliderTitles[1]) ); |
| 179 |
} |
| 180 |
|
| 181 |
/////////////////// |
| 182 |
|
| 183 |
static char *rotateSliderTitles[] = { |
| 184 |
SO_ROTATE_MODULE_LABEL, SO_ROTATE_MODULE_SLIDER1_LABEL, |
| 185 |
SO_ROTATE_MODULE_SLIDER2_LABEL, SO_ROTATE_MODULE_SLIDER3_LABEL, |
| 186 |
}; |
| 187 |
|
| 188 |
SoXtRotateSliderModule::SoXtRotateSliderModule( |
| 189 |
Widget parent, |
| 190 |
const char *name, |
| 191 |
SbBool buildInsideParent) |
| 192 |
: SoXtSliderModule( |
| 193 |
parent, |
| 194 |
name, |
| 195 |
buildInsideParent, |
| 196 |
FALSE) // tell parent class not to build just yet |
| 197 |
{ |
| 198 |
// OK, we will build right now. |
| 199 |
Widget form = buildForm(getParentWidget()); |
| 200 |
_sliderModuleSliders = new SoXtRotateMultiSlider(form, "Rotate"); |
| 201 |
SoXtSliderModule::buildWidget(form); |
| 202 |
// |
| 203 |
SoXtResource xr(form); |
| 204 |
char *tmp; |
| 205 |
if (xr.getResource( "rotateSliderLabel", "RotateSliderLabel", tmp )) |
| 206 |
rotateSliderTitles[0] = tmp; |
| 207 |
if (xr.getResource( "rotateSlider1", "RotateSlider1", tmp )) |
| 208 |
rotateSliderTitles[1] = tmp; |
| 209 |
if (xr.getResource( "rotateSlider2", "RotateSlider2", tmp )) |
| 210 |
rotateSliderTitles[2] = tmp; |
| 211 |
if (xr.getResource( "rotateSlider3", "RotateSlider3", tmp )) |
| 212 |
rotateSliderTitles[3] = tmp; |
| 213 |
// |
| 214 |
initLabels(); |
| 215 |
setBaseWidget(form); |
| 216 |
} |
| 217 |
|
| 218 |
SoXtRotateSliderModule::~SoXtRotateSliderModule() {} |
| 219 |
|
| 220 |
void |
| 221 |
SoXtRotateSliderModule::initLabels() |
| 222 |
{ |
| 223 |
Arg wargs[10]; |
| 224 |
XmString newString; |
| 225 |
Widget theWidget; |
| 226 |
|
| 227 |
/* label for the title in the control bar */ |
| 228 |
_labelResource[0].default_addr = (XtPointer) rotateSliderTitles[0]; |
| 229 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 230 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 231 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 232 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 233 |
XtSetValues( theWidget, wargs, 1 ); |
| 234 |
|
| 235 |
_sliderModuleSliders->initTitles( &(rotateSliderTitles[1]) ); |
| 236 |
} |
| 237 |
|
| 238 |
/////////////////// |
| 239 |
/////////////////// |
| 240 |
|
| 241 |
static char *scaleOrientationSliderTitles[] = { |
| 242 |
SO_SCALE_ORIENTATION_MODULE_LABEL, |
| 243 |
SO_SCALE_ORIENTATION_MODULE_SLIDER1_LABEL, |
| 244 |
SO_SCALE_ORIENTATION_MODULE_SLIDER2_LABEL, |
| 245 |
SO_SCALE_ORIENTATION_MODULE_SLIDER3_LABEL, |
| 246 |
}; |
| 247 |
|
| 248 |
|
| 249 |
SoXtScaleOrientationSliderModule::SoXtScaleOrientationSliderModule( |
| 250 |
Widget parent, |
| 251 |
const char *name, |
| 252 |
SbBool buildInsideParent) |
| 253 |
: SoXtSliderModule( |
| 254 |
parent, |
| 255 |
name, |
| 256 |
buildInsideParent, |
| 257 |
FALSE) // tell parent class not to build just yet |
| 258 |
{ |
| 259 |
// OK, we will build right now. |
| 260 |
Widget form = buildForm(getParentWidget()); |
| 261 |
_sliderModuleSliders = new SoXtScaleOrientationMultiSlider(form, "ScaleOrientation"); |
| 262 |
SoXtSliderModule::buildWidget(form); |
| 263 |
// |
| 264 |
SoXtResource xr(form); |
| 265 |
char *tmp; |
| 266 |
if (xr.getResource( "scaleOrientationSliderLabel", "ScaleOrientationSliderLabel", tmp )) |
| 267 |
scaleOrientationSliderTitles[0] = tmp; |
| 268 |
if (xr.getResource( "scaleOrientationSlider1", "ScaleOrientationSlider1", tmp )) |
| 269 |
scaleOrientationSliderTitles[1] = tmp; |
| 270 |
if (xr.getResource( "scaleOrientationSlider2", "ScaleOrientationSlider2", tmp )) |
| 271 |
scaleOrientationSliderTitles[2] = tmp; |
| 272 |
if (xr.getResource( "scaleOrientationSlider3", "ScaleOrientationSlider3", tmp )) |
| 273 |
scaleOrientationSliderTitles[3] = tmp; |
| 274 |
// |
| 275 |
initLabels(); |
| 276 |
setBaseWidget(form); |
| 277 |
} |
| 278 |
|
| 279 |
SoXtScaleOrientationSliderModule::~SoXtScaleOrientationSliderModule() {} |
| 280 |
|
| 281 |
void |
| 282 |
SoXtScaleOrientationSliderModule::initLabels() |
| 283 |
{ |
| 284 |
Arg wargs[10]; |
| 285 |
XmString newString; |
| 286 |
Widget theWidget; |
| 287 |
|
| 288 |
/* label for the title in the control bar */ |
| 289 |
_labelResource[0].default_addr = (XtPointer) scaleOrientationSliderTitles[0]; |
| 290 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 291 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 292 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 293 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 294 |
XtSetValues( theWidget, wargs, 1 ); |
| 295 |
|
| 296 |
_sliderModuleSliders->initTitles( &(scaleOrientationSliderTitles[1]) ); |
| 297 |
} |
| 298 |
|
| 299 |
/////////////////// |
| 300 |
|
| 301 |
static char *centerSliderTitles[] = { |
| 302 |
SO_CENTER_MODULE_LABEL, SO_CENTER_MODULE_SLIDER1_LABEL, |
| 303 |
SO_CENTER_MODULE_SLIDER2_LABEL, SO_CENTER_MODULE_SLIDER3_LABEL, |
| 304 |
}; |
| 305 |
|
| 306 |
SoXtCenterSliderModule::SoXtCenterSliderModule( |
| 307 |
Widget parent, |
| 308 |
const char *name, |
| 309 |
SbBool buildInsideParent) |
| 310 |
: SoXtSliderModule( |
| 311 |
parent, |
| 312 |
name, |
| 313 |
buildInsideParent, |
| 314 |
FALSE) // tell parent class not to build just yet |
| 315 |
{ |
| 316 |
// OK, we will build right now. |
| 317 |
Widget form = buildForm(getParentWidget()); |
| 318 |
_sliderModuleSliders = new SoXtCenterMultiSlider(form, "Center"); |
| 319 |
SoXtSliderModule::buildWidget(form); |
| 320 |
// |
| 321 |
SoXtResource xr(form); |
| 322 |
char *tmp; |
| 323 |
if (xr.getResource( "centerSliderLabel", "CenterSliderLabel", tmp )) |
| 324 |
centerSliderTitles[0] = tmp; |
| 325 |
if (xr.getResource( "centerSlider1", "CenterSlider1", tmp )) |
| 326 |
centerSliderTitles[1] = tmp; |
| 327 |
if (xr.getResource( "centerSlider2", "CenterSlider2", tmp )) |
| 328 |
centerSliderTitles[2] = tmp; |
| 329 |
if (xr.getResource( "centerSlider3", "CenterSlider3", tmp )) |
| 330 |
centerSliderTitles[3] = tmp; |
| 331 |
// |
| 332 |
initLabels(); |
| 333 |
setBaseWidget(form); |
| 334 |
} |
| 335 |
|
| 336 |
SoXtCenterSliderModule::~SoXtCenterSliderModule() {} |
| 337 |
|
| 338 |
void |
| 339 |
SoXtCenterSliderModule::initLabels() |
| 340 |
{ |
| 341 |
Arg wargs[10]; |
| 342 |
XmString newString; |
| 343 |
Widget theWidget; |
| 344 |
|
| 345 |
/* label for the title in the control bar */ |
| 346 |
_labelResource[0].default_addr = (XtPointer) centerSliderTitles[0]; |
| 347 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 348 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 349 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 350 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 351 |
XtSetValues( theWidget, wargs, 1 ); |
| 352 |
|
| 353 |
_sliderModuleSliders->initTitles( &(centerSliderTitles[1]) ); |
| 354 |
} |
| 355 |
|
| 356 |
static char *ambientColorSliderTitles[] = { |
| 357 |
SO_AMBIENT_COLOR_MODULE_LABEL, SO_AMBIENT_COLOR_MODULE_SLIDER1_LABEL, |
| 358 |
SO_AMBIENT_COLOR_MODULE_SLIDER2_LABEL, SO_AMBIENT_COLOR_MODULE_SLIDER3_LABEL, |
| 359 |
}; |
| 360 |
|
| 361 |
SoXtAmbientColorSliderModule::SoXtAmbientColorSliderModule( |
| 362 |
Widget parent, |
| 363 |
const char *name, |
| 364 |
SbBool buildInsideParent) |
| 365 |
: SoXtSliderModule( |
| 366 |
parent, |
| 367 |
name, |
| 368 |
buildInsideParent, |
| 369 |
FALSE) // tell parent class not to build just yet |
| 370 |
{ |
| 371 |
// OK, we will build right now. |
| 372 |
Widget form = buildForm(getParentWidget()); |
| 373 |
_sliderModuleSliders = new SoXtAmbientColorMultiSlider(form); |
| 374 |
SoXtSliderModule::buildWidget(form); |
| 375 |
initLabels(); |
| 376 |
setBaseWidget(form); |
| 377 |
} |
| 378 |
|
| 379 |
SoXtAmbientColorSliderModule::~SoXtAmbientColorSliderModule() {} |
| 380 |
|
| 381 |
void |
| 382 |
SoXtAmbientColorSliderModule::initLabels() |
| 383 |
{ |
| 384 |
Arg wargs[10]; |
| 385 |
XmString newString; |
| 386 |
Widget theWidget; |
| 387 |
|
| 388 |
/* label for the title in the control bar */ |
| 389 |
_labelResource[0].default_addr = (XtPointer) ambientColorSliderTitles[0]; |
| 390 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 391 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 392 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 393 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 394 |
XtSetValues( theWidget, wargs, 1 ); |
| 395 |
|
| 396 |
_sliderModuleSliders->initTitles( &(ambientColorSliderTitles[1]) ); |
| 397 |
} |
| 398 |
|
| 399 |
static char *diffuseColorSliderTitles[] = { |
| 400 |
SO_DIFFUSE_COLOR_MODULE_LABEL, SO_DIFFUSE_COLOR_MODULE_SLIDER1_LABEL, |
| 401 |
SO_DIFFUSE_COLOR_MODULE_SLIDER2_LABEL, SO_DIFFUSE_COLOR_MODULE_SLIDER3_LABEL, |
| 402 |
}; |
| 403 |
|
| 404 |
SoXtDiffuseColorSliderModule::SoXtDiffuseColorSliderModule( |
| 405 |
Widget parent, |
| 406 |
const char *name, |
| 407 |
SbBool buildInsideParent) |
| 408 |
: SoXtSliderModule( |
| 409 |
parent, |
| 410 |
name, |
| 411 |
buildInsideParent, |
| 412 |
FALSE) // tell parent class not to build just yet |
| 413 |
{ |
| 414 |
// OK, we will build right now. |
| 415 |
Widget form = buildForm(getParentWidget()); |
| 416 |
_sliderModuleSliders = new SoXtDiffuseColorMultiSlider(form); |
| 417 |
SoXtSliderModule::buildWidget(form); |
| 418 |
initLabels(); |
| 419 |
setBaseWidget(form); |
| 420 |
} |
| 421 |
|
| 422 |
SoXtDiffuseColorSliderModule::~SoXtDiffuseColorSliderModule() {} |
| 423 |
|
| 424 |
void |
| 425 |
SoXtDiffuseColorSliderModule::initLabels() |
| 426 |
{ |
| 427 |
Arg wargs[10]; |
| 428 |
XmString newString; |
| 429 |
Widget theWidget; |
| 430 |
|
| 431 |
/* label for the title in the control bar */ |
| 432 |
_labelResource[0].default_addr = (XtPointer) diffuseColorSliderTitles[0]; |
| 433 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 434 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 435 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 436 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 437 |
XtSetValues( theWidget, wargs, 1 ); |
| 438 |
|
| 439 |
_sliderModuleSliders->initTitles( &(diffuseColorSliderTitles[1]) ); |
| 440 |
} |
| 441 |
|
| 442 |
static char *specularColorSliderTitles[] = { |
| 443 |
SO_SPECULAR_COLOR_MODULE_LABEL, SO_SPECULAR_COLOR_MODULE_SLIDER1_LABEL, |
| 444 |
SO_SPECULAR_COLOR_MODULE_SLIDER2_LABEL,SO_SPECULAR_COLOR_MODULE_SLIDER3_LABEL, |
| 445 |
}; |
| 446 |
|
| 447 |
SoXtSpecularColorSliderModule::SoXtSpecularColorSliderModule( |
| 448 |
Widget parent, |
| 449 |
const char *name, |
| 450 |
SbBool buildInsideParent) |
| 451 |
: SoXtSliderModule( |
| 452 |
parent, |
| 453 |
name, |
| 454 |
buildInsideParent, |
| 455 |
FALSE) // tell parent class not to build just yet |
| 456 |
{ |
| 457 |
// OK, we will build right now. |
| 458 |
Widget form = buildForm(getParentWidget()); |
| 459 |
_sliderModuleSliders = new SoXtSpecularColorMultiSlider(form); |
| 460 |
SoXtSliderModule::buildWidget(form); |
| 461 |
initLabels(); |
| 462 |
setBaseWidget(form); |
| 463 |
} |
| 464 |
|
| 465 |
SoXtSpecularColorSliderModule::~SoXtSpecularColorSliderModule() {} |
| 466 |
|
| 467 |
void |
| 468 |
SoXtSpecularColorSliderModule::initLabels() |
| 469 |
{ |
| 470 |
Arg wargs[10]; |
| 471 |
XmString newString; |
| 472 |
Widget theWidget; |
| 473 |
|
| 474 |
/* label for the title in the control bar */ |
| 475 |
_labelResource[0].default_addr = (XtPointer) specularColorSliderTitles[0]; |
| 476 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 477 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 478 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 479 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 480 |
XtSetValues( theWidget, wargs, 1 ); |
| 481 |
|
| 482 |
_sliderModuleSliders->initTitles( &(specularColorSliderTitles[1]) ); |
| 483 |
} |
| 484 |
|
| 485 |
static char *emissiveColorSliderTitles[] = { |
| 486 |
SO_EMISSIVE_COLOR_MODULE_LABEL, SO_EMISSIVE_COLOR_MODULE_SLIDER1_LABEL, |
| 487 |
SO_EMISSIVE_COLOR_MODULE_SLIDER2_LABEL,SO_EMISSIVE_COLOR_MODULE_SLIDER3_LABEL, |
| 488 |
}; |
| 489 |
|
| 490 |
SoXtEmissiveColorSliderModule::SoXtEmissiveColorSliderModule( |
| 491 |
Widget parent, |
| 492 |
const char *name, |
| 493 |
SbBool buildInsideParent) |
| 494 |
: SoXtSliderModule( |
| 495 |
parent, |
| 496 |
name, |
| 497 |
buildInsideParent, |
| 498 |
FALSE) // tell parent class not to build just yet |
| 499 |
{ |
| 500 |
// OK, we will build right now. |
| 501 |
Widget form = buildForm(getParentWidget()); |
| 502 |
_sliderModuleSliders = new SoXtEmissiveColorMultiSlider(form); |
| 503 |
SoXtSliderModule::buildWidget(form); |
| 504 |
initLabels(); |
| 505 |
setBaseWidget(form); |
| 506 |
} |
| 507 |
|
| 508 |
SoXtEmissiveColorSliderModule::~SoXtEmissiveColorSliderModule() {} |
| 509 |
|
| 510 |
void |
| 511 |
SoXtEmissiveColorSliderModule::initLabels() |
| 512 |
{ |
| 513 |
Arg wargs[10]; |
| 514 |
XmString newString; |
| 515 |
Widget theWidget; |
| 516 |
|
| 517 |
/* label for the title in the control bar */ |
| 518 |
_labelResource[0].default_addr = (XtPointer) emissiveColorSliderTitles[0]; |
| 519 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 520 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 521 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 522 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 523 |
XtSetValues( theWidget, wargs, 1 ); |
| 524 |
|
| 525 |
_sliderModuleSliders->initTitles( &(emissiveColorSliderTitles[1]) ); |
| 526 |
} |
| 527 |
|
| 528 |
static char *shininessSliderTitles[] = { |
| 529 |
SO_SHININESS_MODULE_LABEL, SO_SHININESS_MODULE_SLIDER1_LABEL |
| 530 |
}; |
| 531 |
|
| 532 |
SoXtShininessSliderModule::SoXtShininessSliderModule( |
| 533 |
Widget parent, |
| 534 |
const char *name, |
| 535 |
SbBool buildInsideParent) |
| 536 |
: SoXtSliderModule( |
| 537 |
parent, |
| 538 |
name, |
| 539 |
buildInsideParent, |
| 540 |
FALSE) // tell parent class not to build just yet |
| 541 |
{ |
| 542 |
// OK, we will build right now. |
| 543 |
Widget form = buildForm(getParentWidget()); |
| 544 |
_sliderModuleSliders = new SoXtShininessMultiSlider(form); |
| 545 |
SoXtSliderModule::buildWidget(form); |
| 546 |
initLabels(); |
| 547 |
setBaseWidget(form); |
| 548 |
} |
| 549 |
|
| 550 |
SoXtShininessSliderModule::~SoXtShininessSliderModule() {} |
| 551 |
|
| 552 |
void |
| 553 |
SoXtShininessSliderModule::initLabels() |
| 554 |
{ |
| 555 |
Arg wargs[10]; |
| 556 |
XmString newString; |
| 557 |
Widget theWidget; |
| 558 |
|
| 559 |
/* label for the title in the control bar */ |
| 560 |
_labelResource[0].default_addr = (XtPointer) shininessSliderTitles[0]; |
| 561 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 562 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 563 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 564 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 565 |
XtSetValues( theWidget, wargs, 1 ); |
| 566 |
|
| 567 |
_sliderModuleSliders->initTitles( &(shininessSliderTitles[1]) ); |
| 568 |
} |
| 569 |
|
| 570 |
static char *transparencySliderTitles[] = { |
| 571 |
SO_TRANSPARENCY_MODULE_LABEL, SO_TRANSPARENCY_MODULE_SLIDER1_LABEL |
| 572 |
}; |
| 573 |
|
| 574 |
SoXtTransparencySliderModule::SoXtTransparencySliderModule( |
| 575 |
Widget parent, |
| 576 |
const char *name, |
| 577 |
SbBool buildInsideParent) |
| 578 |
: SoXtSliderModule( |
| 579 |
parent, |
| 580 |
name, |
| 581 |
buildInsideParent, |
| 582 |
FALSE) // tell parent class not to build just yet |
| 583 |
{ |
| 584 |
// OK, we will build right now. |
| 585 |
Widget form = buildForm(getParentWidget()); |
| 586 |
_sliderModuleSliders = new SoXtTransparencyMultiSlider(form); |
| 587 |
SoXtSliderModule::buildWidget(form); |
| 588 |
initLabels(); |
| 589 |
setBaseWidget(form); |
| 590 |
} |
| 591 |
|
| 592 |
SoXtTransparencySliderModule::~SoXtTransparencySliderModule() {} |
| 593 |
|
| 594 |
void |
| 595 |
SoXtTransparencySliderModule::initLabels() |
| 596 |
{ |
| 597 |
Arg wargs[10]; |
| 598 |
XmString newString; |
| 599 |
Widget theWidget; |
| 600 |
|
| 601 |
/* label for the title in the control bar */ |
| 602 |
_labelResource[0].default_addr = (XtPointer) transparencySliderTitles[0]; |
| 603 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 604 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 605 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 606 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 607 |
XtSetValues( theWidget, wargs, 1 ); |
| 608 |
|
| 609 |
_sliderModuleSliders->initTitles( &(transparencySliderTitles[1]) ); |
| 610 |
} |
| 611 |
|
| 612 |
static char *lightIntensitySliderTitles[] = { |
| 613 |
SO_LIGHT_INTENSITY_MODULE_LABEL, SO_LIGHT_INTENSITY_MODULE_SLIDER1_LABEL |
| 614 |
}; |
| 615 |
|
| 616 |
SoXtLightIntensitySliderModule::SoXtLightIntensitySliderModule( |
| 617 |
Widget parent, |
| 618 |
const char *name, |
| 619 |
SbBool buildInsideParent) |
| 620 |
: SoXtSliderModule( |
| 621 |
parent, |
| 622 |
name, |
| 623 |
buildInsideParent, |
| 624 |
FALSE) // tell parent class not to build just yet |
| 625 |
{ |
| 626 |
// OK, we will build right now. |
| 627 |
Widget form = buildForm(getParentWidget()); |
| 628 |
_sliderModuleSliders = new SoXtLightIntensityMultiSlider(form); |
| 629 |
SoXtSliderModule::buildWidget(form); |
| 630 |
initLabels(); |
| 631 |
setBaseWidget(form); |
| 632 |
} |
| 633 |
|
| 634 |
SoXtLightIntensitySliderModule::~SoXtLightIntensitySliderModule() {} |
| 635 |
|
| 636 |
void |
| 637 |
SoXtLightIntensitySliderModule::initLabels() |
| 638 |
{ |
| 639 |
Arg wargs[10]; |
| 640 |
XmString newString; |
| 641 |
Widget theWidget; |
| 642 |
|
| 643 |
/* label for the title in the control bar */ |
| 644 |
_labelResource[0].default_addr = (XtPointer) lightIntensitySliderTitles[0]; |
| 645 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 646 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 647 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 648 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 649 |
XtSetValues( theWidget, wargs, 1 ); |
| 650 |
|
| 651 |
_sliderModuleSliders->initTitles( &(lightIntensitySliderTitles[1]) ); |
| 652 |
} |
| 653 |
|
| 654 |
static char *lightColorSliderTitles[] = { |
| 655 |
SO_LIGHT_COLOR_MODULE_LABEL, SO_LIGHT_COLOR_MODULE_SLIDER1_LABEL, |
| 656 |
SO_LIGHT_COLOR_MODULE_SLIDER2_LABEL, SO_LIGHT_COLOR_MODULE_SLIDER3_LABEL, |
| 657 |
}; |
| 658 |
|
| 659 |
SoXtLightColorSliderModule::SoXtLightColorSliderModule( |
| 660 |
Widget parent, |
| 661 |
const char *name, |
| 662 |
SbBool buildInsideParent) |
| 663 |
: SoXtSliderModule( |
| 664 |
parent, |
| 665 |
name, |
| 666 |
buildInsideParent, |
| 667 |
FALSE) // tell parent class not to build just yet |
| 668 |
{ |
| 669 |
// OK, we will build right now. |
| 670 |
Widget form = buildForm(getParentWidget()); |
| 671 |
_sliderModuleSliders = new SoXtLightColorMultiSlider(form); |
| 672 |
SoXtSliderModule::buildWidget(form); |
| 673 |
initLabels(); |
| 674 |
setBaseWidget(form); |
| 675 |
} |
| 676 |
|
| 677 |
SoXtLightColorSliderModule::~SoXtLightColorSliderModule() {} |
| 678 |
|
| 679 |
void |
| 680 |
SoXtLightColorSliderModule::initLabels() |
| 681 |
{ |
| 682 |
Arg wargs[10]; |
| 683 |
XmString newString; |
| 684 |
Widget theWidget; |
| 685 |
|
| 686 |
/* label for the title in the control bar */ |
| 687 |
_labelResource[0].default_addr = (XtPointer) lightColorSliderTitles[0]; |
| 688 |
theWidget = _sliderModuleControl->getOpenCloseButton(); |
| 689 |
XtGetApplicationResources( theWidget, (XtPointer) &newString, |
| 690 |
_labelResource, XtNumber( _labelResource ), NULL, 0); |
| 691 |
XtSetArg( wargs[0], XmNlabelString, newString ); |
| 692 |
XtSetValues( theWidget, wargs, 1 ); |
| 693 |
|
| 694 |
_sliderModuleSliders->initTitles( &(lightColorSliderTitles[1]) ); |
| 695 |
} |