cg@156: " tz@765: COPYRIGHT (c) 1995-1998 by eXept Software AG jan@3567: COPYRIGHT (c) 2017 Jan Vrany sv@2217: All Rights Reserved cg@156: cg@156: This software is furnished under a license and may be used cg@156: only in accordance with the terms of that license and with the cg@156: inclusion of the above copyright notice. This software may not cg@156: be provided or otherwise made available to, or used by, any cg@156: other person. No title to or ownership of the software is cg@156: hereby transferred. cg@156: " cg@2023: "{ Package: 'stx:libtool2' }" ca@1391: cg@3218: "{ NameSpace: Smalltalk }" cg@3218: cg@2007: ResourceSpecEditor subclass:#UIPainter sv@2218: instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool cg@2243: helpTool painterView painter lastPort lastPage' cg@2500: classVariableNames:'SelectionPanelClass UseViewScroller LastPort LastPage cg@2500: DefaultEditToolBarVisible DefaultToolBarVisible' sv@2218: poolDictionaries:'' sv@2218: category:'Interface-UIPainter' cg@60: ! cg@60: sv@3111: Query subclass:#ApplicationClassQuery sv@3111: instanceVariableNames:'' sv@3111: classVariableNames:'' sv@3111: poolDictionaries:'' sv@3111: privateIn:UIPainter sv@3111: ! sv@3111: ca@222: SelectionInTreeView subclass:#TreeView cg@2541: instanceVariableNames:'lastDrawnMaster canvasEventsDisabled windowSpec windowSpecClass cg@2541: painter' sv@2218: classVariableNames:'' sv@2218: poolDictionaries:'' sv@2218: privateIn:UIPainter ca@222: ! ca@222: cg@60: !UIPainter class methodsFor:'documentation'! cg@60: cg@156: copyright cg@156: " tz@765: COPYRIGHT (c) 1995-1998 by eXept Software AG jan@3567: COPYRIGHT (c) 2017 Jan Vrany sv@2217: All Rights Reserved cg@156: cg@156: This software is furnished under a license and may be used cg@156: only in accordance with the terms of that license and with the cg@156: inclusion of the above copyright notice. This software may not cg@156: be provided or otherwise made available to, or used by, any cg@156: other person. No title to or ownership of the software is cg@156: hereby transferred. cg@156: " cg@156: cg@156: ! cg@156: cg@60: documentation cg@60: " tz@765: The GUI Painter provides the user with a graphical user interface for building own tz@765: interfaces by interactively assembling widgets and defining the behavior of the widgets. tz@765: The resulting interface specifications can be saved as methods on the application tz@765: classes, typically subclasses of the class ApplicationModel. These specifications tz@765: are used by the UIBuilder to generate the application window and its widgets when tz@765: opening the application. cg@60: cg@60: [start with:] sv@2217: UIPainter open ca@127: cg@156: [author:] sv@2217: Claus Gittinger, eXept Software AG sv@2217: Claus Atzkern, eXept Software AG sv@2217: Thomas Zwick, eXept Software AG cg@156: ca@127: [see also:] sv@2217: UIBuilder sv@2217: ApplicationModel sv@2217: UISpecification cg@2277: cg@2277: [instance variables:] cg@2277: isSpecOnlyPainter true if this painter is for a spec only (as used by expecco), cg@2277: as opposed to a regular painter, which stores the spec in a class. cg@2277: A spec-only painter has no class to store additional specs (esp. cg@2277: menu- and tabSpecs) and should not offer postBuild and other cg@2277: callback functions. cg@60: " ca@109: ! ! ca@109: cg@2399: !UIPainter class methodsFor:'initialization'! cg@2399: cg@2399: initialize cg@2399: SelectionPanelClass isNil ifTrue:[ cg@2399: SelectionPanelClass := UISelectionPanel cg@2399: ]. cg@2399: ! ! cg@2399: ca@109: !UIPainter class methodsFor:'instance creation'! ca@109: cg@195: openOnClass:aClass andSelector:aSelector cg@1976: "open a GUI Painter on aClass and (windowSpec) aSelector" cg@1976: cg@1976: ^ self new openOnClass:aClass theNonMetaclass andSelector:aSelector cg@60: ! ! cg@60: ca@87: !UIPainter class methodsFor:'ST-80 queries'! ca@87: ca@87: preferenceFor:aSymbol ca@282: "ST-80 compatible; always returns false ca@282: " ca@87: ^ false ca@109: ca@109: ca@109: ! ! ca@109: cg@2541: !UIPainter class methodsFor:'defaults'! cg@2541: cg@2541: defaultEditToolbarVisible cg@2541: ^ DefaultEditToolBarVisible ? true cg@2541: ! tz@713: tz@713: defaultNameOfCanvas tz@765: "returns the default name of the application" tz@765: cg@2208: ^ 'NewApplication' sv@2217: ! sv@2217: cg@2541: defaultToolbarVisible cg@2541: ^ DefaultToolBarVisible ? true cg@2541: ! cg@2541: sv@2218: selectionPanelClass sv@2218: ^ SelectionPanelClass cg@2225: cg@2225: " cg@2225: UIPainter selectionPanelClass. cg@2225: UIPainter selectionPanelClass:UISelectionPanel cg@2225: " sv@2218: ! sv@2218: sv@2217: selectionPanelClass:something sv@2217: "set the class used as selection panel. sv@2217: this is UISelectionPanel as default" sv@2217: sv@2217: SelectionPanelClass := something. cg@2225: cg@2225: " cg@2225: UIPainter selectionPanelClass:UISelectionPanel cg@2225: " tz@713: ! ! tz@713: ca@193: !UIPainter class methodsFor:'help specs'! ca@193: cg@1545: flyByHelpSpec cg@1545: cg@1545: cg@2361: ^super flyByHelpSpec cg@2361: addPairsFrom:#( cg@1545: cg@1545: #fileSave cg@2198: 'Save Spec' cg@2198: cg@2336: shadesOfRed cg@2336: 'Red color tones' cg@2336: cg@2336: shadesOfGreen cg@2336: 'Green color tones' cg@2336: cg@2336: shadesOfBlue cg@2336: 'Blue color tones' cg@2336: cg@2336: shadesOfCyan cg@2336: 'Cyan color tones' cg@2336: cg@2336: shadesOfMagenta cg@2336: 'Magenta color tones' cg@2336: cg@2336: shadesOfYellow cg@2336: 'Yellow color tones' cg@2336: cg@2336: shadesOfGray cg@2336: 'Gray color tones' cg@2336: cg@2336: openColorEditor cg@2336: 'Open a color editor' cg@2336: cg@2336: pickColorFromScreen cg@2336: 'Pick a color from the screen' cg@2336: cg@2336: recentlyUsedColors cg@2336: 'Pick a recently used color' cg@2336: cg@2336: useDefaultColorToggle cg@2336: 'Toggle between default and explicit color' cg@1545: cg@2361: ); cg@2361: declareAllFrom:self helpSpec cg@1545: ! cg@1545: ca@193: helpSpec tz@743: "This resource specification was automatically generated tz@743: by the UIHelpTool of ST/X." tz@743: tz@743: "Do not manually edit this!! If it is corrupted, tz@743: the UIHelpTool may not be able to read the specification." ca@295: ca@193: " tz@743: UIHelpTool openOnClass:UIPainter ca@295: " ca@295: tz@743: tz@743: werner@1827: ^ super helpSpec addPairsFrom:#( ca@193: cg@934: #align cg@2901: 'Widget alignment functions' cg@934: cg@3032: #alignResizeSelectionBottom cg@3032: 'Resize the selected widgets'' bottom edges to align them with the bottom of the dominant widget' cg@3032: cg@3032: #alignResizeSelectionLeft cg@3032: 'Resize the selected widgets'' left edges to align them with the left edge of the dominant widget' cg@3032: cg@3032: #alignResizeSelectionRight cg@3032: 'Resize the selected widgets'' right edges to align them with the right edge of the dominant widget' cg@3032: cg@3032: #alignResizeSelectionTop cg@3032: 'Resize the selected widgets'' top edges to align them with the top edge of the dominant widget' cg@3032: tz@466: #alignSelectionBottom cg@2901: 'Aligns the selected widgets'' bottom edges with the bottom of the dominant widget' tz@466: tz@466: #alignSelectionCenterHor cg@2901: 'Aligns the selected widgets'' centers vertically with the center of the dominant widget' tz@466: tz@466: #alignSelectionCenterVer cg@2901: 'Aligns the selected widgets'' centers horizontally with the center of the dominant widget' tz@466: tz@466: #alignSelectionLeft cg@2901: 'Aligns the selected widgets'' left edges with the left edge of the dominant widget' tz@466: tz@466: #alignSelectionLeftAndRight cg@2901: 'Aligns the selected widgets'' left & right edges with the dominant widget' tz@466: tz@466: #alignSelectionRight cg@2901: 'Aligns the selected widgets'' right edges with the right edge of the dominant widget' tz@466: tz@466: #alignSelectionTop cg@2901: 'Aligns the selected widgets'' top edges with the top edge of the dominant widget' tz@466: tz@466: #alignSelectionTopAndBottom cg@2901: 'Aligns the selected widgets'' top and bottom edges with the dominant widget' tz@466: cg@3032: #alignToGrid cg@3032: 'Am Raster ausrichten' cg@3032: tz@466: #centerSelectionHor cg@2901: 'Centers the selected widgets horizontally within their containing widget' tz@466: tz@466: #centerSelectionVer cg@2901: 'Centers the selected widgets vertically within their containing widget' tz@713: tz@713: #changePositionDown cg@3218: 'Moves the selected widget(s) towards the bottom (by %1 pixels)' tz@713: tz@713: #changePositionLeft cg@3218: 'Moves the selected widget(s) towards the left (by %1 pixels)' tz@713: tz@713: #changePositionRight cg@3218: 'Moves the selected widget(s) towards the right (by %1 pixels)' tz@713: tz@713: #changePositionUp cg@3218: 'Moves the selected widget(s) towards the top (by %1 pixels)' cg@3218: cg@3218: #'changeMoveDelta' cg@3218: 'Click to change the delta by which the buttons to the left move the selected widget(s)' tz@713: werner@1827: #drawEdit werner@1827: '' werner@1827: werner@1827: #editBrowseViewClass cg@2901: 'Opens a browser on the class of the selected widget' werner@1827: tz@713: #editDimensionCopyExtent cg@2901: 'Copies the extent of the selected widget' tz@713: tz@713: #editDimensionCopyLayout cg@2901: 'Copies the layout of the selected widget' tz@713: tz@713: #editDimensionDefaultExtent cg@2901: 'Sets the selected widget(s) extent to their default' tz@713: tz@713: #editDimensionDefaultHeight cg@2901: 'Sets the selected widget(s) height to their default' tz@713: tz@713: #editDimensionDefaultWidth cg@2901: 'Sets the selected widget(s) width to their default' tz@713: tz@713: #editDimensionPasteExtent cg@2901: 'Sets the extent of the selected widget(s) to the last copied extent' tz@713: tz@713: #editDimensionPasteHeight cg@2901: 'Sets the height of the selected widget(s) to the height of the last copied layout/extent' tz@713: tz@713: #editDimensionPasteLayout cg@2901: 'Sets the layout of the selected widget(s) to the last copied layout' tz@713: tz@713: #editDimensionPasteWidth cg@2901: 'Sets the width of the selected widget(s) to the width of the last copied layout/extent' tz@713: tz@724: #editInspectSpec cg@2901: 'Opens an inspector on the spec of the selected widget' tz@724: tz@755: #editInspectView cg@2901: 'Opens an inspector on the selected widget' tz@755: tz@743: #editOpenSpecDocumentation cg@2901: 'Opens the documentation of the selected widget' tz@743: cg@3032: #editSaveSpecForSelection cg@3032: 'Generate a sub-spec method for the selected element only.\Useful when refactoring an existing spec into sub specifications.' cg@3032: werner@1827: #fileBrowseAspectMethods cg@2901: 'Opens a System Browser on the application''s aspect methods' werner@1827: cg@1742: #fileBrowseClass cg@2901: 'Open a System Browser on the application''s class' cg@1742: tz@498: #fileLoad cg@2901: 'Opens a dialog to load a window specification from a classes spec method' tz@498: tz@533: #fileLoadSubspec cg@2901: 'Opens a dialog to load a sub specification from a classes windowSpec method' tz@533: tz@498: #fileNew cg@2901: 'Creates a new window spec' tz@498: tz@498: #filePickAnInterface cg@2901: 'Select a view on the screen, generate a window spec for it and edit this spec' tz@498: tz@498: #fileSave cg@2901: 'Saves the window spec in the current class (as spec method)' tz@713: tz@713: #fileSaveAs cg@2901: 'Opens a dialog to select class and selector for saving the window spec' tz@713: tz@713: #fileShowWindowSpec cg@2901: 'Opens a Workspace showing the current window spec' tz@713: tz@713: #generateAspectMethods cg@2901: 'Generates aspect methods for defined aspect selectors of the widgets' tz@713: tz@713: #generateHookMethods tz@713: 'Generates startup/release methods. (#closeRequest, #postBuildWith:, #postOpenWith:)' tz@713: tz@755: #helpExamples cg@2901: 'Show some examples uses of the GUI Painter' tz@755: tz@755: #helpFunctions cg@2901: 'Show the documentation on the GUI Painters menu and button functions' tz@755: tz@755: #helpLayoutTool cg@2901: 'Show the Layout Tools documentation' tz@755: tz@755: #helpSelectedWidget cg@2901: 'Show the documentation of the selected widget' cg@935: cg@935: #helpTutorial cg@2901: 'Show the GUI Painters documentation' tz@755: cg@924: #historyMenuItem cg@2901: 'Edit this windowSpec' cg@924: tz@713: #moveWidgetDown cg@2901: 'Moves the selected widget down in the list (brings it to the front)' tz@713: tz@713: #moveWidgetInto cg@2901: 'Moves the selected widget into next widget as child widget' tz@713: tz@713: #moveWidgetOut cg@2901: 'Moves the selected widget out of its parent widget' tz@713: tz@713: #moveWidgetUp cg@2901: 'Moves the selected widget up in the list (brings it to the back)' ca@287: cg@3032: #openColorEditor cg@3032: 'Open a color editor' cg@3032: tz@466: #pasteBuffer cg@2901: 'Pastes the widgets of the clipboard at the current mouse position' tz@466: tz@466: #pasteWithLayout cg@2901: 'Pastes the widgets of the clipboard without changing their layouts' tz@713: cg@3032: #pickColorFromScreen cg@3032: 'Pick a color from the screen' cg@3032: cg@3032: #recentlyUsedColors cg@3032: 'Pick a recently used color' cg@3032: cg@3032: #referToConfigDatabase werner@1827: '' werner@1827: werner@1827: #settingsAspectsAsInstances cg@2901: 'Generate aspects as instance variables (or bindings, if off)' werner@1827: tz@713: #settingsCanvas cg@2901: 'Shows or hides the canvas window' tz@713: tz@713: #settingsGallery cg@2901: 'Shows or hides the gallery window' tz@713: sv@2294: #settingsGenerateCommentedCode cg@3032: 'Enables/disables comments in the generated code, especially in aspect and hook methods' sv@2294: tz@713: #settingsGridManager cg@2901: 'Opens a dialog to toggle grid display or to change the grids spacing' tz@713: tz@713: #settingsRedefineAspectMethods cg@2901: 'Toggles the permission to overwrite existing aspect methods' cg@924: tz@743: #settingsTranscriptHelp cg@2901: 'Toggles display of help texts (after opening a new GUI Painter)' tz@743: tz@713: #settingsUndoManager cg@2901: 'Opens a dialog to undo modifications' ca@287: cg@3032: #shadesOfBlue cg@3032: 'Blue color tones' cg@3032: cg@3032: #shadesOfCyan cg@3032: 'Cyan color tones' cg@3032: cg@3032: #shadesOfGray cg@3032: 'Gray color tones' cg@3032: cg@3032: #shadesOfGreen cg@3032: 'Green color tones' cg@3032: cg@3032: #shadesOfMagenta cg@3032: 'Magenta color tones' cg@3032: cg@3032: #shadesOfRed cg@3032: 'Red color tones' cg@3032: cg@3032: #shadesOfYellow cg@3032: 'Yellow color tones' cg@3032: cg@2690: #showGrid cg@2690: 'Raster zeigen' cg@2690: sv@2310: #sortItems sv@2310: 'Sort the selected items by position (left to right, top to bottom)' sv@2310: ca@287: #spreadSelectionHor cg@2901: 'Sets the horizontal spaces between the selected widgets to the same value' ca@287: tz@466: #spreadSelectionVer cg@2901: 'Sets the vertical spaces between the selected widgets to the same value' tz@713: tz@713: #testGeometryTestMode cg@2901: 'Toggles geometry test mode (to define ratios of variable panels and top-window dimension)' tz@498: tz@498: #testStartApplication cg@2901: 'Starts the application with the current window spec' ca@194: cg@3032: #useDefaultColorToggle cg@2336: 'Toggle between default and explicit color' cg@2336: cg@3229: #useDefaultFontToggle cg@3229: 'Toggle between default and explicit font' cg@3229: cg@3229: #concreteFontsFamily cg@3229: 'Choose a font family' cg@3229: cg@3229: #concreteFontsFace cg@3229: 'Choose a font face' cg@3229: cg@3229: #concreteFontsStyle cg@3229: 'Choose a font style' cg@3229: cg@3229: #concreteFontsSize cg@3229: 'Choose a font size (in points, not pixels)' cg@3229: cg@3054: ca@193: ) ca@193: ! ! ca@193: ca@297: !UIPainter class methodsFor:'helpers'! ca@297: ca@368: convertString:aString maxLineSize:maxCharactersPerLine skipLineFeed:skipLineFeed ca@297: "converts a string to a string collection with maximum characters ca@297: per line ca@297: " ca@297: |stream sv@2217: max "{ Class:SmallInteger }" sv@2217: size "{ Class:SmallInteger }" sv@2217: start "{ Class:SmallInteger }" sv@2217: stop "{ Class:SmallInteger }" sv@2217: cpySz "{ Class:SmallInteger }" sv@2217: lnSz "{ Class:SmallInteger }" sv@2217: atBeginOfLine| ca@297: ca@297: maxCharactersPerLine < 20 ifFalse:[max := maxCharactersPerLine - 1] sv@2217: ifTrue:[max := 20]. ca@297: ca@297: (size := aString size) <= max ifTrue:[ sv@2217: ^ aString ca@297: ]. ca@297: start := 1. ca@297: lnSz := 0. ca@297: stream := (String new:size) writeStream. ca@297: cg@542: atBeginOfLine := true. cg@542: ca@297: [start <= size] whileTrue:[ sv@2217: (start := aString indexOfNonSeparatorStartingAt:start) == 0 ifTrue:[ sv@2217: ^ stream contents sv@2217: ]. sv@2217: (aString at:start) == $\ ifTrue:[ sv@2217: skipLineFeed ifFalse:[ sv@2217: stream nextPut:$\ sv@2217: ]. sv@2217: start := start + 1. sv@2217: stream cr. sv@2217: start := start + 1. sv@2217: lnSz := 0. sv@2217: ] ifFalse:[ sv@2217: (stop := aString indexOfSeparatorStartingAt:start) == 0 ifTrue:[ sv@2217: stop := size + 1 sv@2217: ]. sv@2217: (aString at:(stop - 1)) == $\ ifTrue:[ sv@2217: stop := stop - 1 sv@2217: ]. sv@2217: cpySz := stop - start. sv@2217: sv@2217: lnSz == 0 ifFalse:[ sv@2217: (lnSz := lnSz + cpySz) >= max ifTrue:[stream cr. lnSz := cpySz. atBeginOfLine := true. ] sv@2217: ifFalse:[stream space. lnSz := lnSz + 1] sv@2217: ] ifTrue:[ sv@2217: lnSz := cpySz sv@2217: ]. sv@2217: stream nextPutAll:aString startingAt:start to:(stop - 1). sv@2217: start := stop. sv@2217: ] ca@297: ]. ca@297: ^ stream contents cg@542: cg@542: "Modified: / 1.2.1998 / 14:42:56 / cg" ca@297: ! ! ca@297: tz@735: !UIPainter class methodsFor:'image specs'! tz@735: cg@1883: arrowDown sv@3113: cg@1883: "This resource specification was automatically generated cg@1883: by the ImageEditor of ST/X." cg@1883: "Do not manually edit this!! If it is corrupted, cg@1883: the ImageEditor may not be able to read the specification." cg@1883: " cg@1883: self arrowDown inspect cg@1883: ImageEditor openOnClass:self andSelector:#arrowDown sv@3113: Icon flushCachedIcons" sv@3113: sv@3113: ^ Icon constantNamed:'UIPainter class arrowDown' sv@3113: ifAbsentPut:[ sv@3113: (Depth1Image new) sv@3113: width:11; sv@3113: height:11; sv@3113: photometric:(#palette); sv@3113: bitsPerSample:(#[ 1 ]); sv@3113: samplesPerPixel:(1); sv@3113: bits:(ByteArray fromPackedString:'?>C?8O? ?>C@XNC <^C;8O? ?>C?8@@a'); sv@3113: colorMapFromArray:#[ 0 0 0 255 255 255 ]; sv@3113: mask:((ImageMask new) sv@3113: width:11; sv@3113: height:11; sv@3113: bits:(ByteArray sv@3113: fromPackedString:' cg@1883: @@@@@@@@@@@? A<@C @D@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ sv@3113: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); sv@3113: yourself); sv@3113: yourself sv@3113: ] cg@1883: ! cg@1883: cg@1883: arrowLeft sv@3113: cg@1883: "This resource specification was automatically generated cg@1883: by the ImageEditor of ST/X." cg@1883: "Do not manually edit this!! If it is corrupted, cg@1883: the ImageEditor may not be able to read the specification." cg@1883: " cg@1883: self arrowLeft inspect cg@1883: ImageEditor openOnClass:self andSelector:#arrowLeft sv@3113: Icon flushCachedIcons" sv@3113: sv@3113: ^ Icon constantNamed:'UIPainter class arrowLeft' sv@3113: ifAbsentPut:[ sv@3113: (Depth1Image new) sv@3113: width:11; sv@3113: height:11; sv@3113: photometric:(#palette); sv@3113: bitsPerSample:(#[ 1 ]); sv@3113: samplesPerPixel:(1); sv@3113: bits:(ByteArray fromPackedString:'?>C?8O7 >^C18NG <^C98O7 ?>C?8@@a'); sv@3113: colorMapFromArray:#[ 0 0 0 255 255 255 ]; sv@3113: mask:((ImageMask new) sv@3113: width:11; sv@3113: height:11; sv@3113: bits:(ByteArray fromPackedString:'@@@@@@H@A @N@A8@C PF@@H@@@@@@@@a'); sv@3113: yourself); sv@3113: yourself sv@3113: ] cg@1883: ! cg@1883: cg@1883: arrowRight sv@3113: cg@1883: "This resource specification was automatically generated cg@1883: by the ImageEditor of ST/X." cg@1883: "Do not manually edit this!! If it is corrupted, cg@1883: the ImageEditor may not be able to read the specification." cg@1883: " cg@1883: self arrowRight inspect cg@1883: ImageEditor openOnClass:self andSelector:#arrowRight sv@3113: Icon flushCachedIcons" sv@3113: sv@3113: ^ Icon constantNamed:'UIPainter class arrowRight' sv@3113: ifAbsentPut:[ sv@3113: (Depth1Image new) sv@3113: width:11; sv@3113: height:11; sv@3113: photometric:(#palette); sv@3113: bitsPerSample:(#[ 1 ]); sv@3113: samplesPerPixel:(1); sv@3113: bits:(ByteArray fromPackedString:'?>C?8O_ <>C18OC <^C38O_ ?>C?8@@a'); sv@3113: colorMapFromArray:#[ 0 0 0 255 255 255 ]; sv@3113: mask:((ImageMask new) sv@3113: width:11; sv@3113: height:11; sv@3113: bits:(ByteArray fromPackedString:'@@@@@@ @C@@NA@<@C @L@@ @@@@@@@@a'); sv@3113: yourself); sv@3113: yourself sv@3113: ] cg@1883: ! cg@1883: cg@1883: arrowUp sv@3113: cg@1883: "This resource specification was automatically generated cg@1883: by the ImageEditor of ST/X." cg@1883: "Do not manually edit this!! If it is corrupted, cg@1883: the ImageEditor may not be able to read the specification." cg@1883: " cg@1883: self arrowUp inspect cg@1883: ImageEditor openOnClass:self andSelector:#arrowUp sv@3113: Icon flushCachedIcons" sv@3113: sv@3113: ^ Icon constantNamed:'UIPainter class arrowUp' sv@3113: ifAbsentPut:[ sv@3113: (Depth1Image new) sv@3113: width:11; sv@3113: height:11; sv@3113: photometric:(#palette); sv@3113: bitsPerSample:(#[ 1 ]); sv@3113: samplesPerPixel:(1); sv@3113: bits:(ByteArray fromPackedString:'?>C?8O? >>C18NC 0FC?8O? ?>C?8@@a'); sv@3113: colorMapFromArray:#[ 0 0 0 255 255 255 ]; sv@3113: mask:((ImageMask new) sv@3113: width:11; sv@3113: height:11; sv@3113: bits:(ByteArray fromPackedString:'@@@@@@@@A@@NG1<@O8@@@@@@@@@@AP@a'); sv@3113: yourself); sv@3113: yourself sv@3113: ] cg@1883: ! cg@1883: cg@2210: browseActionImage sv@3113: cg@2210: "This resource specification was automatically generated cg@2210: by the ImageEditor of ST/X." cg@2210: "Do not manually edit this!! If it is corrupted, cg@2210: the ImageEditor may not be able to read the specification." cg@2210: " cg@2210: self browseActionImage inspect cg@2210: ImageEditor openOnClass:self andSelector:#browseActionImage sv@3113: Icon flushCachedIcons" sv@3113: sv@3113: ^ Icon constantNamed:'UIPainter class browseActionImage' sv@3113: ifAbsentPut:[ sv@3113: (Depth8Image new) sv@3113: width:11; sv@3113: height:12; sv@3113: photometric:(#palette); sv@3113: bitsPerSample:(#[ 8 ]); sv@3113: samplesPerPixel:(1); sv@3113: bits:(ByteArray sv@3113: fromPackedString:' cg@2210: R@@@RT%RST1LTD9H@D%IT%MRSD1PS$!!RT$5RUEILT%INT%UVT%YWU%IVUUIHT%!!YV%-ZVU!!RWD!!MT%Y[@E-VT%5\RD1RU%,@V5YRWU1HT%!!YV%-ZVU!!RWEIU sv@3113: U%IVU5YRU%URZ%IR@EITT ART&,@@@@@T%MR@@@@@@@@@@@@T @@@@@@'); sv@3113: colorMapFromArray:#[ 255 248 248 63 144 224 64 152 232 79 160 232 64 152 224 64 144 224 63 136 224 48 128 216 48 120 216 47 112 216 47 112 208 32 104 208 32 96 208 31 88 200 16 88 200 16 80 200 15 72 192 15 64 192 0 64 192 0 56 184 0 56 176 0 48 160 143 200 248 128 200 248 127 192 248 112 184 248 111 176 248 96 168 248 95 160 248 80 152 248 79 144 248 64 128 248 63 120 248 48 112 248 32 104 248 31 96 248 16 88 248 15 80 248 0 72 248 0 64 240 0 48 168 112 176 248 111 168 248 96 160 248 95 152 248 80 144 248 79 136 248 63 128 248 48 120 248 47 112 248 15 72 248 0 48 176 95 168 232 191 224 248 191 216 248 176 208 248 175 208 248 175 200 248 160 200 248 160 192 248 159 192 248 159 184 248 144 184 248 144 176 248 143 168 248 128 168 248 128 160 248 127 160 248 127 152 240 31 72 176 111 168 232 127 160 216 207 216 240 240 240 248 240 232 240 63 88 176 239 232 240 240 240 240 48 88 176 96 168 224 224 224 232 96 160 224 240 144 24 255 248 48 255 248 96 255 248 24 240 208 24 255 248 152 255 248 88 255 248 136 255 248 176 255 248 200 48 80 176 223 216 224 96 152 224 96 152 216 95 152 216 48 120 208 80 144 208 80 136 208 79 128 200 79 120 200 79 120 192 64 112 192 64 104 184 63 104 184 63 96 184 15 56 160 ]; sv@3113: mask:((ImageMask new) sv@3113: width:11; sv@3113: height:12; sv@3113: bits:(ByteArray fromPackedString:'A@@N@F;@?>A?0G>@O8A?0O? [,@N@@P@'); sv@3113: yourself); sv@3113: yourself sv@3113: ] cg@2210: ! cg@2210: sv@3296: builderIcon sv@3296: "This resource specification was automatically generated sv@3296: by the ImageEditor of ST/X." sv@3296: sv@3296: "Do not manually edit this!! If it is corrupted, sv@3296: the ImageEditor may not be able to read the specification." sv@3296: sv@3296: " sv@3296: self builderIcon inspect sv@3296: ImageEditor openOnClass:self andSelector:#builderIcon sv@3296: Icon flushCachedIcons sv@3296: " sv@3296: sv@3296: sv@3296: sv@3296: ^Icon sv@3296: constantNamed:'UIPainter builderIcon' sv@3296: ifAbsentPut:[(Depth1Image width:48 height:48 photometric:#whiteIs0) bits:(ByteArray fromPackedString:' sv@3296: @@@@@@@@O??????DH_@IC??$H_@IC??4H_@IC??$H_@IC?>DH_@F@J DH_@F@M DH_@F@J DH_@F@M DH_@F@J DH_@F@M D sv@3296: H_@F@J DH_@F@M DH_@F@J DH_@F@M DH_@F@J DH_@_ M DH_@ PJ DH_@)PM DH_@)PJ DH_@)PM DH? )PJ DI?0)PM DK?8)PJ DK18)PM DK 8)PJ D sv@3296: K@X)PM DK@X PG@DK@X_ @@DH@@@@@@DH@@@@@@DO??????<@@@@@@@@NDIHNG''@IDIHIDD H$IHH$DPIDIHH$DPNDIHH$D IDIHH''G@H$IHH$E@H$IHH$D sv@3296: IBQHIDDPNA!!ONG$P@@@@@@@@'); yourself] sv@3296: ! sv@3296: cg@2157: defaultIcon cg@2175: cg@2175: cg@2157: ^ ToolbarIconLibrary startUIPainterIcon cg@2157: cg@2157: "Created: / 10-02-2007 / 14:45:56 / cg" cg@2175: "Modified: / 17-09-2007 / 11:36:33 / cg" cg@2157: ! cg@2157: cg@3218: delta cg@3218: "This resource specification was automatically generated cg@3218: by the ImageEditor of ST/X." cg@3218: cg@3218: "Do not manually edit this!! If it is corrupted, cg@3218: the ImageEditor may not be able to read the specification." cg@3218: cg@3218: " cg@3218: self delta inspect cg@3218: ImageEditor openOnClass:self andSelector:#delta cg@3218: Icon flushCachedIcons cg@3218: " cg@3218: cg@3218: cg@3218: cg@3218: ^Icon cg@3218: constantNamed:'UIPainter delta' cg@3218: ifAbsentPut:[(Depth1Image new) width:11; height:11; bits:(ByteArray fromPackedString:'?>C?8O? >>C@XLA 0VB;(H@ ?"C?8@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width:11; height:11; bits:(ByteArray fromPackedString:' cg@3218: @@@@@@@@A@@J@AD@HHA@PG?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ cg@3218: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] cg@3218: ! cg@3218: sv@2284: editTableIcon sv@2284: sv@2284: sv@2284: ^ SystemBrowser tableColumnsIcon sv@2284: ! sv@2284: sv@2284: helpIcon sv@2284: sv@2284: sv@2284: ^ Icon helpIcon sv@2284: ! sv@2284: cg@2500: hideToolBarIcon cg@2500: cg@2500: cg@2500: ^ ToolbarIconLibrary hideToolBarIcon cg@2500: ! cg@2500: tz@735: iconAlignB sv@3119: tz@743: "This resource specification was automatically generated tz@743: by the ImageEditor of ST/X." tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the ImageEditor may not be able to read the specification." tz@735: " cg@2268: self iconAlignB inspect tz@743: ImageEditor openOnClass:self andSelector:#iconAlignB sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconAlignB' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2268: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@ sv@3119: @G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] tz@778: ! tz@735: tz@735: iconAlignL sv@3119: tz@743: "This resource specification was automatically generated tz@743: by the ImageEditor of ST/X." tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the ImageEditor may not be able to read the specification." tz@735: " cg@2268: self iconAlignL inspect tz@743: ImageEditor openOnClass:self andSelector:#iconAlignL sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconAlignL' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2268: @@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@ sv@3119: @(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] tz@778: ! tz@735: tz@735: iconAlignLR sv@3119: tz@743: "This resource specification was automatically generated tz@743: by the ImageEditor of ST/X." tz@785: "Do not manually edit this!! If it is corrupted, tz@743: the ImageEditor may not be able to read the specification." tz@735: " cg@2268: self iconAlignLR inspect tz@743: ImageEditor openOnClass:self andSelector:#iconAlignLR sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconAlignLR' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2268: @@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(_??2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??2 @@(@@@B E@(@@@B @@(@@@B @ sv@3119: @(@@@B @@(UUUR @@(_??B @@(@@@B @@(@@@B @@@@@@@@E@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: 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 @@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] tz@785: ! tz@735: tz@735: iconAlignR sv@3119: tz@743: "This resource specification was automatically generated tz@743: by the ImageEditor of ST/X." tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the ImageEditor may not be able to read the specification." tz@735: " cg@2268: self iconAlignR inspect tz@743: ImageEditor openOnClass:self andSelector:#iconAlignR sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconAlignR' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2268: @@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@_??2 @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUUR @@G???2 @@@@@@B E@@@@@B @@@@@@B @ sv@3119: @@@@@B @@@@EUR @@@@G?2 @@@@@@B @@@@@@B @@@@@@@@E@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@@A A?? A?? A?? A?? @@A @@A G?? G?? G?? G?? @@A @@A @G? @G? @G? @G? @@A @@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] ca@1432: ! tz@735: tz@735: iconAlignT sv@3119: tz@743: "This resource specification was automatically generated tz@743: by the ImageEditor of ST/X." tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the ImageEditor may not be able to read the specification." tz@735: " cg@2268: self iconAlignT inspect tz@743: ImageEditor openOnClass:self andSelector:#iconAlignT sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconAlignT' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2268: @@@@@@@@@@@@@@@@@@@@@@@@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@@ sv@3119: @@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] tz@778: ! tz@735: tz@735: iconAlignTB sv@3119: tz@743: "This resource specification was automatically generated tz@743: by the ImageEditor of ST/X." tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the ImageEditor may not be able to read the specification." tz@735: " cg@2268: self iconAlignTB inspect tz@743: ImageEditor openOnClass:self andSelector:#iconAlignTB sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconAlignTB' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2268: @@@@@@@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@@ sv@3119: @G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@1862: ! cg@1862: cg@1862: iconCenterH sv@3119: cg@1862: "This resource specification was automatically generated cg@1862: by the ImageEditor of ST/X." cg@1862: "Do not manually edit this!! If it is corrupted, cg@1862: the ImageEditor may not be able to read the specification." cg@1862: " cg@1862: self iconCenterH inspect cg@1862: ImageEditor openOnClass:self andSelector:#iconCenterH sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconCenterH' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@1862: @@@@@@@@@@@@@@@@@(@J@B @@(@J@B @@(UZUR @@(?:?R @@(@J@B @@(@J@B @@(@J@B @@@@J@@@@@EUZUU@@@O?:?=@@@@@J@@@@@(@J@B @@(@J@B @ sv@3119: @(@J@B @@(EZUB@@@(O:=B @@(@J@B @@(@J@B @@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@C@@A?>@A?>@A?>@A?>@@C@@@C@@G?? G?? G?? G??#@C@@@C@C@?<@@? cg@1862: "This resource specification was automatically generated cg@1862: by the ImageEditor of ST/X." cg@1862: "Do not manually edit this!! If it is corrupted, cg@1862: the ImageEditor may not be able to read the specification." cg@1862: " cg@1862: self iconCenterHInFrame inspect cg@1862: ImageEditor openOnClass:self andSelector:#iconCenterHInFrame sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconCenterHInFrame' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@1862: @@@@@@@@J******@H@@@@@B@HL@@@CB@H8UUUR2@HH???RB@H8@@@B2@HH@@@BB@H8@@@B2@H@@@@@B@HEUUUUB@HO???=B@H@@@@@B@H8@@@@2@HH@@@@B@ sv@3119: H8@@@@2@HHEUUBB@H8O?=B2@HL@@@CB@H@@@@@B@J******@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@_??8P@@HW??(U?>(U?>(U?>(T@@(T@@(W??(W??(W??(W??+T@@(T@@+T?<(T?<)T?<(W??(P@@H_??9@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@1862: ! cg@1862: cg@1862: iconCenterV sv@3119: cg@1862: "This resource specification was automatically generated cg@1862: by the ImageEditor of ST/X." cg@1862: "Do not manually edit this!! If it is corrupted, cg@1862: the ImageEditor may not be able to read the specification." cg@1862: " cg@1862: self iconCenterV inspect cg@1862: ImageEditor openOnClass:self andSelector:#iconCenterV sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconCenterV' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@1862: @@@@@@@@@@@@@@@@@@@@@@@@B**@J*(@B**MJ*(@@@@M@@@@@@@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@B*****(@B*****(@@M@M@M@@@M@M@M@@@E@M@M@@ sv@3119: @@@M@E@@@@@M@@@@B**EJ*(@B(*@J*(@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@@@@@G @@G @@G'' G''''!!G'''' G'''' G'''' O??0O??0G'''' G'''' G'''' G'''' @G''#@G @@G C@@@@@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@1862: ! cg@1862: cg@1862: iconCenterVInFrame sv@3119: cg@1862: "This resource specification was automatically generated cg@1862: by the ImageEditor of ST/X." cg@1862: "Do not manually edit this!! If it is corrupted, cg@1862: the ImageEditor may not be able to read the specification." cg@1862: " cg@1862: self iconCenterVInFrame inspect cg@1862: ImageEditor openOnClass:self andSelector:#iconCenterVInFrame sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconCenterVInFrame' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@1862: @@@@@@@@J******@H@@@@@B@HL3@L3B@H:*GJ*2@H@@G@@B@HG@G@@B@HG@G@GB@HG@G@GB@HG@G@GB@HG@G@GB@HG@G@GB@HG@G@GB@HG@G@GB@HG@G@EB@ sv@3119: HE@G@@B@H@@G@@B@H:*E@J2@HL3@L3B@H@@@@@B@J******@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@B_??9P@@HW??(TG (W'' (W''''*W''''(W''''*W'''')W''''(W'''')W''''+W''''*W''''*W''''(W'' )TG (W??(P@@H_??8@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@1862: ! cg@1862: cg@1862: iconDistributeH sv@3119: cg@1862: "This resource specification was automatically generated cg@1862: by the ImageEditor of ST/X." cg@1862: "Do not manually edit this!! If it is corrupted, cg@1862: the ImageEditor may not be able to read the specification." cg@1862: " cg@1862: self iconDistributeH inspect cg@1862: ImageEditor openOnClass:self andSelector:#iconDistributeH sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconDistributeH' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@1863: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@E@@E@G@@G@@G@G@@G@@G@GHBGHBG@GHBGHBG@GJ*GJ*G@GHBGHBG@GHBGHBG@GB*GJ G@GB*GJ G@ sv@3119: G@@G@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@@@@@@@@O1?>O1????<>O1<>O1> cg@1862: "This resource specification was automatically generated cg@1862: by the ImageEditor of ST/X." cg@1862: "Do not manually edit this!! If it is corrupted, cg@1862: the ImageEditor may not be able to read the specification." cg@1862: " cg@1862: self iconDistributeV inspect cg@1862: ImageEditor openOnClass:self andSelector:#iconDistributeV sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconDistributeV' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@1863: @@@@@@@@@@UUUT@@@@???4@@@@@@@@@@@@@*(@@@@@JB@@@@@@JB@@@@@@JB@@@@@@J*(@@@@@@@@@@@@@UUUT@@@@???4@@@@@@@@@@@@J*(@@@@@JB@@@@ sv@3119: @@JB@@@@@@@B@@@@@@@*(@@@@@@@@@@@@@UUUT@@@@???4@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'A??@A??@A??CA??@@G0@@A@@@A@@@A@@@G0CA??@A??@A??@A??@@G0C@A@@@A@@@A@@@G0AA??AA??@A??@A??B'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@2361: ! cg@2361: cg@2361: iconResizeB sv@3119: cg@2361: "This resource specification was automatically generated cg@2361: by the ImageEditor of ST/X." cg@2361: "Do not manually edit this!! If it is corrupted, cg@2361: the ImageEditor may not be able to read the specification." cg@2361: " cg@2361: self iconResizeB inspect cg@2361: ImageEditor openOnClass:self andSelector:#iconResizeB sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconResizeB' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2361: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@@@@@@M@@@@@@@M@M@@@@@M@M@@@@@M@M@@@@@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@@@@@@M@@ sv@3119: @@@@@E@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@@@@@G A@G @@G'' @G'' @G''#@G'' G''''"G'''' G''''!!G'''' G'''' O?7 G'''' CCG O??0O??0@@@A@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@2361: ! cg@2361: cg@2361: iconResizeL sv@3119: cg@2361: "This resource specification was automatically generated cg@2361: by the ImageEditor of ST/X." cg@2361: "Do not manually edit this!! If it is corrupted, cg@2361: the ImageEditor may not be able to read the specification." cg@2361: " cg@2361: self iconResizeL inspect cg@2361: ImageEditor openOnClass:self andSelector:#iconResizeL sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconResizeL' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2361: @@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(AUUU@@@(C???@@@(@@@@@E@(@@@@@@@(@@@@@@ sv@3119: @(@@@@@@@(AU@@@@@(C?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@FP@@F?? G?? G?? F?? FP@@FP@@F? @G? @G? @F? @FP@@@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@2361: ! cg@2361: cg@2361: iconResizeLR sv@3119: cg@2361: "This resource specification was automatically generated cg@2361: by the ImageEditor of ST/X." cg@2361: "Do not manually edit this!! If it is corrupted, cg@2361: the ImageEditor may not be able to read the specification." cg@2361: " cg@2361: self iconResizeLR inspect cg@2361: ImageEditor openOnClass:self andSelector:#iconResizeLR sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconResizeLR' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2361: @@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(???2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(AUTB @@(C? cg@2361: "This resource specification was automatically generated cg@2361: by the ImageEditor of ST/X." cg@2361: "Do not manually edit this!! If it is corrupted, cg@2361: the ImageEditor may not be able to read the specification." cg@2361: " cg@2361: self iconResizeR inspect cg@2361: ImageEditor openOnClass:self andSelector:#iconResizeR sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconResizeR' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2361: @@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@???R @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUTB @@O?? cg@2361: "This resource specification was automatically generated cg@2361: by the ImageEditor of ST/X." cg@2361: "Do not manually edit this!! If it is corrupted, cg@2361: the ImageEditor may not be able to read the specification." cg@2361: " cg@2361: self iconResizeT inspect cg@2361: ImageEditor openOnClass:self andSelector:#iconResizeT sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconResizeT' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2361: @@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@E@@@@@@@M@@@M@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@@@@M@M@@@@@M@M@@@@@M@M@@ sv@3119: @@@M@M@@@@@M@@@@@@@M@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@@@@@@@@@AO??0O??0CCG G'''' O?7 G'''' G'''' G''''!!G'''' G''''"@G'' @G''#@G'' @G'' @G @@G A@@@@@@@@@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] cg@2361: ! cg@2361: cg@2361: iconResizeTB sv@3119: cg@2361: "This resource specification was automatically generated cg@2361: by the ImageEditor of ST/X." cg@2361: "Do not manually edit this!! If it is corrupted, cg@2361: the ImageEditor may not be able to read the specification." cg@2361: " cg@2361: self iconResizeTB inspect cg@2361: ImageEditor openOnClass:self andSelector:#iconResizeTB sv@3119: Icon flushCachedIcons" sv@3119: sv@3119: ^ Icon constantNamed:'UIPainter class iconResizeTB' sv@3119: ifAbsentPut:[ sv@3119: (Depth2Image new) sv@3119: width:22; sv@3119: height:22; sv@3119: photometric:(#palette); sv@3119: bitsPerSample:(#( 2 )); sv@3119: samplesPerPixel:(1); sv@3119: bits:(ByteArray sv@3119: fromPackedString:' cg@2361: @@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@G@@@@@@@G@@@@@@@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@@@G@@@@@@ sv@3119: @G@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@'); sv@3119: colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ]; sv@3119: mask:((ImageMask new) sv@3119: width:22; sv@3119: height:22; sv@3119: bits:(ByteArray sv@3119: fromPackedString:'@@@B@@@@@@@BO??0O??2G#C@G'''' G/?0G''''#G'''' G'''' G'''' G'''' G''''"G/?0G'''' G#C@O??1O??0@@@A@@@B@@@@'); sv@3119: yourself); sv@3119: yourself sv@3119: ] tz@778: ! ! tz@735: cg@60: !UIPainter class methodsFor:'interface specs'! cg@60: tz@743: dialogSpecForDefiningClassAndSelector tz@743: "This resource specification was automatically generated tz@743: by the UIPainter of ST/X." tz@743: tz@765: "Do not manually edit this!! If it is corrupted, tz@743: the UIPainter may not be able to read the specification." cg@366: cg@366: " tz@743: UIPainter new openOnClass:UIPainter andSelector:#dialogSpecForDefiningClassAndSelector tz@743: UIPainter new openInterface:#dialogSpecForDefiningClassAndSelector cg@366: " cg@366: cg@366: cg@366: cg@366: ^ tz@446: cg@366: #(#FullSpec sv@2217: #window: sv@2217: #(#WindowSpec sv@2217: #name: 'GUI Painter' sv@2217: #layout: #(#LayoutFrame 291 0 130 0 637 0 289 0) sv@2217: #label: 'GUI Painter' sv@2217: #min: #(#Point 350 160) sv@2217: #bounds: #(#Rectangle 291 130 638 290) sv@2217: #usePreferredExtent: false sv@2217: ) sv@2217: #component: sv@2217: #(#SpecCollection sv@2217: #collection: sv@2217: #( sv@2217: #(#FramedBoxSpec sv@2217: #name: 'FramedBox' sv@2217: #layout: #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0) sv@2217: #component: sv@2217: #(#SpecCollection sv@2217: #collection: sv@2217: #( sv@2217: #(#LabelSpec sv@2217: #name: 'selectorLabel' sv@2217: #layout: #(#AlignmentOrigin 67 0.11 29 0 1 0.5) sv@2217: #label: 'Selector:' sv@2217: #translateLabel: true sv@2217: #adjust: #right sv@2217: #resizeForLabel: true sv@2217: ) sv@2217: #(#InputFieldSpec sv@2217: #name: 'methodNameField' sv@2217: #layout: #(#LayoutFrame 70 0.11 18 0 4 1.0 40 0) sv@2217: #tabable: true sv@2217: #model: #methodNameChannel sv@2217: #group: #inputGroup sv@2217: ) sv@2217: #(#LabelSpec sv@2217: #name: 'classLabel' sv@2217: #layout: #(#AlignmentOrigin 67 0.11 54 0 1 0.5) sv@2217: #label: 'Class:' sv@2217: #translateLabel: true sv@2217: #adjust: #right sv@2217: #resizeForLabel: true sv@2217: ) sv@2217: #(#InputFieldSpec sv@2217: #name: 'classNameField' sv@2217: #layout: #(#LayoutFrame 70 0.11 43 0 4 1.0 65 0) sv@2217: #tabable: true sv@2217: #model: #classNameChannel sv@2217: #group: #inputGroup sv@2217: ) sv@2217: #(#LabelSpec sv@2217: #name: 'superClassLabel' sv@2217: #layout: #(#AlignmentOrigin 67 0.11 79 0 1 0.5) sv@2217: #label: 'Superclass:' sv@2217: #translateLabel: true sv@2217: #adjust: #right sv@2217: #resizeForLabel: true sv@2217: ) sv@2217: #(#ComboBoxSpec sv@2217: #name: 'superclassNameComboBox' sv@2217: #layout: #(#LayoutFrame 70 0.11 68 0 4 1.0 90 0) sv@2217: #tabable: true sv@2217: #model: #superclassNameChannel sv@2217: #comboList: #superclassNameDefaults sv@2217: ) sv@2217: ) sv@2217: ) sv@2217: #label: 'Define Class And Selector' sv@2217: #labelPosition: #topLeft sv@2217: #translateLabel: true sv@2217: ) sv@2217: #(#UISubSpecification sv@2217: #name: 'subSpec' sv@2217: #layout: #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) sv@2217: #majorKey: #ToolApplicationModel sv@2217: #minorKey: #windowSpecForCommitWithoutChannels sv@2217: ) sv@2217: ) sv@2217: ) tz@743: ) cg@838: cg@950: "Modified: / 13.8.1998 / 19:59:44 / cg" tz@743: ! tz@743: tz@743: dialogSpecForDefiningGridParameters tz@743: "This resource specification was automatically generated tz@743: by the UIPainter of ST/X." tz@743: tz@765: "Do not manually edit this!! If it is corrupted, tz@743: the UIPainter may not be able to read the specification." tz@743: tz@743: " tz@743: UIPainter new openOnClass:UIPainter andSelector:#dialogSpecForDefiningGridParameters tz@743: UIPainter new openInterface:#dialogSpecForDefiningGridParameters tz@743: " tz@743: tz@743: tz@743: cg@1782: ^ cg@1782: #(FullSpec cg@1782: name: dialogSpecForDefiningGridParameters cg@1782: window: cg@1782: (WindowSpec cg@1782: label: 'GUI Painter' cg@1782: name: 'GUI Painter' cg@1782: min: (Point 300 200) cg@1782: max: (Point 300 200) cg@1782: bounds: (Rectangle 16 46 298 244) cg@1782: ) cg@1782: component: cg@1782: (SpecCollection cg@1782: collection: ( cg@1782: (FramedBoxSpec cg@1782: label: 'Grid Parameter' cg@1782: name: 'FramedBox' cg@1782: layout: (LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0) cg@1782: labelPosition: topLeft cg@1782: translateLabel: true cg@1782: component: cg@1782: (SpecCollection cg@1782: collection: ( cg@1782: (CheckBoxSpec cg@1782: label: 'Show Grid' cg@1782: name: 'ShowGridCheckBox' cg@1782: layout: (Point 13 14) cg@1782: model: showGrid cg@1782: translateLabel: true cg@2692: activeHelpKey: showGrid cg@1782: ) cg@1782: (CheckBoxSpec cg@1782: label: 'Align To Grid' cg@1782: name: 'AlignCheckBox' cg@1782: layout: (Point 13 42) cg@1782: model: alignToGrid cg@1782: translateLabel: true cg@2692: activeHelpKey: alignToGrid cg@1782: ) cg@1782: (LabelSpec cg@1782: label: 'Horizontal Pixels:' cg@1782: name: 'HorizontalPixelsLabel' cg@1782: layout: (AlignmentOrigin 138 0 89 0 1 0.5) cg@1782: translateLabel: true cg@1782: resizeForLabel: true cg@1782: adjust: right cg@1782: ) cg@1782: (InputFieldSpec cg@1782: name: 'HorizontalPixelsField' cg@1782: layout: (LayoutFrame 144 0 77 0 197 0 99 0) cg@1782: model: hspace cg@1782: group: inputGroup cg@1782: type: numberOrNil cg@1782: acceptOnPointerLeave: false cg@1782: ) cg@1782: (LabelSpec cg@1782: label: 'Vertical Pixels:' cg@1782: name: 'VerticalPixelsLabel' cg@1782: layout: (AlignmentOrigin 139 0 114 0 1 0.5) cg@1782: translateLabel: true cg@1782: resizeForLabel: true cg@1782: adjust: right cg@1782: ) cg@1782: (InputFieldSpec cg@1782: name: 'VerticalPixelsField' cg@1782: layout: (LayoutFrame 144 0 102 0 197 0 124 0) cg@1782: model: vspace cg@1782: group: inputGroup cg@1782: type: numberOrNil cg@1782: acceptOnPointerLeave: false cg@1782: ) cg@1782: ) cg@1782: cg@1782: ) cg@1782: ) cg@1782: (UISubSpecification cg@1782: name: 'subSpec' cg@1782: layout: (LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) cg@1782: majorKey: ToolApplicationModel cg@1782: minorKey: windowSpecForCommitWithoutChannels cg@1782: ) cg@1782: ) cg@1782: cg@1782: ) cg@366: ) cg@366: ! cg@366: cg@2243: dialogSpecForDefiningPortAndPageName cg@2243: "This resource specification was automatically generated cg@2243: by the UIPainter of ST/X." cg@2243: cg@2243: "Do not manually edit this!! If it is corrupted, cg@2243: the UIPainter may not be able to read the specification." cg@2243: cg@2243: " cg@2258: UIPainter new openOnClass:UIPainter andSelector:#dialogSpecForDefiningPortAndPageName cg@2258: UIPainter new openInterface:#dialogSpecForDefiningPortAndPageName cg@2243: " cg@2243: cg@2243: cg@2243: cg@2243: ^ cg@2243: #(FullSpec cg@2258: name: dialogSpecForDefiningPortAndPageName cg@2243: window: cg@2243: (WindowSpec cg@2243: label: 'GUI Painter' cg@2243: name: 'GUI Painter' cg@2243: min: (Point 350 140) cg@2243: max: (Point 500 140) cg@2243: bounds: (Rectangle 0 0 346 138) cg@2243: ) cg@2243: component: cg@2243: (SpecCollection cg@2243: collection: ( cg@2243: (FramedBoxSpec cg@2261: label: 'Define Service and Pagename' cg@2243: name: 'FramedBox' cg@2243: layout: (LayoutFrame 0 0.0 3 0.0 0 1.0 -34 1.0) cg@2243: labelPosition: topLeft cg@2243: translateLabel: true cg@2243: component: cg@2243: (SpecCollection cg@2243: collection: ( cg@2243: (LabelSpec cg@2243: label: 'Service (or Port):' cg@2243: name: 'portLabel' cg@2243: layout: (AlignmentOrigin 67 0.11 29 0 1 0.5) cg@2243: translateLabel: true cg@2243: resizeForLabel: true cg@2243: adjust: right cg@2243: ) cg@2258: (ComboBoxSpec cg@2258: name: 'ComboBox1' cg@2243: layout: (LayoutFrame 70 0.11 18 0 4 1.0 40 0) cg@2243: model: serviceOrPortNameChannel cg@2243: acceptOnPointerLeave: false cg@2258: comboList: runningServerPorts cg@2243: ) cg@2243: (LabelSpec cg@2243: label: 'Pagename:' cg@2243: name: 'pageNameLabel' cg@2243: layout: (AlignmentOrigin 67 0.11 54 0 1 0.5) cg@2243: translateLabel: true cg@2243: resizeForLabel: true cg@2243: adjust: right cg@2243: ) cg@2243: (InputFieldSpec cg@2243: name: 'pageNameNameField' cg@2243: layout: (LayoutFrame 70 0.11 43 0 4 1.0 65 0) cg@2243: tabable: true cg@2243: model: pageNameNameChannel cg@2243: group: inputGroup cg@2243: acceptOnPointerLeave: false cg@2243: ) cg@2243: ) cg@2243: cg@2243: ) cg@2243: ) cg@2243: (UISubSpecification cg@2243: name: 'subSpec' cg@2243: layout: (LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) cg@2243: majorKey: ToolApplicationModel cg@2243: minorKey: windowSpecForCommitWithoutChannels cg@2243: ) cg@2243: ) cg@2243: cg@2243: ) cg@2243: ) cg@2243: ! cg@2243: tz@743: windowSpec tz@743: "This resource specification was automatically generated tz@743: by the UIPainter of ST/X." tz@743: tz@743: "Do not manually edit this!! If it is corrupted, tz@743: the UIPainter may not be able to read the specification." ca@222: ca@222: " tz@743: UIPainter new openOnClass:UIPainter andSelector:#windowSpec tz@743: UIPainter new openInterface:#windowSpec tz@743: UIPainter open ca@222: " ca@222: ca@222: ca@222: cg@1115: ^ sv@1739: #(FullSpec sv@1739: name: windowSpec sv@1739: window: sv@1739: (WindowSpec sv@1739: label: 'GUI Painter' sv@1739: name: 'GUI Painter' sv@1739: min: (Point 560 460) cg@2950: bounds: (Rectangle 0 0 834 575) cg@2500: menu: menu cg@2157: icon: defaultIcon ca@1317: ) sv@1739: component: sv@1739: (SpecCollection sv@1739: collection: ( cg@2531: (ViewSpec cg@2531: name: 'mainPanel' cg@2531: layout: (LayoutFrame 0 0 0 0 0 1 -24 1) sv@1739: component: sv@1739: (SpecCollection sv@1739: collection: ( cg@2531: (ViewSpec cg@2531: name: 'ToolBar' cg@2531: layout: (LayoutFrame 0 0 0 0 0 1 32 0) cg@2531: visibilityChannel: toolBarVisibleHolder cg@2531: component: cg@2531: (SpecCollection cg@2531: collection: ( cg@2531: (ActionButtonSpec cg@2531: label: 'hideToolBarIcon' cg@2531: name: 'HideToolBarButton' cg@2531: layout: (LayoutFrame 0 0 0 0 13 0 0 1) cg@2531: activeHelpKey: hideToolBar cg@2531: hasCharacterOrientedLabel: false cg@2531: translateLabel: true cg@2531: model: hideToolbar cg@2531: postBuildCallback: hideToolBarButtonCreated: cg@2531: ) cg@2531: (MenuPanelSpec cg@2531: name: 'menuToolbarView' cg@2531: layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) cg@2531: visibilityChannel: toolBarVisibleHolder cg@2531: menu: menuToolbar cg@2531: textDefault: true cg@2531: ) cg@2531: ) cg@2531: cg@2531: ) ca@1317: ) sv@1739: (ViewSpec cg@2531: name: 'EditToolBar' cg@2531: layout: (LayoutFrame 0 0 30 0 0 1 62 0) cg@2531: visibilityChannel: editToolBarVisibleHolder cg@2531: component: cg@2531: (SpecCollection cg@2531: collection: ( cg@2531: (ActionButtonSpec cg@2531: label: 'hideToolBarIcon' cg@2531: name: 'HideEditToolBarButton' cg@2531: layout: (LayoutFrame 0 0 0 0 13 0 0 1) cg@2531: activeHelpKey: hideToolBar cg@2531: hasCharacterOrientedLabel: false cg@2531: translateLabel: true cg@2531: model: hideEditToolbar cg@2531: postBuildCallback: hideToolBarButtonCreated: cg@2531: ) cg@2531: (MenuPanelSpec cg@2531: name: 'EditToolBar1' cg@2531: layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) cg@2531: visibilityChannel: editToolBarVisibleHolder cg@2531: menu: editToolbar cg@2531: textDefault: true cg@2531: ) cg@2531: ) cg@2531: cg@2531: ) cg@2531: ) cg@2531: (VariableHorizontalPanelSpec cg@2531: name: 'Painter' cg@2531: layout: (LayoutFrame 0 0.0 60 0.0 0 1.0 0 1.0) cg@2531: level: 1 sv@1739: component: sv@1739: (SpecCollection sv@1739: collection: ( cg@2531: (ArbitraryComponentSpec cg@2531: name: 'treeView' sv@1739: tabable: true cg@2531: menu: menuEdit cg@2531: hasHorizontalScrollBar: true cg@2531: hasVerticalScrollBar: true cg@2531: miniScrollerHorizontal: true cg@2531: miniScrollerVertical: true cg@2531: hasBorder: false cg@2531: component: treeView ca@1317: ) cg@2531: (ViewSpec cg@2531: name: 'specHolderView' cg@2531: level: 0 sv@1739: component: sv@1739: (SpecCollection sv@1739: collection: ( cg@2531: (MenuPanelSpec cg@2531: name: 'menuToolbar2View' cg@2531: layout: (LayoutFrame 2 0.0 2 0 -2 1.0 32 0) cg@2531: level: 0 cg@2531: tabable: true cg@2531: menu: menuToolbar2 cg@2531: ) cg@2531: (NoteBookViewSpec cg@2531: name: 'noteBook' cg@2531: layout: (LayoutFrame 2 0.0 32 0.0 -2 1.0 -28 1.0) cg@2531: level: 0 cg@2531: enableChannel: enableChannel cg@2531: tabable: true cg@2531: model: tabModel cg@2531: menu: tabList cg@1782: translateLabel: true cg@2531: canvas: noteBookView cg@1457: ) cg@2531: (HorizontalPanelViewSpec cg@2531: name: 'HorizontalPanel1' cg@2531: layout: (LayoutFrame 2 0 -26 1 -2 1 -2 1) cg@2531: horizontalLayout: fit cg@2531: verticalLayout: fit cg@2531: horizontalSpace: 3 cg@2531: verticalSpace: 3 cg@2531: reverseOrderIfOKAtLeft: true cg@2531: component: cg@2531: (SpecCollection cg@2531: collection: ( cg@2531: (ActionButtonSpec cg@2531: label: 'Cancel' cg@2531: name: 'cancelButton' cg@2531: activeHelpKey: commitCancel cg@2531: translateLabel: true cg@2531: tabable: true cg@2531: model: cancel cg@2531: enableChannel: modifiedChannel cg@2950: extent: (Point 274 24) cg@2531: ) cg@2531: (ActionButtonSpec cg@2531: label: 'OK' cg@2531: name: 'acceptButton' cg@2531: activeHelpKey: commitOK cg@2531: translateLabel: true cg@2531: tabable: true cg@2531: model: accept cg@2531: enableChannel: modifiedChannel cg@2950: extent: (Point 274 24) cg@2531: ) cg@2531: ) cg@2531: cg@2531: ) cg@1457: ) cg@1457: ) cg@1457: ca@1317: ) ca@1317: ) ca@1317: ) cg@1115: ca@1317: ) cg@2950: handles: (Any 0.3 1.0) ca@1317: ) ca@1317: ) cg@1115: ca@1317: ) ca@1317: ) sv@1739: (UISubSpecification sv@1739: name: 'infoBarSubSpec' sv@1739: layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) sv@1739: level: 1 sv@1739: majorKey: ToolApplicationModel sv@1739: minorKey: windowSpecForInfoBar ca@1317: ) ca@1317: ) cg@1115: cg@2531: ) cg@2500: ) ca@222: ! ! ca@222: ca@222: !UIPainter class methodsFor:'menu specs'! ca@222: cg@2500: cutCopyPasteMenuSlice cg@2500: "This resource specification was automatically generated cg@2500: by the MenuEditor of ST/X." cg@2500: cg@2500: "Do not manually edit this!! If it is corrupted, cg@2500: the MenuEditor may not be able to read the specification." cg@2500: cg@2500: " cg@2500: MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar cg@2500: (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp cg@2500: " cg@2500: cg@2500: cg@2500: cg@2500: ^ cg@2500: #(Menu cg@2500: ( cg@2500: (MenuItem cg@2500: activeHelpKey: editCut cg@2500: enabled: canCutHolder cg@2500: label: 'Cut' cg@2500: itemValue: deleteSelection cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: editCopy cg@2500: enabled: canCopyHolder cg@2500: label: 'Copy' cg@2500: itemValue: copySelection cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: editPaste cg@2500: enabled: canPasteKeepingLayoutHolder cg@2500: label: 'Paste with Layout' cg@2500: itemValue: pasteWithLayout cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: editDelete cg@2500: enabled: canCutHolder cg@2500: label: 'Delete' cg@2500: itemValue: deleteTotalSelection cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: isVisible: false cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary deleteWidgetIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: label: '-' cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: editUndo cg@2500: enabled: hasUndoHistoryHolder cg@2500: label: 'Undo' cg@2500: itemValue: undoLast cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon) cg@2500: ) cg@2500: ) cg@2500: nil cg@2500: nil cg@2500: ) cg@2500: ! cg@2500: cg@2500: editToolbar cg@2500: "This resource specification was automatically generated cg@2500: by the MenuEditor of ST/X." cg@2500: cg@2500: "Do not manually edit this!! If it is corrupted, cg@2500: the MenuEditor may not be able to read the specification." cg@2500: cg@2500: " cg@2500: MenuEditor new openOnClass:UIPainter andSelector:#editToolbar cg@2500: (Menu new fromLiteralArrayEncoding:(UIPainter editToolbar)) startUp cg@2500: " cg@2500: cg@2500: cg@2500: cg@2500: ^ cg@2500: #(Menu cg@2500: ( cg@2500: (MenuItem cg@2500: label: 'moveItems' cg@2500: translateLabel: true cg@2500: submenuChannel: moveInListMenuSlice cg@2500: isMenuSlice: true cg@2500: ) cg@2500: (MenuItem cg@2500: label: '-' cg@2500: ) cg@2500: (MenuItem cg@2500: label: 'gridItems' cg@2500: translateLabel: true cg@2500: submenuChannel: gridMenuSlice cg@2500: isMenuSlice: true cg@2500: ) cg@2500: ) cg@2500: nil cg@2500: nil cg@2500: ) cg@2500: ! cg@2500: cg@2500: gridMenuSlice cg@2500: "This resource specification was automatically generated cg@2500: by the MenuEditor of ST/X." cg@2500: cg@2500: "Do not manually edit this!! If it is corrupted, cg@2500: the MenuEditor may not be able to read the specification." cg@2500: cg@2500: " cg@2500: MenuEditor new openOnClass:Workflow::WorksheetEditor andSelector:#zoomMenuSlice cg@2500: (Menu new fromLiteralArrayEncoding:(Workflow::WorksheetEditor zoomMenuSlice)) startUp cg@2500: " cg@2500: cg@2500: cg@2500: cg@2500: ^ cg@2500: #(Menu cg@2500: ( cg@2500: (MenuItem cg@2500: label: 'ShowGrid' cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: indication: gridShownHolder cg@2522: labelImage: (ResourceRetriever ToolbarIconLibrary gridIcon) cg@2692: activeHelpKey: showGrid cg@2500: ) cg@2500: (MenuItem cg@2500: label: 'AlignToGrid' cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: indication: alignToGridHolder cg@2522: labelImage: (ResourceRetriever ToolbarIconLibrary gridAlignIcon) cg@2692: activeHelpKey: alignToGrid cg@2500: ) cg@2500: ) cg@2500: nil cg@2500: nil cg@2500: ) cg@2500: ! cg@2500: tz@446: menu tz@743: "This resource specification was automatically generated tz@743: by the MenuEditor of ST/X." tz@743: tz@743: "Do not manually edit this!! If it is corrupted, tz@743: the MenuEditor may not be able to read the specification." ca@217: cg@2883: ca@217: " tz@446: MenuEditor new openOnClass:UIPainter andSelector:#menu tz@446: (Menu new fromLiteralArrayEncoding:(UIPainter menu)) startUp tz@446: " tz@446: tz@446: tz@446: cg@1710: ^ ca@1775: #(Menu ca@1775: ( ca@1775: (MenuItem ca@1775: label: '&File' ca@1775: translateLabel: true cg@2277: submenuChannel: menuFile cg@2277: keepLinkedMenu: true cg@1710: ) ca@1775: (MenuItem ca@1775: label: 'Edit' ca@1775: translateLabel: true ca@1775: submenuChannel: menuEdit cg@1710: ) ca@1775: (MenuItem cg@2500: label: 'View' cg@2500: translateLabel: true cg@2500: submenu: cg@2500: (Menu cg@2500: ( cg@2500: (MenuItem cg@2500: activeHelpKey: settingsCanvas cg@2500: label: 'Canvas' cg@2500: translateLabel: true cg@2500: indication: painterShown cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: settingsGallery cg@2500: label: 'Gallery' cg@2500: translateLabel: true cg@2500: indication: galleryShown cg@2500: ) cg@2500: (MenuItem cg@2500: label: '-' cg@2500: ) cg@2500: (MenuItem cg@2500: label: 'Toolbar' cg@2500: translateLabel: true cg@2500: hideMenuOnActivated: false cg@2500: indication: toolBarVisibleHolder cg@2500: ) cg@2500: (MenuItem cg@2500: label: 'Editor Toolbar' cg@2500: translateLabel: true cg@2500: hideMenuOnActivated: false cg@2500: indication: editToolBarVisibleHolder cg@2500: ) cg@2500: (MenuItem cg@2500: label: '-' cg@2500: ) cg@2500: (MenuItem cg@2500: label: 'Load Sketch as Background...' cg@2500: itemValue: useSketch cg@2500: translateLabel: true cg@2500: ) cg@2500: (MenuItem cg@2500: label: 'Load Image as Background...' cg@2500: itemValue: useBackgroundImage cg@2500: translateLabel: true cg@2500: ) cg@2500: ) cg@2500: nil cg@2500: nil cg@2500: ) cg@2500: ) cg@2500: (MenuItem ca@1775: label: 'Align' ca@1775: translateLabel: true ca@1775: submenuChannel: menuAlign cg@1710: ) ca@1775: (MenuItem ca@1775: label: 'Generate' ca@1775: translateLabel: true cg@2198: isVisible: isNotEditingSpecOnly ca@1775: submenu: ca@1775: (Menu ca@1775: ( ca@1775: (MenuItem ca@1775: activeHelpKey: generateAspectMethods ca@1775: enabled: hasSpecClass ca@1775: label: 'Aspect Methods' ca@1775: itemValue: doGenerateAspectMethods ca@1775: translateLabel: true cg@1498: ) ca@1775: (MenuItem ca@1775: activeHelpKey: generateAspectMethodFor ca@1775: enabled: hasSpecClass ca@1775: label: 'Aspect Method For...' ca@1775: itemValue: doGenerateAspectMethodFor ca@1775: translateLabel: true cg@1710: ) ca@1775: (MenuItem ca@1775: enabled: hasSpecClass ca@1775: label: 'Menu Stub Methods' ca@1775: itemValue: doGenerateMenuMethods ca@1775: translateLabel: true cg@1710: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: generateHookMethods ca@1775: enabled: hasSpecClass ca@1775: label: 'Hook Methods' ca@1775: itemValue: doGenerateHookMethods ca@1775: translateLabel: true cg@1710: ) cg@1710: ) cg@1710: nil cg@1710: nil cg@1498: ) cg@1710: ) ca@1775: (MenuItem ca@1775: label: 'Test' ca@1775: translateLabel: true ca@1775: submenu: ca@1775: (Menu ca@1775: ( ca@1775: (MenuItem ca@1775: activeHelpKey: testStartApplication ca@1775: label: 'Start Application' ca@1775: itemValue: doStartApplication ca@1775: translateLabel: true cg@2198: isVisible: isNotEditingSpecOnly cg@1498: ) ca@1775: (MenuItem ca@1775: label: '-' cg@2198: isVisible: isNotEditingSpecOnly cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: testGeometryTestMode cg@2883: label: 'Geometry Test/Set Mode' ca@1775: translateLabel: true ca@1775: indication: testMode: cg@1710: ) cg@1710: ) cg@1710: nil cg@1710: nil cg@1498: ) cg@1710: ) ca@1775: (MenuItem ca@1775: label: 'Settings' ca@1775: translateLabel: true ca@1775: submenu: ca@1775: (Menu ca@1775: ( ca@1775: (MenuItem cg@2243: activeHelpKey: settingsAspectsAsInstances cg@2243: label: 'Aspects as InstanceVariables' cg@2243: translateLabel: true cg@2243: isVisible: isNotEditingSpecOnly cg@2243: indication: generateAspectsAsInstanceVariables: cg@2243: ) cg@2243: (MenuItem ca@1775: activeHelpKey: settingsRedefineAspectMethods ca@1775: label: 'Redefine Aspect Methods' ca@1775: translateLabel: true cg@2243: isVisible: isNotEditingSpecOnly ca@1775: indication: redefineAspectMethods: cg@1710: ) ca@1775: (MenuItem cg@2243: activeHelpKey: settingsGenerateCommentedCode cg@2243: label: 'Generate Commented Code' ca@1775: translateLabel: true cg@2198: isVisible: isNotEditingSpecOnly cg@2243: indication: generateCommentedCode: cg@1498: ) ca@1775: (MenuItem ca@1775: label: 'AutoAccept on Selection-Change ' ca@1775: translateLabel: true ca@1775: indication: autoAcceptOnSelectionChange cg@1710: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: settingsUndoManager ca@1775: enabled: hasUndoHistory ca@1775: label: 'Undo Manager...' ca@1775: itemValue: openUndoMenu ca@1775: translateLabel: true cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: settingsGridManager ca@1775: label: 'Grid Manager...' ca@1775: itemValue: doDefineGrid ca@1775: translateLabel: true cg@1710: ) cg@1710: ) cg@1710: nil cg@1710: nil cg@1498: ) cg@1710: ) ca@1775: (MenuItem ca@1775: label: 'History' ca@1775: translateLabel: true cg@2023: isVisible: isStandAlone ca@1775: submenuChannel: menuHistory cg@1710: ) ca@1775: (MenuItem cg@2138: label: 'MENU_Help' ca@1775: translateLabel: true cg@2124: startGroup: conditionalRight ca@1775: submenu: ca@1775: (Menu ca@1775: ( ca@1775: (MenuItem ca@1775: activeHelpKey: helpTutorial ca@1775: label: 'Tutorial' ca@1775: itemValue: openHTMLDocument: ca@1775: translateLabel: true ca@1775: argument: 'tools/uipainter/TOP.html' ca@1775: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: helpFunctions ca@1775: label: 'Functions' ca@1775: itemValue: openHTMLDocument: ca@1775: translateLabel: true ca@1775: argument: 'tools/uipainter/Functions.html' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: helpExamples ca@1775: label: 'Examples' ca@1775: itemValue: openHTMLDocument: ca@1775: translateLabel: true ca@1775: argument: 'tools/uipainter/Examples.html' cg@1710: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: helpHelpTool ca@1775: label: 'Help Tool' ca@1775: itemValue: openHTMLDocument: ca@1775: translateLabel: true ca@1775: argument: 'tools/uipainter/HelpTool.html' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: helpLayoutTool ca@1775: label: 'Layout Tool' ca@1775: itemValue: openHTMLDocument: ca@1775: translateLabel: true ca@1775: argument: 'tools/uipainter/LayoutTool.html' cg@1710: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: helpSelectedWidget ca@1775: label: 'Selected Widget' ca@1775: itemValue: doOpenWidgetDocumentation ca@1775: translateLabel: true cg@1710: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: helpShowHelp ca@1775: label: 'Show Help Texts' ca@1775: translateLabel: true ca@1775: indication: showingHelp: cg@1710: ) ca@1775: (MenuItem ca@1775: label: '-' cg@1710: ) ca@1775: (MenuItem ca@1775: activeHelpKey: aboutThisAppliaction ca@1775: label: 'About this Application...' ca@1775: itemValue: openAboutThisApplication ca@1775: translateLabel: true cg@1710: ) cg@1710: ) cg@1710: nil cg@1710: nil cg@1498: ) cg@1710: ) cg@1710: ) cg@1710: nil cg@1710: nil tz@564: ) tz@564: ! tz@564: tz@446: menuAlign tz@743: "This resource specification was automatically generated tz@743: by the MenuEditor of ST/X." tz@743: tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the MenuEditor may not be able to read the specification." tz@446: tz@446: " tz@446: MenuEditor new openOnClass:UIPainter andSelector:#menuAlign tz@446: (Menu new fromLiteralArrayEncoding:(UIPainter menuAlign)) startUp ca@217: " ca@217: ca@217: ca@217: cg@1862: ^ cg@1862: #(Menu cg@1862: ( cg@1862: (MenuItem cg@1862: activeHelpKey: alignSelectionLeft cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Left' cg@1862: itemValue: alignSelectionLeft cg@1862: translateLabel: true cg@1862: labelImage: (ResourceRetriever UIPainter iconAlignL 'Left') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: alignSelectionRight cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Right' cg@1862: itemValue: alignSelectionRight cg@1862: translateLabel: true cg@1862: labelImage: (ResourceRetriever UIPainter iconAlignR 'Right') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: alignSelectionTop cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Top' cg@1862: itemValue: alignSelectionTop cg@1862: translateLabel: true cg@1862: labelImage: (ResourceRetriever UIPainter iconAlignT 'Top') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: alignSelectionBottom cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Bottom' cg@1862: itemValue: alignSelectionBottom cg@1862: translateLabel: true cg@1862: labelImage: (ResourceRetriever UIPainter iconAlignB 'Bottom') cg@1862: ) cg@1862: (MenuItem cg@2361: label: '-' cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignResizeSelectionLeft cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Resize Left' cg@2361: itemValue: alignResizeSelectionLeft cg@2361: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconResizeL 'Resize Left') cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignResizeSelectionRight cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Resize Right' cg@2361: itemValue: alignResizeSelectionRight cg@2361: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconResizeR 'Resize Right') cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignResizeSelectionTop cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Resize Top' cg@2361: itemValue: alignResizeSelectionTop cg@2361: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconResizeT 'Resize Top') cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignResizeSelectionBottom cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Resize Bottom' cg@2361: itemValue: alignResizeSelectionBottom cg@2361: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconResizeB 'Resize Bottom') cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionLeftAndRight sv@2479: enabled: canResizeSelection cg@2361: label: 'Left && Right' cg@2361: itemValue: alignSelectionLeftAndRight cg@2361: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconResizeLR 'Left && Right') cg@2361: ) cg@2361: (MenuItem cg@1862: activeHelpKey: alignSelectionTopAndBottom sv@2479: enabled: canResizeSelection cg@1862: label: 'Top && Bottom' cg@1862: itemValue: alignSelectionTopAndBottom cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconResizeTB 'Top && Bottom') cg@1862: ) cg@1862: (MenuItem cg@1862: label: '-' cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: alignSelectionCenterHor cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Center Horizontal' cg@1862: itemValue: alignSelectionCenterHor cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconCenterH 'Center Horizontal') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: centerSelectionHor cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Center Horizontal in Frame' cg@1862: itemValue: centerSelectionHor cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconCenterHInFrame 'Center Horizontal in Frame') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: alignSelectionCenterVer cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Center Vertical' cg@1862: itemValue: alignSelectionCenterVer cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconCenterV 'Center Vertical') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: centerSelectionVer cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Center Vertical in Frame' cg@1862: itemValue: centerSelectionVer cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconCenterVInFrame 'Center Vertical in Frame') cg@1862: ) cg@1862: (MenuItem cg@1862: label: '-' cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: spreadSelectionHor cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Distribute Horizontal' cg@1862: itemValue: spreadSelectionHor cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconDistributeH 'Distribute Horizontal') cg@1862: ) cg@1862: (MenuItem cg@1862: activeHelpKey: spreadSelectionVer cg@1862: enabled: canMoveOrAlignSelection cg@1862: label: 'Distribute Vertical' cg@1862: itemValue: spreadSelectionVer cg@1862: translateLabel: true cg@2361: labelImage: (ResourceRetriever UIPainter iconDistributeV 'Distribute Vertical') cg@1862: ) cg@1862: ) cg@1862: nil cg@1862: nil tz@446: ) tz@446: ! tz@446: tz@446: menuEdit tz@743: "This resource specification was automatically generated tz@743: by the MenuEditor of ST/X." tz@743: tz@755: "Do not manually edit this!! If it is corrupted, tz@743: the MenuEditor may not be able to read the specification." tz@446: cg@3032: tz@446: " tz@446: MenuEditor new openOnClass:UIPainter andSelector:#menuEdit tz@446: (Menu new fromLiteralArrayEncoding:(UIPainter menuEdit)) startUp tz@446: " tz@446: tz@446: tz@446: werner@1827: ^ werner@1827: #(Menu werner@1827: ( werner@1827: (MenuItem werner@1827: activeHelpKey: editUndo werner@1827: enabled: hasUndoHistory werner@1827: label: 'Undo' werner@1827: itemValue: undoLast werner@1827: nameKey: undo werner@1827: ) werner@1827: (MenuItem werner@1827: label: '-' werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editCut cg@1991: enabled: canCutHolder werner@1827: label: 'Cut' werner@1827: itemValue: deleteSelection werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editCopy cg@1991: enabled: canCopyHolder werner@1827: label: 'Copy' werner@1827: itemValue: copySelection werner@1827: ) werner@1827: (MenuItem cg@2319: activeHelpKey: editPaste cg@1991: enabled: canPasteHolder werner@1827: label: 'Paste' werner@1827: itemValue: pasteBuffer werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: pasteWithLayout cg@1991: enabled: canPasteKeepingLayoutHolder cg@2425: label: 'Paste with Layout' cg@2370: itemValue: pasteWithLayout werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editPaste cg@1991: enabled: canPasteKeepingLayoutHolder werner@1827: label: 'Paste Keeping Absolute Position' werner@1827: itemValue: pasteKeepingPosition werner@1827: ) werner@1827: (MenuItem cg@1940: activeHelpKey: editDelete cg@1991: enabled: canCutHolder cg@1940: label: 'Delete' cg@1940: itemValue: deleteTotalSelection cg@1940: ) cg@1940: (MenuItem cg@2319: activeHelpKey: replaceBy cg@2023: enabled: canReplaceSelection cg@2426: label: 'Replace By...' cg@2023: itemValue: doAskAndReplaceWidgetBy cg@1940: ) cg@1940: (MenuItem cg@3054: activeHelpKey: wrapInto sv@3063: enabled: canWrapSelection cg@3054: label: 'Wrap Into...' cg@3054: itemValue: doAskAndWrapWidgetInto cg@3054: ) cg@3054: (MenuItem werner@1827: label: '-' werner@1827: ) werner@1827: (MenuItem werner@1827: enabled: canMoveSelection werner@1827: label: 'Move' werner@1827: submenuChannel: menuMove werner@1827: ) werner@1827: (MenuItem cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Align' cg@2361: submenuChannel: menuAlign cg@2361: ) cg@2361: (MenuItem werner@1827: enabled: hasSelection werner@1827: label: 'Dimension' werner@1827: submenu: werner@1827: (Menu werner@1827: ( werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionCopyLayout werner@1827: enabled: hasSingleSelection werner@1827: label: 'Copy Layout' werner@1827: itemValue: copyLayout werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionPasteLayout werner@1827: enabled: canMoveOrAlignSelection werner@1827: label: 'Paste Layout' werner@1827: itemValue: pasteLayout werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionExchangeLayouts werner@1827: enabled: canExchangeSelectionLayouts werner@1827: label: 'Exchange Layouts' werner@1827: itemValue: exchangeLayouts werner@1827: ) werner@1827: (MenuItem werner@1827: label: '-' werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionCopyExtent werner@1827: enabled: hasSingleSelection werner@1827: label: 'Copy Extent' werner@1827: itemValue: copyExtent werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionPasteExtent werner@1827: enabled: canMoveOrAlignSelection werner@1827: label: 'Paste Extent' werner@1827: itemValue: pasteExtent werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionPasteWidth werner@1827: enabled: canMoveOrAlignSelection werner@1827: label: 'Paste Width' werner@1827: itemValue: pasteWidth werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editDimensionPasteHeight werner@1827: enabled: canMoveOrAlignSelection werner@1827: label: 'Paste Height' werner@1827: itemValue: pasteHeight werner@1827: ) cg@2361: (MenuItem cg@2361: label: '-' cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: editDimensionDefaultExtent cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Set Default Extent' cg@2361: itemValue: setToDefaultExtent cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: editDimensionDefaultWidth cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Set Default Width' cg@2361: itemValue: setToDefaultWidth cg@2361: ) cg@2361: (MenuItem cg@2361: activeHelpKey: editDimensionDefaultHeight cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Set Default Height' cg@2361: itemValue: setToDefaultHeight cg@2361: ) werner@1827: ) werner@1827: nil werner@1827: nil cg@1230: ) werner@1827: ) werner@1827: (MenuItem werner@1827: label: '-' werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editOpenSpecDocumentation werner@1827: label: 'Open Widget Documentation' werner@1827: itemValue: doOpenWidgetDocumentation cg@3361: enabled: hasOneSelectionOtherThanCanvas werner@1827: ) werner@1827: (MenuItem cg@3032: activeHelpKey: referToConfigDatabase werner@1827: label: 'Refer to Config Database' werner@1827: itemValue: configSelection werner@1827: isVisible: false werner@1827: ) werner@1827: (MenuItem werner@1827: label: '-' werner@1827: isVisible: false werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: drawEdit werner@1827: label: 'Draw Edit' werner@1827: itemValue: shapeEdit werner@1827: isVisible: false werner@1827: ) werner@1827: (MenuItem werner@1827: label: '-' werner@1827: ) werner@1827: (MenuItem sv@2310: activeHelpKey: sortItems cg@2500: label: 'Sort Selected Items by Position' sv@2310: itemValue: doSortItems cg@3361: enabled: hasMultipleSelectionOtherThanCanvas sv@2310: ) werner@1827: (MenuItem werner@1827: activeHelpKey: groupWithLayout ca@2393: enabled: canGroup werner@1827: label: 'Group with Layout' werner@1827: itemValue: groupWithLayout werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: ungroup ca@2393: enabled: canUngroup werner@1827: label: 'Ungroup' werner@1827: itemValue: ungroup werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: ungroupWithLayout cg@3361: enabled: canUngroup werner@1827: label: 'Ungroup with Layout' werner@1827: itemValue: ungroupWithLayout werner@1827: ) werner@1827: (MenuItem werner@1827: label: '-' werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editBrowseViewClass werner@1827: enabled: hasOneSelectionOtherThanCanvas werner@1827: label: 'Browse Widget Class' werner@1827: itemValue: doBrowseViewClass werner@1827: ) werner@1827: (MenuItem werner@1827: activeHelpKey: editInspectView werner@1827: enabled: hasOneSelectionOtherThanCanvas werner@1827: label: 'Inspect Widget' werner@1827: itemValue: doInspectView werner@1827: ) werner@1827: (MenuItem sv@2310: activeHelpKey: editBrowseViewClass sv@2310: label: 'Browse Specification Class' sv@2310: itemValue: doBrowseSpecificationClass cg@3361: enabled: hasOneSelectionOtherThanCanvas sv@2310: ) sv@2310: (MenuItem werner@1827: activeHelpKey: editInspectSpec werner@1827: label: 'Inspect Spec' werner@1827: itemValue: doInspectSpec cg@3361: enabled: hasOneSelectionOtherThanCanvas cg@3032: ) cg@3032: (MenuItem cg@3032: label: '-' cg@3032: ) cg@3032: (MenuItem cg@3032: activeHelpKey: editSaveSpecForSelection cg@3032: enabled: hasOneSelectionOtherThanCanvas cg@3032: label: 'Save Spec of Selection...' cg@3032: itemValue: doSaveElementSpecAs werner@1827: ) werner@1827: ) werner@1827: nil werner@1827: nil tz@498: ) tz@498: ! tz@498: cg@2277: menuFile cg@2277: "This resource specification was automatically generated cg@2277: by the MenuEditor of ST/X." cg@2277: cg@2277: "Do not manually edit this!! If it is corrupted, cg@2277: the MenuEditor may not be able to read the specification." cg@2277: cg@2277: " cg@2277: MenuEditor new openOnClass:UIPainter andSelector:#menuFile cg@2277: (Menu new fromLiteralArrayEncoding:(UIPainter menuFile)) startUp cg@2277: " cg@2277: cg@2277: cg@2277: cg@2277: ^ cg@2277: #(Menu cg@2277: ( cg@2277: (MenuItem cg@2277: activeHelpKey: fileNew cg@2277: label: 'New' cg@2277: itemValue: doNew cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: label: '-' cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileLoad cg@2277: label: 'Load...' cg@2277: itemValue: doLoad cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileLoadSubspec cg@2277: label: 'Load Subspec...' cg@2277: itemValue: doLoadSubspec cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: label: '-' cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileSave cg@2277: label: 'Save' cg@2277: itemValue: doSave cg@2277: translateLabel: true cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileSaveAs cg@2277: label: 'Save As...' cg@2277: itemValue: doSaveAs cg@2277: translateLabel: true cg@2277: ) cg@2277: (MenuItem cg@2277: label: '-' cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileSaveAs cg@2277: label: 'Define Class and Selector...' cg@2277: itemValue: doDefineClassAndSelector cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: filePickAnInterface cg@2277: label: 'Pick a Window Spec...' cg@2277: itemValue: doPickAView cg@2277: translateLabel: true cg@2277: ) cg@2277: (MenuItem cg@2277: label: '-' cg@2277: ) cg@2277: (MenuItem cg@2277: label: 'Launch' cg@2277: itemValue: doStartApplication cg@2277: translateLabel: true cg@2277: ) cg@2277: (MenuItem cg@2277: enabled: canInstallAsWebPageHolder cg@2277: label: 'Install as WebPage' cg@2277: itemValue: doInstallAsWebPage cg@2277: translateLabel: true cg@2277: ) cg@2277: (MenuItem cg@2277: label: '-' cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileShowWindowSpec cg@2277: label: 'Show Window Spec' cg@2277: itemValue: doWindowSpec cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileBrowseClass cg@2277: enabled: hasSpecClass cg@2277: label: 'Browse Applications Class' cg@2277: itemValue: doBrowseClass cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileBrowseAspectMethods cg@2277: enabled: hasSpecClass cg@2277: label: 'Browse Applications Aspect Methods' cg@2277: itemValue: doBrowseAspectMethods cg@2277: translateLabel: true cg@2277: ) cg@2277: (MenuItem cg@2277: label: '-' cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: (MenuItem cg@2277: activeHelpKey: fileExit cg@2277: label: 'Exit' cg@2277: itemValue: closeRequest cg@2277: translateLabel: true cg@2277: isVisible: isStandAlone cg@2277: ) cg@2277: ) cg@2277: nil cg@2277: nil cg@2277: ) cg@2277: ! cg@2277: tz@498: menuMove tz@743: "This resource specification was automatically generated tz@743: by the MenuEditor of ST/X." tz@743: tz@755: "Do not manually edit this!! If it is corrupted, tz@743: the MenuEditor may not be able to read the specification." tz@498: tz@498: " tz@498: MenuEditor new openOnClass:UIPainter andSelector:#menuMove tz@498: (Menu new fromLiteralArrayEncoding:(UIPainter menuMove)) startUp tz@498: " tz@498: tz@498: tz@498: tz@498: ^ tz@498: tz@498: #(#Menu tz@498: sv@2217: #( sv@2217: #(#MenuItem sv@2217: #label: 'Up' sv@2217: #translateLabel: true sv@2217: #value: #doStepUp sv@2217: #activeHelpKey: #moveWidgetUp sv@2217: #enabled: #canChangeOrderInContainer sv@2217: #labelImage: #(#ResourceRetriever #Icon #upIcon 'Up') sv@2217: ) sv@2217: #(#MenuItem sv@2217: #label: 'Down' sv@2217: #translateLabel: true sv@2217: #value: #doStepDown sv@2217: #activeHelpKey: #moveWidgetDown sv@2217: #enabled: #canChangeOrderInContainer sv@2217: #labelImage: #(#ResourceRetriever #Icon #downIcon 'Down') sv@2217: ) sv@2217: #(#MenuItem sv@2217: #label: 'Into' sv@2217: #translateLabel: true sv@2217: #value: #doStepIn sv@2217: #activeHelpKey: #moveWidgetInto sv@2217: #enabled: #canMoveSelectionIntoContainer sv@2217: #labelImage: #(#ResourceRetriever #Icon #downRightIcon 'Into') sv@2217: ) sv@2217: #(#MenuItem sv@2217: #label: 'Out' sv@2217: #translateLabel: true sv@2217: #value: #doStepOut sv@2217: #activeHelpKey: #moveWidgetOut sv@2217: #enabled: #canMoveSelectionOutOfContainer sv@2217: #labelImage: #(#ResourceRetriever #Icon #leftDownIcon 'Out') sv@2217: ) sv@2217: ) nil sv@2217: nil tz@446: ) tz@446: ! tz@446: cg@1940: menuReplaceWidget cg@1940: "This resource specification was automatically generated cg@1940: by the MenuEditor of ST/X." cg@1940: cg@1940: "Do not manually edit this!! If it is corrupted, cg@1940: the MenuEditor may not be able to read the specification." cg@1940: cg@1940: " cg@1940: MenuEditor new openOnClass:UIPainter andSelector:#menuReplaceWidget cg@1940: (Menu new fromLiteralArrayEncoding:(UIPainter menuReplaceWidget)) startUp cg@1940: " cg@1940: cg@1940: cg@1940: cg@1940: ^ cg@1940: #(Menu cg@1940: ( cg@1940: (MenuItem cg@2319: activeHelpKey: replaceBy cg@1940: enabled: canChangeOrderInContainer cg@2426: label: 'Replace By...' cg@1940: itemValue: doAskAndReplaceWidgetBy cg@1940: translateLabel: true cg@1940: ) cg@1940: ) cg@1940: nil cg@1940: nil cg@1940: ) cg@1940: ! cg@1940: tz@446: menuToolbar tz@743: "This resource specification was automatically generated tz@743: by the MenuEditor of ST/X." tz@743: tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the MenuEditor may not be able to read the specification." tz@446: tz@446: " tz@446: MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar tz@446: (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp tz@446: " tz@446: tz@446: tz@446: cg@1690: ^ cg@1750: #(Menu cg@1750: ( cg@1750: (MenuItem cg@1750: activeHelpKey: testStartApplication cg@1750: label: 'Start' cg@1750: itemValue: doStartApplication cg@1750: translateLabel: true cg@1750: isButton: true cg@1750: labelImage: (ResourceRetriever ToolbarIconLibrary start22x22Icon) cg@1690: ) cg@1750: (MenuItem cg@2243: enabled: canInstallAsWebPageHolder cg@2243: label: 'Install as WebPage' cg@2243: itemValue: doInstallAsWebPage cg@2243: translateLabel: true cg@2243: isButton: true cg@2243: isVisible: installAsWebPageVisible cg@2243: labelImage: (ResourceRetriever XPToolbarIconLibrary installAsWebPage24x24Icon) cg@2243: ) cg@2243: (MenuItem cg@1917: label: '-' cg@1690: ) cg@1750: (MenuItem cg@1750: activeHelpKey: fileNew cg@1750: label: 'New' cg@1750: itemValue: doNew cg@1750: translateLabel: true cg@1750: isButton: true cg@2023: isVisible: isStandAlone cg@2198: labelImage: (ResourceRetriever ToolbarIconLibrary newWindowSpecIcon) cg@1690: ) cg@1750: (MenuItem cg@1950: label: '-' cg@2023: isVisible: isStandAlone cg@1950: ) cg@1950: (MenuItem cg@1750: activeHelpKey: fileLoad cg@1750: label: 'Load' cg@1750: itemValue: doLoad cg@1750: translateLabel: true cg@1750: isButton: true cg@2023: isVisible: isStandAlone cg@2198: labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon) cg@1690: ) cg@1750: (MenuItem cg@1750: activeHelpKey: fileSave cg@1750: label: 'Save' cg@1750: itemValue: doSave cg@1750: translateLabel: true cg@1750: isButton: true cg@1883: labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon) cg@1690: ) cg@1750: (MenuItem cg@1917: label: '-' cg@1917: ) cg@1917: (MenuItem cg@2500: label: 'CutCopyPaste' cg@1750: translateLabel: true cg@2500: submenuChannel: cutCopyPasteMenuSlice cg@2500: isMenuSlice: true cg@1690: ) cg@1750: (MenuItem cg@1917: label: '-' cg@1820: startGroup: right cg@1690: ) cg@1750: (MenuItem cg@1750: activeHelpKey: settingsCanvas cg@1750: label: 'Canvas' cg@1750: translateLabel: true cg@1750: indication: painterShown cg@1690: ) cg@1750: (MenuItem cg@1750: activeHelpKey: settingsGallery cg@1750: label: 'Gallery' cg@1750: translateLabel: true cg@1750: indication: galleryShown cg@1690: ) cg@1690: ) cg@1690: nil cg@1690: nil tz@713: ) tz@713: ! tz@713: tz@713: menuToolbar2 tz@743: "This resource specification was automatically generated tz@743: by the MenuEditor of ST/X." tz@743: tz@778: "Do not manually edit this!! If it is corrupted, tz@743: the MenuEditor may not be able to read the specification." tz@713: cg@3218: tz@713: " tz@713: MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar2 tz@713: (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar2)) startUp tz@713: " tz@713: tz@713: tz@713: ca@1565: ^ cg@2361: #(Menu cg@2361: ( cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionLeft cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Align Left' cg@2361: itemValue: alignSelectionLeft cg@2361: isButton: true cg@2361: labelImage: (ResourceRetriever nil iconAlignL) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionRight cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Align Right' cg@2361: itemValue: alignSelectionRight cg@2361: isButton: true cg@2361: labelImage: (ResourceRetriever nil iconAlignR) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionTop cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Align Top' cg@2361: itemValue: alignSelectionTop cg@2361: isButton: true cg@2361: labelImage: (ResourceRetriever nil iconAlignT) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionBottom cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Align Bottom' cg@2361: itemValue: alignSelectionBottom cg@2361: isButton: true cg@2361: labelImage: (ResourceRetriever nil iconAlignB) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionLeftAndRight sv@2479: enabled: canResizeSelection cg@2361: label: 'Align Left & Right' cg@2361: itemValue: alignSelectionLeftAndRight cg@2361: isButton: true cg@2361: labelImage: (ResourceRetriever nil iconResizeLR) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: alignSelectionTopAndBottom sv@2479: enabled: canResizeSelection cg@2361: label: 'Align Top & Bottom' cg@2361: itemValue: alignSelectionTopAndBottom cg@2361: isButton: true cg@2361: labelImage: (ResourceRetriever nil iconResizeTB) ca@1565: ) cg@2361: (MenuItem cg@2361: label: '' ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: changePositionLeft cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Move Left' cg@2361: itemValue: moveSelectionLeft cg@2361: isButton: true cg@2361: hideMenuOnActivated: false cg@2361: triggerOnDown: true cg@2361: labelImage: (ResourceRetriever nil arrowLeft) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: changePositionRight cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Move Right' cg@2361: itemValue: moveSelectionRight cg@2361: isButton: true cg@2361: hideMenuOnActivated: false cg@2361: triggerOnDown: true cg@2361: labelImage: (ResourceRetriever nil arrowRight) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: changePositionUp cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Move Up' cg@2361: itemValue: moveSelectionUp cg@2361: isButton: true cg@2848: hideMenuOnActivated: false cg@2361: triggerOnDown: true cg@2361: labelImage: (ResourceRetriever nil arrowUp) ca@1565: ) cg@2361: (MenuItem cg@2361: activeHelpKey: changePositionDown cg@2361: enabled: canMoveOrAlignSelection cg@2361: label: 'Move Down' cg@2361: itemValue: moveSelectionDown cg@2361: isButton: true cg@2848: hideMenuOnActivated: false cg@2361: triggerOnDown: true cg@2361: labelImage: (ResourceRetriever nil arrowDown) ca@1565: ) cg@2361: (MenuItem cg@3218: activeHelpKey: changeMoveDelta cg@3218: label: 'Move by' cg@3218: nameKey: MoveByMenu cg@3218: isButton: true cg@3218: submenu: cg@3218: (Menu cg@3218: ( cg@3218: (MenuItem cg@3218: label: '1' cg@3218: itemValue: setMoveByStep: cg@3218: argument: 1 cg@3218: ) cg@3218: (MenuItem cg@3218: label: '5' cg@3218: itemValue: setMoveByStep: cg@3218: argument: 5 cg@3218: ) cg@3218: (MenuItem cg@3218: label: '10' cg@3218: itemValue: setMoveByStep: cg@3218: argument: 10 cg@3218: ) cg@3218: (MenuItem cg@3218: label: '24' cg@3218: itemValue: setMoveByStep: cg@3218: argument: 24 cg@3218: ) cg@3218: (MenuItem cg@3218: label: '30' cg@3218: itemValue: setMoveByStep: cg@3218: argument: 30 cg@3218: ) cg@3218: (MenuItem cg@3218: label: '100' cg@3218: itemValue: setMoveByStep: cg@3218: argument: 100 cg@3218: ) cg@3218: (MenuItem cg@3218: label: '-' cg@3218: ) cg@3218: (MenuItem cg@3218: label: 'Enter Value...' cg@3218: itemValue: askForMoveByStep cg@3218: ) cg@3218: ) cg@3218: nil cg@3218: nil cg@3218: ) cg@3218: labelImage: (ResourceRetriever UIPainter delta) cg@3218: ) cg@3218: (MenuItem cg@2361: activeHelpKey: editOpenSpecDocumentation cg@2361: label: 'Widget Documentation' cg@2361: itemValue: doOpenWidgetDocumentation cg@2361: isButton: true cg@2361: startGroup: right cg@2361: labelImage: (ResourceRetriever Icon helpIcon) ca@1565: ) ca@1565: ) ca@1565: nil ca@1565: nil ca@217: ) cg@2500: ! cg@2500: cg@2500: moveInListMenuSlice cg@2500: "This resource specification was automatically generated cg@2500: by the MenuEditor of ST/X." cg@2500: cg@2500: "Do not manually edit this!! If it is corrupted, cg@2500: the MenuEditor may not be able to read the specification." cg@2500: cg@2500: " cg@2500: MenuEditor new openOnClass:UIPainter andSelector:#editToolbar cg@2500: (Menu new fromLiteralArrayEncoding:(UIPainter editToolbar)) startUp cg@2500: " cg@2500: cg@2500: cg@2500: cg@2500: ^ cg@2500: #(Menu cg@2500: ( cg@2500: (MenuItem cg@2500: activeHelpKey: moveWidgetUp cg@2500: enabled: canChangeOrderInContainer cg@2500: label: 'Move Up' cg@2500: itemValue: doStepUp cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetUpIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: moveWidgetDown cg@2500: enabled: canChangeOrderInContainer cg@2500: label: 'Move Down' cg@2500: itemValue: doStepDown cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetDownIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: moveWidgetInto cg@2500: enabled: canMoveSelectionIntoContainer cg@2500: label: 'Move Into' cg@2500: itemValue: doStepIn cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetDownRightIcon) cg@2500: ) cg@2500: (MenuItem cg@2500: activeHelpKey: moveWidgetOut cg@2500: enabled: canMoveSelectionOutOfContainer cg@2500: label: 'Move Out' cg@2500: itemValue: doStepOut cg@2500: translateLabel: true cg@2500: isButton: true cg@2500: labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetLeftDownIcon) cg@2500: ) cg@2500: ) cg@2500: nil cg@2500: nil cg@2500: ) tz@446: ! ! tz@446: sv@3111: !UIPainter class methodsFor:'private class access'! sv@3111: sv@3111: applicationClassQuery sv@3111: ^ ApplicationClassQuery sv@3111: ! ! sv@3111: cg@60: !UIPainter methodsFor:'aspects'! cg@60: cg@2500: alignToGridHolder cg@2500: |holder| cg@2500: cg@2500: (holder := builder bindingAt:#alignToGridHolder) isNil ifTrue:[ cg@2500: holder := (self class settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue. cg@2500: builder aspectAt:#alignToGridHolder put: holder. cg@2500: holder addDependent:self. cg@2500: ]. cg@2500: ^ holder cg@2500: ! cg@2500: tz@724: aspectFor:aKey cg@2361: "returns the aspect for aKey or nil" cg@2361: cg@2361: ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] tz@724: ! tz@724: tz@565: canChangeOrderInContainer tz@765: "returns a boolean value holder which is true if the widget order can be changed tz@765: within their container" tz@765: tz@565: ^ builder booleanValueAspectFor:#canChangeOrderInContainer tz@565: ! tz@565: cg@1230: canExchangeSelectionLayouts cg@1230: "returns a boolean value holder which is true in case that the selection cg@1230: consists of exactly 2 components cg@1230: and all widgets in the selection can change its layout through to a move or cg@1230: align operation" cg@1230: cg@1230: ^ builder booleanValueAspectFor:#canExchangeSelectionLayouts cg@1230: ! cg@1230: cg@2243: canInstallAsWebPage cg@3060: ^ specClass notNil cg@3060: and:[ specClass isSubclassOf:WebApplicationModel ] cg@2243: cg@2243: "Created: / 14-01-2008 / 17:34:56 / cg" cg@2243: ! cg@2243: cg@2243: canInstallAsWebPageHolder cg@3060: ^ builder cg@3061: valueAspectFor:#canInstallAsWebPageHolder cg@3060: initialValue:(self canInstallAsWebPage). cg@2243: cg@2243: "Created: / 14-01-2008 / 17:36:04 / cg" cg@2243: ! cg@2243: ca@282: canMoveOrAlignSelection ca@282: "returns a boolean value holder which is true in case that any selection exists cg@2552: and all widgets in the selection can change their layout through to a move or tz@765: align operation" tz@765: ca@282: ^ builder booleanValueAspectFor:#canMoveOrAlignSelection ca@222: ! ca@222: tz@755: canMoveSelection cg@2361: "true if move-in/move-out/move-up and down are enabled" cg@2361: cg@3361: treeView hasOneSelectionOtherThanCanvas ifFalse:[^ false]. cg@2361: ^ self canChangeOrderInContainer value cg@2361: or: [ self canMoveSelectionOutOfContainer value cg@2361: or: [ self canMoveSelectionIntoContainer value ]] tz@755: ! tz@755: ca@282: canMoveSelectionIntoContainer cg@2552: "returns true in case that at least one widget is selected and can change its container sv@2280: widget to an element below" tz@765: ca@282: ^ builder booleanValueAspectFor:#canMoveSelectionIntoContainer ca@282: ! ca@282: ca@282: canMoveSelectionOutOfContainer cg@2552: "returns a boolean value holder which is true in case that at least one widget is selected tz@765: which is contained within another component" tz@765: ca@282: ^ builder booleanValueAspectFor:#canMoveSelectionOutOfContainer ca@222: ! ca@222: sv@2313: canPasteHolder cg@1991: cg@1991: |holder| sv@2313: (holder := builder bindingAt:#canPasteHolder) isNil ifTrue:[ sv@2313: holder := [ self canPaste ]. cg@1991: ]. cg@1991: ^ holder cg@1991: ! cg@1991: sv@2313: canPasteKeepingLayoutHolder sv@2313: ^ self canPasteHolder sv@2313: ! sv@2313: cg@1940: canReplaceSelection cg@3361: treeView hasOneSelectionOtherThanCanvas ifFalse:[^ false]. cg@1940: ^ true cg@1940: ! cg@1940: cg@2552: canResizeSelection cg@2552: "returns a boolean value holder which is true in case that any selection exists cg@2552: and all widgets in the selection can be resized" cg@2552: cg@2552: ^ builder booleanValueAspectFor:#canResizeSelection cg@2552: ! cg@2552: cg@3054: canWrapSelection cg@3361: treeView hasOneSelectionOtherThanCanvas ifFalse:[^ false]. cg@3054: ^ true cg@3054: ! cg@3054: cg@2500: editToolBarVisibleHolder cg@2500: |holder| cg@2500: cg@2500: (holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[ cg@2500: holder := self class defaultEditToolbarVisible asValue. cg@2500: builder aspectAt:#editToolBarVisibleHolder put: holder. cg@2500: holder addDependent:self. cg@2500: ]. cg@2500: ^ holder cg@2500: ! cg@2500: ca@118: enableChannel cg@2012: "true if modifications are allowed otherwise in test mode" cg@2012: cg@2012: ^ builder valueAspectFor:#enableChannel initialValue:true cg@2012: ! cg@2012: cg@2012: enableChannel2 tz@765: "true if modifications are allowed otherwise running test" tz@765: tz@765: ^ self painter enableChannel ca@109: ! ca@109: ca@173: galleryShown tz@765: "returns a boolean value holder which is set to true if the gallery is shown" tz@765: ca@173: |holder| ca@173: ca@173: (holder := builder bindingAt:#galleryShown) isNil ifTrue:[ sv@2217: builder aspectAt:#galleryShown put:(holder := true asValue). sv@2217: holder addDependent:self ca@173: ]. ca@173: ^ holder ca@173: ca@173: ! ca@173: cg@2500: gridShownHolder cg@2500: |holder| cg@2500: cg@2500: (holder := builder bindingAt:#gridShownHolder) isNil ifTrue:[ cg@2500: holder := (self class settings at: #GridShown ifAbsent: [painter gridShown]) asValue. cg@2500: builder aspectAt:#gridShownHolder put: holder. cg@2500: holder addDependent:self. cg@2500: ]. cg@2500: ^ holder cg@2500: ! cg@2500: cg@3361: hasMultipleSelectionOtherThanCanvas cg@3361: "returns a value holder which is true in case that multiple widget other than the root are selected" cg@3361: cg@3361: ^ builder booleanValueAspectFor:#hasMultipleSelectionOtherThanCanvas cg@3361: ! cg@3361: ca@282: hasOneSelectionOtherThanCanvas tz@765: "returns a value holder which is true in case that one widget is selected tz@765: other than the root" tz@765: ca@282: ^ builder booleanValueAspectFor:#hasOneSelectionOtherThanCanvas ca@222: ! ca@222: cg@3361: hasSelectionOtherThanCanvas cg@3361: "returns a value holder which is true in case that any widget other than the root is selected" cg@3361: cg@3361: ^ builder booleanValueAspectFor:#hasSelectionOtherThanCanvas cg@3361: ! cg@3361: cg@1917: hasUndoHistory cg@1917: ^ self painter hasUndoHistory cg@1917: ! cg@1917: cg@1954: hasUndoHistoryHolder cg@1954: ^ self painter hasUndoHistoryHolder cg@1954: ! cg@1954: cg@2243: installAsWebPageVisible cg@2243: ^ true cg@2243: cg@2243: "Created: / 14-01-2008 / 17:46:05 / cg" cg@2243: ! cg@2243: ca@109: noteBookView tz@765: "returns the notebook view; initialize the tools embedded in the notebook" tz@765: ca@2159: |noteBook| ca@109: ca@109: (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ ca@1316: noteBook := View new. ca@1316: builder aspectAt:#noteBookView put:noteBook. ca@1316: ca@2159: layoutTool := self createToolApplication:UILayoutTool spec:#windowSpec in:noteBook. ca@2159: helpTool := self createToolApplication:UIHelpTool spec:#innerSpec in:noteBook. ca@2159: specTool := self createToolApplication:UISpecificationTool spec:#windowSpec in:noteBook. ca@2159: cg@2072: helpTool loadFromClass:specClass. ca@109: ]. ca@109: ^ noteBook cg@2072: cg@2072: "Modified: / 31-08-2006 / 10:11:15 / cg" ca@109: ! ca@109: ca@282: painterShown tz@765: "returns a boolean value holder which is set to true if the painter is shown" tz@765: ca@173: |holder| ca@173: ca@173: (holder := builder bindingAt:#painterShown) isNil ifTrue:[ sv@2217: builder aspectAt:#painterShown put:(holder := true asValue). sv@2217: holder addDependent:self ca@173: ]. ca@173: ^ holder ca@173: ca@173: ! ca@173: ca@109: tabList tz@765: "returns a value holder which keeps a list of the section labels in the notebook" tz@765: cg@1782: |tabs holder| ca@109: ca@109: (holder := builder bindingAt:#tabList) isNil ifTrue:[ cg@1782: tabs := #(Basics Details Layout). cg@1782: builder aspectAt:#tabList put:(holder := (resources array:tabs) asValue). ca@109: ]. ca@109: ^ holder ca@109: ! ca@109: ca@109: tabModel tz@765: "returns a value holder which keeps the label of the current section in the notebook" tz@765: ca@109: |holder| ca@109: ca@109: (holder := builder bindingAt:#tabModel) isNil ifTrue:[ sv@2217: holder := AspectAdaptor new subject:self; forAspect:#tabSelection. sv@2217: builder aspectAt:#tabModel put:holder. ca@109: ]. ca@109: ^ holder ca@222: ! ca@222: cg@2500: toolBarVisibleHolder cg@2500: |holder| cg@2500: cg@2500: (holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[ cg@2500: holder := self class defaultToolbarVisible asValue. cg@2500: builder aspectAt:#toolBarVisibleHolder put: holder. cg@2500: holder addDependent:self. cg@2500: ]. cg@2500: ^ holder cg@2500: ! cg@2500: ca@222: treeView tz@765: "returns the tree view which holds all widget" tz@765: ca@222: ^ treeView tz@729: ! tz@729: tz@729: valueOfCanPasteWithKeepingLayout sv@2310: cg@1991: self obsoleteMethodWarning:'stupid name - use #canPasteKeepingLayoutHolder'. cg@1991: ^ self canPasteKeepingLayoutHolder cg@60: ! ! cg@60: sv@587: !UIPainter methodsFor:'building editors'! ca@513: ca@2559: XXopenDataSetColumnEditor tz@765: "opens a Table Column Editor on current widget" tz@765: ca@2559: |cls editor specTool columnHolder tableSelector columns isEditingSpecOnly| ca@2559: ca@2559: isEditingSpecOnly := self isEditingSpecOnly. ca@2559: ca@2559: isEditingSpecOnly ifFalse:[ cg@2296: (cls := self resolveName:specClassName) isNil ifTrue:[ cg@2296: self askForSaving ifTrue:[cls := self resolveName:specClassName]. cg@2296: ]. cg@2296: cls isNil ifTrue:[^ self]. cg@1103: ]. ca@1453: cg@2243: self acceptOrIgnoreSectionModification. tz@743: ca@1453: editor := DataSetBuilder new. cg@2551: editor masterApplication:self. ca@1453: specTool := self specTool. ca@1453: ca@2559: isEditingSpecOnly ifFalse:[ cg@2296: editor specClass: cls. cg@2296: editor rowClassName:(specTool specification rowClassName). cg@2296: ]. ca@1453: columnHolder := specTool aspectFor:#columnHolder. ca@1453: tableSelector := columnHolder value. ca@1453: cg@2551: tableSelector := tableSelector notEmptyOrNil cg@2551: ifTrue:[tableSelector asSymbol] cg@2551: ifFalse:[nil]. ca@1453: ca@2559: (isEditingSpecOnly not cg@2296: and:[tableSelector notNil cg@2296: and:[cls class includesSelector:tableSelector]]) ifTrue:[ ca@1453: editor openModalOnClass:cls andSelector:tableSelector ca@1453: ] ifFalse:[ cg@2551: editor editingSpecOnly:true. cg@2551: ca@1453: columns := specTool specification columns. ca@1453: columns size ~~ 0 ifTrue:[ ca@1453: editor openModalOnResourceSpec:columns ca@1453: ] ifFalse:[ ca@1453: editor openModal cg@2551: ]. tz@827: ]. tz@827: ca@2559: isEditingSpecOnly ifFalse:[ cg@2551: editor hasSaved ifTrue:[ cg@2551: specTool specification cg@2551: columns:nil; cg@2551: rowClassName:(editor rowClassName). cg@2551: cg@2551: tableSelector = editor specSelector ifFalse:[ cg@2551: columnHolder value:(editor specSelector). cg@2551: self accept. cg@2551: ]. cg@2551: ^ self ca@1453: ]. tz@827: ]. tz@827: cg@2551: tableSelector isNil ifTrue:[ cg@2551: editor hasSaved ifTrue:[ cg@2551: editor modified ifFalse:[ cg@2551: specTool specification cg@2551: columns:(editor acceptedColumns); cg@2551: rowClassName:(editor rowClassName). cg@2551: self modifiedChannel value:true. cg@2551: ]. cg@2551: ]. tz@827: ]. cg@2243: cg@2243: "Modified: / 12-01-2008 / 10:31:47 / cg" ca@513: ! ca@513: ca@2559: openDataSetColumnEditor ca@2559: "opens a Table Column Editor on current widget" ca@2559: ca@2559: |cls editor specTool columnHolder tableSelector columns isEditingSpecOnly| ca@2559: ca@2559: self isModified ifTrue:[ ca@2559: "/ force editFields to accept ca@2559: self acceptChannel value:true; value:false. ca@2559: ]. ca@2559: ca@2559: specTool := self specTool. ca@2559: columnHolder := specTool aspectFor:#columnHolder. ca@2559: tableSelector := columnHolder value. ca@2559: ca@2559: tableSelector notEmptyOrNil ifTrue:[ ca@2559: tableSelector := tableSelector asSymbol. ca@2559: ] ifFalse:[ ca@2559: tableSelector := nil. ca@2559: ]. ca@2559: ca@2559: isEditingSpecOnly := true. ca@2559: ca@2559: (tableSelector notNil and:[self isEditingSpecOnly not]) ifTrue:[ ca@2559: (cls := self resolveName:specClassName) notNil ifTrue:[ ca@2559: isEditingSpecOnly := false. ca@2559: ]. ca@2559: ]. ca@2559: editor := DataSetBuilder new. ca@2559: editor masterApplication:self. ca@2559: ca@2559: isEditingSpecOnly ifFalse:[ ca@2559: editor specClass:cls. ca@2559: editor rowClassName:(specTool specification rowClassName). ca@2559: ]. ca@2559: cg@2768: isEditingSpecOnly ifFalse:[ ca@2559: editor openModalOnClass:cls andSelector:tableSelector. ca@2559: ca@2559: editor hasSaved ifTrue:[ ca@2559: specTool specification ca@2559: columns:nil; ca@2559: rowClassName:(editor rowClassName). ca@2559: ca@2559: tableSelector = editor specSelector ifFalse:[ ca@2559: columnHolder value:(editor specSelector). ca@2559: self accept. ca@2559: ]. ca@2559: ]. ca@2559: ^ self ca@2559: ]. ca@2559: ca@2559: editor editingSpecOnly:true. ca@2559: ca@2559: columns := specTool specification columns. ca@2559: ca@2559: columns size ~~ 0 ifTrue:[ ca@2559: editor openModalOnResourceSpec:columns ca@2559: ] ifFalse:[ ca@2559: editor openModal ca@2559: ]. ca@2559: ca@2559: editor hasSaved ifTrue:[ ca@2559: columnHolder value:nil. ca@2559: ca@2559: specTool specification ca@2559: columns:(editor acceptedColumns); ca@2559: rowClassName:(editor rowClassName). ca@2559: ca@2559: columnHolder value:nil. ca@2559: self modifiedChannel value:true. ca@2559: ]. ca@2559: ! ca@2559: ca@513: openEditMenu cg@2967: "opens a Menu Editor on current widget for the standard menu cg@2967: (accessed via #menu or #menuSelector)" cg@2967: cg@2967: ^ self cg@2967: openEditMenuFor:#menu cg@2967: and:#menuSelector cg@2967: ! cg@2967: cg@2967: openEditMenuFor:menuSelector and:menuSelectorSelector cg@2967: "opens a Menu Editor on the current widget. cg@2967: The arguments menuSelector (typically: #menu) cg@2967: and menuSelectorSelector (typically: #menuSelector) can be passed in cg@2967: for widgets with a secondary menu (with different selectors)" tz@765: cg@2568: |cls selectorOrMenu editor selectedSpec windowSpec holder| cg@2568: cg@2568: self isEditingSpecOnly ifFalse:[ cg@2568: "/ normal mode cg@2568: (cls := self resolveName:specClassName) isNil ifTrue:[ cg@2568: self askForSaving ifTrue:[cls := self resolveName:specClassName]. cg@2568: ]. cg@2568: cls isNil ifTrue:[^ self]. cg@2568: ]. ca@1453: cg@2243: self acceptOrIgnoreSectionModification. cg@2568: windowSpec := self specTool specification. cg@2568: cg@2568: self isEditingSpecOnly ifTrue:[ cg@2967: selectorOrMenu := windowSpec perform:menuSelector ca@1453: ] ifFalse:[ cg@2967: (selectorOrMenu := (windowSpec perform:menuSelectorSelector)) notNil ifTrue:[ cg@2568: selectorOrMenu := selectorOrMenu asSymbol cg@2568: ] ifFalse:[ cg@2568: "/ cg: q&d hack ... cg@2568: selectorOrMenu := nil. cg@2568: cg@2568: (selectedSpec := treeView propertySelected) notNil ifTrue:[ cg@2568: Error handle:[:ex | cg@2568: selectorOrMenu := nil. cg@2568: ] do:[ cg@2568: selectorOrMenu := selectedSpec view asMenu. cg@2568: ] cg@2568: ]. ca@1453: ]. ca@1453: ]. ca@1453: ca@1453: editor := MenuEditor new. ca@1453: editor masterApplication:self. cg@2568: self isEditingSpecOnly ifFalse:[ cg@2568: editor specClass: cls. cg@2568: editor useHelpTool:(self helpTool). cg@2568: ]. cg@2568: cg@2568: (self isEditingSpecOnly or:[selectorOrMenu class == Menu]) ifTrue: [ cg@2568: editor openModalOnMenu:(selectorOrMenu). cg@2568: editor hasSaved ifTrue:[ cg@3094: windowSpec perform:menuSelector asMutator with:(editor savedSpec). cg@2568: self accept. cg@2568: ]. cg@2568: ] ifFalse: [ cg@2568: editor openModalOnClass:cls andSelector:selectorOrMenu. cg@2568: editor hasSaved ifTrue:[ cg@2967: holder := self specTool aspectFor:menuSelector. cg@2568: holder value:(editor specSelector). cg@2568: self accept. cg@2568: ]. ca@1453: ]. cg@2243: cg@2243: "Modified: / 12-01-2008 / 10:31:41 / cg" ca@513: ! ca@513: ca@513: openHierarchicalListEditor tz@765: "opens a Hierarchical List Editor on current widget" tz@765: cg@892: |selector editor spec| tz@765: cg@1983: (self resolveName:specClassName) isNil ifTrue:[ sv@2217: self askForSaving ifFalse: [^self] ca@513: ]. ca@513: cg@892: spec := self specTool specification. cg@892: (selector := spec hierarchicalList) notNil ifTrue:[ sv@2217: selector := selector asSymbol ca@513: ]. tz@735: ca@513: editor := HierarchicalListEditor new. ca@513: editor masterApplication:self. cg@1983: editor openModalOnClass:specClassName andSelector:selector. tz@765: tz@765: editor specSelector ~= selector ifTrue:[ sv@2217: editor hasSaved ifTrue:[ sv@2217: spec hierarchicalList:editor specSelector. sv@2217: self modifiedChannel value:true. sv@2217: self accept sv@2217: ] ca@513: ] cg@892: cg@892: "Modified: / 16.7.1998 / 18:15:46 / cg" ca@513: ! ca@513: cg@3241: openSubSpecBrowser cg@3241: "opens a browser on the current subspecification" cg@3241: cg@3241: self withSpecClassAndSelectorDo:[:cls :sel | cg@3241: cls theMetaclass browse:sel. cg@3241: ]. cg@3241: ! cg@3241: tz@729: openSubSpecGUIPainter sv@609: "opens a GUI Painter on the current subspecification" sv@609: cg@3241: self withSpecClassAndSelectorDo:[:cls :sel | cg@3241: self class cg@3241: openOnClass:cls theMetaclass soleInstance cg@3241: andSelector:sel. cg@3241: ]. cg@1523: cg@1523: "Modified: / 5.11.2001 / 16:51:46 / cg" sv@609: ! sv@609: tz@743: openTabListEditor tz@765: "opens a Tab List Editor on current widget" tz@765: ca@1453: |selector editor spec cls holder| ca@1453: cg@1983: (cls := self resolveName:specClassName) isNil ifTrue:[ cg@1983: self askForSaving ifTrue:[cls := self resolveName:specClassName]. ca@513: ]. ca@1453: cls isNil ifTrue:[^ self]. ca@1453: cg@2243: self acceptOrIgnoreSectionModification. cg@892: spec := self specTool specification. ca@1453: cg@892: (selector := spec listSelector) isArray ca@1453: ifTrue: [^self warn: 'Cannot open the Tab List Editor on an array!!']. tz@743: tz@743: editor := TabListEditor new. ca@513: editor masterApplication:self. ca@1453: editor openModalOnClass:cls andSelector:selector. ca@1453: ca@1453: editor hasSaved ifTrue:[ ca@1453: holder := self specTool aspectFor:#listSelector. ca@1453: ca@1453: holder value ~= editor specSelector ifTrue:[ ca@1453: holder value:editor specSelector. ca@1453: self accept. ca@1453: ] ca@1453: ]. cg@2243: cg@2243: "Modified: / 12-01-2008 / 10:31:34 / cg" cg@3241: ! cg@3241: cg@3241: withSpecClassAndSelectorDo:aTwoArgBlock cg@3241: "helper for open GUI Painter/open Browser on the current subspecification" cg@3241: cg@3241: |spec cls meta sel| cg@3241: cg@3241: (self resolveName:specClassName) isNil ifTrue:[ cg@3241: self askForSaving ifFalse: [^self] cg@3241: ]. cg@3241: cg@3241: spec := self specTool specification. cg@3241: cls := spec majorKey. cg@3241: cls isNil ifTrue:[ cg@3241: cls := specClassName. cg@3241: ]. cg@3241: (cls := self resolveName:cls inClass:(Smalltalk at: specClassName asSymbol)) isNil ifTrue:[ cg@3241: spec majorKey isNil ifTrue:[ cg@3241: ^ self warn:'Cannot find class (no majorKey specified).'. cg@3241: ]. cg@3251: ^ self warn:('Cannot find class ', spec majorKey allBold, '.'). cg@3241: ]. cg@3241: sel := spec minorKey. cg@3241: meta := cls class whichClassIncludesSelector:sel. cg@3241: meta isNil ifTrue:[ cg@3251: ^ self warn:'Cannot find selector #', (sel ? '') allBold, ' in class ', cls name allBold, '!!' cg@3241: ]. cg@3241: cg@3241: aTwoArgBlock value:meta value:spec minorKey. ca@513: ! ! ca@513: ca@109: !UIPainter methodsFor:'change & update'! ca@109: ca@222: layoutChanged ca@282: "called by the painter/canvas whenever the layout of the current selected tz@765: widget has changed" tz@765: ca@272: self isModified ifFalse:[ cg@1188: self layoutTool update. cg@1188: self clearModifiedFlag ca@222: ] ca@222: ! ca@222: ca@272: propertyChanged ca@282: "called by the painter/canvas whenever the property of the current selected tz@765: widget has changed" tz@765: cg@1071: |property spec| tz@765: tz@765: (property := treeView propertySelected) notNil ifTrue:[ cg@1188: spec := property spec copy. cg@1188: self specTool specification:spec. cg@1188: self setViewInLayoutTool:(property view) spec:spec. cg@1188: self clearModifiedFlag ca@272: ] ifFalse:[ cg@1188: self layoutTool layoutView notNil ifTrue:[ cg@1188: self clearModifiedFlag. cg@1710: self treeSelectionChanged cg@1188: ] ca@272: ] ca@222: ! ca@222: cg@2500: toolBarVisibilityChanged cg@2500: |toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset| cg@2500: cg@2500: topOffset := 0. cg@2500: cg@2500: toolBar := self componentAt:#ToolBar. cg@2500: toolBar notNil ifTrue:[ cg@2500: toolBarVisible := self toolBarVisibleHolder value. cg@2500: DefaultToolBarVisible := toolBarVisible. cg@2500: toolBarVisible ifTrue:[ cg@2500: topOffset := topOffset + toolBar height. cg@2500: ] cg@2500: ]. cg@2500: cg@2500: editToolBar := self componentAt:#EditToolBar. cg@2500: editToolBar notNil ifTrue:[ cg@2500: editToolBar layout cg@2500: topOffset:topOffset bottomOffset:(topOffset + editToolBar height). cg@2500: "/ force it to recompute its dimension cg@2500: editToolBar container notNil ifTrue:[ cg@2500: editToolBar containerChangedSize. cg@2500: ]. cg@2500: editToolBarVisible := self editToolBarVisibleHolder value. cg@2500: DefaultEditToolBarVisible := editToolBarVisible. cg@2500: editToolBarVisible ifTrue:[ cg@2500: topOffset := topOffset + editToolBar height. cg@2500: ] cg@2500: ]. cg@2500: cg@2500: noteBook := self componentAt:#Painter. cg@2500: noteBook notNil ifTrue:[ cg@2500: noteBook layout topOffset:topOffset. cg@2500: "/ force it to recompute its dimension cg@2500: noteBook container notNil ifTrue:[ cg@2500: noteBook containerChangedSize. cg@2500: ]. cg@2500: ]. cg@2500: cg@2500: "Created: / 18-02-2007 / 14:46:22 / cg" cg@2500: ! cg@2500: cg@2500: update:something with:aParameter from:changedObject tz@765: "catches change notifications" tz@765: cg@1710: |window lbl| cg@892: cg@2500: ((changedObject == self toolBarVisibleHolder) cg@2500: or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[ cg@2500: self toolBarVisibilityChanged. cg@2500: ^ self cg@2500: ]. cg@2500: changedObject == self gridShownHolder ifTrue:[ cg@2500: self class settings at: #GridShown put: changedObject value. cg@2500: painter gridShown:changedObject value. cg@2500: ^ self cg@2500: ]. cg@2500: changedObject == self alignToGridHolder ifTrue:[ cg@2500: self class settings at: #GridAlign put: changedObject value. cg@2500: painter gridAlign:changedObject value. cg@2500: ^ self cg@2500: ]. cg@2500: cg@2500: changedObject == treeView model ifTrue:[ cg@1710: (something == #selection cg@1710: or:[something == #selectionIndex]) ifTrue:[self treeSelectionChanged]. cg@2198: ^ self ca@173: ]. ca@173: cg@2500: changedObject == self galleryShown ifTrue:[ cg@1710: "/ galleryShown toggle changed cg@1710: window := selectionPanel window. cg@2500: (changedObject value) ifTrue:[ cg@1710: self raiseUIView:window cg@1710: ] ifFalse:[ cg@1710: self hideUIView:window cg@1710: ]. cg@2198: ^ self ca@173: ]. ca@173: cg@2500: changedObject == self painterShown ifTrue:[ cg@1710: "/ canvasShown toggle changed cg@1710: window := self painter topView. cg@2500: (changedObject value) ifTrue:[ cg@1710: self raiseUIView:window cg@1710: ] ifFalse:[ cg@1710: self hideUIView:window cg@1710: ]. cg@2198: ^ self ca@173: ]. ca@173: cg@2500: changedObject == self autoAcceptOnSelectionChange ifTrue:[ cg@2500: lbl := changedObject value ifTrue:['Apply'] ifFalse:['OK']. cg@1710: (builder componentAt:'acceptButton') label:(resources string:lbl). cg@1710: ^ self cg@1710: ]. cg@1710: cg@892: "Modified: / 16.7.1998 / 19:09:57 / cg" tz@884: ! tz@884: tz@884: updateChannels tz@884: "updates the channels" tz@884: sv@2313: |canCutOrCopy| tz@884: cg@3108: treeView isNil ifTrue:[^ self]. cg@3108: tz@884: self canMoveOrAlignSelection value:(treeView canMoveOrAlignSelection). cg@2552: self canResizeSelection value:(treeView canResizeSelection). cg@1230: self canExchangeSelectionLayouts value:(treeView canExchangeSelectionLayouts). tz@884: self canChangeOrderInContainer value:(treeView canChangeOrderInContainer). tz@884: self canMoveSelectionIntoContainer value:(treeView canMoveSelectionIntoContainer). tz@884: self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer). tz@884: self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas). cg@3361: self hasSelectionOtherThanCanvas value:(treeView hasSelectionOtherThanCanvas). cg@3361: self hasMultipleSelectionOtherThanCanvas value:(treeView hasMultipleSelectionOtherThanCanvas). cg@3361: sv@2313: "/ the top-node cannot be cut, copied or pasted. sv@2313: canCutOrCopy := treeView selection notEmptyOrNil and:[treeView selection first ~~ 1]. tz@884: cg@1991: self canCutHolder value: canCutOrCopy. cg@1991: self canCopyHolder value: canCutOrCopy. cg@892: cg@1063: "/ self modifiedChannel value: false. cg@1063: cg@892: "Modified: / 16.7.1998 / 19:13:30 / cg" ca@109: ! ! ca@109: cg@952: !UIPainter methodsFor:'defaults'! cg@952: cg@2541: defaultNameOfCanvas cg@2541: ^ self class defaultNameOfCanvas cg@2541: ! cg@2541: cg@1466: defaultWindowSpecClass cg@1466: ^ WindowSpec cg@952: ! ! cg@952: ca@109: !UIPainter methodsFor:'event handling'! ca@109: ca@109: doesNotUnderstand:aMessage cg@1940: "forward misunderstood messages to the painter" ca@282: ca@282: |painter| ca@282: ca@282: painter := self painter. ca@282: ca@282: (painter respondsTo:(aMessage selector)) ifTrue:[ cg@1940: ^ aMessage sendTo:painter ca@282: ]. ca@282: super doesNotUnderstand:aMessage ca@282: cg@1957: ! cg@1957: cg@1957: processEvent:anEvent cg@1957: "filter keyboard events. cg@1957: Return true, if I have eaten the event" cg@1957: cg@2947: cg@2947: cg@1957: |key| cg@1957: cg@1957: anEvent isKeyPressEvent ifTrue:[ cg@1957: anEvent targetView == treeView ifFalse:[^ false]. cg@1957: treeView hasFocus ifFalse:[^ false]. cg@1957: cg@1957: key := anEvent key. cg@1957: cg@1957: "/ (anEvent rawKey == #Cmdr) ifTrue:[ cg@1957: "/ self openNameEditorOnTreeSelection. cg@1957: "/ ^ true. cg@1957: "/ ]. cg@1957: (anEvent rawKey == #CtrlCursorUp) ifTrue:[ cg@1957: self doStepUp. cg@1957: ^ true. cg@1957: ]. cg@1957: (anEvent rawKey == #CtrlCursorDown) ifTrue:[ cg@1957: self doStepDown. cg@1957: ^ true. cg@1957: ]. cg@1957: (anEvent rawKey == #CtrlCursorLeft) ifTrue:[ cg@1957: self doStepOut. cg@1957: ^ true. cg@1957: ]. cg@1957: (anEvent rawKey == #CtrlCursorRight) ifTrue:[ cg@1957: self doStepIn. cg@1957: ^ true. cg@1957: ]. cg@1957: ]. cg@1957: cg@1957: ^ false. ca@282: ! ! ca@282: tz@547: !UIPainter methodsFor:'help'! tz@547: tz@572: defaultInfoLabel tz@765: "returns the default info label" tz@572: cg@2072: specClassName isNil ifTrue: [^'No class defined.']. cg@877: specSelector isNil ifTrue: [^'No selector defined.']. cg@2001: ^ specClassName printString, ' >> ', specSelector cg@877: cg@2072: "Modified: / 31-08-2006 / 10:12:03 / cg" ca@297: ! ! ca@297: cg@2353: !UIPainter methodsFor:'help specs'! cg@1917: cg@2544: basicHelpTextFromSpecification:specification forKey:aKey cg@2544: "redefinable, to allow for subclasses to overwrite the helpTexts of the ui-spec" cg@2544: cg@2544: ^ specification helpSpec at:aKey ifAbsent:nil cg@2544: ! cg@2544: cg@1917: flyByHelpSpec cg@3218: |spec painter| cg@3218: cg@3218: painter := self painter. cg@1917: cg@1917: spec := self class flyByHelpSpec. cg@1917: spec at:#editUndo put:(resources string:'Undo (%1)' cg@3218: with:(resources string:painter undoHistory labelOfLastUndo)). cg@3218: cg@3218: spec at:#changePositionDown put:(resources string: cg@3218: (spec at:#changePositionDown) with:painter nPixelsForMoveSelection). cg@3218: cg@3218: spec at:#changePositionLeft put:(resources string: cg@3218: (spec at:#changePositionLeft) with:painter nPixelsForMoveSelection). cg@3218: cg@3218: spec at:#changePositionRight put:(resources string: cg@3218: (spec at:#changePositionRight) with:painter nPixelsForMoveSelection). cg@3218: cg@3218: spec at:#changePositionUp put:(resources string: cg@3218: (spec at:#changePositionUp) with:painter nPixelsForMoveSelection). cg@3218: cg@1917: ^ spec cg@1917: ! cg@1917: cg@1917: helpSpec cg@1917: |spec| cg@1917: cg@1917: spec := self class helpSpec. cg@1917: spec at:#editUndo put:(resources string:'Undo (%1)' cg@1917: with:(resources string:self painter undoHistory labelOfLastUndo)). cg@1917: ^ spec cg@1917: ! ! cg@1917: cg@2023: !UIPainter methodsFor:'initialization'! cg@2023: cg@2500: hideToolBarButtonCreated:aButton cg@2500: aButton passiveLevel:(MenuPanel defaultLevel). cg@2500: "/ aButton passiveLevel:1. cg@2500: aButton activeLevel:-1. cg@2500: aButton backgroundColor:(MenuPanel defaultBackgroundColor). cg@2500: ! cg@2500: cg@2023: initialize cg@2213: |name scroller viewScroller| cg@2023: cg@2023: super initialize. cg@2023: cg@2023: modified := false. cg@2500: cg@2023: aspects := IdentityDictionary new. cg@2023: aspects at:#classNameChannel put:'NewApplication' asValue. cg@2023: aspects at:#superclassNameChannel put:'ApplicationModel' asValue. cg@2023: aspects at:#methodNameChannel put:'windowSpec' asValue. cg@2023: cg@2023: treeView := TreeView new. cg@2541: treeView painter:self. cg@2023: treeView windowSpecClass:(self defaultWindowSpecClass). cg@2541: treeView selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ]. cg@2023: cg@2023: painterView := StandardSystemView new. cg@2541: name := name ? self defaultNameOfCanvas. cg@2023: painterView beToolWindow. cg@2023: painterView name:name. cg@2023: painterView label:name. cg@2023: painterView extent:(treeView windowSpecClass defaultExtentInUIPainter). cg@2213: cg@2213: UseViewScroller == true ifTrue:[ cg@2213: scroller := HVScrollableView for:ViewScroller in:painterView. cg@2213: scroller cg@2213: horizontalScrollable:true miniScroller:true; cg@2213: verticalScrollable:true; verticalMini:true; cg@2213: autoHideScrollBars:false; cg@2213: layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. cg@2213: viewScroller := scroller scrolledView. cg@2213: painter := UIPainterView new. cg@2213: painter extent:300@300. cg@2213: viewScroller scrolledView:painter. cg@2213: ] ifFalse:[ cg@2213: painter := UIPainterView in:painterView. cg@2213: painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. cg@2213: ]. cg@2541: cg@2023: treeView := treeView canvas:painter specName:name. cg@2023: painter treeView:treeView. cg@2023: treeView model addDependent:self. cg@2023: painter enableChannel:(self enableChannel). cg@2198: cg@2198: selectionPanel := self selectionPanelClass new. cg@2198: selectionPanel allButOpenInterface:#windowSpec. cg@2023: ! ! cg@2023: cg@1718: !UIPainter methodsFor:'menus-dynamic'! cg@1521: cg@1521: menuEdit cg@1528: ^ [ cg@1528: |m i| cg@1528: cg@1528: m := self class menuEdit. cg@1528: m := m decodeAsLiteralArray. cg@1528: i := m detectItem:[:item | item nameKey == #undo] ifNone:nil. cg@1528: i notNil ifTrue:[ cg@1917: i label:(resources string:(i label , ' (%1)') cg@1917: with:(resources string:self painter undoHistory labelOfLastUndo)). cg@1528: ]. cg@1540: "/ m receiver:self. -- now done in findGuiResources ... cg@1528: m findGuiResourcesIn:self. cg@1528: m cg@1528: ]. cg@1940: ! cg@1940: cg@1940: menuReplaceWidget cg@1940: ^ [ cg@1940: |m i specAndView spec usefulReplacementSpecClasses| cg@1940: cg@1940: m := self class menuReplaceWidget. cg@1940: m := m decodeAsLiteralArray. cg@1940: cg@1940: specAndView := self selectedSpecAndView. cg@1940: spec := specAndView first. cg@1968: spec notNil ifTrue:[ cg@1968: usefulReplacementSpecClasses := spec usefulReplacementSpecClasses. cg@1968: usefulReplacementSpecClasses notEmptyOrNil ifTrue:[ cg@1968: m addSeparator. cg@1968: usefulReplacementSpecClasses do:[:eachClass | cg@1968: |item| cg@1968: cg@3137: item := MenuItem cg@3137: label:(resources string:'Replace by %1' with:eachClass userFriendlyName) cg@3137: itemValue:#replaceWidgetByClass: argument:eachClass. cg@3137: item translateLabel:false. cg@1968: m addItem:item. cg@1968: ]. cg@1940: ]. cg@1940: ]. cg@1940: cg@1940: m findGuiResourcesIn:self. cg@1940: m cg@1940: ]. cg@2923: cg@2923: "Modified: / 09-09-2012 / 13:25:09 / cg" cg@1521: ! ! cg@1521: ca@109: !UIPainter methodsFor:'private'! ca@109: cg@2243: acceptOrIgnoreSectionModification cg@2243: self isModified ifTrue:[ cg@2243: (self confirm:'Accept changes made to spec ?') ifTrue:[ cg@2243: self accept cg@2243: ] cg@2243: ]. cg@2243: cg@2243: "Created: / 12-01-2008 / 10:31:20 / cg" cg@2243: ! cg@2243: tz@729: askForModification tz@765: "asks for window spec modification" tz@765: cg@1341: |painter| cg@1341: cg@1341: painter := self painter. cg@1341: tz@765: self askForSectionModification. tz@729: cg@1341: (modified or: [painter isModified or: [self helpTool modified]]) cg@1341: ifTrue:[ sv@1772: ((YesNoBox title:(resources string:'Window spec was modified. Exit anyway?')) cg@1341: noText:(resources string:'Cancel'); sv@1772: yesText:(resources string:'Discard Changes and Exit'); cg@1341: showAtPointer; cg@1341: accepted) ifFalse: [^false]. cg@2007: self clearModified. cg@1341: painter resetModification tz@729: ]. sv@2293: ^ true cg@838: cg@838: "Modified: / 20.5.1998 / 02:03:16 / cg" tz@729: ! tz@729: tz@808: askForSaving tz@808: "asks for defining an application class" tz@808: tz@808: self askForSectionModification. tz@808: tz@808: ((YesNoBox title:'No application class defined yet!!') sv@2217: noText:'Cancel'; sv@2217: yesText:'Define'; sv@2217: showAtPointer; sv@2217: accepted) ifFalse: [^false]. tz@808: tz@808: self doSave. tz@808: tz@808: ^true tz@808: ! tz@808: tz@765: askForSectionModification tz@765: "asks for section modification in the notebook" tz@765: tz@765: self isModified ifTrue:[ cg@3251: (self confirm:'Accept modifications in section ' , tabSelection printString allBold, '?') ifTrue:[ sv@2217: self accept sv@2217: ] ifFalse: [ sv@2217: self cancel sv@2217: ] tz@765: ] tz@765: ! tz@765: tz@743: checkClassAndSelector tz@765: "checks for class & superclass" tz@743: cg@1211: |superclass cls| tz@743: cg@1983: specClassName isNil ifTrue:[^ false]. cg@1983: cg@1983: cls := self resolveName:specClassName. tz@743: tz@743: cls isNil ifTrue:[ cg@1976: superclass := self resolveName:specSuperclassName. cg@1976: cg@1976: superclass isNil ifTrue:[ cg@1976: self warn:'No class named ' , specSuperclassName , ' exists!!'. cg@1976: ^ false. cg@1976: ]. cg@1976: cg@3251: (self confirm:'Create class ' , specClassName allBold, '?') ifTrue:[ cg@1976: cls := superclass cg@1983: subclass:(specClassName asSymbol) cg@1976: instanceVariableNames:'' cg@1976: classVariableNames:'' cg@1976: poolDictionaries:'' cg@1976: category:'Applications'. cg@1976: cg@1983: cls name ~= specClassName ifTrue:[ cg@1976: self information:'Created new class is ' , cls name. cg@1983: specClassName := cls name cg@1976: ]. cg@1976: ^ true. cg@1976: ]. cg@1976: ^ false. tz@743: ]. tz@743: cls isBehavior ifFalse:[ cg@1983: self warn:'A global named ' , specClassName , ' exists, but it is no class.'. cg@1976: ^ false. tz@743: ]. tz@743: cg@1976: specSuperclassName isBehavior ifFalse:[ cg@2001: specSuperclassName notEmptyOrNil ifTrue:[ cg@1976: superclass := self resolveName:specSuperclassName cg@2001: ] ifFalse:[ cg@1976: specSuperclassName := nil. cg@1976: ] tz@743: ] ifTrue:[ cg@1976: superclass := specSuperclassName tz@743: ]. tz@743: cg@1976: specSuperclassName notNil ifTrue:[ cg@1976: superclass isNil ifTrue:[ cg@1976: self warn:'No class named ' , specSuperclassName , ' exists!!'. cg@1976: ^ false. cg@1976: ]. cg@1976: cg@1976: (cls isSubclassOf:superclass) ifFalse:[ cg@1983: self information:('A global named ' , specClassName , ' exists,\' , cg@1976: 'but is not a subclass of ' , superclass name , '.\\' , cg@1976: 'Check and try again if that is not what you want.') withCRs. cg@1976: ] tz@743: ]. tz@743: tz@743: superclass isNil ifTrue:[ cg@1976: cls notNil ifTrue:[ cg@1976: specSuperclassName := cls superclass name cg@1976: ] tz@743: ]. tz@743: tz@743: ^ true tz@743: tz@743: "Modified: 12.8.1997 / 23:39:10 / cg" tz@743: ! tz@743: ca@2159: createToolApplication:anApplicationClass spec:aSpec in:aView ca@2159: |appl applBuilder applWindow| ca@2159: ca@2159: appl := anApplicationClass new. ca@2159: appl createBuilder. ca@2159: applBuilder := appl builder. ca@2159: ca@2159: applWindow := ApplicationSubView origin:0.0@0.0 corner:1.0@1.0 in:aView. ca@2159: applWindow level:0. ca@2159: applWindow hiddenOnRealize:true. ca@2159: ca@2159: appl masterApplication:self. ca@2159: applBuilder window:applWindow. ca@2159: applWindow client:appl spec:aSpec builder:applBuilder. ca@2159: appl modifiedHolder:(self modifiedChannel). ca@2159: applBuilder window:applWindow. ca@2159: ca@2159: ^ appl ca@2159: ! ca@2159: ca@173: hideUIView:aView tz@765: "hides the view which is an application or top view" tz@765: ca@173: aView beIndependent. ca@173: aView unmap. ca@173: ! ca@173: ca@287: raiseTabView ca@2159: |tool| ca@2159: ca@2159: self isLayoutToolSelected ifTrue:[tool := layoutTool ] ca@2159: ifFalse:[self isHelpToolSelected ifTrue:[tool := helpTool ] ca@2159: ifFalse:[ ca@2159: tool := specTool. sv@3111: tool notNil ifTrue:[ sv@3111: ApplicationClassQuery answer:specClass do:[ sv@3111: "/ the spectool needs to know, in which nameSpace the application class is located, to find out sv@3111: "/ how to resolve short majorKeys... sv@3111: UISpecification uiMajorKeyBindingNameSpaceQuery sv@3111: answer:(specClass notNil ifTrue:[specClass nameSpace] ifFalse:Smalltalk) sv@3111: do:[ sv@3111: specTool selection:tabSelection sv@3111: ]. cg@3085: ]. cg@3085: ]. ca@2159: ]]. ca@2159: ca@2159: (Array with:helpTool with:layoutTool with:specTool) do:[:aTool| ca@2159: aTool ~~ tool ifTrue:[ ca@2159: aTool window beInvisible. ca@2159: ]. ca@2159: ]. ca@2159: tool notNil ifTrue:[ ca@2159: tool window beVisible. ca@2159: ]. ca@173: ! ca@173: ca@173: raiseUIView:aView tz@765: "raise the view which is an application or top view" tz@765: cg@1193: aView remap. ca@173: aView bePartner. cg@177: ! cg@177: cg@177: setClass:cls selector:selector tz@765: "sets the specClass and the specSelector under which the window spec should be saved" tz@765: cg@177: |clsName superClassName| cg@177: cg@177: clsName := cls name. cg@177: superClassName := cls superclass name. cg@177: cg@177: (self aspectFor:#classNameChannel) value:clsName. cg@177: (self aspectFor:#methodNameChannel) value:(selector ? ''). cg@177: (self aspectFor:#superclassNameChannel) value:superClassName. cg@177: cg@177: self painter cg@1760: className:clsName cg@1760: superclassName:superClassName cg@1760: selector:(selector ? ''). cg@177: ca@287: self specClass:clsName. cg@177: specSelector := (selector ? ''). cg@1976: specSuperclassName := superClassName. cg@177: cg@1983: (specClassName notNil and:[ selector notNil ]) ifTrue:[ cg@2072: self addHistoryEntryForClass:specClass selector:specSelector. cg@1760: self updateInfoLabel tz@446: ]. sv@587: cg@2072: "Modified: / 05-02-1998 / 09:44:58 / stefan" cg@2072: "Modified: / 31-08-2006 / 10:14:49 / cg" ca@282: ! ca@282: cg@1071: setViewInLayoutTool:aView spec:aSpec tz@765: "sets view for layout tool" tz@765: ca@287: |type| ca@287: ca@287: self painter topView == aView ifTrue:[ cg@2213: type := #Extent cg@2213: ] ifFalse:[ cg@2213: self canvas == aView ifTrue:[ cg@2213: type := #Extent cg@2213: ] ca@287: ]. cg@1071: self layoutTool layoutView:aView type:type spec:aSpec ca@287: ! ca@287: cg@2072: specClass cg@2072: specClass isNil ifTrue:[ cg@2072: specClassName notNil ifTrue:[ cg@2072: specClass := Smalltalk classNamed:specClassName. cg@2243: self canInstallAsWebPageHolder value:self canInstallAsWebPage. cg@2072: ] cg@2072: ]. cg@2072: ^ specClass cg@2072: cg@2072: "Created: / 31-08-2006 / 10:08:43 / cg" cg@2243: "Modified: / 14-01-2008 / 17:39:32 / cg" cg@2072: ! cg@2072: cg@1976: specClass:aClassOrClassName tz@765: "sets the specClass and updates the Help Tool" sv@587: cg@1976: aClassOrClassName isBehavior cg@2072: ifTrue: [ specClass := aClassOrClassName. cg@2072: specClassName := aClassOrClassName name ] cg@2072: ifFalse:[ specClass := Smalltalk classNamed:aClassOrClassName. cg@2072: specClassName := aClassOrClassName ]. cg@2072: cg@2243: self canInstallAsWebPageHolder value:self canInstallAsWebPage. cg@2072: self helpTool loadFromClass:specClass. cg@2072: self clearModifiedFlag. cg@2072: cg@2243: "Modified: / 14-01-2008 / 17:39:08 / cg" ca@287: ! ! ca@287: cg@1714: !UIPainter methodsFor:'private-tools'! ca@287: cg@2213: canvas cg@2213: "returns the canvas view" cg@2213: cg@2213: UseViewScroller == true ifTrue:[ cg@2213: ^ painter. cg@2213: ]. cg@2213: cg@2213: ^ painter topView. cg@2213: "/ ^ treeView canvas cg@2213: cg@2213: "Modified: / 05-09-2006 / 18:36:32 / cg" cg@2213: ! cg@2213: ca@287: helpTool tz@765: "returns the help tool" tz@765: ca@1316: helpTool isNil ifTrue:[self noteBookView]. ca@1316: ^ helpTool ca@287: ! ca@287: ca@287: layoutTool tz@765: "returns the layout tool" tz@765: ca@1316: layoutTool isNil ifTrue:[self noteBookView]. ca@1316: ^ layoutTool ca@287: ! ca@287: ca@287: painter tz@765: "returns the canvas view" tz@765: cg@2077: ^ painter. cg@2077: "/ ^ treeView canvas cg@2077: cg@2077: "Modified: / 05-09-2006 / 18:36:32 / cg" ca@287: ! ca@287: ca@287: specTool tz@765: "returns the spec tool" tz@765: ca@1316: specTool isNil ifTrue:[self noteBookView]. ca@1316: ^ specTool ca@109: ! ! ca@109: ca@166: !UIPainter methodsFor:'queries'! ca@166: sv@2313: canPaste sv@2313: |clipboard sel| sv@2313: sv@2313: clipboard := painterView getClipboardObject. sv@2313: cg@2328: (clipboard isCollection cg@2328: and:[ clipboard notEmptyOrNil ]) sv@2313: ifTrue:[sel := clipboard first] sv@2313: ifFalse:[sel := clipboard]. sv@2313: sv@2313: ^ (sel isKindOf:UISpecification) sv@2313: "/ and:[treeSelection size = 1 sv@2313: "/ and:[treeSelection first == 1 sv@2313: "/ or: [self canPasteInto: treeView selectedNode contents view]]] sv@2313: ! sv@2313: ca@217: hasSpecClass tz@765: "answers whether an application class is defined" tz@765: cg@1983: ^ (self resolveName:specClassName) notNil ca@217: ! ca@217: ca@217: hasSpecClassAndSelector tz@765: "answers whether an application class and a selector under which tz@765: the window spec is stored is defined" tz@765: ca@217: specSelector size > 1 ifTrue:[ sv@2217: ^ self hasSpecClass ca@217: ]. tz@765: ^ false ca@217: ! ca@217: cg@2277: isEditingSpecOnly cg@2277: ^ self isNotEditingSpecOnly not cg@2277: ! cg@2277: ca@166: isHelpToolSelected tz@765: "answers whether the current selected section in the noteBook is the Help Tool" tz@765: ca@287: ^ tabSelection = UIHelpTool label ca@166: ! ca@166: ca@166: isLayoutToolSelected tz@765: "answers whether the current selected section in the noteBook is the Layout Tool" tz@765: ca@287: ^ tabSelection = UILayoutTool label ca@217: ! ca@217: ca@272: isModified tz@765: "answers whether the current window spec or a layout is modified" tz@765: ca@272: ^ self modifiedChannel value ca@272: ! ca@272: cg@2198: isNotEditingSpecOnly cg@2198: ^ true cg@2198: ! cg@2198: ca@217: isPainterEnabled tz@765: "answers whether I am running in test mode" tz@765: ca@217: ^ self painter enabled penk@1608: ! penk@1608: penk@1608: isUIPainter penk@1608: ^ true cg@2243: ! cg@2243: cg@2243: listOfAspects cg@2243: ^ self painter listOfAspects cg@2243: cg@2243: "Created: / 12-01-2008 / 19:24:51 / cg" cg@2243: ! cg@2243: cg@2243: listOfCallbacks cg@2243: ^ self painter listOfCallbacks cg@2243: cg@2243: "Created: / 12-01-2008 / 19:25:09 / cg" ca@166: ! ! ca@166: ca@109: !UIPainter methodsFor:'selection'! ca@109: tm@1621: askForUnsavedModifications tm@1621: |whatToDo| tm@1621: tm@1621: self isModified ifFalse:[^ true]. tm@1621: tm@1621: whatToDo := DialogBox cg@3251: confirmWithCancel:'Accept modifications in section ' , tabSelection printString allBold, ' ?' tm@1621: labels:#('Cancel' 'Ignore' 'Accept') tm@1621: default:3. tm@1621: whatToDo isNil ifTrue:[^ false]. tm@1621: whatToDo == true ifTrue:[ tm@1621: self accept tm@1621: ] ifFalse:[ tm@1621: self cancel tm@1621: ]. tm@1621: tm@1621: ^ true tm@1621: ! tm@1621: tm@1621: copySelection tm@1621: self painter copySelection. tm@1621: self updateChannels. tm@1621: ! tm@1621: cg@1940: selectedSpec cg@1940: |specAndView| cg@1940: cg@1940: specAndView := self selectedSpecAndView. cg@1940: ^ specAndView first cg@1940: ! cg@1940: cg@1940: selectedSpecAndView cg@1940: |spec view property| cg@1940: cg@1940: treeView isCanvasSelected ifTrue:[ cg@1940: spec := treeView canvasSpec. cg@2213: view := self canvas. "/ self painter topView. cg@1940: ] ifFalse:[ cg@1940: (property := treeView propertySelected) notNil ifTrue:[ cg@1940: treeView canResizeSelectedWidget ifTrue:[ cg@1940: view := property view. cg@1940: ]. cg@1940: spec := property spec copy. cg@1940: ] cg@1940: ]. cg@1940: ^ Array with:spec with:view cg@1940: ! cg@1940: ca@109: tabSelection tz@765: "returns the label of the current section in the notebook" tz@765: ca@109: ^ tabSelection ca@109: ! ca@109: ca@109: tabSelection:something tz@765: "called whenever the section of the notebook has changed" cg@351: ca@272: (something isNil or:[tabSelection = something]) ifTrue:[ tm@1621: ^ self ca@272: ]. ca@272: ca@2202: self isModified ifTrue:[ ca@2202: self autoAcceptOnSelectionChange value ifTrue:[ ca@2202: self accept ca@2202: ] ifFalse:[ ca@2202: self askForUnsavedModifications ifFalse:[^ self]. ca@2202: ]. cg@1710: ]. ca@272: tabSelection := something. ca@287: self raiseTabView. ca@272: self cancel. ca@272: ! ca@272: cg@1710: treeSelectionChanged tz@765: "called whenever the selection of the treeview has changed" tz@765: cg@1940: |specAndView view spec| tm@1621: tm@1621: self askForUnsavedModifications ifFalse:[^ self]. tm@1621: "/ self isModified ifTrue:[ tm@1621: "/ (self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[ tm@1621: "/ self accept tm@1621: "/ ] tm@1621: "/ ]. tz@713: cg@1940: specAndView := self selectedSpecAndView. cg@1940: spec := specAndView first. cg@1940: view := specAndView last. tm@1621: cg@1071: self setViewInLayoutTool:view spec:spec. ca@287: self specTool specification:spec. ca@282: tm@1621: self updateSlicesForSpec:spec andView:view. tm@1621: self clearModifiedFlag. tm@1621: self updateChannels. tm@1621: ! tm@1621: tm@1621: updateSlicesForSpec:spec andView:view cg@2512: "fetch slices-info from the spec; add help and geometry slices manually" cg@2512: cg@2023: |slices "size" list tabComponent| tm@1621: tm@1621: tabComponent := self componentAt:#noteBook. tm@1621: ca@282: spec notNil ifTrue:[ cg@1188: self helpTool helpKey:(spec activeHelpKey). cg@1188: slices := spec class slices. cg@2023: cg@2023: list := slices collect:[:eachSlice | eachSlice first asString]. cg@2023: self treeView isCanvasSelected ifFalse:[ ab@2040: list := list copyWith:(UIHelpTool label) cg@2023: ]. cg@1188: view notNil ifTrue:[ cg@2512: "/ for now, keep it as an empty slice; cg@2512: "/ better when toggling as we do not loos the 'geometry' selection. cg@2512: "/ slices notebook should remember the last 'explicit' selected tab. cg@2512: true "spec hasLayout" ifTrue:[ cg@2511: list := list copyWith:UILayoutTool label. cg@2511: ] cg@1188: ]. cg@1188: cg@2023: "/ size := slices size. cg@2023: "/ view notNil ifTrue:[ cg@2023: "/ self treeView isCanvasSelected ifFalse:[ cg@2023: "/ list := Array new:(size + 2). cg@2023: "/ list at:(size + 2) put:(UILayoutTool label). cg@2023: "/ ] ifTrue:[ cg@2023: "/ list := Array new:(size + 1). cg@2023: "/ list at:(size + 1) put:(UILayoutTool label). cg@2023: "/ ]. cg@2023: "/ ] ifFalse:[ cg@2023: "/ list := Array new:(size + 1). cg@2023: "/ ]. cg@2023: "/ cg@2023: "/ 1 to:size do:[:i| list at:i put:((slices at:i) first asString)]. cg@2023: "/ self treeView isCanvasSelected ifFalse: [ cg@2023: "/ list at:(size + 1) put:(UIHelpTool label) cg@2023: "/ ]. cg@1188: cg@1188: self tabList value:list. cg@1188: self showHelp:spec class name for:self. cg@1188: tabComponent enabled:true. cg@1188: cg@1188: (tabSelection := tabComponent selection) isNil ifTrue:[ cg@1188: tabComponent setSelection:(tabSelection := list first) cg@1188: ]. cg@1188: self raiseTabView ca@282: ] ifFalse:[ cg@1188: self helpTool helpKey:nil. cg@1188: tabComponent enabled:false. cg@1188: self defaultInfoLabel. ca@272: ]. cg@60: ! ! cg@60: tz@765: !UIPainter methodsFor:'settings'! tz@765: cg@924: generateAspectsAsInstanceVariables cg@924: "if on, aspects are held as instance variables; cg@2243: if off (the default), they are kept in the bindings dictionary." cg@2243: cg@924: ^ UIPainterView generateAspectsAsInstanceVariables cg@924: cg@2243: "Created: / 29-07-1998 / 11:17:59 / cg" cg@2243: "Modified: / 12-01-2008 / 10:37:43 / cg" cg@924: ! cg@924: cg@924: generateAspectsAsInstanceVariables:aBoolean cg@924: "if on, aspects are held as instance variables; cg@2243: if off (the default), they are kept in the bindings dictionary." cg@2243: cg@924: ^ UIPainterView generateAspectsAsInstanceVariables:aBoolean cg@924: cg@924: "Created: / 29.7.1998 / 11:18:20 / cg" cg@924: ! cg@924: cg@2243: generateCommentedCode cg@2243: "comments in generated aspect methods; yes or no." cg@2243: cg@2243: ^ UIPainterView generateCommentedCode cg@2243: cg@2243: "Created: / 12-01-2008 / 10:34:14 / cg" cg@2243: ! cg@2243: cg@2243: generateCommentedCode:aBoolean cg@2243: "comments in generated aspect methods; yes or no." cg@2243: cg@2243: UIPainterView generateCommentedCode:aBoolean cg@2243: cg@2243: "Created: / 12-01-2008 / 10:23:10 / cg" cg@2243: ! cg@2243: tz@765: redefineAspectMethods cg@2243: "redefine methods yes or no. cg@2243: If a method is defined in super class should the message be reinstalled ?" cg@2243: tz@765: ^ UIPainterView redefineAspectMethods tz@765: cg@2243: "Modified: / 12-01-2008 / 10:34:07 / cg" tz@765: ! tz@765: tz@765: redefineAspectMethods:aBoolean cg@2243: "redefine methods yes or no. cg@2243: If a method is defined in super class should the message be reinstalled ?" cg@2243: tz@765: UIPainterView redefineAspectMethods:aBoolean tz@765: cg@2243: "Modified: / 12-01-2008 / 10:23:20 / cg" tz@765: ! ! tz@765: cg@1716: !UIPainter methodsFor:'startup & release'! ca@109: ca@109: closeRequest cg@2023: "asks for permission before closing" tz@713: tz@729: self askForModification ifFalse:[^self]. ca@133: cg@2007: super closeRequest. cg@2007: cg@2551: painterView notNil ifTrue:[ cg@2551: painterView masterApplication:nil. cg@2551: painterView closeRequest. cg@2551: ]. cg@2551: treeView notNil ifTrue:[ cg@2551: treeView model removeDependent:self. cg@2551: ]. ca@109: selectionPanel notNil ifTrue:[ cg@2007: selectionPanel masterApplication:nil. cg@2007: selectionPanel closeRequest ca@109: ]. cg@2551: "/ selectionPanel := nil. cg@2551: "/ treeView := nil. ca@109: ! ca@109: ca@109: closeRequestFor:aTopView tz@765: "handles a close request for a specific view" tz@765: ca@173: |topView| cg@60: tz@765: (topView := self window) == aTopView ifTrue:[ sv@2217: super closeRequestFor:aTopView ca@109: ] ifFalse:[ sv@2217: aTopView = selectionPanel window ifTrue:[ sv@2217: self galleryShown value:false sv@2217: ] ifFalse:[ sv@2217: aTopView == (self painter topView) ifTrue:[ sv@2217: self painterShown value:false sv@2217: ] ifFalse:[ sv@2217: aTopView closeRequest sv@2217: ] sv@2217: ]. sv@2217: topView raise. ca@109: ]. cg@60: ! cg@60: cg@1994: commonPostBuild cg@1994: "sets the root of the tree view as first selection; cg@1994: sets the grid parameters, if defined" cg@1994: cg@1994: |cls sel| cg@1994: cg@2072: cls := self specClass. cg@1994: sel := specSelector. cg@1994: cls notNil ifTrue:[ cg@1994: self setClass:cls selector:sel. cg@1994: cg@1994: (cls respondsTo:sel) ifTrue:[ cg@1994: self painter setupFromSpec:(cls perform:sel). cg@1994: ] cg@1994: ]. cg@1994: cg@1994: self autoAcceptOnSelectionChange addDependent:self. cg@1994: self autoAcceptOnSelectionChange value ifTrue:[ cg@1994: (builder componentAt:'acceptButton') label:(resources string:'Apply') cg@1994: ]. cg@1994: cg@2023: "/ using masters infoHolder ? cg@2023: (builder aspectAt:#useAlienInfoLabelHolder) == true ifTrue:[ cg@2023: (builder componentAt:#mainPanel) layout bottomOffset:0. cg@2023: (builder componentAt:#infoBarSubSpec) beInvisible cg@2023: ]. cg@2023: cg@2001: self updateInfoLabel. cg@2023: cg@2072: "Modified: / 31-08-2006 / 10:12:53 / cg" cg@1994: ! cg@1994: cg@1976: loadFromClass:aClass andSelector:selector cg@1185: "loads a window spec by evaluating aMessageString cg@1185: (which is something like 'fooClass windowSpec')" cg@1185: cg@1976: self assert:(aClass isNil or:[aClass isClass]). cg@1976: cg@1976: self askForModification ifFalse:[^ self]. cg@1976: cg@1976: self setClass:aClass selector:selector. cg@1976: cg@1976: (aClass respondsTo:selector) ifTrue:[ cg@2198: self loadFromSpec:(aClass perform:selector). cg@1976: ] cg@1976: ! cg@1976: cg@1976: loadFromMessage:classAndSelector cg@1976: "loads a window spec by evaluating aMessageString cg@1976: (which is something like 'fooClass windowSpec')" cg@1976: cg@1976: self askForModification ifFalse:[^ self]. cg@1976: cg@1976: classAndSelector notNil ifTrue:[ cg@2198: self cg@2198: loadFromClass:classAndSelector methodClass cg@2198: andSelector:classAndSelector methodSelector tz@743: ] tz@743: ! tz@743: cg@2198: loadFromSpec:aSpec cg@2198: "loads a window spec proper" cg@2198: cg@2198: self askForModification ifFalse:[^ self]. cg@2198: cg@2198: self painter setupFromSpec:aSpec. cg@2198: ! cg@2198: cg@1850: openInterface:aSymbol cg@1994: "in addition to opening my interface, also open up a gallery and a painter" cg@1850: cg@2198: |topView| cg@2198: cg@2198: self setupSpecClassAndSelector. cg@1994: cg@2012: "/ treeView := TreeView new. cg@2012: "/ treeView windowSpecClass:(self defaultWindowSpecClass). cg@2012: "/ treeView cg@2012: "/ selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ]. cg@2012: cg@2012: "/ painterView := StandardSystemView new. cg@2012: "/ name := name ? UIPainter defaultNameOfCanvas. cg@2012: "/ painterView beToolWindow. cg@2012: "/ painterView name:name. cg@2012: "/ painterView label:name. cg@2012: "/ painterView extent:(treeView windowSpecClass defaultExtentInUIPainter). cg@2012: "/ painter := UIPainterView in:painterView. cg@2012: "/ painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. cg@2012: "/ treeView := treeView canvas:painter specName:name. cg@2012: "/ painter treeView:treeView. cg@2012: "/ treeView model addDependent:self. cg@2012: "/ painter enableChannel:(self enableChannel). cg@1994: tz@765: super openInterface:aSymbol. cg@1994: ca@136: topView := self window. cg@345: topView label:'GUI Painter'. cg@2198: cg@2198: "/ self setupCanvasAndSelectionPanel. cg@2198: "/ cg@2198: "/ selectionPanel window waitUntilVisible. cg@2198: "/ painterView window waitUntilVisible. cg@2198: "/ self window waitUntilVisible. cg@2198: "/ [ Delay waitForSeconds:0.5. self window topView raise ] fork. cg@2072: cg@2072: "Modified: / 31-08-2006 / 10:13:16 / cg" cg@60: ! cg@60: ca@109: openOnClass:aClass tz@765: "opens the GUI Painter on aClass and #windowSpec" tz@765: ca@109: self openOnClass:aClass andSelector:#windowSpec ca@109: ! ca@109: cg@60: openOnClass:aClass andSelector:aSelector cg@1976: "opens the GUI Painter on aClass and aSelector" cg@1976: cg@157: aClass isNil ifTrue:[ cg@1976: (self confirm:'No class given to the GUI Painter (class was probably renamed?)\\Open anyway (to create a new window spec) ?' withCRs) cg@1976: ifFalse:[^ nil]. cg@157: ]. cg@60: ca@798: specSelector := aSelector. cg@2072: specClass := aClass. cg@2072: specClassName := aClass name. ca@798: cg@964: self openInterface. cg@964: cg@964: "/ specSelector := aSelector. cg@964: "/ specClass := aClass. cg@964: cg@2072: "Modified: / 31-08-2006 / 10:13:31 / cg" tz@713: ! tz@713: cg@1192: postBuildWith: aBuilder cg@1192: super postBuildWith:aBuilder. ca@798: cg@2500: (self toolBarVisibleHolder value cg@2500: or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ]. cg@2500: cg@2500: "Created: / 18-02-2007 / 15:03:08 / cg" cg@2500: cg@1994: self setupPainter. cg@1710: cg@1192: "Modified: / 22.8.1998 / 17:41:34 / cg" cg@1192: ! cg@1192: cg@1192: postOpenWith: aBuilder cg@1994: "spread the painter and gallery views on the screen" cg@1192: cg@1194: |myWindow canvasWindow canvasOrg galleryWindow sv@3062: galleryOrg windowGroup monitorBounds myViewRectangle| sv@3062: sv@3062: super postOpenWith:aBuilder. cg@1957: cg@1957: windowGroup := self topApplication windowGroup. cg@1957: windowGroup addPreEventHook:self. cg@1957: ca@798: treeView selection: #(1). ca@1247: aBuilder keyboardProcessor menuBar:nil. ca@798: cg@1192: myWindow := self window. cg@1192: canvasWindow := self painter topView. cg@1456: [selectionPanel isNil] whileTrue:[ cg@1456: Delay waitForSeconds:0.1. cg@1456: ]. cg@2007: cg@1192: galleryWindow := selectionPanel window. cg@1192: cg@1197: "/ try to lay out things non-overlapping cg@1197: "/ but only, if the window manager placed all windows cg@1197: "/ on top of each other sv@3062: "/ make sure, that all the windows are on the same physical monitor sv@3062: monitorBounds := device monitorBoundsAt:self window origin. sv@3062: myViewRectangle := myWindow screenBounds. sv@3062: (myViewRectangle intersects:galleryWindow screenBounds) ifTrue:[ sv@3062: galleryOrg := (monitorBounds right - galleryWindow width - 20) cg@1197: @ sv@3062: ((myWindow bottom + 20) min:(monitorBounds bottom - galleryWindow height - 20)). sv@3062: galleryWindow sv@3062: origin:galleryOrg; sv@3062: raise. sv@3062: ]. sv@3062: ((myViewRectangle intersects:canvasWindow screenBounds) sv@3062: or:[galleryWindow screenBounds intersects:canvasWindow screenBounds])ifTrue:[ sv@3062: canvasOrg := monitorBounds origin + (10@20). sv@3062: canvasWindow sv@3062: origin:canvasOrg; sv@3062: raise. cg@1197: ]. cg@1192: cg@2198: self setupCanvasAndSelectionPanel. cg@2198: cg@2198: "/ selectionPanel window waitUntilVisible. cg@2198: "/ painterView window waitUntilVisible. cg@2198: "/ self window waitUntilVisible. sv@3062: [ sv@3062: Delay waitForSeconds:0.1. sv@3062: myWindow topView raise. cg@2198: Delay waitForSeconds:0.25. sv@3062: myWindow topView raise cg@2198: ] fork. cg@1195: "Modified: / 13.7.1999 / 21:26:52 / cg" cg@1461: ! cg@1461: cg@2551: release cg@2551: super release. cg@2551: cg@2551: painterView notNil ifTrue:[ cg@2551: painterView destroy. cg@2551: ]. cg@2551: selectionPanel notNil ifTrue:[ cg@2551: selectionPanel masterApplication:nil. cg@2551: selectionPanel window destroy cg@2551: ]. cg@2551: selectionPanel := nil. cg@2551: treeView := nil. cg@2551: painterView := nil. cg@2551: ! cg@2551: cg@1461: selectionPanelClass sv@2218: ^ SelectionPanelClass cg@1994: ! cg@1994: cg@2198: setupCanvasAndSelectionPanel cg@2198: |topView galleryWindow icon| cg@2198: sv@3132: painterView isOpen ifTrue:[ sv@3132: ^ self. sv@3132: ]. sv@3132: sv@3296: icon := self class builderIcon. cg@2198: cg@2198: topView := self window. cg@2198: cg@2198: painterView openInGroup:(topView windowGroup). cg@2198: painterView application:self. cg@2198: cg@2198: galleryWindow := selectionPanel window. cg@2198: galleryWindow beToolWindow. cg@2198: galleryWindow openInGroup:(topView windowGroup). cg@2198: cg@2198: selectionPanel masterApplication:self. cg@2198: cg@2198: topView iconLabel:'GUI Painter'. cg@2198: topView icon:icon. cg@2198: painterView iconLabel:'GUI Canvas'. cg@2198: painterView icon:icon. cg@2198: galleryWindow iconLabel:'GUI Gallery'. cg@2198: galleryWindow icon:icon. cg@2198: cg@2277: topView isModal ifFalse:[ cg@2277: topView bePartner. cg@2277: painterView bePartner. cg@2277: galleryWindow bePartner. cg@2277: ] cg@2198: ! cg@2198: cg@1994: setupPainter cg@1994: "sets the painter's grid parameters, if defined" cg@1994: cg@1994: |painter settings gridPara hspace vspace| cg@1994: cg@1994: painter := self painter. cg@1994: settings := self class settings. cg@1994: gridPara := painter gridParameters copy. cg@1994: hspace := settings at: #HGridSpace ifAbsent:10. cg@1994: vspace := settings at: #VGridSpace ifAbsent:10. cg@1994: gridPara at:1 put:hspace; at:2 put:vspace; at:5 put:hspace; at:6 put:vspace. cg@1994: painter gridParameters:gridPara. cg@1994: painter gridShown: (settings at: #GridShown ifAbsent:false). cg@1994: painter gridAlign: (settings at: #GridAlign ifAbsent:false). cg@1994: painter shown ifTrue:[painter clearView]. cg@1994: cg@1994: "Modified: / 22.8.1998 / 17:41:34 / cg" cg@2198: ! cg@2198: cg@2198: setupSpecClassAndSelector cg@2198: |cls name| cg@2198: cg@2198: self specClass notNil ifTrue:[ cg@2198: specClassName isBehavior ifTrue:[ cg@2198: name := specClassName nameWithoutPrefix. cg@2198: ] ifFalse:[ cg@2198: name := specClassName printString string cg@2198: ] cg@2198: ]. cg@2198: (aspects at:#classNameChannel) value:(specClassName ? 'NewApplication'). cg@2198: cg@2198: specSuperclassName isNil ifTrue:[ cg@2198: specClassName notNil ifTrue:[ cg@2198: (cls := self resolveName:specClassName) notNil ifTrue:[ cg@2198: specSuperclassName := cls superclass name. cg@2198: ] cg@2198: ] cg@2198: ]. cg@2198: aspects at:#superclassNameChannel cg@2198: put:((specSuperclassName notNil cg@2198: ifTrue:[ specSuperclassName ] cg@2198: ifFalse:[ 'ApplicationModel' ]) asValue). cg@2198: aspects at:#superclassNameDefaults cg@2243: put:#( 'ApplicationModel' 'SimpleDialog' 'WebApplicationModel') asValue. cg@2198: aspects at:#methodNameChannel cg@2198: put:((specSelector notNil cg@2198: ifTrue:[ specSelector asValue ] cg@2198: ifFalse:[ #windowSpec ]) asValue). cg@2243: cg@2243: "Modified: / 16-01-2008 / 10:44:55 / cg" cg@60: ! ! cg@60: tz@743: !UIPainter methodsFor:'user actions'! tz@446: tz@765: accept tz@765: "accepts all modifications done to the attributes of the current section" tz@765: cg@1071: |painter layout spec layoutTool layoutView t| cg@1068: cg@1068: self acceptChannel value:true; value:false. "/ force editFields to accept cg@1188: self clearModifiedFlag. tz@788: tz@765: painter := self painter. cg@1071: spec := self specTool specification. tz@765: tz@765: self isLayoutToolSelected ifTrue:[ cg@1188: layoutTool := self layoutTool. cg@1188: cg@1188: (layout := layoutTool layout) notNil ifTrue:[ cg@2950: "/ cg->ca: the following code should be moded to the layoutTool mawalch@3325: "/ (i.e. layoutTool saveInSpec:spec). cg@2950: cg@1188: layoutTool layoutType == #Extent ifTrue:[ cg@1188: layoutView := layoutTool layoutView. cg@1188: cg@2213: layoutView == self canvas ifTrue:[ cg@2213: layoutView extent:layout. cg@2213: UseViewScroller == true ifTrue:[ cg@2213: layoutView container container sizeChanged:nil. cg@2213: ]. cg@1188: ] ifFalse:[ cg@3236: spec useDefaultExtent:(layoutTool aspectValueFor:#useDefaultExtent). cg@1188: spec useDefaultExtent ifTrue:[ cg@1188: "/ temporarily unfreeze the widgets size cg@1188: "/ (but remember, the old setting, which is actually cg@1188: "/ controlled by the resizeForLabel attribute) cg@1188: t := layoutView sizeFixed. cg@1188: layoutView sizeFixed:false. cg@1188: layout := layoutView preferredExtent. cg@1188: layoutView sizeFixed:t. cg@1188: ]. cg@3236: spec usePreferredWidth:(layoutTool aspectValueFor:#usePreferredWidth). cg@3236: spec usePreferredHeight:(layoutTool aspectValueFor:#usePreferredHeight). cg@3236: spec useDynamicPreferredWidth:(layoutTool aspectValueFor:#useDynamicPreferredWidth). cg@3236: spec useDynamicPreferredHeight:(layoutTool aspectValueFor:#useDynamicPreferredHeight). cg@1188: painter setExtent:layout. cg@1188: painter updateFromSpec:spec. cg@1188: ] cg@1188: ] ifFalse:[ martin@1444: spec useDefaultExtent:false. cg@3236: spec usePreferredWidth:(layoutTool aspectValueFor:#usePreferredWidth). cg@3236: spec usePreferredHeight:(layoutTool aspectValueFor:#usePreferredHeight). cg@3236: spec useDynamicPreferredWidth:(layoutTool aspectValueFor:#useDynamicPreferredWidth). cg@3236: spec useDynamicPreferredHeight:(layoutTool aspectValueFor:#useDynamicPreferredHeight). cg@2950: layoutTool layoutType == #LayoutFrame ifTrue:[ cg@3236: spec keepSpaceForOSXResizeHandleH:(layoutTool aspectValueFor:#keepSpaceForOSXResizeHandleH). cg@3236: spec keepSpaceForOSXResizeHandleV:(layoutTool aspectValueFor:#keepSpaceForOSXResizeHandleV). cg@2950: ]. sv@2477: painter setLayout:layout. cg@2500: spec layout:layout. sv@2477: painter updateFromSpec:spec. cg@2378: ]. cg@1188: ] tz@765: ] ifFalse:[ cg@1188: self isHelpToolSelected ifTrue:[ cg@1188: self helpTool accept. cg@1188: spec activeHelpKey:self helpTool helpKey. cg@1188: ]. cg@1188: painter updateFromSpec:spec cg@1071: ]. cg@1071: cg@2007: self clearModified tz@765: ! tz@765: cg@3238: addWidget: aSpecClassSymbol tz@765: "adds a widget from aSpecClass to the current widget" tz@765: cg@3238: self addWidgetOfSpec: (Array with: (Smalltalk at: aSpecClassSymbol) new) tz@765: ! tz@765: tz@765: addWidgetOfSpec: aSpec tz@765: "adds a widget from aSpec to the current widget" tz@765: cg@1521: |newSel| cg@1521: cg@2077: (newSel := painter pasteSpecifications:aSpec keepLayout:false at:0@0) notNil cg@2077: ifTrue:[ cg@2077: painter select: newSel cg@2077: ] ifFalse:[ cg@1521: ((treeView selection size = 0) or: [treeView selectedNode isNil]) cg@2077: ifTrue:[ cg@1521: treeView selection: #(1). cg@2077: ] ifFalse:[ cg@1521: treeView selectNode: (treeView detectNode: [:n| n = treeView selectedNode parent]) cg@1521: ]. cg@1521: self addWidgetOfSpec: aSpec tz@765: ] tz@765: cg@2077: "Modified: / 05-09-2006 / 18:37:12 / cg" tz@765: ! tz@765: cg@3218: askForMoveByStep cg@3218: "open a dialog to ask for a number" cg@3218: cg@3218: |s nPixels| cg@3218: cg@3218: s := Dialog request:'Number of Pixels to Move: ' cg@3218: initialAnswer:painter nPixelsForMoveSelection asString. cg@3218: s isEmptyOrNil ifTrue:[^ self]. cg@3218: nPixels := Integer readFrom:s onError:nil. cg@3218: nPixels isNil ifTrue:[^ self]. cg@3218: cg@3218: self painter nPixelsForMoveSelection:nPixels cg@3218: ! cg@3218: tz@765: cancel tz@765: "cancels all modifications done to the attributes of the current section; tz@765: reread the old attributes" tz@765: tz@765: |spec key view| tz@765: tz@765: self isModified ifTrue:[ cg@1188: (spec := self painter specForSelection) notNil ifTrue:[ cg@1188: key := spec activeHelpKey. cg@1188: ]. cg@1188: self helpTool helpKey:key. cg@1188: cg@1188: treeView isCanvasSelected ifTrue: [ cg@1188: spec := treeView canvasSpec. cg@1188: ]. cg@1710: cg@1188: self specTool specification:spec. cg@1188: view := self layoutTool layoutView. cg@1188: cg@1188: self setViewInLayoutTool:view spec:spec. cg@1188: spec class == DataSetSpec ifTrue:[ cg@1188: view notNil ifTrue:[ cg@1188: view columnDescriptors:(spec columns) cg@1188: ] cg@1188: ]. cg@1188: self clearModifiedFlag. cg@2007: self clearModified. tz@765: ] tz@765: ! tz@765: cg@3361: hideEditToolbar cg@3361: self editToolBarVisibleHolder value:false cg@3361: ! cg@3361: cg@3361: hideToolbar cg@3361: self toolBarVisibleHolder value:false cg@3361: ! cg@3361: cg@3361: replaceWidgetByClass:aSpecOrWidgetClass cg@3361: "replace the selected widget by a new instance of aSpecOrWidgetClass, cg@3361: which gets the old widget's layout" cg@3361: cg@3361: |newSpecClass oldSpec newSpec| cg@3361: cg@3361: treeView isCanvasSelected ifTrue:[ cg@3361: ^ self cg@3361: ]. cg@3361: (newSpecClass := self specClassFromUsersSpecOrWidgetClass:aSpecOrWidgetClass) isNil ifTrue:[ cg@3361: ^ newSpecClass cg@3361: ]. cg@3361: cg@3361: oldSpec := self selectedSpec. cg@3361: newSpec := newSpecClass cloneFrom:oldSpec. cg@3361: cg@3361: self painter replaceSelectionBy:newSpec. cg@3361: cg@3361: "Modified: / 05-09-2012 / 19:24:40 / cg" cg@3361: ! cg@3361: cg@3361: setMoveByStep:nPixels cg@3361: "change the number of pixels by which the step-buttons move the selected widget(s)" cg@3361: cg@3361: self painter nPixelsForMoveSelection:nPixels cg@3361: ! cg@3361: cg@3361: specClassFromUsersSpecOrWidgetClass:aSpecOrWidgetClass cg@3361: |newSpecClass| cg@3361: cg@3361: (aSpecOrWidgetClass isSubclassOf:UISpecification) ifTrue:[ cg@3361: newSpecClass := aSpecOrWidgetClass. cg@3361: ] ifFalse:[ cg@3361: (aSpecOrWidgetClass isSubclassOf:View) ifTrue:[ cg@3361: newSpecClass := aSpecOrWidgetClass basicNew specClass. cg@3361: ] ifFalse:[ cg@3361: newSpecClass := nil cg@3361: ]. cg@3361: ]. cg@3361: newSpecClass isNil ifTrue:[ cg@3361: Dialog warn:'Invalid Spec- or View-Class: ' , aSpecOrWidgetClass name. cg@3361: ^ nil. cg@3361: ]. cg@3361: ^ newSpecClass cg@3361: ! cg@3361: cg@3361: useBackgroundImage cg@3361: "select bitmap to underly" cg@3361: cg@3361: |fn| cg@3361: cg@3361: fn := Dialog requestFileName:'Bitmap Image File ?' pattern:'*.gif;*.tiff;*.jpg;*.png' fromDirectory:'f:'. cg@3361: fn isNil ifTrue:[ cg@3361: ^ self cg@3361: ]. cg@3361: painter useSketchFile:fn cg@3361: cg@3361: "Created: / 16-01-2008 / 17:49:20 / cg" cg@3361: ! cg@3361: cg@3361: useSketch cg@3361: "select sketchfile to underly. cg@3361: Sketchfiles are generated by notepads, which can offline-store drawn sketches" cg@3361: cg@3361: |fn| cg@3361: cg@3361: fn := Dialog requestFileName:'Sketch (Notepad Drawing) ?' pattern:'*.TOP' fromDirectory:'f:'. cg@3361: fn isNil ifTrue:[ cg@3361: ^ self cg@3361: ]. cg@3361: painter useSketchFile:fn cg@3361: cg@3361: "Created: / 16-01-2008 / 17:49:20 / cg" cg@3361: ! cg@3361: cg@3361: wrapWidgetIntoClass:aSpecOrWidgetClass cg@3361: "put the selected widget into a new instance of aSpecOrWidgetClass, cg@3361: which gets the wrapped widget's layout" cg@3361: cg@3361: |newSpecClass oldSpec newSpec| cg@3361: cg@3361: treeView isCanvasSelected ifTrue:[ cg@3361: ^ self cg@3361: ]. cg@3361: (newSpecClass := self specClassFromUsersSpecOrWidgetClass:aSpecOrWidgetClass) isNil ifTrue:[ cg@3361: ^ newSpecClass cg@3361: ]. cg@3361: cg@3361: oldSpec := self selectedSpec. cg@3361: newSpec := newSpecClass new. cg@3361: newSpec layout:oldSpec layout. cg@3361: newSpec component:oldSpec. cg@3361: cg@3361: self painter replaceSelectionBy:newSpec. cg@3361: cg@3361: "Modified: / 05-09-2012 / 19:24:40 / cg" cg@3361: ! ! cg@3361: cg@3361: !UIPainter methodsFor:'user actions-menu'! cg@3361: cg@1940: doAskAndReplaceWidgetBy cg@3054: "ask for a widget class, cg@3054: and replace the selected widget by a new instance of that one, cg@3054: which gets the old widget's layout" cg@3054: ca@2397: |widgetClass list common selectedSpec| ca@2397: ca@2397: selectedSpec := self selectedSpec. ca@2397: selectedSpec isNil ifTrue:[^ self]. cg@2243: cg@2243: list := UISpecification allSubclasses cg@2920: select:[:cls | cg@2920: [ cls viewClass notNil] cg@2920: on: NotFoundError cg@2920: do:[ false ] cg@2920: ]. cg@2243: list sort:[:a :b | a name < b name]. cg@2243: ca@2397: common := selectedSpec class commonReplacementClasses. cg@2243: common notEmpty ifTrue:[ cg@2243: list addAllFirst:(common , (Array with:'-')). cg@2243: ]. cg@2243: widgetClass := Dialog cg@3054: requestClass:'Replace by (Spec or View Class):' cg@2243: list:list cg@2243: okLabel:'OK' cg@2243: initialAnswer:nil. cg@1940: widgetClass isNil ifTrue:[ cg@1940: ^ self cg@1940: ]. cg@1940: self replaceWidgetByClass:widgetClass cg@2243: cg@2920: "Modified: / 05-09-2012 / 19:31:22 / cg" cg@1940: ! cg@1940: cg@3054: doAskAndWrapWidgetInto cg@3054: "ask for a container class, cg@3054: and put the selected widget into a new instance of that one, cg@3054: which gets the wrapped widget's layout" cg@3054: cg@3361: |widgetClass list selectedSpec| cg@3361: cg@3361: selectedSpec := self selectedSpec. cg@3361: selectedSpec isNil ifTrue:[^ self]. cg@3361: cg@3361: list := UISpecification allSubclasses cg@3361: select:[:cls | cg@3361: [ cls viewClass notNil cg@3361: and:[ cls supportsSubComponents ]] cg@3361: on: NotFoundError cg@3361: do:[ false ] cg@3361: ]. cg@3361: list sort:[:a :b | a name < b name]. cg@3361: cg@3361: widgetClass := Dialog cg@3361: requestClass:'Wrap into (Spec or View Class):' cg@3361: list:list cg@3361: okLabel:'OK' cg@3361: initialAnswer:nil. cg@3361: widgetClass isNil ifTrue:[ cg@3361: ^ self cg@3361: ]. cg@3361: self wrapWidgetIntoClass:widgetClass cg@3054: ! cg@3054: cg@2210: doBrowseActionMethod:aspectSelector cg@3256: "browse or create the action method as entered in the field cg@3256: (button beside input field in ui-slice pressed)" cg@2243: cg@2243: self acceptOrIgnoreSectionModification. cg@2240: cg@2222: self doBrowseActionMethod:aspectSelector nameAs:aspectSelector cg@2243: cg@2243: "Modified: / 12-01-2008 / 10:32:12 / cg" cg@2222: ! cg@2222: cg@2222: doBrowseActionMethod:aspectSelector nameAs:aspectNameShown cg@3256: "browse or create the action method as entered in the field. cg@3256: sent by embedded ui-slice's browse class button." cg@2240: cg@2210: |cls spec aspect code| cg@2210: cg@2210: cls := self specClass. cg@2210: cls isNil ifTrue:[ cg@2296: Dialog information:'No application class defined.'. cg@2210: ^ self cg@2210: ]. cg@2210: cg@2210: spec := painter specForSelection. cg@2210: spec isNil ifTrue:[^ self]. cg@2210: aspect := spec perform:aspectSelector. cg@2210: aspect isNil ifTrue:[ cg@2210: Dialog information:(resources cg@2296: string:'Please enter an action method name for "%1" first.' cg@2222: with:(resources string:aspectNameShown) allBold). cg@2210: ^ self cg@2210: ]. cg@2210: cg@2629: (cls includesSelector:aspect asSymbol) ifFalse:[ cg@2210: (Dialog confirm:(resources cg@2210: stringWithCRs:'%1 does not implement %2.\\Create ?' cg@2210: with:(cls name allBold) cg@2210: with:aspect allBold)) cg@2210: ifFalse:[ cg@2210: (Dialog confirm:(resources cg@2210: stringWithCRs:'Browse implementors of %1 ?' cg@2210: with:aspect allBold)) cg@2210: ifTrue:[ cg@3228: SystemBrowser default browseImplementorsOf:aspect cg@2210: ]. cg@2210: ^ self cg@2210: ]. cg@2210: code := painter cg@2210: generateActionMethodFor:aspect cg@2210: spec:nil cg@2210: inClass:cls. cg@3073: Class packageQuerySignal answer:painter targetClass package do:[ cg@3073: code readStream fileIn. cg@3073: ]. cg@2210: ]. cg@3228: SystemBrowser default openInClass:cls selector:aspect cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:55:56 / cg" cg@2210: ! cg@2210: jan@3084: doBrowseAspectClass: aspect cg@3256: "sent by embedded ui-slice's 'browse'-class button (for example, subcanvasSpec)." cg@3256: jan@3084: | spec className class | jan@3084: jan@3084: spec := painter specForSelection. jan@3084: spec isNil ifTrue:[ self error: 'No spec!!'.]. jan@3084: className := spec perform: aspect. jan@3084: class := self resolveName: className inClass: specClass. jan@3084: class isNil ifTrue:[ jan@3084: Dialog warn: (resources string: 'No such class (%1)' with: className). jan@3084: ^ self. jan@3084: ]. jan@3084: Smalltalk browseInClass: (self resolveName: className inClass: specClass) jan@3084: jan@3084: "Created: / 24-02-2014 / 17:20:17 / Jan Vrany " jan@3084: ! jan@3084: cg@3106: doBrowseAspectClassAndSelector:classAspectAndSelectorAspect cg@3256: "sent by embedded ui-slice's browse class button (for example, subcanvasSpec)." cg@3256: cg@3106: | classAspect selector selectorAspect spec className class | cg@3106: cg@3106: classAspect := classAspectAndSelectorAspect first. "/ #(#majorKey #minorKey) cg@3106: selectorAspect := classAspectAndSelectorAspect second. "/ #(#majorKey #minorKey) cg@3106: cg@3106: spec := painter specForSelection. cg@3106: spec isNil ifTrue:[ self error: 'No spec!!'.]. cg@3106: className := spec perform: classAspect. cg@3106: class := self resolveName: className inClass: specClass. cg@3106: class isNil ifTrue:[ cg@3106: Dialog warn: (resources string: 'No such class (%1)' with: className). cg@3106: ^ self. cg@3106: ]. cg@3106: selector := spec perform: selectorAspect. cg@3106: Smalltalk cg@3106: browseInClass: (self resolveName: className inClass: specClass) theMetaclass cg@3106: selector:selector cg@3106: ! cg@3106: cg@2235: doBrowseAspectMethod:aspectSelector cg@3256: "browse or create the aspect method as entered in the field cg@3256: (button beside input field pressed)" cg@2243: cg@2529: self isModified ifTrue:[ self accept ]. cg@2529: "/ self acceptOrIgnoreSectionModification. cg@2235: self doBrowseAspectMethod:aspectSelector nameAs:aspectSelector cg@2243: cg@2243: "Modified: / 12-01-2008 / 10:32:15 / cg" jan@3084: "Modified (format): / 24-02-2014 / 17:44:03 / Jan Vrany " cg@2235: ! cg@2235: cg@2235: doBrowseAspectMethod:aspectSelector nameAs:aspectNameShown cg@2240: "browse or create the aspect method as entered in the field" cg@2240: cg@2527: |cls spec aspect implementingClass answer| cg@2235: cg@2235: cls := self specClass. cg@2235: cls isNil ifTrue:[ cg@2235: Dialog information:'No Application Class defined.'. cg@2235: ^ self cg@2235: ]. cg@2235: cg@2235: spec := painter specForSelection. cg@2527: spec isNil ifTrue:[self halt. ^ self]. cg@2525: cg@2235: aspect := spec perform:aspectSelector. sv@2284: aspect isString ifFalse:[ sv@2284: "ignore non-strings (list may be an Array)" sv@2284: aspect isNil ifTrue:[ sv@2284: Dialog information:(resources sv@2284: string:'Please enter a Method name for "%1" first.' sv@2284: with:(resources string:aspectNameShown) allBold). sv@2284: ]. cg@2235: ^ self cg@2235: ]. cg@2357: cg@2615: implementingClass := (cls whichClassIncludesSelector:aspect asSymbol). cg@2357: implementingClass isNil ifTrue:[ cg@2615: implementingClass := (cls class whichClassIncludesSelector:aspect asSymbol). cg@2357: ]. cg@2357: implementingClass isNil ifTrue:[ cg@2525: answer := OptionBox cg@2525: request:(resources cg@2525: stringWithCRs:'%1 does not implement %2.\\Create ?' cg@2525: with:(cls name allBold) cg@2525: with:aspect allBold) cg@2525: label:'Create/Browse Aspect Method' cg@2525: image:(WarningBox iconBitmap) cg@2525: buttonLabels:#('Cancel' 'Browse Implementors' 'Create & Browse' 'Create' ) cg@2525: values:#(abort browseImplementors createAndBrowse create ) cg@2525: default:#create cg@2525: onCancel:#abort. cg@2525: cg@2525: answer == #browseImplementors ifTrue:[ cg@3025: UserPreferences systemBrowserClass browseImplementorsOf:aspect. cg@2235: ^ self cg@2235: ]. cg@2525: answer == #abort ifTrue:[ cg@2525: ^ self cg@2525: ]. cg@2525: cg@2525: self doGenerateAspectMethodsForAll:(Array with:aspect). cg@2525: implementingClass := self painter targetClass. cg@2525: cg@2525: answer == #create ifTrue:[^ self]. cg@2525: ] ifFalse:[ cg@2547: (Dialog confirm:(resources string:'Browse the implementation of "%1" ?' with:aspect)) ifFalse:[ cg@2525: ^ self. cg@2525: ]. cg@2235: ]. cg@2525: cg@3025: UserPreferences systemBrowserClass cg@2357: openInClass:implementingClass selector:aspect cg@2235: ! cg@2235: tz@446: doBrowseAspectMethods cg@2240: "opens a browser on all the aspect methods" tz@765: tz@765: |methods| tz@446: tz@446: self painter isModified ifTrue:[ cg@1392: self warn:'The current window spec has not yet been saved!!\\The System Browser may show the code of the old aspect methods.' withCRs. tz@446: ]. tz@765: tz@765: (methods := self painter aspectMethods) isEmpty ifTrue:[ cg@1683: self warn:'No aspect methods found !!'. cg@1392: ^ self. tz@446: ]. cg@1684: UserPreferences systemBrowserClass cg@1684: browseMethods:methods cg@1684: title:'Aspect methods'. tz@446: ! tz@446: tz@713: doBrowseClass tz@765: "opens a System Browser on the specClass" tz@713: tz@713: self painter isModified ifTrue:[ cg@1392: self warn:'The current window spec has not yet been saved!!\\The System Browser will show the code of the old window spec.' withCRs. tz@713: ]. tz@765: cg@2400: Smalltalk browseInClass:(self resolveName:specClassName) tz@743: ! tz@743: sv@2310: doBrowseSpecificationClass sv@2310: "opens an browser on the spec class of the selected widget" sv@2310: sv@2310: |spec| sv@2310: sv@2310: (spec := self painter specForSelection) isNil ifTrue:[ sv@2310: treeView isCanvasSelected ifTrue:[ sv@2310: spec := treeView canvasSpec. sv@2310: ] sv@2310: ]. sv@2310: spec notNil ifTrue:[ sv@2310: spec class browse sv@2310: ] sv@2310: ! sv@2310: cg@1742: doBrowseViewClass cg@1742: "opens a browser on the selected widgets class" cg@1742: cg@2273: |selection widget| cg@1742: cg@1742: ((selection := self painter selection) isCollection and: [selection size >= 1]) ifTrue:[ cg@2273: widget := selection first cg@2273: ] ifFalse:[ cg@2273: widget := selection cg@2273: ]. cg@2273: cg@2829: widget scrolledView class browse cg@2829: cg@2829: "Modified: / 22-01-2011 / 12:02:31 / cg" cg@1742: ! cg@1742: tz@755: doDefineClassAndSelector tz@765: "launches a dialog for defining class, superclass, and selector of the application" tz@755: jan@3391: | again readFromModelKeyed | ca@1819: ca@1819: readFromModelKeyed := [:aKey| |ret| cg@3236: ret := (self aspectValueFor:aKey). ca@1819: ret isEmptyOrNil ifTrue:[ ca@1819: ret := nil ca@1819: ] ifFalse:[ ca@1819: ret isString ifTrue:[ ca@1819: ret := ret string withoutSeparators. ca@1819: ret := ret isEmpty ifTrue:[nil] ifFalse:[ret asSymbol]. ca@1819: ]. ca@1819: ]. ca@1819: ret ca@1819: ]. tz@755: tz@755: [ cg@1188: again := false. cg@1188: fm@2372: aspects at:#classNameChannel put:(specClassName ? 'NewApplication') asValue. ca@1819: aspects at:#methodNameChannel put:(specSelector ? 'windowSpec') asValue. cg@1976: aspects at:#superclassNameChannel put:(specSuperclassName ? 'ApplicationModel') asValue. cg@1188: cg@1188: (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[ cg@2206: specClassName := readFromModelKeyed value:#classNameChannel. ca@1819: specSelector := readFromModelKeyed value:#methodNameChannel. cg@1976: specSuperclassName := readFromModelKeyed value:#superclassNameChannel. cg@1188: cg@1188: (again := self checkClassAndSelector not) ifFalse:[ cg@2541: self painter cg@2541: className:specClassName cg@2541: superclassName:specSuperclassName cg@2541: selector:specSelector. cg@1394: ]. cg@1394: cg@1394: again ifFalse:[ cg@1983: ((Smalltalk at:specClassName asSymbol) notNil cg@1983: and:[ (Smalltalk at:specClassName asSymbol) class includesSelector:specSelector ]) cg@1394: ifTrue:[ cg@1983: (self confirm:('%1 already implements %2. Overwrite ?' bindWith:specClassName with:specSelector)) cg@1394: ifFalse:[ cg@1394: again := true. cg@1394: ]. cg@1394: ]. cg@1394: ]. cg@1394: ] ifFalse: [ cg@1188: ^nil cg@1188: ] tz@755: tz@755: ] doWhile:[again]. tz@755: cg@2541: specClassName := specClassName isBehavior cg@2541: ifTrue:[specClassName name] cg@2541: ifFalse:[specClassName]. jan@3391: specClass := self resolveName: specClassName. tz@755: cg@1188: self clearModifiedFlag. jan@3391: self helpTool buildAndMergeFromClass:specClass. tz@765: self updateInfoLabel cg@892: jan@3391: "Modified: / 16-07-1998 / 18:26:33 / cg" jan@3391: "Modified: / 18-01-2017 / 23:38:26 / Jan Vrany " tz@755: ! tz@755: tz@755: doDefineGrid tz@765: "opens a dialog for the grid parameters" tz@765: tz@755: |hspace vspace bindings painter gridPara settings| tz@755: tz@755: painter := self painter. tz@755: bindings := IdentityDictionary new. tz@755: gridPara := painter gridParameters copy. cg@1021: settings := self class settings. cg@1021: cg@1021: bindings at:#showGrid put:((settings at: #GridShown ifAbsent: [painter gridShown]) asValue). cg@1021: bindings at:#alignToGrid put:((settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue). tz@755: bindings at:#hspace put:((gridPara at:1) asValue). tz@755: bindings at:#vspace put:((gridPara at:2) asValue). tz@755: tz@755: (self openDialogInterface:#dialogSpecForDefiningGridParameters withBindings:bindings) ifFalse:[ cg@1803: ^ self tz@755: ]. tz@755: tz@755: hspace := (bindings at:#hspace) value ? 5. tz@755: vspace := (bindings at:#vspace) value ? 5. tz@755: tz@755: gridPara at:1 put:hspace. tz@755: gridPara at:2 put:vspace. tz@755: gridPara at:5 put:hspace. tz@755: gridPara at:6 put:vspace. tz@755: tz@755: painter gridShown:false. tz@755: painter gridAlign:false. tz@755: painter gridParameters:gridPara. tz@755: painter gridAlign:(bindings at:#alignToGrid) value. tz@755: painter gridShown:(bindings at:#showGrid) value. cg@1021: tz@755: settings at: #GridShown put: (bindings at:#showGrid) value. tz@755: settings at: #GridAlign put: (bindings at:#alignToGrid) value. tz@755: settings at: #HGridSpace put: hspace. tz@755: settings at: #VGridSpace put: vspace. cg@1803: painter clearView. tz@755: cg@1021: "Modified: / 4.2.1999 / 15:36:34 / cg" tz@755: ! tz@755: sv@2284: doEditList:listSelector sv@2284: "browse or create the aspect method as entered in the field (button beside input fieled pressed)" sv@2284: sv@2284: |spec list editor| sv@2284: sv@2284: self acceptOrIgnoreSectionModification. sv@2284: cg@2318: UIListEditor isNil ifTrue:[^ self]. cg@2318: sv@2284: spec := painter specForSelection. sv@2284: spec isNil ifTrue:[^ self]. sv@2284: sv@2284: "Kludge: subject - fetch the AspectAdaptor behind the TypeConverter" sv@2284: list := (specTool aspectFor:listSelector) subject value. sv@2284: list isNil ifTrue:[ sv@2284: list := #() sv@2284: ]. sv@2284: sv@2284: editor := UIListEditor new. sv@2284: editor sv@2284: informationLabel:'Edit List'; sv@2284: list:list; sv@2284: useSymbols:(list notEmpty and:[list conform:[:e| e isSymbol]]); "set use symbols, if all elements are symbols" sv@2284: open. sv@2284: sv@2284: sv@2284: editor accepted ifTrue:[ sv@2284: "Kludge: subject - fetch the AspectAdaptor behind the TypeConverter" sv@2284: (specTool aspectFor:listSelector) subject value:editor list. sv@2284: ]. sv@2284: ! sv@2284: cg@1683: doGenerateAspectMethodFor cg@2525: |cls aspectList displayedList selectorsToGenerateCode cg@1684: doBrowse methods| cg@1683: cg@1683: self askForSectionModification. cg@1683: cg@2238: cls := self painter targetClass. cg@1683: cg@1683: aspectList := OrderedCollection new. cg@1683: sv@3368: self painter aspectSelectorsAndTypesDo:[:selector :type | cg@2235: |newEntry| cg@2235: cg@1683: ( #(#modelAspect channelAspect actionSelector valueSelector) includes:type) ifTrue:[ sv@2294: ((cls canUnderstand:selector) or:[cls class canUnderstand:selector]) ifFalse:[ cg@2235: newEntry := Array with:selector with:type. sv@3368: (aspectList includes:newEntry) ifFalse:[ cg@2235: aspectList add:newEntry. cg@2235: ] cg@1683: ] cg@1683: ] cg@1683: ]. cg@1683: cg@1683: aspectList isEmpty ifTrue:[ cg@1683: self information:'All aspect methods exist.'. cg@1683: ^ self. cg@1683: ]. cg@1683: cg@2220: aspectList sort:[:a :b | a first < b first]. cg@1683: displayedList := aspectList collect:[:entry | (((entry first) paddedTo:25) contractTo:25) , ' -> ' , entry second ]. cg@1683: aspectList := aspectList collect:[:each | each first]. cg@1683: cg@1684: doBrowse := false. cg@1683: selectorsToGenerateCode := Dialog cg@1684: choose:'Select aspect(s) for which code shall be generated:' cg@1683: fromList:displayedList cg@1683: values:aspectList cg@1684: initialSelection:nil cg@1684: buttons:nil cg@1684: values:nil cg@1684: lines:15 cg@1684: cancel:nil cg@1684: multiple:true cg@1684: postBuildBlock:[:dialog | cg@1684: |b| cg@1684: cg@1684: b := Button label:'Generate & Browse'. cg@1684: b action:[doBrowse := true. dialog okPressed]. cg@1684: b := dialog addButton:b before:dialog okButton. cg@1684: ]. cg@1683: cg@1683: selectorsToGenerateCode isEmptyOrNil ifTrue:[^ self]. cg@1683: cg@2525: self doGenerateAspectMethodsForAll:selectorsToGenerateCode. cg@1684: cg@1689: "/ refetch - cls is now obsolete cg@2238: cls := self painter targetClass. cg@1689: cg@1684: doBrowse ifTrue:[ cg@1684: methods := selectorsToGenerateCode sv@1739: collect:[:sel | cls compiledMethodAt:sel] cg@1684: thenSelect:[:m | m notNil]. cg@1684: cg@1684: UserPreferences systemBrowserClass cg@1684: browseMethods:methods cg@1684: title:'Some Aspect methods'. cg@1684: ]. cg@1683: ! cg@1683: tz@743: doGenerateAspectMethods tz@765: "generates aspect and action methods for the application class" tz@765: tz@765: self askForSectionModification. cg@1683: self withWaitCursorDo:[ cg@1683: |code| cg@1683: cg@1683: code := self painter generateAspectMethodCode. cg@3073: Class packageQuerySignal answer:painter targetClass package do:[ cg@3073: code readStream fileIn. cg@3073: ] cg@1683: ] cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:56:03 / cg" tz@446: ! tz@446: cg@2525: doGenerateAspectMethodsForAll:selectorsToGenerateCode cg@2525: |code| cg@2525: cg@2525: code := self painter generateAspectMethodCodeFiltering:selectorsToGenerateCode. cg@3073: Class packageQuerySignal answer:painter targetClass package do:[ cg@3073: code readStream fileIn. cg@3073: ] cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:56:06 / cg" cg@2525: ! cg@2525: ca@1357: doGenerateAspectSelectorsMethod ca@1357: "generates aspectSelectors method for the exported aspects" ca@1357: ca@2846: |aspectSelectorsAsString| ca@1357: ca@1357: self askForSectionModification. ca@2846: aspectSelectorsAsString := self painter generateAspectSelectorsMethod. ca@2846: aspectSelectorsAsString notEmptyOrNil ifTrue:[ cg@3073: Class packageQuerySignal answer:painter targetClass package do:[ cg@3073: (ReadStream on:aspectSelectorsAsString) fileIn. cg@3073: ]. cg@3073: ]. cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:56:09 / cg" ca@1357: ! ca@1357: tz@743: doGenerateHookMethods tz@765: "generates hook methods for the application class" tz@765: tz@765: self askForSectionModification. tz@765: cg@3073: Class packageQuerySignal answer:painter targetClass package do:[ cg@3073: (ReadStream on:painter generateHookMethods) fileIn. cg@3073: ] cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:56:13 / cg" tz@765: ! tz@765: cg@966: doGenerateMenuMethods cg@966: "generates menu stub methods for the application class" cg@966: cg@966: self askForSectionModification. cg@966: cg@3073: Class packageQuerySignal answer:painter targetClass package do:[ cg@3073: (ReadStream on:painter generateMenuMethods) fileIn. cg@3073: ] cg@3073: cg@3073: "Created: / 23-08-1998 / 16:10:04 / cg" cg@966: ! cg@966: tz@765: doInspectSpec tz@765: "opens an inspector on the spec of the selected widget" tz@765: tz@765: |spec| tz@765: cg@2198: (spec := self painter specForSelection) isNil ifTrue:[ cg@2198: treeView isCanvasSelected ifTrue:[ cg@2198: spec := treeView canvasSpec. cg@2198: ] tz@446: ]. tz@765: spec notNil ifTrue:[ cg@2551: spec inspect. tz@765: ] tz@765: ! tz@765: tz@765: doInspectView tz@765: "opens an inspector on the view of the selected widget" tz@765: tz@765: |selection| tz@765: tz@765: ((selection := self painter selection) isCollection and: [selection size >= 1]) ifTrue:[ sv@2217: selection first inspect tz@765: ] ifFalse: [ sv@2217: selection inspect tz@765: ] tz@765: tz@446: ! tz@446: cg@2243: doInstallAsWebPage cg@2243: "lets user select a service, page-name and installs the page" cg@2243: cg@2258: |runningServerPorts again serviceOrPort pageName port serviceLinkName service server app| cg@2258: cg@2258: runningServerPorts := (HTTPServer runningServers collect:[:s | s port printString]) asOrderedCollection sort. cg@2243: serviceOrPort := lastPort ? LastPort ? '8080'. cg@2243: pageName := lastPage ? LastPage ? 'myPage'. cg@2243: cg@2243: [ cg@2243: again := false. cg@2243: cg@2243: aspects at:#serviceOrPortNameChannel put:serviceOrPort printString asValue. cg@2243: aspects at:#pageNameNameChannel put:pageName printString asValue. cg@2258: aspects at:#runningServerPorts put:runningServerPorts. cg@2243: cg@2243: (self openDialogInterface:#dialogSpecForDefiningPortAndPageName) ifFalse:[^ nil]. cg@2243: cg@2243: port := Integer readFrom:(aspects at:#serviceOrPortNameChannel) value onError:nil. cg@2243: port isNil ifTrue:[ cg@2243: serviceLinkName := (aspects at:#serviceOrPortNameChannel) value. cg@2243: service := HTTPPortalService allSubInstances select:[:s | s linkName = serviceLinkName]. cg@2243: service notEmptyOrNil ifTrue:[ cg@2243: again := false. cg@2243: service := service first. cg@2243: ] ifFalse:[ cg@2243: Dialog warn:'No such service' cg@2243: ]. cg@2243: ] ifFalse:[ cg@2243: server := HTTPServer serverOnPort:port. cg@2243: service := server cg@2243: serviceForLink:'/portal' cg@2243: ifAbsent:[ cg@2243: service := HTTPPortalService new. cg@2243: service linkName:'/portal'. cg@2243: service class unRegisterServiceOn:server. cg@2243: service registerServiceOn:server. cg@2243: ]. cg@2243: ]. cg@2243: cg@2243: pageName := (aspects at:#pageNameNameChannel) value. cg@2243: ] doWhile:[again]. cg@2243: cg@2243: lastPage := LastPage := pageName. cg@2243: lastPort := LastPort := port. cg@2243: cg@2243: app := self specClass new. cg@2411: app webLink:pageName. cg@2243: app service:service. cg@2243: app defineInterface:(self specSelector). cg@2243: app addToService. cg@2243: cg@2243: "/ self clearModifiedFlag. cg@2243: "/ self helpTool buildAndMergeFromClass:specClassName. cg@2243: self updateInfoLabel cg@2243: cg@2243: "Modified: / 15-01-2008 / 14:18:53 / cg" cg@2243: ! cg@2243: tz@713: doLoad tz@765: "opens a ResourceSelectionBrowser for loading a window spec from a class" tz@713: tz@729: self askForModification ifFalse: [^nil]. tz@729: tz@713: self loadFromMessage: cg@2072: (ResourceSelectionBrowser cg@3032: request: 'Load Window Spec from Class' cg@2072: onSuperclass: nil cg@2072: andClass: self specClass cg@2072: andSelector: specSelector ? #windowSpec cg@2072: withResourceTypes: #(canvas)) cg@2072: cg@2072: "Modified: / 31-08-2006 / 10:14:01 / cg" tz@713: ! tz@713: tz@713: doLoadSubspec tz@765: "opens a ResourceSelectionBrowser for loading a sub spec from a class" tz@713: cg@1976: |classAndSelector class selector| tz@729: tz@765: self askForSectionModification. tz@729: cg@1976: classAndSelector := ResourceSelectionBrowser cg@3032: request: 'Load Subspec from Class' cg@1976: onSuperclass: nil cg@2072: andClass: self specClass cg@1976: andSelector: specSelector cg@1976: withResourceTypes: #(canvas). cg@1976: cg@1976: classAndSelector isNil ifTrue:[^ self]. cg@1976: class := classAndSelector methodClass. cg@1976: selector := classAndSelector methodSelector. cg@1983: (class == specClassName and: [selector == specSelector]) ifTrue: [ cg@1976: self warn: 'Current interface as subspec not allowed!!'. cg@1976: ^ self. cg@1976: ]. cg@1976: (class respondsTo:selector) ifTrue:[ cg@1976: self addWidgetOfSpec:(Array with: (UISubSpecification new majorKey: class name; minorKey: selector)) tz@713: ] cg@2072: cg@2072: "Modified: / 31-08-2006 / 10:13:56 / cg" tz@446: ! tz@446: tz@446: doNew tz@765: "removes all widgets, specClass, and specSelector" tz@729: tz@729: self askForModification ifFalse: [^nil]. cg@2072: specClass := specClassName := specSelector := nil. tz@572: self painter removeAll. cg@2564: "/ self halt. cg@2500: treeView canvas topView cg@2541: name: self defaultNameOfCanvas; cg@2541: label: self defaultNameOfCanvas. tz@755: self helpTool doNew. cg@1710: self treeSelectionChanged. tz@785: treeView selectedNode changed. tz@785: self tabModel value: self tabList value first. tz@729: self updateInfoLabel. cg@2072: cg@2072: "Modified: / 31-08-2006 / 10:14:10 / cg" tz@446: ! tz@446: cg@3256: doOpenAspectClassChooserFor: aspect cg@3256: "open a class chooser; when ok, set the aspect to its name cg@3256: sent by embedded ui-slice's '...'-class button (for example, subcanvasSpec)." cg@3256: cg@3256: | spec className class choice| cg@3256: cg@3256: spec := painter specForSelection. cg@3256: spec isNil ifTrue:[ self error: 'No spec!!'.]. cg@3256: className := spec perform: aspect. cg@3256: class := self resolveName: className inClass: specClass. cg@3256: choice := Dialog requestClassName:'Choose class' initialAnswer:(class isNil ifTrue:nil ifFalse:[class name]). cg@3256: choice isEmptyOrNil ifTrue:[^ self ]. cg@3256: cg@3256: spec perform: (aspect asMutator) with:choice. cg@3256: (specTool aspectFor:aspect) value:choice. cg@3256: ! cg@3256: tz@765: doOpenWidgetDocumentation tz@765: "opens documentation for the selected widget" tz@765: tz@765: |spec document| tz@765: tz@765: (spec := self specForSelection) isNil ifTrue:[ cg@1940: "/ treeView isCanvasSelected ifTrue:[ cg@1940: "/ spec := nil cg@1940: "/ ] tz@765: ]. tz@765: spec notNil ifTrue:[ cg@1204: document := 'tools/uipainter/', spec documentFileName,'.html' tz@765: ] ifFalse: [ cg@1204: document := 'tools/uipainter/WindowSpec.html' tz@765: ]. tz@765: HTMLDocumentView openFullOnDocumentationFile: document tz@765: ! tz@765: tz@446: doPickAView tz@765: "changes the cursor for picking a view and builds a window spec from it" tz@765: tz@765: |view| tz@446: tz@729: self askForModification ifFalse: [^nil]. tz@446: tz@446: (view := Screen current viewFromUser) notNil ifTrue:[ sv@2217: view == Screen current rootView ifFalse:[ sv@2217: self painter setupFromSpec:(UISpecification fromView:view topView). sv@2217: ] tz@729: ]. tz@729: tz@729: self updateInfoLabel tz@729: tz@446: ! tz@446: tz@713: doSave tz@765: "saves the window spec" cg@1850: cg@2213: |code painter specClass extentUsed| tz@713: tz@765: self askForSectionModification. tz@713: self hasSpecClassAndSelector ifFalse:[ cg@1850: self doDefineClassAndSelector isNil ifTrue:[ cg@1850: ^ nil cg@1850: ] tz@713: ]. cg@2001: cg@2001: specClass := self resolveName:specClassName. cg@2001: (specClass notNil and:[ specClass isClass ]) ifFalse:[ cg@3032: self warn:('Oops - cannot save. Class not found: ' , specClassName). cg@1976: ^ nil cg@1976: ]. cg@3155: ApplicationModel forgetDefaultExtentFor:specClass. cg@2001: tz@713: painter := self painter. cg@1177: painter cg@2001: class:specClass cg@1976: superclassName:specSuperclassName cg@1341: selector:specSelector. cg@1851: cg@1851: "/ Transcript showCR:'generating windowSpec code...'. cg@1851: cg@2213: extentUsed := self canvas extent. cg@2264: (extentUsed > (1024 @ 768)) ifTrue:[ cg@1851: Dialog cg@1851: warn:(resources cg@2740: stringWithCRs:'The application''s default window-size is taken from the current size and will be %1.\\This may be too large for some displays - if required, resize and save again.' cg@2213: with:extentUsed printString allBold) cg@1851: ]. cg@2264: (self canvas maxExtent notNil cg@2264: and:[ extentUsed > self canvas maxExtent ]) ifTrue:[ cg@2264: Dialog cg@2264: warn:(resources cg@2264: stringWithCRs:'The window-size is larger than its max-extent.\\This may lead to trouble (lost extent) later. I suggest removal of the max or resizing.' cg@2264: with:extentUsed printString allBold) cg@2264: ]. cg@1851: cg@3222: code := painter generateWindowSpecMethodSource. cg@3073: Class packageQuerySignal answer:specClass package do:[ cg@3073: (ReadStream on:code) fileIn. cg@3073: ]. ca@1357: self doGenerateAspectSelectorsMethod. ca@1669: self helpTool doSave. tz@713: self updateInfoLabel. cg@2007: self clearModified. cg@1177: painter resetModification. cg@2001: (specClass respondsTo:specSelector) ifTrue:[ cg@2001: self addHistoryEntryForClass:specClass selector:specSelector. tz@713: ]. cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:52:32 / cg" tz@713: ! tz@713: tz@713: doSaveAs tz@765: "opens a ResourceSelectionBrowser for saving the window spec on a class" tz@713: cg@1976: |classAndSelector| tz@713: tz@765: self askForSectionModification. cg@2378: "/ self hasSpecClassAndSelector ifTrue:[ cg@2378: "/ self askForModification ifFalse:[^ false]. cg@2378: "/ ]. cg@1976: cg@1976: classAndSelector := ResourceSelectionBrowser cg@3032: request: 'Save Window Spec in Class' cg@1976: onSuperclass: #Object cg@1983: andClass: (specClassName ? #ApplicationModel) asSymbol cg@1976: andSelector: specSelector ? #windowSpec cg@1976: withResourceTypes: #(canvas). cg@1976: cg@1976: classAndSelector isNil ifTrue:[^ false]. cg@1976: cg@2007: self clearModified. cg@1976: self painter resetModification. cg@1976: fm@2372: specClass := classAndSelector methodClass. fm@2372: specClassName := classAndSelector methodClass name. cg@1976: specSelector := classAndSelector methodSelector. fm@2372: specSuperclassName := specClass superclass name. cg@1976: self doSave. cg@1976: ^ true tz@713: ! tz@713: cg@3032: doSaveElementSpecAs cg@3032: "opens a ResourceSelectionBrowser for saving a spec for the selected cg@3032: elements on a class. cg@3032: Useful to save parts for refactoring a spec into cg@3032: subSpecifications, for example when putting parts into a tab" cg@3032: cg@3032: |spec fullSpec classAndSelector subSpecClass subSpecClassName subSpecSelector code| cg@3032: cg@3032: self askForSectionModification. cg@3032: cg@3032: (spec := self painter specForSelection) isNil ifTrue:[ cg@3032: self warn:('Select a single item first'). cg@3032: ^ false cg@3032: ]. cg@3032: cg@3032: classAndSelector := ResourceSelectionBrowser cg@3032: request: 'Save Subspec in Class' cg@3032: onSuperclass: #Object cg@3032: andClass: specClassName cg@3032: andSelector: #subSpec cg@3032: withResourceTypes: #(canvas). cg@3032: cg@3032: classAndSelector isNil ifTrue:[^ false]. cg@3032: cg@3032: self clearModified. cg@3032: self painter resetModification. cg@3032: cg@3032: subSpecClass := classAndSelector methodClass. cg@3032: subSpecClassName := classAndSelector methodClass name. cg@3032: subSpecSelector := classAndSelector methodSelector. cg@3032: cg@3032: subSpecClass := self resolveName:subSpecClassName. cg@3032: (subSpecClass notNil and:[ subSpecClass isClass ]) ifFalse:[ cg@3032: self warn:('Oops - cannot save - class not found: ' , subSpecClassName). cg@3032: ^ false cg@3032: ]. cg@3032: cg@3032: spec := painter fullSpecFor:(painter singleSelection). cg@3032: cg@3032: fullSpec := treeView generateFullSpecForComponents:(Array with:spec) named:subSpecSelector asUppercaseFirst. cg@3032: code := painter generateWindowSpecMethodSourceFor:fullSpec class:subSpecClassName selector:subSpecSelector. cg@3073: Class packageQuerySignal answer:subSpecClass package do:[ cg@3073: (ReadStream on:code) fileIn. cg@3073: ]. cg@3032: ^ true cg@3073: cg@3073: "Modified: / 28-01-2014 / 21:53:35 / cg" cg@3032: ! cg@3032: cg@2240: doSelectAspectMethod:aspectSelector cg@2240: "open a dialog to select an existing aspect method and enter in the field" cg@2240: cg@2240: self doSelectAspectMethod:aspectSelector nameAs:aspectSelector cg@2240: ! cg@2240: cg@2240: doSelectAspectMethod:aspectSelector nameAs:aspectNameShown cg@2240: "/ |cls spec aspect code| cg@2240: "/ cg@2240: "/ cls := self specClass. cg@2240: "/ cls isNil ifTrue:[ cg@2240: "/ Dialog information:'No Application Class defined.'. cg@2240: "/ ^ self cg@2240: "/ ]. cg@2240: "/ cg@2240: "/ spec := painter specForSelection. cg@2240: "/ spec isNil ifTrue:[^ self]. cg@2240: "/ aspect := spec perform:aspectSelector. cg@2240: "/ aspect isNil ifTrue:[ cg@2240: "/ Dialog information:(resources cg@2240: "/ string:'Please enter a Method name for "%1" first.' cg@2240: "/ with:(resources string:aspectNameShown) allBold). cg@2240: "/ ^ self cg@2240: "/ ]. cg@2240: "/ cg@2240: "/ (cls implements:aspect asSymbol) ifFalse:[ cg@2240: "/ (Dialog confirm:(resources cg@2240: "/ stringWithCRs:'%1 does not implement %2.\\Create ?' cg@2240: "/ with:(cls name allBold) cg@2240: "/ with:aspect allBold)) cg@2240: "/ ifFalse:[ cg@2240: "/ (Dialog confirm:(resources cg@2240: "/ stringWithCRs:'Browse implementors of %1 ?' cg@2240: "/ with:aspect allBold)) cg@2240: "/ ifTrue:[ cg@2240: "/ UserPreferences current systemBrowserClass browseImplementorsOf:aspect cg@2240: "/ ]. cg@2240: "/ ^ self cg@2240: "/ ]. cg@2240: "/ code := painter cg@2240: "/ generateAspectMethodFor:aspect cg@2240: "/ spec:nil cg@2240: "/ inClass:cls. cg@2240: "/ code readStream fileIn. cg@2240: "/ ]. cg@2240: "/ UserPreferences current systemBrowserClass openInClass:cls selector:aspect cg@2240: ! cg@2240: sv@2310: doSortItems sv@2310: "sort the selected items by position" sv@2310: sv@2310: treeView doSortItems sv@2310: ! sv@2310: tz@446: doStartApplication tz@765: "starts the application on the editing window spec" tz@765: cg@1177: |cls application| tz@765: tz@765: self hasSpecClassAndSelector ifFalse:[ cg@1442: self doSave isNil ifTrue: [^nil]. tz@765: ] ifTrue: [ cg@1442: self askForSectionModification. cg@1442: (modified or: [self painter isModified or: [self helpTool modified]]) cg@1442: ifTrue: cg@1442: [ cg@1442: ((YesNoBox title:'Window Spec was modified!!') cg@1442: noText:'Cancel'; cg@1442: yesText:'Save it and start'; cg@1442: showAtPointer; cg@1442: accepted) ifFalse: [^nil]. cg@1442: self doSave isNil ifTrue: [^nil] cg@1442: ] tz@446: ]. tz@446: cg@1983: cls := self resolveName:specClassName. cg@1177: cls isNil ifTrue:[ cg@1983: self warn:'Oops cannot start application - no class:' , specClassName. cg@1442: ^ nil cg@1177: ]. cg@2227: application := cls new. cg@2227: (application respondsTo:#openInterface:) ifFalse:[ cg@1442: (self confirm:('The application does not respond to the ''openInterface:'' message.\(maybe the spec is supposed to be used as subApplication/subCanvas)\\Shall I try to open this as a standAlone dialog ?') withCRs) cg@1442: ifTrue:[ cg@1442: SimpleDialog new openSpec:(cls perform:specSelector) withBindings:nil. cg@1442: ]. cg@1442: ^ self. tz@446: ]. tz@765: application openInterface:specSelector tz@446: ! tz@446: ca@222: doStepDown cg@3130: "moves the selected widget(s) one step down in the hierarchy" tz@765: ca@222: treeView doStepOver:1 ca@222: ! ca@222: ca@222: doStepIn tz@765: "moves the selected widget into the next widget as child" tz@765: ca@222: treeView doStepIn ca@222: ! ca@222: ca@222: doStepOut tz@765: "moves the selected widget out of the parent widget" tz@765: ca@222: treeView doStepOut ca@222: ! ca@222: ca@222: doStepUp cg@3130: "moves the selected widget(s) one step up in the hierarchy" tz@765: ca@222: treeView doStepOver:-1 tz@743: ! tz@743: tz@743: doWindowSpec tz@765: "opens a code view with the contents of the window spec" tz@765: tz@765: self askForSectionModification. tz@765: tz@765: CodeView sv@2217: openWith: self painter generateWindowSpecMethodSource sv@2217: title: 'Window Spec' tz@743: ca@222: ! ! ca@222: sv@3111: !UIPainter::ApplicationClassQuery class methodsFor:'documentation'! sv@3111: sv@3111: documentation sv@3111: "This Query answers the application class, that is currently being edited" sv@3111: ! ! sv@3111: ca@222: !UIPainter::TreeView class methodsFor:'documentation'! ca@222: cg@3053: documentation cg@3053: " cg@3053: selection in tree view; only used by the UIPainter cg@3053: cg@3053: [see also:] cg@3053: SelectionInTreeView cg@3053: SelectionInTree cg@3053: TreeItem sv@2217: UIPainter ca@222: ca@222: [author:] sv@2217: Claus Atzkern ca@222: " ca@222: ca@222: cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'accessing'! cg@3053: cg@3053: canvas cg@3053: "returns the canvas (UIPainterView)" cg@3053: cg@3053: ^ model root contents view cg@3053: cg@3053: cg@3053: ! cg@3053: cg@3053: canvas:aCanvas cg@3053: "install canvas (UIPainterView)" tz@765: cg@1396: self canvas:aCanvas specName:nil ca@281: ! ca@281: cg@3053: canvas:aCanvas specName:nameOfSpec cg@3053: "install canvas (UIPainterView)" cg@3053: cg@3053: |props| cg@3053: cg@3053: props := UIPainterView::ViewProperty new. cg@1394: props view:aCanvas. cg@2541: cg@2541: model root:(TreeItem cg@3251: name:(nameOfSpec ? painter defaultNameOfCanvas) allBold cg@2541: contents:props). cg@2541: cg@1394: model root expand. cg@1394: self enableChannel:(aCanvas enableChannel). cg@1394: ! cg@1394: cg@3053: canvasSpec tz@765: "returns spec assigned to canvas" tz@765: sv@1574: |spec list cls canvas| ca@281: cg@1466: spec := self windowSpecClass new. ca@1356: canvas := self canvas. ca@1356: ca@1356: spec fromView:(canvas topView) callBack:nil. ca@1356: ca@311: windowSpec notNil ifTrue:[ ca@1356: spec copyValuesFromSpec:windowSpec. ca@311: ]. ca@1356: ca@1356: spec exportedAspects isNil ifTrue:[ ca@1356: ( (cls := canvas className) notNil ca@1357: and:[(cls := canvas resolveName:cls) notNil] ca@1356: ) ifTrue:[ ca@1357: list := cls perform:#aspectSelectors ifNotUnderstood:nil. ca@1356: ]. ca@1357: spec setExportedAspectsFrom:list. cg@1360: windowSpec notNil ifTrue:[ cg@1360: windowSpec exportedAspects:(spec exportedAspects). cg@1360: ] ca@1356: ]. ca@1356: cg@1466: self propertiesDo:[:aProp| cg@1466: |propsSpec| cg@1466: ca@1357: spec exportedAspectsAddKey:(aProp model) type:nil. cg@1466: propsSpec := aProp spec. cg@2251: propsSpec aspectSelectors cg@2251: select:[:a | a isString or:[a isSymbol]] cg@2251: thenDo:[:aKey|spec exportedAspectsAddKey:aKey type:nil]. cg@2251: propsSpec actionSelectors cg@2251: select:[:a | a isString or:[a isSymbol]] cg@2251: thenDo:[:aKey|spec exportedAspectsAddKey:aKey type:#action]. ca@1356: ]. ca@1356: ^ spec ca@282: ! ca@282: cg@3053: canvasSpec:aSpec cg@3053: "update canvas from spec" cg@3053: cg@3053: |spec| cg@3053: cg@3053: self setAttributesFromWindowSpec:aSpec. cg@3053: spec := aSpec copy. cg@3053: spec menu:nil. cg@3053: spec flags:nil. cg@3053: cg@3053: spec setAttributesIn:(self canvas "topView") with:(UIBuilder new isEditing:true). cg@3053: ! cg@3053: cg@3053: exportedAspects cg@3053: "returns spec assigned to canvas" cg@3053: cg@3053: windowSpec isNil ifTrue:[^ #()]. cg@3053: ^ windowSpec exportedAspects ? #() cg@3053: cg@3053: ! cg@3053: cg@3053: itemOfView:aView cg@3053: "returns item assigned to view or nil" cg@3053: cg@3053: aView notNil ifTrue:[ sv@2217: self allItemsDo:[:anItem| sv@2217: (anItem contents view == aView) ifTrue:[^ anItem] sv@2217: ] ca@282: ]. tz@765: ^ nil ca@282: ca@282: tz@755: ! tz@755: cg@3053: lastDrawnMaster cg@3053: "returns the lastDrawnMaster" cg@3053: cg@3053: ^ lastDrawnMaster cg@3053: cg@3053: cg@3053: ! cg@3053: cg@3053: painter cg@3053: ^ painter cg@3053: ! cg@3053: cg@3053: painter:something cg@3053: painter := something. cg@3053: ! cg@3053: cg@3053: windowSpecClass cg@3053: "returns the default windowSpecClass (WindowSpec)" cg@3053: cg@3053: ^ windowSpecClass ? WindowSpec cg@3053: ! cg@3053: cg@3053: windowSpecClass:aClass cg@1466: "set the default windowSpecClass" cg@1466: cg@3078: windowSpecClass := aClass ca@222: ! ! ca@222: cg@3053: !UIPainter::TreeView methodsFor:'accessing-property'! cg@3053: cg@3053: propertiesDo:aOneArgBlock cg@3053: "evaluates the argument a block on each property" cg@3053: cg@3053: self allItemsDo:[:anItem| aOneArgBlock value:(anItem contents)] cg@3053: cg@3053: cg@3053: ! cg@3053: cg@3053: propertyDetect:aOneArgBlock tz@765: "evaluates the block on each property" tz@765: ca@222: self allItemsDo:[:anItem| sv@2217: (aOneArgBlock value:(anItem contents)) ifTrue:[^ anItem contents] ca@222: ]. tz@765: ^ nil ca@222: ca@222: ! ca@222: cg@3053: propertySelected cg@3053: "returns current selected property or nil in case of multi selection cg@3053: or empty selection " cg@3053: cg@3053: |idx| cg@3053: cg@3053: selection size == 1 ifTrue:[ cg@3053: (idx := selection first) ~~ 1 ifTrue:[ "canvas: not yet supported" cg@3053: ^ (listOfNodes at:idx) contents cg@3053: ] cg@3053: ]. cg@3053: ^ nil cg@3053: cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'adding & removing'! cg@3053: cg@3053: addProperty:aProperty cg@3053: "adds a new item" cg@3053: cg@3053: ^ self addProperty:aProperty beforeIndex:nil. cg@3053: ! cg@3053: cg@3053: addProperty:aProperty beforeIndex:anIndex ca@2389: "adds a new item" ca@2389: ca@2389: |parent treeItem index| ca@295: ca@1870: parent := self detectItemCorespondingToView:(aProperty view superView). ca@2389: parent isNil ifTrue:[^ nil ]. ca@2389: ca@2389: treeItem := TreeItem new contents:aProperty. ca@2389: index := parent numberOfChildren + 1. ca@2389: ca@2389: (anIndex notNil and:[anIndex > 0]) ifTrue:[ ca@2389: index := anIndex min:index. ca@2389: ]. ca@2389: model add:treeItem beforeIndex:index below:parent. ca@2389: ^ treeItem cg@3053: ! cg@3053: cg@3053: removeAll cg@3053: "removes all items other than canvas" cg@3053: cg@3053: lastDrawnMaster := nil. cg@3053: windowSpec := nil. cg@3053: cg@3053: self canvas components copy do:[:aView| cg@2507: aView destroy cg@2507: ]. ca@222: self canvas subViews copy do:[:aView| sv@2217: "/ care to not destroy the transparent input view sv@2217: (aView isInputOnly) ifFalse:[aView destroy] ca@222: ]. cg@3251: model root name: painter defaultNameOfCanvas allBold. ca@774: model removeAllOtherThanRoot. ca@222: ! ca@222: cg@3053: removeView:aView cg@3053: "removes a view" cg@3053: cg@3053: |item prnt| cg@3053: cg@3053: ((item := self itemOfView:aView) notNil and:[(prnt := item parent) notNil]) ifTrue:[ cg@3053: aView destroy. cg@3053: prnt contents view sizeChanged:nil. cg@3053: model remove:item cg@3053: ] cg@3053: cg@3053: cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'building'! cg@3053: cg@3053: generateFullSpecForComponents:aSpecArray named:specNameSymbol tz@765: "generates a full spec from aSpecArray" tz@765: cg@351: |fullSpec winSpec| ca@311: ca@311: fullSpec := FullSpec new. tm@1058: fullSpec name:specNameSymbol. ca@311: cg@2213: fullSpec fromBuilder:(self canvas) cg@2213: components:(SpecCollection new collection:aSpecArray). ca@311: cg@2223: winSpec := fullSpec window. cg@2223: windowSpec isNil ifTrue:[ cg@2223: "/ kludge: if grid was on, its now present in the windowSpec (which should not) cg@2223: self canvas gridShown ifTrue:[ cg@2223: fullSpec window backgroundColor:nil. cg@2223: ]. cg@2223: ] ifFalse:[ cg@2213: winSpec copyValuesFromSpec:windowSpec. ca@311: ]. cg@2223: winSpec name: winSpec label. cg@2277: ^ fullSpec. ca@311: ! ca@311: cg@3053: setAttributesFromWindowSpec:aWindowSpec cg@3053: "sets a window spec from aWindowSpec and applies some attributes cg@3053: to the canvas." cg@3053: cg@3053: |name canvasView builder| tz@765: cg@1466: windowSpec := (self windowSpecClass) new copyValuesFromSpec:aWindowSpec. cg@1172: canvasView := self canvas. cg@1172: cg@1172: builder := UIBuilder new isEditing:true. cg@1172: aWindowSpec setAttributesIn:canvasView with:builder. cg@1172: ca@1391: name := aWindowSpec label. ca@1391: canvasView topView name:name. ca@1391: self canvasNameChanged:name. cg@1710: self application treeSelectionChanged. ca@311: ! ! ca@311: cg@3053: !UIPainter::TreeView methodsFor:'canvas selection'! cg@3053: cg@3053: canvasSelection:aSelection cg@3053: "canvas changed its selection cg@3053: " cg@3053: |sel list size| cg@3053: cg@3053: ((sel := aSelection) isNil or:[sel isCollection]) ifFalse:[ cg@3053: sel := Array with:sel cg@3053: ]. cg@3053: cg@3053: (size := sel size) ~~ 0 ifTrue:[ sv@2217: list := OrderedCollection new:size. sv@2217: cg@2552: sel do:[:aView| cg@2552: |item| cg@2552: sv@2217: (item := self itemOfView:aView) notNil ifTrue:[ sv@2217: list add:item. sv@2217: model doMakeVisible:item. sv@2217: ] sv@2217: ]. sv@2217: sel := list collect:[:anItem| self indexOfNode:anItem ]. ca@774: ]. cg@2256: self canvasEventsDisabledDo:[ self selection:sel ]. cg@2256: ! cg@2256: cg@3053: canvasSelectionAdd:aView cg@3053: "canvas adds a view to current selection cg@3053: " cg@3053: |item index oldSel| cg@3053: cg@3053: item := self itemOfView:aView. cg@3053: cg@3053: item notNil ifTrue:[ cg@3053: model doMakeVisible:item. cg@3053: cg@3053: (index := self indexOfNode:item) ~~ 0 ifTrue:[ cg@3053: oldSel := selection copy. cg@3053: self addToSelection:index. cg@3053: self selectionChangedFrom:oldSel cg@3053: ] cg@3053: ] cg@3053: ! cg@3053: cg@3053: canvasSelectionRemove:aView cg@3053: "canvas removes a view from current selection cg@3053: " cg@3053: |item index oldSel| cg@3053: cg@3053: ( (item := self itemOfView:aView) notNil cg@3053: and:[(index := self indexOfNode:item) ~~ 0 cg@3053: and:[self isInSelection:index]] cg@3053: ) ifTrue:[ cg@3053: oldSel := selection copy. cg@3053: self removeFromSelection:index. cg@3053: self selectionChangedFrom:oldSel. cg@3053: ]. cg@3053: ! cg@3053: cg@3053: selectedViews cg@3053: ^ self selection cg@2552: collect:[:index | cg@2552: |node view| cg@2552: cg@2552: node := listOfNodes at:index. cg@2552: view := node contents view. cg@2552: view cg@2552: ] cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'change & update'! cg@3053: cg@3053: canvasNameChanged:aName cg@3053: "called if identification name assigned to window (canvas) changed cg@3053: " cg@3053: |name node| cg@3053: cg@3053: node := listOfNodes at:1. ca@281: ca@281: ( aName size ~~ 0 ca@281: and:[(name := aName string withoutSeparators) size ~~ 0 ca@281: and:[(self propertyDetect:[:p| p name = name]) isNil ca@281: and:[node name ~= name]]] ca@281: ) ifTrue:[ cg@3251: node name: name allBold. sv@2217: node changed. ca@281: ]. ca@281: ! ca@281: cg@3053: layoutChanged cg@3053: "layout of any component changed; in case of single selection, the cg@3053: application will be informed to update its layout ca@222: " ca@222: selection size == 1 ifTrue:[ sv@2217: self application layoutChanged ca@222: ] ca@222: ca@222: ca@222: ! ca@222: cg@3053: propertyChanged:aProperty cg@3053: "property of view derived from argument a property changed ca@222: " ca@222: |item idx end| ca@222: ca@222: item := self itemOfView:(aProperty view). ca@222: ca@222: item notNil ifTrue:[ sv@2217: item contents:aProperty. sv@2217: sv@2217: item name = aProperty name ifFalse:[ sv@2217: idx := self firstLineShown. sv@2217: sv@2217: (end := self lastLineShown) > listOfNodes size ifTrue:[ sv@2217: end := listOfNodes size sv@2217: ]. sv@2217: item changed. sv@2217: sv@2217: [idx <= end] whileTrue:[ sv@2217: (listOfNodes at:idx) == item ifTrue:[ sv@2217: self redrawLine:idx. "/ is visible; redraw line sv@2217: end := 0 sv@2217: ] ifFalse:[ sv@2217: idx := idx + 1 sv@2217: ] sv@2217: ] sv@2217: ]. sv@2217: sv@2217: self selectedNode == item ifTrue:[ "/ inform application sv@2217: self application propertyChanged sv@2217: ] ca@222: ]. ca@222: ca@222: ca@222: ! ! ca@222: cg@3053: !UIPainter::TreeView methodsFor:'drag & drop'! cg@3053: cg@3053: canDrop:aDropContext cg@3053: "can drop ? -> delegate to canvas" cg@3053: cg@3053: ^ self canvas canDrop:aDropContext cg@3053: cg@3053: "Modified: / 13-10-2006 / 16:08:43 / cg" cg@3053: ! cg@3053: cg@3053: canDrop:aDropContext at:aPoint cg@2114: "can drop ? -> delegate to canvas" cg@2114: cg@2117: ^ self canvas canDrop:aDropContext at:aPoint cg@2114: cg@2114: "Created: / 13-10-2006 / 12:35:53 / cg" cg@2117: "Modified: / 13-10-2006 / 16:08:46 / cg" cg@2114: ! cg@2114: cg@3053: canDropObjects:aCollectionOfDropObjects cg@3053: "can drop ? -> delegate to canvas" cg@3053: cg@3053: ^ self canvas canDropObjects:aCollectionOfDropObjects cg@3053: cg@3053: "Created: / 13-10-2006 / 16:08:31 / cg" cg@3053: ! cg@3053: cg@3053: canDropObjects:aCollectionOfDropObjects at:aPoint cg@3053: "can drop ? -> delegate to canvas" cg@3053: cg@3053: ^ self canvas canDropObjects:aCollectionOfDropObjects at:aPoint cg@3053: cg@3053: "Created: / 13-10-2006 / 16:08:35 / cg" cg@3053: ! cg@3053: cg@3053: drop:aDropContext cg@3053: "drop objects -> delegate to canvas" cg@3053: cg@3053: self canvas drop:aDropContext cg@3053: cg@3053: "Created: / 13-10-2006 / 12:35:59 / cg" cg@3053: "Modified: / 13-10-2006 / 16:09:04 / cg" cg@3053: ! cg@3053: cg@3053: drop:aDropContext at:aPoint cg@3053: "drop objects -> delegate to canvas" cg@3053: cg@3053: self canvas drop:aDropContext at:nil cg@3053: cg@3053: "Modified: / 13-10-2006 / 16:09:07 / cg" cg@3053: ! cg@3053: cg@3053: dropObjects:aCollectionOfDropObjects cg@3053: "drop objects -> delegate to canvas" cg@3053: cg@3053: self canvas dropObjects:aCollectionOfDropObjects cg@3053: cg@3053: "Created: / 13-10-2006 / 16:08:51 / cg" cg@3053: ! cg@3053: cg@3053: dropObjects:aCollectionOfDropObjects at:aPoint cg@3053: "drop objects -> delegate to canvas" cg@3053: cg@3053: self canvas dropObjects:aCollectionOfDropObjects at:nil cg@3053: cg@3053: "Created: / 13-10-2006 / 16:08:56 / cg" cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'enumerating'! cg@3053: cg@3053: allItemsDo:aOneArgBlock cg@3053: "evaluates the argument a block on each item other than the canvas" cg@3053: cg@3053: model root allChildrenDo:aOneArgBlock cg@3053: cg@3053: cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'event handling'! cg@3053: cg@3053: canvasEventsDisabledDo:aBlock cg@3053: "evaluates the block without raising selection changed notifications to canvas" cg@3053: cg@3053: |restoreCanvasEvents| cg@3053: cg@3053: restoreCanvasEvents := canvasEventsDisabled. cg@3053: canvasEventsDisabled := true. cg@3053: aBlock value. cg@3053: canvasEventsDisabled := restoreCanvasEvents. cg@3053: ! cg@3053: cg@3053: doubleClicked cg@3053: "disables collapsing of the root item" cg@3053: cg@3053: self selectedNode == model root ifFalse:[ cg@3053: super doubleClicked cg@3053: ] cg@3053: cg@3053: cg@3053: ! cg@3053: cg@3053: redrawLabelAt:x y:yTop index:anIndex cg@3053: "draws a tiny rectangle for indicating the master node (first selected node)" cg@3053: cg@3053: |dX| cg@3053: cg@3053: super redrawLabelAt:x y:yTop index:anIndex. cg@3053: cg@3053: ((selection size > 1) and: [selection first == anIndex]) ifTrue:[ cg@3053: dX := textInset - 1. cg@3053: self paint:(Color red). "/ self application painter handleMasterColor. cg@3053: self fillRectangleX:(x - dX - 2) cg@3053: y:yTop + ((fontHeight - dX) // 2) cg@3053: width:dX cg@3053: height:dX cg@3053: ] cg@3051: ! ! cg@3051: cg@3051: !UIPainter::TreeView methodsFor:'initialization'! cg@3051: cg@3053: iconForNode:aNode cg@3053: |spec| cg@3053: cg@3053: spec := aNode contents spec. cg@3053: spec isNil ifTrue: [ cg@3053: ^ WindowSpec icon cg@3053: ] ifFalse:[ cg@3053: ^ spec icon cg@3053: ] cg@3053: ! cg@3053: cg@3053: initialize cg@3053: "initialize the tree view; multiple select and tree item actions" cg@3053: cg@3053: super initialize. cg@3053: cg@3053: self multipleSelectOk:true. cg@3053: canvasEventsDisabled := false. cg@3053: self showDirectoryIndicator: true. cg@3053: self showDirectoryIndicatorForRoot: false. cg@3053: cg@3053: self model cg@3053: iconAction:[:aNode| self iconForNode:aNode]; cg@3053: labelAction: [:aNode | self labelForNode:aNode]. cg@3053: ! cg@3053: cg@3053: labelForNode:aNode cg@3053: |spec| cg@3053: cg@3053: spec := aNode contents spec. cg@3053: spec notNil ifTrue: [ cg@3053: ^ self nameForSpecInList:spec cg@3053: ] ifFalse:[ cg@3053: ^ aNode name cg@3053: ] ca@222: ! ! ca@222: cg@3051: !UIPainter::TreeView methodsFor:'private'! cg@3051: cg@3053: nameForSpecInList:aSpec cg@3053: "returns the tree item label for aSpec" cg@3053: cg@3053: |aspect aspectPrefix nameString viewClassString| cg@3053: cg@3053: nameString := aSpec name ? ''. cg@3053: viewClassString := '[',aSpec viewClass name,']' . cg@3053: cg@3053: aspect := aSpec nameOfMainAspect. cg@2230: aspect notNil ifTrue:[ cg@2854: aspectPrefix := '(',aspect allBold ,') ' cg@2854: ] ifFalse:[ cg@2854: aspectPrefix := ''. cg@2854: ]. cg@2854: cg@2854: ^ aspectPrefix, nameString, ': ', viewClassString cg@2854: cg@2854: "Modified: / 17-08-2011 / 09:10:31 / cg" ca@222: ! ca@222: cg@3053: selectionChangedFrom:oldSelection ca@222: "selection has changed. update master selection and raise notification ca@222: to canvas in case of enabled cvs events ca@222: " ca@282: |sel size| ca@222: ca@222: super selectionChangedFrom:oldSelection. ca@282: size := selection size. ca@222: cg@2256: canvasEventsDisabled ifFalse:[ sv@2217: (size ~~ 0 and:[size ~~ 1 or:[selection first ~~ 1]]) ifTrue:[ sv@2217: sel := OrderedCollection new. sv@2217: sv@2217: selection do:[:i| sv@2217: i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view] sv@2217: ] sv@2217: ]. sv@2217: self canvas updateSelectionFromModel:sel tz@778: ]. tz@713: size = 1 ifTrue:[ sv@2217: oldSelection size > 1 ifTrue: [ sv@2217: (listOfNodes at:lastDrawnMaster) retrieveLabel. sv@2217: self redrawLine: lastDrawnMaster. sv@2217: lastDrawnMaster := selection first sv@2217: ] tz@713: ]. tz@713: size > 1 ifTrue:[ sv@2217: selection first ~~ lastDrawnMaster ifTrue: [ sv@2217: (listOfNodes at:selection first) retrieveLabel. sv@2217: lastDrawnMaster notNil ifTrue: [(listOfNodes at:lastDrawnMaster) retrieveLabel]. sv@2217: self redrawLine: lastDrawnMaster. sv@2217: self redrawLine: (lastDrawnMaster := selection first) sv@2217: ] tz@785: ] tz@713: ifFalse: [ sv@2217: lastDrawnMaster := nil tz@785: ] cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'queries'! cg@3053: cg@3053: canChangeOrderInContainer cg@3053: "returns true if any selection exists and all widgets in the selection cg@3053: can change their layout through to a move or align operation" tz@565: cg@3130: "/ old code (only allow if a single item is selected): cg@3130: "/ cg@3130: "/ ^(selection size == 1) and: cg@3130: "/ [(selection at: 1) ~~ 1 and: cg@3130: "/ [self selectedNode parent children size > 1]] cg@3130: cg@3130: ^ self selectedNodes cg@3130: conform:[:eachSelectedNode | cg@3130: |parent| cg@3130: cg@3130: (parent := eachSelectedNode parent) notNil cg@3130: and:[parent children size > 1] cg@3130: ]. tz@565: ! tz@565: cg@3053: canExchangeSelectionLayouts cg@3053: "returns true if the selections size is exactly 2 cg@3053: and all widgets in the selection cg@3053: can change their layout through to a move or align operation" cg@3053: cg@3053: selection size == 2 ifFalse:[ cg@3053: ^ false cg@3053: ]. cg@3053: ^ self canMoveOrAlignSelection cg@3053: ! cg@3053: cg@3053: canMoveOrAlignSelection ca@282: "returns true if any selection exists and all widgets in the selection tz@765: can change their layout through to a move or align operation" ca@282: cg@2361: selection isEmptyOrNil ifTrue:[ sv@2217: ^ false ca@282: ]. ca@282: ca@282: selection do:[:i| cg@2361: |node view| cg@2361: cg@2361: i == 1 ifTrue:[ cg@2361: "/ the tree node for the canvas itself. cg@2361: ^ false cg@2361: ]. cg@2361: node := listOfNodes at:i. cg@2361: view := node contents view. cg@2361: (self canvas canChangeLayoutOfView:view) ifFalse:[ sv@2217: ^ false sv@2217: ] ca@282: ]. ca@282: ^ true ca@282: ! ca@282: cg@3053: canMoveSelectionIntoContainer tz@765: "returns true in case that one widget is selected and can change its container sv@2280: widget to an element below" sv@2280: sv@2280: |item oldParentItem newParentItem idx| sv@2280: sv@2280: item := self selectedNode. sv@2280: (item notNil and:[(oldParentItem := item parent) notNil]) ifTrue:[ sv@2280: idx := (oldParentItem indexOfChild:item) + 1. sv@2280: newParentItem := oldParentItem children detect:[:eachChild| sv@2280: eachChild contents spec class supportsSubComponents sv@2280: ] startingAt:idx ifNone:nil. sv@2280: ^ newParentItem notNil. ca@222: ]. sv@2280: sv@2280: ^ false cg@3053: ! cg@3053: cg@3053: canMoveSelectionOutOfContainer cg@3053: "returns true in case that one widget is selected which is contained within tz@765: another widget" tz@765: ca@222: |item prnt| ca@222: ca@222: ( (item := self selectedNode) isNil ca@222: or:[(prnt := item parent) isNil ca@222: or:[prnt parent isNil]] ca@222: ) ifTrue:[ sv@2217: ^ false ca@222: ]. tz@765: ^ true ca@222: ! ca@222: cg@3053: canResizeSelectedWidget cg@3053: "returns true in case of one widget selected and is contained cg@3053: within a widget which allows to resize sub components" tz@765: tz@765: |selectedNode| tz@765: tz@765: (selectedNode := self selectedNode) notNil ifTrue:[ sv@2217: (selectedNode := selectedNode parent) notNil ifTrue:[ sv@2217: ^ (selectedNode parent isNil or:[selectedNode contents spec class canResizeSubComponents]) sv@2217: ] ca@301: ]. ca@301: ^ false ca@301: ! ca@301: cg@3053: canResizeSelection cg@3053: "returns true if all selected widgets can be resized" cg@3053: cg@3053: selection isEmptyOrNil ifTrue:[ ^ false ]. cg@3053: ^ self canvas canResize:(self selectedViews) cg@3053: ! cg@3053: cg@3361: hasMultipleSelectionOtherThanCanvas cg@3361: "returns true in case that any selection other than the canvas exists" cg@3361: cg@3361: ^ selection size > 0 and:[ (selection count:[:anyindex | anyindex ~~ 1]) > 1] cg@3361: ! cg@3361: cg@3053: hasOneSelectionOtherThanCanvas cg@3053: "returns true in case that one selection exists other than the canvas" cg@3053: cg@3053: ^ selection size == 1 and:[selection first ~~ 1] cg@3053: ! cg@3053: cg@3361: hasSelectionOtherThanCanvas cg@3361: "returns true in case that any selection other than the canvas exists" cg@3361: cg@3361: ^ selection size > 0 and:[selection contains:[:anyindex | anyindex ~~ 1]] cg@3361: ! cg@3361: cg@3053: isCanvasSelected cg@3053: "returns true in case of a single selection and the cg@3053: selection is the canvas (index 1)" cg@3053: cg@3053: ^ selection size == 1 and:[self isInSelection:1] cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'searching'! cg@3053: cg@3053: detectItemCorespondingToView:aView cg@3053: "detects the item coresponding to the view. The item of the view or the first cg@3053: subview providing the item is returned. If no property is detected nil is cg@3053: returned" cg@3053: cg@3053: |view item| cg@3053: cg@3053: (view := aView) isNil ifTrue:[ ^ nil ]. cg@3053: cg@3053: [(item := self itemOfView:view) isNil] whileTrue:[ cg@3053: (view := view superView) isNil ifTrue:[^ listOfNodes at:1] cg@3053: ]. cg@3053: ^ item cg@3053: ! ! cg@3053: cg@3053: !UIPainter::TreeView methodsFor:'user interaction'! cg@3053: cg@3053: askForSelectionChangeAllowed tm@1621: selectConditionBlock notNil ifTrue:[ tm@1621: ^ selectConditionBlock value:nil tm@1621: ]. tm@1621: ^ true tm@1621: ! tm@1621: cg@3053: doChangeParentOfSelectedItemTo:newParentItem cg@3053: cg@3053: |canvas| cg@3053: cg@3053: newParentItem isNil ifTrue:[ cg@3053: ^ self cg@3053: ]. cg@3053: self askForSelectionChangeAllowed ifFalse:[^ self]. cg@3053: self setSelection:nil. cg@3053: cg@3053: canvas := self canvas. cg@3053: canvas deleteSelection. cg@3053: canvas setSelection:(newParentItem contents view) withRedraw:false. cg@3053: canvas pasteWithLayout. cg@3053: ! cg@3053: cg@3053: doSortItems cg@3053: "sort items by their top-left position" cg@3053: cg@3053: |selectedItems parent sortedItems newChildren itemList parentView| cg@3053: cg@3053: self askForSelectionChangeAllowed ifFalse:[^ self]. sv@2310: sv@2310: selectedItems := self selectedNodes. sv@2310: selectedItems size <= 1 ifTrue:[^ self]. sv@2310: parent := selectedItems first parent. sv@2310: (parent isNil or:[(selectedItems conform:[:e| e parent == parent]) not]) ifTrue:[^ self]. sv@2310: cg@2500: sortedItems := selectedItems sort:[:a :b| cg@2500: a contents view origin isLeftOrAbove:(b contents view origin)]. sv@2310: itemList := selectedItems asIdentitySet. sv@2310: sv@2310: newChildren := parent children collect:[:eachChild| sv@2310: (itemList includes:eachChild) ifTrue:[ sv@2310: sortedItems removeFirst. sv@2310: ] ifFalse:[ sv@2310: eachChild. sv@2310: ]. sv@2310: ]. sv@2310: sv@2310: self setSelection:nil. sv@2310: model remove:parent children. sv@2310: model add:newChildren beforeIndex:1 below:parent. sv@2310: sv@2310: parentView := parent contents view. sv@2310: sv@2310: self canvas hideSelection. sv@2310: newChildren keysAndValuesDo:[:idx :eachItem| sv@2310: parentView changeSequenceOrderFor:eachItem contents view to:idx. sv@2310: ]. sv@2310: parentView specClass isLayoutContainer ifFalse:[ cg@2500: parentView components notEmptyOrNil ifTrue:[ self halt ]. sv@2310: parentView subViews do:[:v| v raise ]. sv@2310: ]. sv@2310: self canvas showSelection. sv@2310: cg@2500: self selectNodes:itemList asOrderedCollection. sv@2310: ! sv@2310: cg@3130: doStep:item over:anIndex cg@3130: "moves a single child 'anIndex' forward or backward in list of children. cg@3130: positive index: move down; negative index: move up" cg@3130: cg@3130: |idx size parentItem parentItemsView itemsView canvas prevSelection| cg@3130: cg@3130: self askForSelectionChangeAllowed ifFalse:[^ self]. cg@3130: cg@3130: ( item isNil cg@3130: or:[(parentItem := item parent) isNil cg@3130: or:[(size := parentItem children size) < 2 cg@3130: or:[(idx := parentItem indexOfChild:item) == 0]]] cg@3130: ) ifTrue:[ cg@3130: ^ self cg@3130: ]. cg@3130: cg@3130: idx := idx + anIndex. cg@3130: cg@3130: idx < 1 ifTrue:[idx := size] cg@3130: ifFalse:[idx > size ifTrue:[idx := 1]]. cg@3130: cg@3130: prevSelection := self selectedNodes. cg@3130: self setSelection:nil. cg@3130: cg@3130: model remove:item. cg@3130: model add:item beforeIndex:idx below:parentItem. cg@3130: cg@3130: idx := parentItem indexOfChild:item. cg@3130: itemsView := item contents view. cg@3130: parentItemsView := parentItem contents view. cg@3130: cg@3130: canvas := self canvas. cg@3130: canvas hideSelection. cg@3130: cg@3130: itemsView isView ifFalse:[ cg@3130: "/ a component - has its own collection (and therefore indexing) - sigh cg@3130: idx := idx - ((1 to:idx-1) count:[:i | (parentItem children at:i) contents view isView]). cg@3130: parentItemsView changeSequenceOrderFor:itemsView to:idx. cg@3130: ] ifTrue:[ cg@3130: "/ a view - has its own collection (and therefore indexing) - sigh cg@3130: idx := idx - ((1 to:idx-1) count:[:i | (parentItem children at:i) contents view isView not]). cg@3130: parentItemsView changeSequenceOrderFor:itemsView to:idx. cg@3130: ]. cg@3130: cg@3130: parentItemsView specClass isLayoutContainer ifFalse:[ cg@3130: "/ spVw components notEmptyOrNil ifTrue:[ self halt ]. cg@3130: parentItemsView subViews do:[:v| v raise ]. cg@3130: ]. cg@3130: self selectNodes:prevSelection. cg@3130: canvas showSelection. cg@3130: ! cg@3130: cg@3053: doStepIn cg@3053: "move the currently selected widget into the next available container below" cg@3053: cg@3053: |item oldParentItem newParentItem idx| cg@3053: cg@3053: item := self selectedNode. cg@3053: (item notNil and:[(oldParentItem := item parent) notNil]) ifTrue:[ cg@3053: idx := (oldParentItem indexOfChild:item) + 1. cg@3053: newParentItem := oldParentItem children cg@3053: detect:[:eachChild | eachChild contents spec class supportsSubComponents] cg@3053: startingAt:idx cg@3053: ifNone:nil. cg@3053: newParentItem notNil ifTrue:[ cg@3053: self doChangeParentOfSelectedItemTo:newParentItem sv@2280: ]. cg@3053: ] cg@3053: ! cg@3053: cg@3053: doStepOut cg@3053: |item| cg@3053: cg@3053: item := self selectedNode. cg@3053: (item notNil and:[(item := item parent) notNil]) ifTrue:[ cg@3053: self doChangeParentOfSelectedItemTo:(item parent) cg@3053: ]. cg@3053: ! cg@3053: cg@3053: doStepOver:anIndex cg@3053: "moves child 'anIndex' forward or backward in list of children" cg@3053: cg@3053: |item idx size parentItem parentItemsView itemsView canvas| cg@3053: cg@3053: self askForSelectionChangeAllowed ifFalse:[^ self]. cg@3053: cg@3130: anIndex < 0 ifTrue:[ cg@3130: "/ moving up cg@3130: self selectedNodes do:[:eachNode | cg@3130: self doStep:eachNode over:anIndex. cg@3130: ]. cg@3130: ] ifFalse:[ cg@3130: "/ moving down cg@3130: self selectedNodes reverseDo:[:eachNode | cg@3130: self doStep:eachNode over:anIndex. cg@3130: ]. cg@3130: ]. cg@3130: ^ self. cg@3130: cg@3053: ( (item := self selectedNode) isNil cg@3053: or:[(parentItem := item parent) isNil cg@3053: or:[(size := parentItem children size) < 2 cg@3053: or:[(idx := parentItem indexOfChild:item) == 0]]] cg@3053: ) ifTrue:[ cg@3053: ^ self cg@3053: ]. cg@3053: cg@3053: idx := idx + anIndex. cg@3053: cg@3053: idx < 1 ifTrue:[idx := size] cg@3053: ifFalse:[idx > size ifTrue:[idx := 1]]. ca@282: ca@774: self setSelection:nil. cg@3053: model remove:item. cg@3053: model add:item beforeIndex:idx below:parentItem. cg@3053: cg@3053: idx := parentItem indexOfChild:item. cg@3053: itemsView := item contents view. cg@3053: parentItemsView := parentItem contents view. cg@3053: cg@3053: canvas := self canvas. cg@3053: canvas hideSelection. cg@3053: cg@3053: itemsView isView ifFalse:[ cg@3053: "/ a component - has its own collection (and therefore indexing) - sigh cg@3053: idx := idx - ((1 to:idx-1) count:[:i | (parentItem children at:i) contents view isView]). cg@3053: parentItemsView changeSequenceOrderFor:itemsView to:idx. cg@3053: ] ifTrue:[ cg@3053: "/ a view - has its own collection (and therefore indexing) - sigh cg@3053: idx := idx - ((1 to:idx-1) count:[:i | (parentItem children at:i) contents view isView not]). cg@3053: parentItemsView changeSequenceOrderFor:itemsView to:idx. cg@3053: ]. cg@3053: cg@3053: parentItemsView specClass isLayoutContainer ifFalse:[ cg@3053: "/ spVw components notEmptyOrNil ifTrue:[ self halt ]. cg@3053: parentItemsView subViews do:[:v| v raise ]. cg@3053: ]. cg@3053: canvas showSelection. cg@3053: self selectNode:item. ca@222: ! ! ca@222: cg@60: !UIPainter class methodsFor:'documentation'! cg@60: cg@60: version cg@60: ^ '$Header$' cg@2615: ! cg@2615: cg@2615: version_CVS cg@2615: ^ '$Header$' jan@3391: ! jan@3391: jan@3391: version_HG jan@3391: jan@3391: ^ '$Changeset: $' cg@60: ! ! sv@2217: cg@2947: sv@2217: UIPainter initialize!