home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)objectdefi.tcl 1.11
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)objectdefi.tcl 1.11 12 Mar 1996 Copyright 1996 Cadre Technologies 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 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 editobjTypeProperties }
- # 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 {
- sizeEqual 1
- NamedGroup NG {
- label "Fold state"
- DlgColumn DC {
- verStretchFactor 0
- CheckButton foldCB {
- label "Initial folded"
- }
- }
- }
- NamedGroup NG {
- label "File system extension"
- DlgColumn DC {
- verStretchFactor 0
- SingleLineText extensionSLT {
- }
- }
- }
- }
- }
- }
- }
-
- # 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 ""
-
- # clean page "Command"
- [$this cPage] clearInterface
- }
-
- method ObjectDefineDialog::fromInterface {this} {
-
- # save page "Interface"
- set spec ""
- set spec "$spec foldState [[$this iPage].foldCB state]"
-
- set extension [string trim [[$this iPage].extensionSLT text]]
- if {![lempty $extension]} {
- set spec "$spec fsExtension $extension"
- }
- set spec "$spec normalIcon [[$this iPage].normalIconI pixmap]"
- set spec "$spec activeIcon [[$this iPage].activeIconI pixmap]"
- set spec "$spec smallIcon [[$this iPage].smallIconI pixmap]"
- set spec "$spec largeIcon [[$this iPage].largeIconI pixmap]"
-
- # save page "Command"
- set cmdSpec [[$this cPage] fromInterface]
- if {$cmdSpec == ""} {
- return ""
- }
- 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 == "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
- }
-
- method ObjectDefineDialog::save {this popDown} {
-
- 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
-
-