home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)propif2col.tcl 1.4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)propif2col.tcl 1.4 13 Mar 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
-
- require "propifelem.tcl"
-
- # End user added include file section
-
- require "propifpare.tcl"
-
- Class PropIf2Col : {PropIfParent} {
- method destructor
- constructor
- method getProperties
- method setProperties
- }
-
- method PropIf2Col::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this PropIfParent::destructor
- }
-
- constructor PropIf2Col {class this guiParent propDef} {
- set this [PropIfParent::constructor $class $this]
- $this config -definition $propDef \
- -ifElement [DlgColumn new $guiParent.[$propDef name]]
-
- set options [$propDef ifOptions]
- if ![lempty $options] {
- eval "[$this ifElement] config $options"
- }
-
- set row [DlgRow new [$this ifElement].[$propDef name]Row]
- set col1 [DlgColumn new $row.[$propDef name]Col1]
- set col2 [DlgColumn new $row.[$propDef name]Col2]
- set colLength [expr [llength [$propDef memberSet]] / 2]
- set colDouble [expr $colLength * 2]
- set memberCount 0
- set guiParent $col1
- foreach member [$propDef memberSet] {
- set class [$member ifClass]
- if [PropIfElement::canHandle $class] {
- set child [PropIfElement new $guiParent $member]
- } else {
- if [catch {
- set child [$class new $guiParent $member]
- }] {
- error "Invalid interface class '$class'"
- }
- }
- $this addChild $child
- if {[incr memberCount] == $colLength} {
- set guiParent $col2
- } elseif {$memberCount == $colDouble} {
- set guiParent [$this ifElement]
- }
- }
- return $this
- }
-
- method PropIf2Col::getProperties {this propContainer} {
- [$this childSet] foreach propIf {
- $propIf getProperties $propContainer
- }
- }
-
- method PropIf2Col::setProperties {this propContainer} {
- [$this childSet] foreach propIf {
- $propIf setProperties $propContainer
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-