home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
menuparent.tcl
< prev
next >
Wrap
Text File
|
1996-10-24
|
8KB
|
274 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)menuparent.tcl /main/hindenburg/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)menuparent.tcl /main/hindenburg/2 24 Oct 1996 Copyright 1994 Westmount Technology
# 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 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::fromInterface {this} {
# save page "Interface"
set spec ""
set spec "$spec label \"[[$this iPage].DC.nameSLT text]\""
if {[string trim [[$this iPage].DR.mnemonicDDL selected]] != ""} {
set spec "$spec mnemonic [[$this iPage].DR.mnemonicDDL selected]"
}
if { [[$this curObject] type] != "CustMenuBarButton" } {
set hint [string trim [[$this iPage].DC.hintSLT text]]
if ![lempty $hint] {
set spec "$spec hintText \"$hint\""
}
}
[$this curObject] pinnable [[$this iPage].DR.pinnableCB state]
set arbiters ""
if ![lempty [[$this aPage].nameSLT1 text]] {
lappend arbiters "\{[[$this aPage].nameSLT1 text]\} \
\{[[$this aPage].buttonChangedMLT1 text]\}"
}
if ![lempty [[$this aPage].nameSLT2 text]] {
lappend arbiters "\{[[$this aPage].nameSLT2 text]\} \
\{[[$this aPage].buttonChangedMLT2 text]\}"
}
if ![lempty [[$this aPage].nameSLT3 text]] {
lappend arbiters "\{[[$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
}
}
}
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