home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)opendefdia.tcl 1.3
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)opendefdia.tcl 1.3 04 Apr 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
- require "definedial.tcl"
-
- Class OpenDefDialog : {DefineDialog} {
- constructor
- method destructor
- method clearInterface
- method load
- method save
- method objName
- attribute dPage
- }
-
- constructor OpenDefDialog {class this name} {
- set this [DefineDialog::constructor $class $this $name]
- # Start constructor user section
-
- $this helpPressed { .main helpOnName editOpendefProperties }
-
- # End constructor user section
- return $this
- }
-
- method OpenDefDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this DefineDialog::destructor
- }
-
- method OpenDefDialog::clearInterface {this} {
- [$this dPage].nameSLT text ""
- }
-
- method OpenDefDialog::load {this object} {
- $this clearInterface
- $this curObject $object
- $this objName [$object name]
- $this title "[$object type]Strategy '[$object name]'"
- $this toInterface
- $this popUp
- }
-
- method OpenDefDialog::save {this popDown} {
- set newName [$this objName]
- if {$newName == ""} {
- wmtkerror "Strategy must have a name."
- return 0
- }
- set oldName [[$this curObject] name]
- if {$newName != $oldName} {
- set area [.main editorArea]
- if {[$area getStrategy $newName] != ""} {
- wmtkerror "Strategy $newName already exists."
- return 0
- }
- $area removeStrategy $oldName
- $area setStrategy $newName [$this curObject]
- [$this curObject] name $newName
- [$this curObject] updateView
- }
-
- $this fromInterface
- [.main editorArea] isChanged 1
- if {$popDown == 1} {
- $this popDown
- }
- return 1
- }
-
- method OpenDefDialog::objName {this args} {
- if {$args == ""} {
- return [[$this dPage].nameSLT text]
- } else {
- [$this dPage].nameSLT text [join $args]
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-