home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)objectdefi.tcl /main/titanic/4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)objectdefi.tcl /main/titanic/4 23 Oct 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require "commandpag.tcl"
- # End user added include file section
-
- require "defstoredi.tcl"
-
- Class ObjectDefineDialog : {DefStoreDialog} {
- constructor
- method destructor
- method createInterface
- method clearInterface
- method sensitive
- method fromInterface
- method toInterface
- method load
- method save
- method objName
- attribute iPage
- attribute cPage
- }
-
- constructor ObjectDefineDialog {class this name} {
- set this [DefStoreDialog::constructor $class $this $name]
- # Start constructor user section
- $this helpPressed \
- ".main helpOnName objTypeProp\[\[$this currentPage] label]Page"
- # End constructor user section
- return $this
- }
-
- method ObjectDefineDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this DefStoreDialog::destructor
- }
-
- method ObjectDefineDialog::createInterface {this} {
-
- #indentation of this function is 4 spaces to make it easier to read
- $this DefStoreDialog::createInterface
-
- # create "interface" page
- interface NoteBkPage $this.InterfaceNBP {
- label Interface
- NamedGroup NG {
- DlgColumn DC {
- DlgRow DR {
- verStretchFactor 0
- sizeEqual 1
- NamedGroup NG {
- label "Normal Icon"
- DlgColumn DC {
- Image normalIconI {
- }
- PushButton normalIconPB {
- label "Select Icon"
- }
- }
- }
- NamedGroup NG {
- label "Active Icon"
- DlgColumn DC {
- Image activeIconI {
- }
- PushButton activeIconPB {
- label "Select Icon"
- }
- }
- }
- }
- DlgRow DR {
- verStretchFactor 0
- sizeEqual 1
- NamedGroup NG {
- label "Small Icon"
- DlgColumn DC {
- Image smallIconI {
- }
- PushButton smallIconPB {
- label "Select Icon"
- }
- }
- }
- NamedGroup NG {
- label "Large Icon"
- DlgColumn DC {
- Image largeIconI {
- }
- PushButton largeIconPB {
- label "Select Icon"
- }
- }
- }
- }
- DlgRow DR {
- verStretchFactor 0
- NamedGroup NG {
- label "Fold State"
- DlgColumn DC {
- CheckButton foldCB {
- label "Initial Folded"
- }
- }
- }
- }
- DlgRow DR {
- verStretchFactor 0
- NamedGroup NG {
- label "File System Extension"
- DlgColumn DC {
- SingleLineText extensionSLT {
- }
- }
- }
- }
- DlgRow DR {
- verStretchFactor 0
- NamedGroup NG {
- label "Make Type"
- DlgColumn DC {
- VerRadioGroup makeTypeVRG {
- entrySet {"None" "Source" "Target"}
- }
- }
- }
- }
- }
- }
- }
-
- # create "command" page
- $this cPage [CommandPage new $this.cPage]
- [$this cPage] isMethod 1
-
- $this iPage $this.InterfaceNBP.NG.DC.DR.NG.DC
-
- [$this iPage].normalIconPB activated "[.main smallIconSelector] select \
- [$this iPage].normalIconI"
- [$this iPage].activeIconPB activated "[.main activeIconSelector] select \ [$this iPage].activeIconI"
- [$this iPage].smallIconPB activated "[.main smallIconSelector] select \ [$this iPage].smallIconI"
- [$this iPage].largeIconPB activated "[.main largeIconSelector] select \ [$this iPage].largeIconI"
-
-
- }
-
- method ObjectDefineDialog::clearInterface {this} {
-
- $this DefStoreDialog::clearInterface
-
- # clean page "Interface"
- [$this iPage].normalIconI pixmap undef_16
- [$this iPage].activeIconI pixmap undef_16
- [$this iPage].smallIconI pixmap undef_16
- [$this iPage].largeIconI pixmap undef_32
- [$this iPage].foldCB state 1
- [$this iPage].extensionSLT text ""
- [$this iPage].makeTypeVRG selected "None"
-
- # clean page "Command"
- [$this cPage] clearInterface
- }
-
- method ObjectDefineDialog::sensitive {this args} {
-
- $this DefStoreDialog::sensitive $args
-
- if {[llength $args] == 0} {
- return [[$this iPage].normalIconI]
- } else {
- set sensitive [lindex $args 0]
- }
-
- [$this iPage].normalIconPB sensitive $sensitive
- [$this iPage].activeIconPB sensitive $sensitive
- [$this iPage].smallIconPB sensitive $sensitive
- [$this iPage].largeIconPB sensitive $sensitive
- [$this iPage].foldCB sensitive $sensitive
- [$this iPage].extensionSLT sensitive $sensitive
- [$this iPage].makeTypeVRG sensitive $sensitive
-
- [$this cPage] sensitive $args
-
- return $sensitive
- }
-
- method ObjectDefineDialog::fromInterface {this} {
-
- # save page "Interface"
- set spec [list foldState [[$this iPage].foldCB state]]
-
- set extension [string trim [[$this iPage].extensionSLT text]]
- if {![lempty $extension]} {
- lappend spec fsExtension $extension
- }
- set makeType [[$this iPage].makeTypeVRG selected]
- if {"$makeType" != "None"} {
- lappend spec makeType [string tolower $makeType]
- }
- lappend spec normalIcon [[$this iPage].normalIconI pixmap]
- lappend spec activeIcon [[$this iPage].activeIconI pixmap]
- lappend spec smallIcon [[$this iPage].smallIconI pixmap]
- lappend spec largeIcon [[$this iPage].largeIconI pixmap]
-
- # save page "Command"
- set cmdSpec [[$this cPage] fromInterface]
- if {$cmdSpec == ""} {
- return ""
- }
- # don't use lappend for this purpose
- set spec "$spec defaultAction $cmdSpec"
- return $spec
- }
-
- method ObjectDefineDialog::toInterface {this key value} {
-
- # page "Interface"
- if {$key == "foldState"} {
- [$this iPage].foldCB state $value
- }
- if {$key == "fsExtension"} {
- [$this iPage].extensionSLT text $value
- }
- if {$key == "makeType"} {
- [$this iPage].makeTypeVRG selected "[string toupper [string \
- range $value 0 0]][string range $value 1 end]"
- }
- if {$key == "normalIcon"} {
- [$this iPage].normalIconI pixmap $value
- }
- if {$key == "activeIcon"} {
- [$this iPage].activeIconI pixmap $value
- }
- if {$key == "smallIcon"} {
- [$this iPage].smallIconI pixmap $value
- }
- if {$key == "largeIcon"} {
- [$this iPage].largeIconI pixmap $value
- }
-
- # page "Command"
- if {$key == "defaultAction"} {
- [$this cPage] toInterface $value
- }
- }
-
- method ObjectDefineDialog::load {this object} {
-
- # fill the methods of the selected object
- [$this cPage] setMethods [$object displayName]
-
- $this DefineDialog::load $object
-
- if [$object editable] {
- $this sensitive 1
- } else {
- $this sensitive 0
- }
- }
-
- method ObjectDefineDialog::save {this popDown} {
-
- if {![[$this curObject] editable]} {
- if {$popDown == 1} {
- $this popDown
- }
- return
- }
-
- if {[$this DefineDialog::save $popDown] == 1} {
- # reset redefined attribute
- [$this curObject] redefined 0
- }
- }
-
- method ObjectDefineDialog::objName {this args} {
-
- if {$args == ""} {
- # name of an objecttype can not change so return the original
- return [[$this curObject] displayName]
- } else {
- #set nothing
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-