--- a/UIPainter.st Mon Jun 16 11:34:16 1997 +0200
+++ b/UIPainter.st Mon Jun 16 11:36:46 1997 +0200
@@ -1,6 +1,7 @@
ApplicationModel subclass:#UIPainter
- instanceVariableNames:'objectList selectionPanel tabSelection lastSlice specView
- layoutTool fileName specClass specSelector specSuperclass aspects'
+ instanceVariableNames:'activeHelpTool layoutTool objectList selectionPanel tabSelection
+ lastSlice specView fileName specClass specSelector specSuperclass
+ aspects'
classVariableNames:''
poolDictionaries:''
category:'Interface-UIPainter'
@@ -55,12 +56,6 @@
! !
-!UIPainter class methodsFor:'constants'!
-
-titleOfLayoutMenu
- ^ 'Dimension'
-! !
-
!UIPainter class methodsFor:'icons'!
iconAlignB
@@ -104,6 +99,183 @@
!UIPainter class methodsFor:'interface specs'!
+XXwindowSpec
+ "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:UIPainter andSelector:#windowSpec
+ UIPainter new openInterface:#windowSpec
+ "
+ "UIPainter open"
+
+ <resource: #canvas>
+
+ ^
+
+ #(#FullSpec
+ #'window:'
+ #(#WindowSpec
+ #'name:' 'uIPainterView'
+ #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
+ #'label:' 'Tree-View'
+ #'bounds:' #(#Rectangle 0 0 478 429)
+ )
+ #'component:'
+ #(#SpecCollection
+ #'collection:'
+ #(
+ #(#MenuPanelSpec
+ #'name:' 'menuPullDown'
+ #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 24 0)
+ #'tabable:' true
+ #'menu:' #menuPullDown
+ )
+ #(#MenuPanelSpec
+ #'name:' 'menuAlignment'
+ #'layout:' #(#LayoutFrame 0 0.0 29 0 233 0 54 0)
+ #'tabable:' true
+ #'menu:' #menuAlignment
+ #'showSeparatingLines:' true
+ )
+ #(#PanelViewSpec
+ #'name:' 'panelViewButtons'
+ #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 57 0.0)
+ #'component:'
+ #(#SpecCollection
+ #'collection:'
+ #(
+ #(#ActionButtonSpec
+ #'name:' 'moveLeft'
+ #'label:' ''
+ #'translateLabel:' true
+ #'labelChannel:' #'LABELb_moveLeft.xbm'
+ #'tabable:' true
+ #'defaultable:' true
+ #'model:' #moveSelectionLeft
+ #'isTriggerOnDown:' true
+ #'enableChannel:' #enableChannel
+ #'autoRepeat:' false
+ #'extent:' #(#Point 26 24)
+ )
+ #(#ActionButtonSpec
+ #'name:' 'moveRight'
+ #'label:' ''
+ #'translateLabel:' true
+ #'labelChannel:' #'LABELb_moveRight.xbm'
+ #'tabable:' true
+ #'defaultable:' true
+ #'model:' #moveSelectionRight
+ #'isTriggerOnDown:' true
+ #'enableChannel:' #enableChannel
+ #'autoRepeat:' false
+ #'extent:' #(#Point 26 24)
+ )
+ #(#ActionButtonSpec
+ #'name:' 'moveUp'
+ #'label:' ''
+ #'translateLabel:' true
+ #'labelChannel:' #'LABELb_moveUp.xbm'
+ #'tabable:' true
+ #'defaultable:' true
+ #'model:' #moveSelectionUp
+ #'isTriggerOnDown:' true
+ #'enableChannel:' #enableChannel
+ #'autoRepeat:' false
+ #'extent:' #(#Point 26 24)
+ )
+ #(#ActionButtonSpec
+ #'name:' 'moveDown'
+ #'label:' ''
+ #'translateLabel:' true
+ #'labelChannel:' #'LABELb_moveDown.xbm'
+ #'tabable:' true
+ #'defaultable:' true
+ #'model:' #moveSelectionDown
+ #'isTriggerOnDown:' true
+ #'enableChannel:' #enableChannel
+ #'autoRepeat:' false
+ #'extent:' #(#Point 26 24)
+ )
+ )
+ )
+ #'level:' 1
+ #'horizontalLayout:' #fitSpace
+ #'verticalLayout:' #fitSpace
+ #'horizontalSpace:' 4
+ #'verticalSpace:' 4
+ )
+ #(#SequenceViewSpec
+ #'name:' 'objectTree'
+ #'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 0 1.0)
+ #'enableChannel:' #enableChannel
+ #'tabable:' true
+ #'menu:' #objectListMenu
+ #'model:' #objectList
+ #'hasHorizontalScrollBar:' true
+ #'hasVerticalScrollBar:' true
+ #'miniScrollerHorizontal:' true
+ #'isMultiSelect:' true
+ #'doubleClickSelector:' #doubleClick
+ #'useIndex:' true
+ )
+ #(#NoteBookViewSpec
+ #'name:' 'noteBook'
+ #'layout:' #(#LayoutFrame 0 0.35 59 0.0 0 1.0 -30 1.0)
+ #'enableChannel:' #enableChannel
+ #'tabable:' true
+ #'menu:' #tabList
+ #'style:'
+ #(#FontDescription
+ #helvetica #medium
+ #roman #'10'
+ )
+ #'model:' #tabModel
+ #'tabWidget:' #Window
+ #'canvas:' #noteBookView
+ )
+ #(#HorizontalPanelViewSpec
+ #'name:' 'modifyPanel'
+ #'layout:' #(#LayoutFrame 0 0.35 -30 1.0 0 1.0 0 1.0)
+ #'component:'
+ #(#SpecCollection
+ #'collection:'
+ #(
+ #(#ActionButtonSpec
+ #'name:' 'cancelButton'
+ #'label:' 'cancel'
+ #'tabable:' true
+ #'model:' #cancel
+ #'isTriggerOnDown:' false
+ #'enableChannel:' #modifiedChannel
+ #'autoRepeat:' false
+ #'extent:' #(#Point 151 24)
+ )
+ #(#ActionButtonSpec
+ #'name:' 'acceptButton'
+ #'label:' 'ok'
+ #'tabable:' true
+ #'model:' #accept
+ #'isTriggerOnDown:' false
+ #'enableChannel:' #modifiedChannel
+ #'autoRepeat:' false
+ #'extent:' #(#Point 151 24)
+ )
+ )
+ )
+ #'level:' 0
+ #'horizontalLayout:' #fitSpace
+ #'verticalLayout:' #fitSpace
+ #'horizontalSpace:' 3
+ #'verticalSpace:' 3
+ )
+ )
+ )
+ )
+!
+
menuAlignment
^ #(#Menu #(
#(#MenuItem
@@ -186,24 +358,6 @@
)
)
#(#MenuItem
- #'label:' 'special'
- #'value:' #special
- #'submenu:'
- #(#Menu #(
- #(#MenuItem
- #'label:' 'group radioButtons'
- #'value:' #groupRadioButtons
- )
- #(#MenuItem
- #'label:' 'group enterFields'
- #'value:' #groupEnterFields
- )
- )
- nil
- nil
- )
- )
- #(#MenuItem
#'label:' 'misc'
#'value:' #misc
#'submenu:'
@@ -275,8 +429,12 @@
#'value:' #doWindowSpec
)
#(#MenuItem
- #'label:' 'browse'
- #'value:' #browseAppClass
+ #'label:' 'browse application'
+ #'value:' #doBrowseAppClass
+ )
+ #(#MenuItem
+ #'label:' 'start application'
+ #'value:' #doStartApplication
)
)
#( 1 2 1)
@@ -441,7 +599,7 @@
)
#(#PanelViewSpec
#'name:' 'panelViewButtons'
- #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 -372 1.0)
+ #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 57 0.0)
#'component:'
#(#SpecCollection
#'collection:'
@@ -456,7 +614,6 @@
#'model:' #moveSelectionLeft
#'isTriggerOnDown:' true
#'enableChannel:' #enableChannel
- #'autoRepeat:' false
#'extent:' #(#Point 26 24)
)
#(#ActionButtonSpec
@@ -469,7 +626,6 @@
#'model:' #moveSelectionRight
#'isTriggerOnDown:' true
#'enableChannel:' #enableChannel
- #'autoRepeat:' false
#'extent:' #(#Point 26 24)
)
#(#ActionButtonSpec
@@ -482,7 +638,6 @@
#'model:' #moveSelectionUp
#'isTriggerOnDown:' true
#'enableChannel:' #enableChannel
- #'autoRepeat:' false
#'extent:' #(#Point 26 24)
)
#(#ActionButtonSpec
@@ -495,7 +650,6 @@
#'model:' #moveSelectionDown
#'isTriggerOnDown:' true
#'enableChannel:' #enableChannel
- #'autoRepeat:' false
#'extent:' #(#Point 26 24)
)
)
@@ -508,7 +662,7 @@
)
#(#SequenceViewSpec
#'name:' 'objectTree'
- #'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 0 1.0)
+ #'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 -25 1.0)
#'enableChannel:' #enableChannel
#'tabable:' true
#'menu:' #objectListMenu
@@ -522,7 +676,7 @@
)
#(#NoteBookViewSpec
#'name:' 'noteBook'
- #'layout:' #(#LayoutFrame 0 0.35 59 0.0 0 1.0 -30 1.0)
+ #'layout:' #(#LayoutFrame 0 0.35 59 0.0 0 1.0 -55 1.0)
#'enableChannel:' #enableChannel
#'tabable:' true
#'menu:' #tabList
@@ -537,7 +691,7 @@
)
#(#HorizontalPanelViewSpec
#'name:' 'modifyPanel'
- #'layout:' #(#LayoutFrame 0 0.35 -30 1.0 0 1.0 0 1.0)
+ #'layout:' #(#LayoutFrame 0 0.35 -55 1.0 0 1.0 -25 1.0)
#'component:'
#(#SpecCollection
#'collection:'
@@ -547,9 +701,7 @@
#'label:' 'cancel'
#'tabable:' true
#'model:' #cancel
- #'isTriggerOnDown:' false
#'enableChannel:' #modifiedChannel
- #'autoRepeat:' false
#'extent:' #(#Point 151 24)
)
#(#ActionButtonSpec
@@ -557,9 +709,7 @@
#'label:' 'ok'
#'tabable:' true
#'model:' #accept
- #'isTriggerOnDown:' false
#'enableChannel:' #modifiedChannel
- #'autoRepeat:' false
#'extent:' #(#Point 151 24)
)
)
@@ -570,6 +720,13 @@
#'horizontalSpace:' 3
#'verticalSpace:' 3
)
+ #(#LabelSpec
+ #'name:' 'helpInfo'
+ #'layout:' #(#LayoutFrame 2 0.0 -25 1.0 -2 1.0 -2 1.0)
+ #'label:' ''
+ #'level:' -1
+ #'adjust:' #left
+ )
)
)
)
@@ -581,16 +738,19 @@
"automatically generated by UIPainter ..."
|layout|
- tabSelection = 'Dimension' ifTrue:[
+ tabSelection = layoutTool label ifTrue:[
(layout := layoutTool layout) notNil ifTrue:[
layoutTool layoutType == #Extent ifTrue:[
self painter setExtent:layout
] ifFalse:[
- self painter setDimension:layout
+ self painter setLayout:layout
]
]
] ifFalse:[
- self painter updateFromSpec:(specView specEdited).
+ tabSelection = 'Help' ifTrue:[
+ activeHelpTool accept
+ ].
+ self painter updateFromSpec:(specView specEdited)
].
self cancel
@@ -608,6 +768,35 @@
objectList selectGroup
! !
+!UIPainter methodsFor:'active help'!
+
+activeHelpTool
+ "automatically generated by UIPainter ..."
+
+ activeHelpTool isNil ifTrue:[
+ activeHelpTool := UIHelpTool new
+ ].
+ ^ activeHelpTool
+!
+
+showHelp:aHelpText for:view
+ "hook to allow an application to display active help
+ texts in its own info area.
+ This method may be redefined in a concrete application.
+ If it returns false, the ActiveHelp manager will popup a
+ bubble with the help text."
+
+ |l|
+
+ (l := self builder componentAt:#helpInfo) notNil ifTrue:[
+ l label:aHelpText.
+ ^ true.
+ ].
+ ^ false
+
+
+! !
+
!UIPainter methodsFor:'aspects'!
enableChannel
@@ -746,7 +935,7 @@
(painter respondsTo:(aMessage selector)) ifTrue:[
^ aMessage sendTo:painter
].
- self error
+ super doesNotUnderstand:aMessage
!
@@ -767,7 +956,7 @@
size := slices size + 1.
list := Array new:size.
slices keysAndValuesDo:[:i :s|list at:i put:(s first asString)].
- list at:size put:'Dimension'.
+ list at:size put:(layoutTool label).
(self tabList) value:list.
] ifTrue:[
list := self tabList value
@@ -864,11 +1053,15 @@
objectList removeDependent:self.
objectList painter release.
- objectList := nil.
selectionPanel notNil ifTrue:[
selectionPanel closeRequest
].
+ selectionPanel := nil.
+ layoutTool := nil.
+ objectList := nil.
+ activeHelpTool := nil.
+
super closeRequest.
!
@@ -982,32 +1175,6 @@
!UIPainter methodsFor:'user interaction - dialog'!
-browseAppClass
- "open a browser on the class"
-
- |cls|
-
- specClass isNil ifTrue:[
- self information:'no class yet'.
- ^ self
- ].
-
- specClass isBehavior ifFalse:[
- cls := Smalltalk at:specClass asSymbol
- ] ifTrue:[
- cls := specClass
- ].
-
- cls isNil ifTrue:[
- self information:'no class yet'.
- ^ self
- ].
-
- SystemBrowser openInClass:cls
-
-
-!
-
checkClassAndSelector
"check for class & superclass"
@@ -1089,6 +1256,30 @@
!UIPainter methodsFor:'user interaction - pullDown'!
+doBrowseAppClass
+ "open a browser on the class"
+
+ |cls|
+
+ specClass isNil ifTrue:[
+ ^ self information:'no class yet'.
+ ].
+
+ specClass isBehavior ifFalse:[
+ cls := Smalltalk at:specClass asSymbol
+ ] ifTrue:[
+ cls := specClass
+ ].
+
+ cls isNil ifTrue:[
+ ^ self information:'no class yet'.
+ ].
+
+ SystemBrowser openInClass:cls
+
+
+!
+
doFromClass
|className methodName cls sel accepted failed spec s painter|
@@ -1242,6 +1433,29 @@
!
+doStartApplication
+ |cls|
+
+ (specClass isNil or:[specSelector isNil]) ifTrue:[
+ ^ self information:'no class or selector defined'.
+ ].
+
+ specClass isBehavior ifFalse:[
+ cls := Smalltalk at:specClass asSymbol
+ ] ifTrue:[
+ cls := specClass
+ ].
+
+ cls isNil ifTrue:[
+ ^ self information:'class not existant'.
+ ].
+
+ (cls respondsTo:specSelector) ifFalse:[
+ ^ self information:'selector not defined'.
+ ].
+ cls new openInterface:specSelector
+!
+
doWindowSpec
|code code2 v|