home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
propdefdia.tcl
< prev
next >
Wrap
Text File
|
1997-03-14
|
5KB
|
205 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)propdefdia.tcl /main/titanic/1
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)propdefdia.tcl /main/titanic/1 14 Mar 1997 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
require "definedial.tcl"
Class PropDefDialog : {DefineDialog} {
constructor
method destructor
method createInterface
method clearInterface
method fromInterface
method toInterface
method load
method save
method objName
attribute dPage
}
constructor PropDefDialog {class this name} {
set this [DefineDialog::constructor $class $this $name]
# Start constructor user section
$this helpPressed ".main helpOnName editPropdefProperties"
# End constructor user section
return $this
}
method PropDefDialog::destructor {this} {
# Start destructor user section
# End destructor user section
$this DefineDialog::destructor
}
method PropDefDialog::createInterface {this} {
ClassMaker::extend BrowsObject ICMember isOld
interface NoteBkPage $this.definitionNBP {
label "Property Definition"
DlgColumn DC {
Label L {
text "Name:"
}
SingleLineText shortNameSLT {
editable FALSE
}
Label L {
text "Long Name:"
}
SingleLineText longNameSLT {
}
Label L {
text "Interface Class:"
}
DropDwnComboBox ifClassDDCB {
rowCount 10
}
Label L {
text "Interface Class Options:"
}
SingleLineText ifOptionsSLT {
}
Label L {
text "Interface Class Members:"
}
BrowsView ifMemberBV {
rowCount 10
selectionPolicy MULTIPLE
BrowsHeader shortBH {
label Name
width 12
}
BrowsHeader longBH {
label "Long Name"
width 30
}
}
}
}
$this dPage $this.definitionNBP.DC
global PropDefEdArea::ifClasses
[$this dPage].ifClassDDCB entrySet ${PropDefEdArea::ifClasses}
}
method PropDefDialog::clearInterface {this} {
[$this dPage].shortNameSLT text ""
[$this dPage].longNameSLT text ""
[$this dPage].ifClassDDCB text ""
[$this dPage].ifOptionsSLT text ""
[$this dPage].ifMemberBV selectedSet ""
}
method PropDefDialog::fromInterface {this} {
[$this curObject] longName [[$this dPage].longNameSLT text]
[$this curObject] ifClass [[$this dPage].ifClassDDCB text]
[$this curObject] ifOptions [[$this dPage].ifOptionsSLT text]
set lst {}
set objs [[.main editorArea] objectSet]
foreach obj [[$this dPage].ifMemberBV selectedSet] {
lappend lst [$obj label]
}
[$this curObject] ifMembers $lst
return ""
}
method PropDefDialog::toInterface {this} {
[$this dPage].shortNameSLT text [[$this curObject] shortName]
[$this dPage].longNameSLT text [[$this curObject] longName]
[$this dPage].ifClassDDCB text [[$this curObject] ifClass]
[$this dPage].ifOptionsSLT text [[$this curObject] ifOptions]
set lst {}
foreach member [[$this curObject] ifMembers] {
foreach obj [[$this dPage].ifMemberBV objectSet] {
if {[$obj label] == $member} {
lappend lst $obj
}
}
}
[$this dPage].ifMemberBV selectedSet $lst
}
method PropDefDialog::load {this object} {
$this clearInterface
$this curObject $object
$this title "Property Definition '[$object shortName]'"
# show all the properties that are defined before this one
foreach loopObject [[$this dPage].ifMemberBV objectSet] {
$loopObject isOld 1
}
set index [$object index]
foreach loopObject [[.main editorArea] objectSet] {
if {$index == [$loopObject index]} {
break
}
set objName [$this dPage].ifMemberBV.[$loopObject shortName]
if {![isCommand $objName]} {
ICMember new $objName
}
$objName label [$loopObject shortName]
$objName details [list [$loopObject longName]]
$objName isOld 0
}
foreach loopObject [[$this dPage].ifMemberBV objectSet] {
if [$loopObject isOld] {
$loopObject delete
}
}
$this popUp
$this toInterface
}
method PropDefDialog::save {this popDown} {
set longName [[$this dPage].longNameSLT text]
set ifClass [[$this dPage].ifClassDDCB text]
set ifOptions [[$this dPage].ifOptionsSLT text]
if {$longName == ""} {
wmtkerror "Property Definition must have a 'Long Name'."
return 0
}
if {$ifClass == ""} {
wmtkerror "Property Definition must have an 'Interface Class'."
return 0
}
$this fromInterface
[.main editorArea] isChanged 1
if {$popDown == 1} {
$this popDown
}
[$this curObject] updateView
return 1
}
method PropDefDialog::objName {this args} {
# return the objects name, it can not change in this dialog
return [[$this curObject] name]
}
# Do not delete this line -- regeneration end marker