home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)csintdlgel.tcl /main/hindenburg/4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)csintdlgel.tcl /main/hindenburg/4 15 Oct 1996 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class CSIntDlgElem : {DlgColumn} {
- constructor
- method destructor
- method label
- method min
- method max
- method value
- method step
- }
-
- constructor CSIntDlgElem {class this name} {
- set this [DlgColumn::constructor $class $this $name]
- # Start constructor user section
-
- Label new $this.label
-
- set f [IntField new $this.field \
- -verStretchFactor 0 \
- -horStretchFactor 100]
-
- set s [HorSlider new $this.slider \
- -horStretchFactor 100]
-
- $s valueChanged "
- $f intValue \[expr round(\[$s value])]
- "
-
- $f textModified "
- set newValue \[$f intValue]
- if {\$newValue < \[$this min]} {
- $this min \$newValue
- } elseif {\$newValue > \[$this max]} {
- $this max \$newValue
- }
- $s value \$newValue
- "
-
- # End constructor user section
- return $this
- }
-
- method CSIntDlgElem::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- method CSIntDlgElem::label {this args} {
- if [lempty $args] {
- return [$this.label text]
- }
- $this.label text [lindex $args 0]
- }
-
- method CSIntDlgElem::min {this args} {
- if [lempty $args] {
- return [expr round([$this.slider min])]
- }
- $this.slider setRange [lindex $args 0].0 [$this.slider max]
- }
-
- method CSIntDlgElem::max {this args} {
- if [lempty $args] {
- return [expr round([$this.slider max])]
- }
- $this.slider setRange [$this.slider min] [lindex $args 0].0
- }
-
- method CSIntDlgElem::value {this args} {
- if [lempty $args] {
- return [$this.field intValue]
- }
-
- set value [lindex $args 0]
- $this.field intValue $value
- eval [$this.field textModified]
- $this.slider value ${value}.0
- }
-
- method CSIntDlgElem::step {this args} {
- if [lempty $args] {
- return [expr round([$this.slider stepSize])]
- }
- $this.slider stepSize [lindex $args 0].0
- }
-
- # Do not delete this line -- regeneration end marker
-
-