# HG changeset patch # User Stefan Vogel # Date 1197388450 -3600 # Node ID b54632779619d25ccbc99fed396598543d670515 # Parent 83fa306392adb66a1a806c25caf4ebcadf98aae6 Use class var for SelectionPanel diff -r 83fa306392ad -r b54632779619 UIPainter.st --- a/UIPainter.st Tue Dec 11 16:51:36 2007 +0100 +++ b/UIPainter.st Tue Dec 11 16:54:10 2007 +0100 @@ -1,6 +1,6 @@ " COPYRIGHT (c) 1995-1998 by eXept Software AG - All Rights Reserved + 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 @@ -12,18 +12,18 @@ "{ Package: 'stx:libtool2' }" ResourceSpecEditor subclass:#UIPainter - instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool - helpTool painterView painter' - classVariableNames:'UseViewScroller' - poolDictionaries:'' - category:'Interface-UIPainter' + instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool + helpTool painterView painter' + classVariableNames:'SelectionPanelClass UseViewScroller' + poolDictionaries:'' + category:'Interface-UIPainter' ! SelectionInTreeView subclass:#TreeView - instanceVariableNames:'lastDrawnMaster cvsEventsDisabled windowSpec windowSpecClass' - classVariableNames:'' - poolDictionaries:'' - privateIn:UIPainter + instanceVariableNames:'lastDrawnMaster cvsEventsDisabled windowSpec windowSpecClass' + classVariableNames:'' + poolDictionaries:'' + privateIn:UIPainter ! !UIPainter class methodsFor:'documentation'! @@ -31,7 +31,7 @@ copyright " COPYRIGHT (c) 1995-1998 by eXept Software AG - All Rights Reserved + 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 @@ -53,17 +53,17 @@ opening the application. [start with:] - UIPainter open + UIPainter open [author:] - Claus Gittinger, eXept Software AG - Claus Atzkern, eXept Software AG - Thomas Zwick, eXept Software AG + Claus Gittinger, eXept Software AG + Claus Atzkern, eXept Software AG + Thomas Zwick, eXept Software AG [see also:] - UIBuilder - ApplicationModel - UISpecification + UIBuilder + ApplicationModel + UISpecification " ! ! @@ -92,6 +92,13 @@ "returns the default name of the application" ^ 'NewApplication' +! + +selectionPanelClass:something + "set the class used as selection panel. + this is UISelectionPanel as default" + + SelectionPanelClass := something. ! ! !UIPainter class methodsFor:'help specs'! @@ -325,19 +332,19 @@ per line " |stream - max "{ Class:SmallInteger }" - size "{ Class:SmallInteger }" - start "{ Class:SmallInteger }" - stop "{ Class:SmallInteger }" - cpySz "{ Class:SmallInteger }" - lnSz "{ Class:SmallInteger }" - atBeginOfLine| + max "{ Class:SmallInteger }" + size "{ Class:SmallInteger }" + start "{ Class:SmallInteger }" + stop "{ Class:SmallInteger }" + cpySz "{ Class:SmallInteger }" + lnSz "{ Class:SmallInteger }" + atBeginOfLine| maxCharactersPerLine < 20 ifFalse:[max := maxCharactersPerLine - 1] - ifTrue:[max := 20]. + ifTrue:[max := 20]. (size := aString size) <= max ifTrue:[ - ^ aString + ^ aString ]. start := 1. lnSz := 0. @@ -346,35 +353,35 @@ atBeginOfLine := true. [start <= size] whileTrue:[ - (start := aString indexOfNonSeparatorStartingAt:start) == 0 ifTrue:[ - ^ stream contents - ]. - (aString at:start) == $\ ifTrue:[ - skipLineFeed ifFalse:[ - stream nextPut:$\ - ]. - start := start + 1. - stream cr. - start := start + 1. - lnSz := 0. - ] ifFalse:[ - (stop := aString indexOfSeparatorStartingAt:start) == 0 ifTrue:[ - stop := size + 1 - ]. - (aString at:(stop - 1)) == $\ ifTrue:[ - stop := stop - 1 - ]. - cpySz := stop - start. - - lnSz == 0 ifFalse:[ - (lnSz := lnSz + cpySz) >= max ifTrue:[stream cr. lnSz := cpySz. atBeginOfLine := true. ] - ifFalse:[stream space. lnSz := lnSz + 1] - ] ifTrue:[ - lnSz := cpySz - ]. - stream nextPutAll:aString startingAt:start to:(stop - 1). - start := stop. - ] + (start := aString indexOfNonSeparatorStartingAt:start) == 0 ifTrue:[ + ^ stream contents + ]. + (aString at:start) == $\ ifTrue:[ + skipLineFeed ifFalse:[ + stream nextPut:$\ + ]. + start := start + 1. + stream cr. + start := start + 1. + lnSz := 0. + ] ifFalse:[ + (stop := aString indexOfSeparatorStartingAt:start) == 0 ifTrue:[ + stop := size + 1 + ]. + (aString at:(stop - 1)) == $\ ifTrue:[ + stop := stop - 1 + ]. + cpySz := stop - start. + + lnSz == 0 ifFalse:[ + (lnSz := lnSz + cpySz) >= max ifTrue:[stream cr. lnSz := cpySz. atBeginOfLine := true. ] + ifFalse:[stream space. lnSz := lnSz + 1] + ] ifTrue:[ + lnSz := cpySz + ]. + stream nextPutAll:aString startingAt:start to:(stop - 1). + start := stop. + ] ]. ^ stream contents @@ -510,8 +517,8 @@ ^Icon - constantNamed:#'UIPainter iconAlignB' - ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@@G@@@@@@@G@E@@@@@G@G@@@@@G@G@@@@@G@G@@@E@G@G@@@G@G@G@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@') ; yourself); yourself] + constantNamed:#'UIPainter iconAlignB' + ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@@G@@@@@@@G@E@@@@@G@G@@@@@G@G@@@@@G@G@@@E@G@G@@@G@G@G@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@') ; yourself); yourself] ! iconAlignL @@ -528,8 +535,8 @@ ^Icon - constantNamed:#'UIPainter iconAlignL' - ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@@(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@') ; yourself); yourself] + constantNamed:#'UIPainter iconAlignL' + ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@@(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@') ; yourself); yourself] ! iconAlignLR @@ -546,8 +553,8 @@ ^Icon - constantNamed:#'UIPainter iconAlignLR' - ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(_??2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??2 @@(@@@B E@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??B @@(@@@B @@(@@@B @@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@A G?? G?? G?? G?? F@A F@A G?? G?? G?? G?? F@A F@A G?? G?? G?; G?? F@A @@@@@@@@') ; yourself); yourself] + constantNamed:#'UIPainter iconAlignLR' + ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(_??2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??2 @@(@@@B E@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??B @@(@@@B @@(@@@B @@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@A G?? G?? G?? G?? F@A F@A G?? G?? G?? G?? F@A F@A G?? G?? G?; G?? F@A @@@@@@@@') ; yourself); yourself] ! iconAlignR @@ -564,8 +571,8 @@ ^Icon - constantNamed:#'UIPainter iconAlignR' - ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@_??2 @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUUR @@G???2 @@@@@@B E@@@@@B @@@@@@B @@@@@@B @@@@EUR @@@@G?2 @@@@@@B @@@@@@B @@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@A A?? A?? A?? A?? @@A @@A G?? G?? G?? G?? @@A @@A @G? @G? @G? @G? @@A @@@@@@@@') ; yourself); yourself] + constantNamed:#'UIPainter iconAlignR' + ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@_??2 @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUUR @@G???2 @@@@@@B E@@@@@B @@@@@@B @@@@@@B @@@@EUR @@@@G?2 @@@@@@B @@@@@@B @@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@A A?? A?? A?? A?? @@A @@A G?? G?? G?? G?? @@A @@A @G? @G? @G? @G? @@A @@@@@@@@') ; yourself); yourself] ! iconAlignT @@ -582,8 +589,8 @@ ^Icon - constantNamed:#'UIPainter iconAlignT' - ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@G@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@') ; yourself); yourself] + constantNamed:#'UIPainter iconAlignT' + ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@G@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@') ; yourself); yourself] ! iconAlignTB @@ -600,8 +607,8 @@ ^Icon - constantNamed:#'UIPainter iconAlignTB' - ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@G@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@H@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@@@G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@') ; yourself); yourself] + constantNamed:#'UIPainter iconAlignTB' + ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@G@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@H@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@@@G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@') ; yourself); yourself] ! iconCenterH @@ -736,6 +743,14 @@ @@JB@@@@@@@B@@@@@@@*(@@@@@@@@@@@@@UUUT@@@@???4@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A??@A??@A??CA??@@G0@@A@@@A@@@A@@@G0CA??@A??@A??@A??@@G0C@A@@@A@@@A@@@G0AA??AA??@A??@A??B') ; yourself); yourself] ! ! +!UIPainter class methodsFor:'initialize'! + +initialize + SelectionPanelClass isNil ifTrue:[ + SelectionPanelClass := UISelectionPanel + ]. +! ! + !UIPainter class methodsFor:'interface specs'! dialogSpecForDefiningClassAndSelector @@ -755,86 +770,86 @@ ^ #(#FullSpec - #window: - #(#WindowSpec - #name: 'GUI Painter' - #layout: #(#LayoutFrame 291 0 130 0 637 0 289 0) - #label: 'GUI Painter' - #min: #(#Point 350 160) - #max: #(#Point 500 160) - #bounds: #(#Rectangle 291 130 638 290) - #usePreferredExtent: false - ) - #component: - #(#SpecCollection - #collection: - #( - #(#FramedBoxSpec - #name: 'FramedBox' - #layout: #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0) - #component: - #(#SpecCollection - #collection: - #( - #(#LabelSpec - #name: 'selectorLabel' - #layout: #(#AlignmentOrigin 67 0.11 29 0 1 0.5) - #label: 'Selector:' - #translateLabel: true - #adjust: #right - #resizeForLabel: true - ) - #(#InputFieldSpec - #name: 'methodNameField' - #layout: #(#LayoutFrame 70 0.11 18 0 4 1.0 40 0) - #tabable: true - #model: #methodNameChannel - #group: #inputGroup - ) - #(#LabelSpec - #name: 'classLabel' - #layout: #(#AlignmentOrigin 67 0.11 54 0 1 0.5) - #label: 'Class:' - #translateLabel: true - #adjust: #right - #resizeForLabel: true - ) - #(#InputFieldSpec - #name: 'classNameField' - #layout: #(#LayoutFrame 70 0.11 43 0 4 1.0 65 0) - #tabable: true - #model: #classNameChannel - #group: #inputGroup - ) - #(#LabelSpec - #name: 'superClassLabel' - #layout: #(#AlignmentOrigin 67 0.11 79 0 1 0.5) - #label: 'Superclass:' - #translateLabel: true - #adjust: #right - #resizeForLabel: true - ) - #(#ComboBoxSpec - #name: 'superclassNameComboBox' - #layout: #(#LayoutFrame 70 0.11 68 0 4 1.0 90 0) - #tabable: true - #model: #superclassNameChannel - #comboList: #superclassNameDefaults - ) - ) - ) - #label: 'Define Class And Selector' - #labelPosition: #topLeft - #translateLabel: true - ) - #(#UISubSpecification - #name: 'subSpec' - #layout: #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) - #majorKey: #ToolApplicationModel - #minorKey: #windowSpecForCommitWithoutChannels - ) - ) - ) + #window: + #(#WindowSpec + #name: 'GUI Painter' + #layout: #(#LayoutFrame 291 0 130 0 637 0 289 0) + #label: 'GUI Painter' + #min: #(#Point 350 160) + #max: #(#Point 500 160) + #bounds: #(#Rectangle 291 130 638 290) + #usePreferredExtent: false + ) + #component: + #(#SpecCollection + #collection: + #( + #(#FramedBoxSpec + #name: 'FramedBox' + #layout: #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0) + #component: + #(#SpecCollection + #collection: + #( + #(#LabelSpec + #name: 'selectorLabel' + #layout: #(#AlignmentOrigin 67 0.11 29 0 1 0.5) + #label: 'Selector:' + #translateLabel: true + #adjust: #right + #resizeForLabel: true + ) + #(#InputFieldSpec + #name: 'methodNameField' + #layout: #(#LayoutFrame 70 0.11 18 0 4 1.0 40 0) + #tabable: true + #model: #methodNameChannel + #group: #inputGroup + ) + #(#LabelSpec + #name: 'classLabel' + #layout: #(#AlignmentOrigin 67 0.11 54 0 1 0.5) + #label: 'Class:' + #translateLabel: true + #adjust: #right + #resizeForLabel: true + ) + #(#InputFieldSpec + #name: 'classNameField' + #layout: #(#LayoutFrame 70 0.11 43 0 4 1.0 65 0) + #tabable: true + #model: #classNameChannel + #group: #inputGroup + ) + #(#LabelSpec + #name: 'superClassLabel' + #layout: #(#AlignmentOrigin 67 0.11 79 0 1 0.5) + #label: 'Superclass:' + #translateLabel: true + #adjust: #right + #resizeForLabel: true + ) + #(#ComboBoxSpec + #name: 'superclassNameComboBox' + #layout: #(#LayoutFrame 70 0.11 68 0 4 1.0 90 0) + #tabable: true + #model: #superclassNameChannel + #comboList: #superclassNameDefaults + ) + ) + ) + #label: 'Define Class And Selector' + #labelPosition: #topLeft + #translateLabel: true + ) + #(#UISubSpecification + #name: 'subSpec' + #layout: #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) + #majorKey: #ToolApplicationModel + #minorKey: #windowSpecForCommitWithoutChannels + ) + ) + ) ) "Modified: / 13.8.1998 / 19:59:44 / cg" @@ -1840,41 +1855,41 @@ #(#Menu - #( - #(#MenuItem - #label: 'Up' - #translateLabel: true - #value: #doStepUp - #activeHelpKey: #moveWidgetUp - #enabled: #canChangeOrderInContainer - #labelImage: #(#ResourceRetriever #Icon #upIcon 'Up') - ) - #(#MenuItem - #label: 'Down' - #translateLabel: true - #value: #doStepDown - #activeHelpKey: #moveWidgetDown - #enabled: #canChangeOrderInContainer - #labelImage: #(#ResourceRetriever #Icon #downIcon 'Down') - ) - #(#MenuItem - #label: 'Into' - #translateLabel: true - #value: #doStepIn - #activeHelpKey: #moveWidgetInto - #enabled: #canMoveSelectionIntoContainer - #labelImage: #(#ResourceRetriever #Icon #downRightIcon 'Into') - ) - #(#MenuItem - #label: 'Out' - #translateLabel: true - #value: #doStepOut - #activeHelpKey: #moveWidgetOut - #enabled: #canMoveSelectionOutOfContainer - #labelImage: #(#ResourceRetriever #Icon #leftDownIcon 'Out') - ) - ) nil - nil + #( + #(#MenuItem + #label: 'Up' + #translateLabel: true + #value: #doStepUp + #activeHelpKey: #moveWidgetUp + #enabled: #canChangeOrderInContainer + #labelImage: #(#ResourceRetriever #Icon #upIcon 'Up') + ) + #(#MenuItem + #label: 'Down' + #translateLabel: true + #value: #doStepDown + #activeHelpKey: #moveWidgetDown + #enabled: #canChangeOrderInContainer + #labelImage: #(#ResourceRetriever #Icon #downIcon 'Down') + ) + #(#MenuItem + #label: 'Into' + #translateLabel: true + #value: #doStepIn + #activeHelpKey: #moveWidgetInto + #enabled: #canMoveSelectionIntoContainer + #labelImage: #(#ResourceRetriever #Icon #downRightIcon 'Into') + ) + #(#MenuItem + #label: 'Out' + #translateLabel: true + #value: #doStepOut + #activeHelpKey: #moveWidgetOut + #enabled: #canMoveSelectionOutOfContainer + #labelImage: #(#ResourceRetriever #Icon #leftDownIcon 'Out') + ) + ) nil + nil ) ! @@ -2289,8 +2304,8 @@ |holder| (holder := builder bindingAt:#galleryShown) isNil ifTrue:[ - builder aspectAt:#galleryShown put:(holder := true asValue). - holder addDependent:self + builder aspectAt:#galleryShown put:(holder := true asValue). + holder addDependent:self ]. ^ holder @@ -2342,8 +2357,8 @@ |holder| (holder := builder bindingAt:#painterShown) isNil ifTrue:[ - builder aspectAt:#painterShown put:(holder := true asValue). - holder addDependent:self + builder aspectAt:#painterShown put:(holder := true asValue). + holder addDependent:self ]. ^ holder @@ -2367,8 +2382,8 @@ |holder| (holder := builder bindingAt:#tabModel) isNil ifTrue:[ - holder := AspectAdaptor new subject:self; forAspect:#tabSelection. - builder aspectAt:#tabModel put:holder. + holder := AspectAdaptor new subject:self; forAspect:#tabSelection. + builder aspectAt:#tabModel put:holder. ]. ^ holder ! @@ -2500,12 +2515,12 @@ |selector editor spec| (self resolveName:specClassName) isNil ifTrue:[ - self askForSaving ifFalse: [^self] + self askForSaving ifFalse: [^self] ]. spec := self specTool specification. (selector := spec hierarchicalList) notNil ifTrue:[ - selector := selector asSymbol + selector := selector asSymbol ]. editor := HierarchicalListEditor new. @@ -2513,11 +2528,11 @@ editor openModalOnClass:specClassName andSelector:selector. editor specSelector ~= selector ifTrue:[ - editor hasSaved ifTrue:[ - spec hierarchicalList:editor specSelector. - self modifiedChannel value:true. - self accept - ] + editor hasSaved ifTrue:[ + spec hierarchicalList:editor specSelector. + self modifiedChannel value:true. + self accept + ] ] "Modified: / 16.7.1998 / 18:15:46 / cg" @@ -2933,10 +2948,10 @@ self askForSectionModification. ((YesNoBox title:'No application class defined yet!!') - noText:'Cancel'; - yesText:'Define'; - showAtPointer; - accepted) ifFalse: [^false]. + noText:'Cancel'; + yesText:'Define'; + showAtPointer; + accepted) ifFalse: [^false]. self doSave. @@ -2947,11 +2962,11 @@ "asks for section modification in the notebook" self isModified ifTrue:[ - (self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[ - self accept - ] ifFalse: [ - self cancel - ] + (self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[ + self accept + ] ifFalse: [ + self cancel + ] ] ! @@ -3211,7 +3226,7 @@ the window spec is stored is defined" specSelector size > 1 ifTrue:[ - ^ self hasSpecClass + ^ self hasSpecClass ]. ^ false ! @@ -3461,18 +3476,18 @@ |topView| (topView := self window) == aTopView ifTrue:[ - super closeRequestFor:aTopView + super closeRequestFor:aTopView ] ifFalse:[ - aTopView = selectionPanel window ifTrue:[ - self galleryShown value:false - ] ifFalse:[ - aTopView == (self painter topView) ifTrue:[ - self painterShown value:false - ] ifFalse:[ - aTopView closeRequest - ] - ]. - topView raise. + aTopView = selectionPanel window ifTrue:[ + self galleryShown value:false + ] ifFalse:[ + aTopView == (self painter topView) ifTrue:[ + self painterShown value:false + ] ifFalse:[ + aTopView closeRequest + ] + ]. + topView raise. ]. ! @@ -4197,9 +4212,9 @@ |selection| ((selection := self painter selection) isCollection and: [selection size >= 1]) ifTrue:[ - selection first inspect + selection first inspect ] ifFalse: [ - selection inspect + selection inspect ] ! @@ -4291,9 +4306,9 @@ self askForModification ifFalse: [^nil]. (view := Screen current viewFromUser) notNil ifTrue:[ - view == Screen current rootView ifFalse:[ - self painter setupFromSpec:(UISpecification fromView:view topView). - ] + view == Screen current rootView ifFalse:[ + self painter setupFromSpec:(UISpecification fromView:view topView). + ] ]. self updateInfoLabel @@ -4439,8 +4454,8 @@ self askForSectionModification. CodeView - openWith: self painter generateWindowSpecMethodSource - title: 'Window Spec' + openWith: self painter generateWindowSpecMethodSource + title: 'Window Spec' ! @@ -4479,13 +4494,13 @@ selection in tree view; only used by the UIPainter [see also:] - SelectionInTreeView - SelectionInTree - TreeItem - UIPainter + SelectionInTreeView + SelectionInTree + TreeItem + UIPainter [author:] - Claus Atzkern + Claus Atzkern " @@ -4581,9 +4596,9 @@ "returns item assigned to view or nil" aView notNil ifTrue:[ - self allItemsDo:[:anItem| - (anItem contents view == aView) ifTrue:[^ anItem] - ] + self allItemsDo:[:anItem| + (anItem contents view == aView) ifTrue:[^ anItem] + ] ]. ^ nil @@ -4624,7 +4639,7 @@ "evaluates the block on each property" self allItemsDo:[:anItem| - (aOneArgBlock value:(anItem contents)) ifTrue:[^ anItem contents] + (aOneArgBlock value:(anItem contents)) ifTrue:[^ anItem contents] ]. ^ nil @@ -4637,9 +4652,9 @@ |idx| selection size == 1 ifTrue:[ - (idx := selection first) ~~ 1 ifTrue:[ "canvas: not yet supported" - ^ (listOfNodes at:idx) contents - ] + (idx := selection first) ~~ 1 ifTrue:[ "canvas: not yet supported" + ^ (listOfNodes at:idx) contents + ] ]. ^ nil @@ -4666,8 +4681,8 @@ windowSpec := nil. self canvas subViews copy do:[:aView| - "/ care to not destroy the transparent input view - (aView isInputOnly) ifFalse:[aView destroy] + "/ care to not destroy the transparent input view + (aView isInputOnly) ifFalse:[aView destroy] ]. model root name: UIPainter defaultNameOfCanvas asBoldText. model removeAllOtherThanRoot. @@ -4680,9 +4695,9 @@ |item prnt| ((item := self itemOfView:aView) notNil and:[(prnt := item parent) notNil]) ifTrue:[ - aView destroy. - prnt contents view sizeChanged:nil. - model remove:item + aView destroy. + prnt contents view sizeChanged:nil. + model remove:item ] @@ -4735,19 +4750,19 @@ |sel list size| ((sel := aSelection) isNil or:[sel isCollection]) ifFalse:[ - sel := Array with:sel + sel := Array with:sel ]. (size := sel size) ~~ 0 ifTrue:[ - list := OrderedCollection new:size. - - sel do:[:aView||item| - (item := self itemOfView:aView) notNil ifTrue:[ - list add:item. - model doMakeVisible:item. - ] - ]. - sel := list collect:[:anItem| self indexOfNode:anItem ]. + list := OrderedCollection new:size. + + sel do:[:aView||item| + (item := self itemOfView:aView) notNil ifTrue:[ + list add:item. + model doMakeVisible:item. + ] + ]. + sel := list collect:[:anItem| self indexOfNode:anItem ]. ]. self cvsEventsDisabledDo:[ self selection:sel ]. @@ -4764,13 +4779,13 @@ item := self itemOfView:aView. item notNil ifTrue:[ - model doMakeVisible:item. - - (index := self indexOfNode:item) ~~ 0 ifTrue:[ - oldSel := selection copy. - self addToSelection:index. - self selectionChangedFrom:oldSel - ] + model doMakeVisible:item. + + (index := self indexOfNode:item) ~~ 0 ifTrue:[ + oldSel := selection copy. + self addToSelection:index. + self selectionChangedFrom:oldSel + ] ] @@ -4786,9 +4801,9 @@ and:[(index := self indexOfNode:item) ~~ 0 and:[self isInSelection:index]] ) ifTrue:[ - oldSel := selection copy. - self removeFromSelection:index. - self selectionChangedFrom:oldSel. + oldSel := selection copy. + self removeFromSelection:index. + self selectionChangedFrom:oldSel. ]. @@ -4808,8 +4823,8 @@ and:[(self propertyDetect:[:p| p name = name]) isNil and:[node name ~= name]]] ) ifTrue:[ - node name: name asBoldText. - node changed. + node name: name asBoldText. + node changed. ]. ! @@ -4818,7 +4833,7 @@ application will be informed to update its layout " selection size == 1 ifTrue:[ - self application layoutChanged + self application layoutChanged ] @@ -4832,29 +4847,29 @@ item := self itemOfView:(aProperty view). item notNil ifTrue:[ - item contents:aProperty. - - item name = aProperty name ifFalse:[ - idx := self firstLineShown. - - (end := self lastLineShown) > listOfNodes size ifTrue:[ - end := listOfNodes size - ]. - item changed. - - [idx <= end] whileTrue:[ - (listOfNodes at:idx) == item ifTrue:[ - self redrawLine:idx. "/ is visible; redraw line - end := 0 - ] ifFalse:[ - idx := idx + 1 - ] - ] - ]. - - self selectedNode == item ifTrue:[ "/ inform application - self application propertyChanged - ] + item contents:aProperty. + + item name = aProperty name ifFalse:[ + idx := self firstLineShown. + + (end := self lastLineShown) > listOfNodes size ifTrue:[ + end := listOfNodes size + ]. + item changed. + + [idx <= end] whileTrue:[ + (listOfNodes at:idx) == item ifTrue:[ + self redrawLine:idx. "/ is visible; redraw line + end := 0 + ] ifFalse:[ + idx := idx + 1 + ] + ] + ]. + + self selectedNode == item ifTrue:[ "/ inform application + self application propertyChanged + ] ]. @@ -4958,7 +4973,7 @@ "disables collapsing of the root item" self selectedNode == model root ifFalse:[ - super doubleClicked + super doubleClicked ] @@ -4972,12 +4987,12 @@ super redrawLabelAt:x y:yTop index:anIndex. ((selection size > 1) and: [selection first == anIndex]) ifTrue:[ - dX := textInset - 1. - self paint:(Color red). "/ self application painter handleMasterColor. - self fillRectangleX:(x - dX - 2) - y:yTop + ((fontHeight - dX) // 2) - width:dX - height:dX + dX := textInset - 1. + self paint:(Color red). "/ self application painter handleMasterColor. + self fillRectangleX:(x - dX - 2) + y:yTop + ((fontHeight - dX) // 2) + width:dX + height:dX ] ! ! @@ -4995,18 +5010,18 @@ self model iconAction: [:aNode| - |specClass| - (specClass := aNode contents spec) isNil - ifTrue: [WindowSpec icon] - ifFalse:[specClass class icon] + |specClass| + (specClass := aNode contents spec) isNil + ifTrue: [WindowSpec icon] + ifFalse:[specClass class icon] ]. self model labelAction: [:aNode| - |spec| - (spec := aNode contents spec) notNil - ifTrue: [self nameForSpecInList:spec] - ifFalse:[aNode name] + |spec| + (spec := aNode contents spec) notNil + ifTrue: [self nameForSpecInList:spec] + ifFalse:[aNode name] ] ! ! @@ -5028,32 +5043,32 @@ size := selection size. cvsEventsDisabled ifFalse:[ - (size ~~ 0 and:[size ~~ 1 or:[selection first ~~ 1]]) ifTrue:[ - sel := OrderedCollection new. - - selection do:[:i| - i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view] - ] - ]. - self canvas updateSelectionFromModel:sel + (size ~~ 0 and:[size ~~ 1 or:[selection first ~~ 1]]) ifTrue:[ + sel := OrderedCollection new. + + selection do:[:i| + i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view] + ] + ]. + self canvas updateSelectionFromModel:sel ]. size = 1 ifTrue:[ - oldSelection size > 1 ifTrue: [ - (listOfNodes at:lastDrawnMaster) retrieveLabel. - self redrawLine: lastDrawnMaster. - lastDrawnMaster := selection first - ] + oldSelection size > 1 ifTrue: [ + (listOfNodes at:lastDrawnMaster) retrieveLabel. + self redrawLine: lastDrawnMaster. + lastDrawnMaster := selection first + ] ]. size > 1 ifTrue:[ - selection first ~~ lastDrawnMaster ifTrue: [ - (listOfNodes at:selection first) retrieveLabel. - lastDrawnMaster notNil ifTrue: [(listOfNodes at:lastDrawnMaster) retrieveLabel]. - self redrawLine: lastDrawnMaster. - self redrawLine: (lastDrawnMaster := selection first) - ] + selection first ~~ lastDrawnMaster ifTrue: [ + (listOfNodes at:selection first) retrieveLabel. + lastDrawnMaster notNil ifTrue: [(listOfNodes at:lastDrawnMaster) retrieveLabel]. + self redrawLine: lastDrawnMaster. + self redrawLine: (lastDrawnMaster := selection first) + ] ] ifFalse: [ - lastDrawnMaster := nil + lastDrawnMaster := nil ] ! ! @@ -5086,15 +5101,15 @@ can change their layout through to a move or align operation" selection size == 0 ifTrue:[ - ^ false + ^ false ]. selection do:[:i| - i == 1 ifTrue:[^ false]. - - (self canvas canChangeLayoutOfView:((listOfNodes at:i) contents view)) ifFalse:[ - ^ false - ] + i == 1 ifTrue:[^ false]. + + (self canvas canChangeLayoutOfView:((listOfNodes at:i) contents view)) ifFalse:[ + ^ false + ] ]. ^ true ! @@ -5125,7 +5140,7 @@ or:[(prnt := item parent) isNil or:[prnt parent isNil]] ) ifTrue:[ - ^ false + ^ false ]. ^ true ! @@ -5137,9 +5152,9 @@ |selectedNode| (selectedNode := self selectedNode) notNil ifTrue:[ - (selectedNode := selectedNode parent) notNil ifTrue:[ - ^ (selectedNode parent isNil or:[selectedNode contents spec class canResizeSubComponents]) - ] + (selectedNode := selectedNode parent) notNil ifTrue:[ + ^ (selectedNode parent isNil or:[selectedNode contents spec class canResizeSubComponents]) + ] ]. ^ false ! @@ -5207,7 +5222,7 @@ or:[(prnt := prnt childAt:((prnt indexOfChild:item) + 1)) isNil or:[prnt contents spec class supportsSubComponents not]]] ) ifFalse:[ - self doChangeHierarchyOf:prnt + self doChangeHierarchyOf:prnt ] ! @@ -5215,7 +5230,7 @@ |item| ((item := self selectedNode) notNil and:[(item := item parent) notNil]) ifTrue:[ - self doChangeHierarchyOf:(item parent) + self doChangeHierarchyOf:(item parent) ]. ! @@ -5263,3 +5278,5 @@ version ^ '$Header$' ! ! + +UIPainter initialize!