home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)propviewob.tcl 1.3
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)propviewob.tcl 1.3 17 Oct 1995 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
-
- Class PropViewObject : {BrowsObject} {
- constructor
- method destructor
- method reParent
- method define
- method id
- attribute index
- }
-
- constructor PropViewObject {class this name} {
- set this [BrowsObject::constructor $class $this $name]
- # Start constructor user section
- $this activated "%this define"
- $this conversionSet "BROWSERVIEWPROP id"
- # End constructor user section
- return $this
- }
-
- method PropViewObject::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- method PropViewObject::reParent {this newView} {
-
- global classCount
- set newObj [PropViewObject new $newView.PropViewObject$classCount]
- incr classCount
- $newObj label [$this label]
- $newObj details [$this details]
-
- # remove the dropped one, from the other list
- set fromView [$this view]
- $this delete
- $fromView reIndex
- $fromView sort -command "PropView::sort"
-
- return $newObj
- }
-
- method PropViewObject::define {this} {
-
- if {![isCommand .main.propViewDlg]} {
- ClassMaker::extend TemplateDialog PropViewDlg {propViewObject}
- interface PropViewDlg .main.propViewDlg {
- title "View Property"
- modal Yes
- DlgColumn DC {
- Label nameL {
- alignment CENTER
- }
- DlgRow DR {
- DlgColumn DC {
- Label L { text "Width"}
- IntField widthIF {
- columnCount 4
- editable 1
- }
- }
- DlgColumn DC {
- Label L { text "Sort Kind"}
- OptionMenu sortKindOM {
- entrySet {ascii integer\
- float}
- }
- }
- DlgColumn DC {
- Label L { text "Sort Policy"}
- OptionMenu sortPolicyOM {
- entrySet {none \
- increasing \
- decreasing}
- }
- }
- DlgColumn DC {
- Label L { text "Sort Order"}
- OptionMenu sortOrderOM {
- entrySet {}
- }
- }
- }
- }
- }
- .main.propViewDlg okPressed {
- set width [%this.DC.DR.DC.widthIF intValue]
- set policy [%this.DC.DR.DC.sortPolicyOM selected]
- set kind [%this.DC.DR.DC.sortKindOM selected]
- set order [%this.DC.DR.DC.sortOrderOM selected]
- set details [[%this propViewObject] details]
- set details [lreplace $details 0 0 $width]
- set details [lreplace $details 1 1 $kind]
- set details [lreplace $details 2 2 $policy]
- set details [lreplace $details 3 3 $order]
- [%this propViewObject] details $details
- }
- }
-
- .main.propViewDlg propViewObject $this
- set details [$this details]
- .main.propViewDlg.DC.DR.DC.widthIF intValue [lindex $details 0]
- .main.propViewDlg.DC.DR.DC.sortKindOM selected [lindex $details 1]
- .main.propViewDlg.DC.DR.DC.sortPolicyOM selected [lindex $details 2]
- set index 1
- set numbers {}
- foreach number [[$this view] objectSet] {
- lappend numbers $index
- incr index
- }
- .main.propViewDlg.DC.DR.DC.sortOrderOM entrySet $numbers
- .main.propViewDlg.DC.DR.DC.sortOrderOM selected [lindex $details 3]
- .main.propViewDlg.DC.nameL text "Property: [$this label]"
-
- .main.propViewDlg popUp
- }
-
- method PropViewObject::id {this} {
-
- return $this
- }
-
- # Do not delete this line -- regeneration end marker
-
-