change drop mechanism:
if selected widget is not a container, drop the element
at the current pointer position.
"
COPYRIGHT (c) 1995 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
ApplicationModel subclass:#UISpecificationTool
instanceVariableNames:'modifiedHolder aspects specification selection specChannel'
classVariableNames:''
poolDictionaries:''
category:'Interface-UIPainter'
!
!UISpecificationTool class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 1995 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
!
documentation
"
used by the UIPainter to manipulate the specifications of the selected component
[author:]
Claus Atzkern
[see also:]
UIPainter
UILayoutTool
UIHelpTool
"
! !
!UISpecificationTool class methodsFor:'help specs'!
helpSpec
"return a dictionary filled with helpKey -> helptext associations.
These are used by the activeHelp tool.
"
^ super helpSpec addPairsFrom:#(
#maxChars
'set the maximum number of
characters that are allowed
in the editfield.'
#id
'enter the name of the field here.
This ID can be used by the application
to access components, using #componentAt:<key>'
)
! !
!UISpecificationTool class methodsFor:'interface specs'!
windowSpec
"this window spec was automatically generated by the ST/X UIPainter"
"do not manually edit this - the painter/builder may not be able to
handle the specification if its corrupted."
"
UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec
UISpecificationTool new openInterface:#windowSpec
"
"UISpecificationTool open"
<resource: #canvas>
^
#(#FullSpec
#'window:'
#(#WindowSpec
#'name:' 'uIPainterView'
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
#'label:' 'unnamed canvas'
#'bounds:' #(#Rectangle 0 0 300 300)
)
#'component:'
#(#SpecCollection
#'collection:'
#(
#(#ViewSpec
#'name:' 'Frame'
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
)
)
)
)
! !
!UISpecificationTool methodsFor:'accessing'!
specification
"gets current edit specification
"
^ specification
!
specification:aSpec
"sets current edit specification
"
aSpec isNil ifTrue:[
specChannel := nil.
specification := nil.
aspects := nil.
] ifFalse:[
specification class == aSpec class ifTrue:[
specification := aSpec.
^ specChannel value:specification.
].
specification := aSpec.
aspects := IdentityDictionary new.
specChannel := specification asValue.
specification class addBindingsTo:aspects for:specification channel:specChannel.
aspects do:[:el| el addDependent:self ].
].
selection notNil ifTrue:[
(builder componentAt:#Frame) destroySubViews.
selection := nil.
].
! !
!UISpecificationTool methodsFor:'accessing channels'!
modifiedHolder:aValueHolder
"set the value holder set to true in case of modifying attributes
"
modifiedHolder notNil ifTrue:[
modifiedHolder removeDependent:self.
].
(modifiedHolder := aValueHolder) notNil ifTrue:[
modifiedHolder addDependent:self.
].
! !
!UISpecificationTool methodsFor:'bindings'!
aspectFor:aKey
"returns aspect for a key or nil
"
aspects notNil ifTrue:[
^ aspects at:aKey ifAbsent:nil
].
^ super aspectFor:aKey
! !
!UISpecificationTool methodsFor:'change & update'!
update
"reload specification
"
specChannel notNil ifTrue:[
specChannel value:specification.
]
!
update:something with:someArgument from:someone
"any attribute changed its state in the current specification
"
someone ~~ modifiedHolder ifTrue:[
modifiedHolder value ~~ true ifTrue:[
modifiedHolder value:true
]
]
! !
!UISpecificationTool methodsFor:'selection'!
selection:something
"selection changed
"
|slices idx spec frame|
specification notNil ifTrue:[
slices := specification class slices.
idx:= slices findFirst:[:aSlice| aSlice first = something ].
idx ~~ 0 ifTrue:[
spec := specification class perform:((slices at:idx) last).
].
].
spec ~= selection ifTrue:[
frame := builder componentAt:#Frame.
frame destroySubViews.
spec notNil ifTrue:[
builder buildFromSpec:spec in:frame.
frame allViewBackground:(frame viewBackground).
frame realizeAllSubViews.
]
].
selection := spec.
! !
!UISpecificationTool class methodsFor:'documentation'!
version
^ '$Header$'
! !