home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)menuparent.tcl /main/titanic/5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)menuparent.tcl /main/titanic/5 26 Sep 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require mnemonicbu.tcl
- # End user added include file section
-
- require "menudefine.tcl"
-
- Class MenuParentDialog : {MenuDefineDialog} {
- constructor
- method destructor
- method createInterface
- method clearInterface
- method sensitive
- method fromInterface
- method toInterface
- method load
- method objName
- attribute iPage
- attribute aPage
- }
-
- constructor MenuParentDialog {class this name} {
- set this [MenuDefineDialog::constructor $class $this $name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method MenuParentDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this MenuDefineDialog::destructor
- }
-
- method MenuParentDialog::createInterface {this} {
-
- #indentation of this function is 4 spaces to make it easier to read
- $this MenuDefineDialog::createInterface
-
- # create "interface" page
- interface NoteBkPage $this.InterfaceNBP {
- label Interface
- DlgRow NG {
- DlgColumn DC {
- DlgRow DR {
- verStretchFactor 0
- sizeEqual 1
- NamedGroup NG {
- label Name
- DlgColumn DC {
- SingleLineText nameSLT {}
- }
- }
- NamedGroup NG {
- label Mnemonic
- DlgRow DR {
- spaceType EVEN
- MnemonicButton mnemonicDDL {
- verStretchFactor 0
- horStretchFactor 0
- entrySet " "
-
- }
- }
- }
- }
- DlgRow DR {
- verStretchFactor 0
- sizeEqual 1
- NamedGroup NG {
- label "Hint text"
- DlgColumn DC {
- SingleLineText hintSLT {}
- }
- }
- }
- DlgRow DR {
- verStretchFactor 0
- NamedGroup NG {
- DlgRow DR {
- CheckButton pinnableCB {
- label Pinnable
- state 0
- }
- }
- }
- }
- }
- }
- }
-
- $this iPage $this.InterfaceNBP.NG.DC.DR.NG
- [$this iPage].DC.nameSLT textModified "[$this iPage].DR.mnemonicDDL \
- entrySet \[%this text\]"
-
- # create "arbiter" page
- interface NoteBkPage $this.ArbiterNBP {
- label Arbiters
- DlgRow NG {
- DlgColumn DC {
- NamedGroup NG {
- label "Arbiter 1"
- DlgColumn DC {
- Label L {
- text Name
- }
- SingleLineText nameSLT1 {}
- Label L {
- text CurrentButtonChanged
- }
- MultiLineText buttonChangedMLT1 {
- rowCount 2
- }
- }
- }
- NamedGroup NG {
- label "Arbiter 2"
- DlgColumn DC {
- Label L {
- text Name
- }
- SingleLineText nameSLT2 {}
- Label L {
- text CurrentButtonChanged
- }
- MultiLineText buttonChangedMLT2 {
- rowCount 2
- }
- }
- }
- NamedGroup NG {
- label "Arbiter 3"
- DlgColumn DC {
- Label L {
- text Name
- }
- SingleLineText nameSLT3 {}
- Label L {
- text CurrentButtonChanged
- }
- MultiLineText buttonChangedMLT3 {
- rowCount 2
- }
- }
- }
- }
- }
- }
-
- $this aPage $this.ArbiterNBP.NG.DC.NG.DC
-
- }
-
- method MenuParentDialog::clearInterface {this} {
-
- $this MenuDefineDialog::clearInterface
-
- # clean page "Interface"
- [$this iPage].DC.nameSLT text ""
- [$this iPage].DR.mnemonicDDL entrySet {}
- [$this iPage].DR.pinnableCB state 0
- [$this iPage].DC.hintSLT text ""
- [$this aPage].nameSLT1 text ""
- [$this aPage].buttonChangedMLT1 text ""
- [$this aPage].nameSLT2 text ""
- [$this aPage].buttonChangedMLT2 text ""
- [$this aPage].nameSLT3 text ""
- [$this aPage].buttonChangedMLT3 text ""
- }
-
- method MenuParentDialog::sensitive {this args} {
-
- $this MenuDefineDialog::sensitive $args
-
- if {[llength $args] == 0} {
- return [[$this iPage].DC.nameSLT sensitive]
- } else {
- set sensitive [lindex $args 0]
- }
-
- # clean page "Interface"
- [$this iPage].DC.nameSLT sensitive $sensitive
- [$this iPage].DR.mnemonicDDL sensitive $sensitive
- [$this iPage].DR.pinnableCB sensitive $sensitive
- set type [[$this curObject] type]
- if {$sensitive == 1 && $type == "CustMenuBarButton"} {
- # do not make sensitive
- } else {
- [$this iPage].DC.hintSLT sensitive $sensitive
- }
- [$this aPage].nameSLT1 sensitive $sensitive
- [$this aPage].buttonChangedMLT1 sensitive $sensitive
- [$this aPage].nameSLT2 sensitive $sensitive
- [$this aPage].buttonChangedMLT2 sensitive $sensitive
- [$this aPage].nameSLT3 sensitive $sensitive
- [$this aPage].buttonChangedMLT3 sensitive $sensitive
-
- return $sensitive
- }
-
- method MenuParentDialog::fromInterface {this} {
-
- # save page "Interface"
- set spec [list label [[$this iPage].DC.nameSLT text]]
- if {[string trim [[$this iPage].DR.mnemonicDDL selected]] != ""} {
- lappend spec mnemonic [[$this iPage].DR.mnemonicDDL selected]
- }
-
- if { [[$this curObject] type] != "CustMenuBarButton" } {
- set hint [string trim [[$this iPage].DC.hintSLT text]]
- if ![lempty $hint] {
- lappend spec hintText $hint
- }
- }
-
- [$this curObject] pinnable [[$this iPage].DR.pinnableCB state]
-
- set arbiters ""
- if ![lempty [[$this aPage].nameSLT1 text]] {
- lappend arbiters [list [[$this aPage].nameSLT1 text] \
- [[$this aPage].buttonChangedMLT1 text]]
- }
- if ![lempty [[$this aPage].nameSLT2 text]] {
- lappend arbiters [list [[$this aPage].nameSLT2 text] \
- [[$this aPage].buttonChangedMLT2 text]]
- }
- if ![lempty [[$this aPage].nameSLT3 text]] {
- lappend arbiters [list [[$this aPage].nameSLT3 text] \
- [[$this aPage].buttonChangedMLT3 text]]
- }
-
- [$this curObject] arbiters $arbiters
-
- return $spec
- }
-
- method MenuParentDialog::toInterface {this key value} {
-
- # page "Interface"
- if {$key == "label"} {
-
- [$this iPage].DC.nameSLT text $value
- [$this iPage].DR.mnemonicDDL entrySet $value
- return
- }
-
- if {$key == "mnemonic"} {
- [$this iPage].DR.mnemonicDDL selected $value
- return
- }
-
- if { [[$this curObject] type] != "CustMenuBarButton" } {
- if {$key == "hintText"} {
- [$this iPage].DC.hintSLT text $value
- }
- }
- }
-
- method MenuParentDialog::load {this object} {
-
- $this MenuDefineDialog::load $object
- [$this iPage].DR.pinnableCB state [$object pinnable]
-
- # disable the hintText for MenuBarButtons,
- # A MenuBarButton has no hintText YET (next release?)
- if { [[$this curObject] type] != "CustMenuBarButton" } {
- [$this iPage].DC.hintSLT sensitive 1
- } else {
- [$this iPage].DC.hintSLT sensitive 0
- }
-
- set count 1
- foreach i [$object arbiters] {
- [$this aPage].nameSLT$count text [lindex $i 0]
- [$this aPage].buttonChangedMLT$count text [lindex $i 1]
- if {$count == 3} {
- break;
- } else {
- incr count
- }
- }
-
- if [$object editable] {
- $this sensitive 1
- } else {
- $this sensitive 0
- }
- }
-
- method MenuParentDialog::objName {this args} {
-
- if {$args == ""} {
- return [[$this iPage].DC.nameSLT text]
- } else {
- [$this iPage].DC.nameSLT text [join $args]
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-