home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
m4optionbr.tcl
< prev
next >
Wrap
Text File
|
1997-07-02
|
2KB
|
76 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)m4optionbr.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)m4optionbr.tcl /main/titanic/2 2 Jul 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require m4vardescr.tcl
# End user added include file section
Class M4OptionBrowser : {ListDialog} {
method destructor
constructor
method formatEntry
method selectedOption
}
method M4OptionBrowser::destructor {this} {
# Start destructor user section
# End destructor user section
}
constructor M4OptionBrowser {class this name {entries {}}} {
set this [ListDialog::constructor $class $this $name]
$this config \
-title "M4 Option Browser" \
-message "Select an M4 option:" \
-selectionPolicy BROWSE \
-rowCount 10 \
-font courier-normal-12 \
-modal 1
$this delHelpButton
set m4desc [M4VarDescription new $this.m4desc]
if [lempty $entries] {
set entries [[$m4desc _UiName] names]
}
set max -1
foreach entry $entries {
set l [string length $entry]
if {$l > $max} {
set max $l
}
}
set entrySet {}
foreach name [lsort $entries] {
lappend entrySet \
[$this formatEntry $max $name [$m4desc getUiName $name]]
}
$this entrySet $entrySet
return $this
}
method M4OptionBrowser::formatEntry {this nameWidth name desc} {
return [format "%-${nameWidth}s %s" $name $desc]
}
method M4OptionBrowser::selectedOption {this} {
set sel [lindex [$this selectedSet] 0]
return [lindex $sel 0]
}
# Do not delete this line -- regeneration end marker