UIPainter.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 3567 002306321d77
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

- All source *.st files are now Unicode UTF8 without BOM
Files are in two groups (fileOut works this way in Smalltalk/X):
- containing a unicode character have "{ Encoding: utf8 }" at the header
- ASCII only are without the header
     1 "
     2  COPYRIGHT (c) 1995-1998 by eXept Software AG
     3  COPYRIGHT (c) 2017 Jan Vrany
     4               All Rights Reserved
     5 
     6  This software is furnished under a license and may be used
     7  only in accordance with the terms of that license and with the
     8  inclusion of the above copyright notice.   This software may not
     9  be provided or otherwise made available to, or used by, any
    10  other person.  No title to or ownership of the software is
    11  hereby transferred.
    12 "
    13 "{ Package: 'stx:libtool2' }"
    14 
    15 "{ NameSpace: Smalltalk }"
    16 
    17 ResourceSpecEditor subclass:#UIPainter
    18 	instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool
    19 		helpTool painterView painter lastPort lastPage'
    20 	classVariableNames:'SelectionPanelClass UseViewScroller LastPort LastPage
    21 		DefaultEditToolBarVisible DefaultToolBarVisible'
    22 	poolDictionaries:''
    23 	category:'Interface-UIPainter'
    24 !
    25 
    26 Query subclass:#ApplicationClassQuery
    27 	instanceVariableNames:''
    28 	classVariableNames:''
    29 	poolDictionaries:''
    30 	privateIn:UIPainter
    31 !
    32 
    33 SelectionInTreeView subclass:#TreeView
    34 	instanceVariableNames:'lastDrawnMaster canvasEventsDisabled windowSpec windowSpecClass
    35 		painter'
    36 	classVariableNames:''
    37 	poolDictionaries:''
    38 	privateIn:UIPainter
    39 !
    40 
    41 !UIPainter class methodsFor:'documentation'!
    42 
    43 copyright
    44 "
    45  COPYRIGHT (c) 1995-1998 by eXept Software AG
    46  COPYRIGHT (c) 2017 Jan Vrany
    47               All Rights Reserved
    48 
    49  This software is furnished under a license and may be used
    50  only in accordance with the terms of that license and with the
    51  inclusion of the above copyright notice.   This software may not
    52  be provided or otherwise made available to, or used by, any
    53  other person.  No title to or ownership of the software is
    54  hereby transferred.
    55 "
    56 
    57 !
    58 
    59 documentation
    60 "
    61     The GUI Painter provides the user with a graphical user interface for building own 
    62     interfaces by interactively assembling widgets and defining the behavior of the widgets.
    63     The resulting interface specifications can be saved as methods on the application
    64     classes, typically subclasses of the class ApplicationModel. These specifications
    65     are used by the UIBuilder to generate the application window and its widgets when 
    66     opening the application.
    67 
    68     [start with:]
    69         UIPainter open
    70 
    71     [author:]
    72         Claus Gittinger, eXept Software AG
    73         Claus Atzkern, eXept Software AG
    74         Thomas Zwick, eXept Software AG
    75 
    76     [see also:]
    77         UIBuilder
    78         ApplicationModel
    79         UISpecification
    80 
    81     [instance variables:]                                                  
    82         isSpecOnlyPainter       true if this painter is for a spec only (as used by expecco),
    83                                 as opposed to a regular painter, which stores the spec in a class.
    84                                 A spec-only painter has no class to store additional specs (esp.
    85                                 menu- and tabSpecs) and should not offer postBuild and other
    86                                 callback functions.
    87 "
    88 ! !
    89 
    90 !UIPainter class methodsFor:'initialization'!
    91 
    92 initialize
    93     SelectionPanelClass isNil ifTrue:[
    94         SelectionPanelClass := UISelectionPanel
    95     ].
    96 ! !
    97 
    98 !UIPainter class methodsFor:'instance creation'!
    99 
   100 openOnClass:aClass andSelector:aSelector
   101     "open a GUI Painter on aClass and (windowSpec) aSelector"
   102 
   103     ^ self new openOnClass:aClass theNonMetaclass andSelector:aSelector
   104 ! !
   105 
   106 !UIPainter class methodsFor:'ST-80 queries'!
   107 
   108 preferenceFor:aSymbol
   109     "ST-80 compatible; always returns false
   110     "
   111     ^ false
   112 
   113 
   114 ! !
   115 
   116 !UIPainter class methodsFor:'defaults'!
   117 
   118 defaultEditToolbarVisible
   119     ^ DefaultEditToolBarVisible ? true
   120 !
   121 
   122 defaultNameOfCanvas
   123     "returns the default name of the application"
   124 
   125     ^ 'NewApplication'
   126 !
   127 
   128 defaultToolbarVisible
   129     ^ DefaultToolBarVisible ? true
   130 !
   131 
   132 selectionPanelClass
   133     ^ SelectionPanelClass
   134 
   135     "
   136      UIPainter selectionPanelClass.
   137      UIPainter selectionPanelClass:UISelectionPanel
   138     "
   139 !
   140 
   141 selectionPanelClass:something
   142     "set the class used as selection panel.
   143      this is UISelectionPanel as default"
   144 
   145     SelectionPanelClass := something.
   146 
   147     "
   148      UIPainter selectionPanelClass:UISelectionPanel
   149     "
   150 ! !
   151 
   152 !UIPainter class methodsFor:'help specs'!
   153 
   154 flyByHelpSpec
   155     <resource: #help>
   156 
   157     ^super flyByHelpSpec 
   158         addPairsFrom:#(
   159 
   160 #fileSave
   161 'Save Spec'
   162 
   163 shadesOfRed
   164 'Red color tones'
   165 
   166 shadesOfGreen
   167 'Green color tones'
   168 
   169 shadesOfBlue
   170 'Blue color tones'
   171 
   172 shadesOfCyan
   173 'Cyan color tones'
   174 
   175 shadesOfMagenta
   176 'Magenta color tones'
   177 
   178 shadesOfYellow
   179 'Yellow color tones'
   180 
   181 shadesOfGray
   182 'Gray color tones'
   183 
   184 openColorEditor
   185 'Open a color editor'
   186 
   187 pickColorFromScreen
   188 'Pick a color from the screen'
   189 
   190 recentlyUsedColors
   191 'Pick a recently used color'
   192 
   193 useDefaultColorToggle
   194 'Toggle between default and explicit color'
   195 
   196 );
   197     declareAllFrom:self helpSpec
   198 !
   199 
   200 helpSpec
   201     "This resource specification was automatically generated
   202      by the UIHelpTool of ST/X."
   203 
   204     "Do not manually edit this!! If it is corrupted,
   205      the UIHelpTool may not be able to read the specification."
   206 
   207     "
   208      UIHelpTool openOnClass:UIPainter    
   209     "
   210 
   211     <resource: #help>
   212 
   213     ^ super helpSpec addPairsFrom:#(
   214 
   215 #align
   216 'Widget alignment functions'
   217 
   218 #alignResizeSelectionBottom
   219 'Resize the selected widgets'' bottom edges to align them with the bottom of the dominant widget'
   220 
   221 #alignResizeSelectionLeft
   222 'Resize the selected widgets'' left edges to align them with the left edge of the dominant widget'
   223 
   224 #alignResizeSelectionRight
   225 'Resize the selected widgets'' right edges to align them with the right edge of the dominant widget'
   226 
   227 #alignResizeSelectionTop
   228 'Resize the selected widgets'' top edges to align them with the top edge of the dominant widget'
   229 
   230 #alignSelectionBottom
   231 'Aligns the selected widgets'' bottom edges with the bottom of the dominant widget'
   232 
   233 #alignSelectionCenterHor
   234 'Aligns the selected widgets'' centers vertically with the center of the dominant widget'
   235 
   236 #alignSelectionCenterVer
   237 'Aligns the selected widgets'' centers horizontally with the center of the dominant widget'
   238 
   239 #alignSelectionLeft
   240 'Aligns the selected widgets'' left edges with the left edge of the dominant widget'
   241 
   242 #alignSelectionLeftAndRight
   243 'Aligns the selected widgets'' left & right edges with the dominant widget'
   244 
   245 #alignSelectionRight
   246 'Aligns the selected widgets'' right edges with the right edge of the dominant widget'
   247 
   248 #alignSelectionTop
   249 'Aligns the selected widgets'' top edges with the top edge of the dominant widget'
   250 
   251 #alignSelectionTopAndBottom
   252 'Aligns the selected widgets'' top and bottom edges with the dominant widget'
   253 
   254 #alignToGrid
   255 'Am Raster ausrichten'
   256 
   257 #centerSelectionHor
   258 'Centers the selected widgets horizontally within their containing widget'
   259 
   260 #centerSelectionVer
   261 'Centers the selected widgets vertically within their containing widget'
   262 
   263 #changePositionDown
   264 'Moves the selected widget(s) towards the bottom (by %1 pixels)'
   265 
   266 #changePositionLeft
   267 'Moves the selected widget(s) towards the left (by %1 pixels)'
   268 
   269 #changePositionRight
   270 'Moves the selected widget(s) towards the right (by %1 pixels)'
   271 
   272 #changePositionUp
   273 'Moves the selected widget(s) towards the top (by %1 pixels)'
   274 
   275 #'changeMoveDelta'
   276 'Click to change the delta by which the buttons to the left move the selected widget(s)'
   277 
   278 #drawEdit
   279 ''
   280 
   281 #editBrowseViewClass
   282 'Opens a browser on the class of the selected widget'
   283 
   284 #editDimensionCopyExtent
   285 'Copies the extent of the selected widget'
   286 
   287 #editDimensionCopyLayout
   288 'Copies the layout of the selected widget'
   289 
   290 #editDimensionDefaultExtent
   291 'Sets the selected widget(s) extent to their default'
   292 
   293 #editDimensionDefaultHeight
   294 'Sets the selected widget(s) height to their default'
   295 
   296 #editDimensionDefaultWidth
   297 'Sets the selected widget(s) width to their default'
   298 
   299 #editDimensionPasteExtent
   300 'Sets the extent of the selected widget(s) to the last copied extent'
   301 
   302 #editDimensionPasteHeight
   303 'Sets the height of the selected widget(s) to the height of the last copied layout/extent'
   304 
   305 #editDimensionPasteLayout
   306 'Sets the layout of the selected widget(s) to the last copied layout'
   307 
   308 #editDimensionPasteWidth
   309 'Sets the width of the selected widget(s) to the width of the last copied layout/extent'
   310 
   311 #editInspectSpec
   312 'Opens an inspector on the spec of the selected widget'
   313 
   314 #editInspectView
   315 'Opens an inspector on the selected widget'
   316 
   317 #editOpenSpecDocumentation
   318 'Opens the documentation of the selected widget'
   319 
   320 #editSaveSpecForSelection
   321 'Generate a sub-spec method for the selected element only.\Useful when refactoring an existing spec into sub specifications.'
   322 
   323 #fileBrowseAspectMethods
   324 'Opens a System Browser on the application''s aspect methods'
   325 
   326 #fileBrowseClass
   327 'Open a System Browser on the application''s class'
   328 
   329 #fileLoad
   330 'Opens a dialog to load a window specification from a classes spec method'
   331 
   332 #fileLoadSubspec
   333 'Opens a dialog to load a sub specification from a classes windowSpec method'
   334 
   335 #fileNew
   336 'Creates a new window spec'
   337 
   338 #filePickAnInterface
   339 'Select a view on the screen, generate a window spec for it and edit this spec'
   340 
   341 #fileSave
   342 'Saves the window spec in the current class (as spec method)'
   343 
   344 #fileSaveAs
   345 'Opens a dialog to select class and selector for saving the window spec'
   346 
   347 #fileShowWindowSpec
   348 'Opens a Workspace showing the current window spec'
   349 
   350 #generateAspectMethods
   351 'Generates aspect methods for defined aspect selectors of the widgets'
   352 
   353 #generateHookMethods
   354 'Generates startup/release methods. (#closeRequest, #postBuildWith:, #postOpenWith:)'
   355 
   356 #helpExamples
   357 'Show some examples uses of the GUI Painter'
   358 
   359 #helpFunctions
   360 'Show the documentation on the GUI Painters menu and button functions'
   361 
   362 #helpLayoutTool
   363 'Show the Layout Tools documentation'
   364 
   365 #helpSelectedWidget
   366 'Show the documentation of the selected widget'
   367 
   368 #helpTutorial
   369 'Show the GUI Painters documentation'
   370 
   371 #historyMenuItem
   372 'Edit this windowSpec'
   373 
   374 #moveWidgetDown
   375 'Moves the selected widget down in the list (brings it to the front)'
   376 
   377 #moveWidgetInto
   378 'Moves the selected widget into next widget as child widget'
   379 
   380 #moveWidgetOut
   381 'Moves the selected widget out of its parent widget'
   382 
   383 #moveWidgetUp
   384 'Moves the selected widget up in the list (brings it to the back)'
   385 
   386 #openColorEditor
   387 'Open a color editor'
   388 
   389 #pasteBuffer
   390 'Pastes the widgets of the clipboard at the current mouse position'
   391 
   392 #pasteWithLayout
   393 'Pastes the widgets of the clipboard without changing their layouts'
   394 
   395 #pickColorFromScreen
   396 'Pick a color from the screen'
   397 
   398 #recentlyUsedColors
   399 'Pick a recently used color'
   400 
   401 #referToConfigDatabase
   402 ''
   403 
   404 #settingsAspectsAsInstances
   405 'Generate aspects as instance variables (or bindings, if off)'
   406 
   407 #settingsCanvas
   408 'Shows or hides the canvas window'
   409 
   410 #settingsGallery
   411 'Shows or hides the gallery window'
   412 
   413 #settingsGenerateCommentedCode
   414 'Enables/disables comments in the generated code, especially in aspect and hook methods'
   415 
   416 #settingsGridManager
   417 'Opens a dialog to toggle grid display or to change the grids spacing'
   418 
   419 #settingsRedefineAspectMethods
   420 'Toggles the permission to overwrite existing aspect methods'
   421 
   422 #settingsTranscriptHelp
   423 'Toggles display of help texts (after opening a new GUI Painter)'
   424 
   425 #settingsUndoManager
   426 'Opens a dialog to undo modifications'
   427 
   428 #shadesOfBlue
   429 'Blue color tones'
   430 
   431 #shadesOfCyan
   432 'Cyan color tones'
   433 
   434 #shadesOfGray
   435 'Gray color tones'
   436 
   437 #shadesOfGreen
   438 'Green color tones'
   439 
   440 #shadesOfMagenta
   441 'Magenta color tones'
   442 
   443 #shadesOfRed
   444 'Red color tones'
   445 
   446 #shadesOfYellow
   447 'Yellow color tones'
   448 
   449 #showGrid
   450 'Raster zeigen'
   451 
   452 #sortItems
   453 'Sort the selected items by position (left to right, top to bottom)'
   454 
   455 #spreadSelectionHor
   456 'Sets the horizontal spaces between the selected widgets to the same value'
   457 
   458 #spreadSelectionVer
   459 'Sets the vertical spaces between the selected widgets to the same value'
   460 
   461 #testGeometryTestMode
   462 'Toggles geometry test mode (to define ratios of variable panels and top-window dimension)'
   463 
   464 #testStartApplication
   465 'Starts the application with the current window spec'
   466 
   467 #useDefaultColorToggle
   468 'Toggle between default and explicit color'
   469 
   470 #useDefaultFontToggle
   471 'Toggle between default and explicit font'
   472 
   473 #concreteFontsFamily
   474 'Choose a font family'
   475 
   476 #concreteFontsFace
   477 'Choose a font face'
   478 
   479 #concreteFontsStyle
   480 'Choose a font style'
   481 
   482 #concreteFontsSize
   483 'Choose a font size (in points, not pixels)'
   484 
   485 
   486 )
   487 ! !
   488 
   489 !UIPainter class methodsFor:'helpers'!
   490 
   491 convertString:aString maxLineSize:maxCharactersPerLine skipLineFeed:skipLineFeed
   492     "converts a string to a string collection with maximum characters
   493      per line
   494     "
   495     |stream
   496         max     "{ Class:SmallInteger }"
   497         size    "{ Class:SmallInteger }"
   498         start   "{ Class:SmallInteger }"
   499         stop    "{ Class:SmallInteger }"
   500         cpySz   "{ Class:SmallInteger }"
   501         lnSz    "{ Class:SmallInteger }"
   502         atBeginOfLine|
   503 
   504     maxCharactersPerLine < 20 ifFalse:[max := maxCharactersPerLine - 1]
   505                                ifTrue:[max := 20].
   506 
   507     (size := aString size) <= max ifTrue:[
   508         ^ aString
   509     ].
   510     start  := 1.
   511     lnSz   := 0.
   512     stream := (String new:size) writeStream.
   513 
   514     atBeginOfLine := true.
   515 
   516     [start <= size] whileTrue:[
   517         (start := aString indexOfNonSeparatorStartingAt:start) == 0 ifTrue:[
   518             ^ stream contents
   519         ].
   520         (aString at:start) == $\ ifTrue:[
   521             skipLineFeed ifFalse:[
   522                 stream nextPut:$\
   523             ].
   524             start := start + 1.
   525             stream cr.
   526             start := start + 1.
   527             lnSz := 0.
   528         ] ifFalse:[
   529             (stop := aString indexOfSeparatorStartingAt:start) == 0 ifTrue:[
   530                 stop := size + 1
   531             ].
   532             (aString at:(stop - 1)) == $\ ifTrue:[
   533                 stop := stop - 1
   534             ].
   535             cpySz := stop - start.
   536 
   537             lnSz == 0 ifFalse:[
   538                 (lnSz := lnSz + cpySz) >= max ifTrue:[stream cr.    lnSz := cpySz. atBeginOfLine := true. ]
   539                                              ifFalse:[stream space. lnSz := lnSz + 1]
   540             ] ifTrue:[
   541                 lnSz := cpySz
   542             ].
   543             stream nextPutAll:aString startingAt:start to:(stop - 1).
   544             start := stop.
   545         ]
   546     ].
   547     ^ stream contents
   548 
   549     "Modified: / 1.2.1998 / 14:42:56 / cg"
   550 ! !
   551 
   552 !UIPainter class methodsFor:'image specs'!
   553 
   554 arrowDown
   555     <resource: #image>
   556     "This resource specification was automatically generated
   557      by the ImageEditor of ST/X."
   558     "Do not manually edit this!! If it is corrupted,
   559      the ImageEditor may not be able to read the specification."
   560     "
   561      self arrowDown inspect
   562      ImageEditor openOnClass:self andSelector:#arrowDown
   563      Icon flushCachedIcons"
   564     
   565     ^ Icon constantNamed:'UIPainter class arrowDown'
   566         ifAbsentPut:[
   567             (Depth1Image new)
   568                 width:11;
   569                 height:11;
   570                 photometric:(#palette);
   571                 bitsPerSample:(#[ 1 ]);
   572                 samplesPerPixel:(1);
   573                 bits:(ByteArray fromPackedString:'?>C?8O? ?>C@XNC <^C;8O? ?>C?8@@a');
   574                 colorMapFromArray:#[ 0 0 0 255 255 255 ];
   575                 mask:((ImageMask new)
   576                             width:11;
   577                             height:11;
   578                             bits:(ByteArray 
   579                                         fromPackedString:'
   580 @@@@@@@@@@@? A<@C @D@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   581 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a');
   582                             yourself);
   583                 yourself
   584         ]
   585 !
   586 
   587 arrowLeft
   588     <resource: #image>
   589     "This resource specification was automatically generated
   590      by the ImageEditor of ST/X."
   591     "Do not manually edit this!! If it is corrupted,
   592      the ImageEditor may not be able to read the specification."
   593     "
   594      self arrowLeft inspect
   595      ImageEditor openOnClass:self andSelector:#arrowLeft
   596      Icon flushCachedIcons"
   597     
   598     ^ Icon constantNamed:'UIPainter class arrowLeft'
   599         ifAbsentPut:[
   600             (Depth1Image new)
   601                 width:11;
   602                 height:11;
   603                 photometric:(#palette);
   604                 bitsPerSample:(#[ 1 ]);
   605                 samplesPerPixel:(1);
   606                 bits:(ByteArray fromPackedString:'?>C?8O7 >^C18NG <^C98O7 ?>C?8@@a');
   607                 colorMapFromArray:#[ 0 0 0 255 255 255 ];
   608                 mask:((ImageMask new)
   609                             width:11;
   610                             height:11;
   611                             bits:(ByteArray fromPackedString:'@@@@@@H@A @N@A8@C PF@@H@@@@@@@@a');
   612                             yourself);
   613                 yourself
   614         ]
   615 !
   616 
   617 arrowRight
   618     <resource: #image>
   619     "This resource specification was automatically generated
   620      by the ImageEditor of ST/X."
   621     "Do not manually edit this!! If it is corrupted,
   622      the ImageEditor may not be able to read the specification."
   623     "
   624      self arrowRight inspect
   625      ImageEditor openOnClass:self andSelector:#arrowRight
   626      Icon flushCachedIcons"
   627     
   628     ^ Icon constantNamed:'UIPainter class arrowRight'
   629         ifAbsentPut:[
   630             (Depth1Image new)
   631                 width:11;
   632                 height:11;
   633                 photometric:(#palette);
   634                 bitsPerSample:(#[ 1 ]);
   635                 samplesPerPixel:(1);
   636                 bits:(ByteArray fromPackedString:'?>C?8O_ <>C18OC <^C38O_ ?>C?8@@a');
   637                 colorMapFromArray:#[ 0 0 0 255 255 255 ];
   638                 mask:((ImageMask new)
   639                             width:11;
   640                             height:11;
   641                             bits:(ByteArray fromPackedString:'@@@@@@ @C@@NA@<@C @L@@ @@@@@@@@a');
   642                             yourself);
   643                 yourself
   644         ]
   645 !
   646 
   647 arrowUp
   648     <resource: #image>
   649     "This resource specification was automatically generated
   650      by the ImageEditor of ST/X."
   651     "Do not manually edit this!! If it is corrupted,
   652      the ImageEditor may not be able to read the specification."
   653     "
   654      self arrowUp inspect
   655      ImageEditor openOnClass:self andSelector:#arrowUp
   656      Icon flushCachedIcons"
   657     
   658     ^ Icon constantNamed:'UIPainter class arrowUp'
   659         ifAbsentPut:[
   660             (Depth1Image new)
   661                 width:11;
   662                 height:11;
   663                 photometric:(#palette);
   664                 bitsPerSample:(#[ 1 ]);
   665                 samplesPerPixel:(1);
   666                 bits:(ByteArray fromPackedString:'?>C?8O? >>C18NC 0FC?8O? ?>C?8@@a');
   667                 colorMapFromArray:#[ 0 0 0 255 255 255 ];
   668                 mask:((ImageMask new)
   669                             width:11;
   670                             height:11;
   671                             bits:(ByteArray fromPackedString:'@@@@@@@@A@@NG1<@O8@@@@@@@@@@AP@a');
   672                             yourself);
   673                 yourself
   674         ]
   675 !
   676 
   677 browseActionImage
   678     <resource: #image>
   679     "This resource specification was automatically generated
   680      by the ImageEditor of ST/X."
   681     "Do not manually edit this!! If it is corrupted,
   682      the ImageEditor may not be able to read the specification."
   683     "
   684      self browseActionImage inspect
   685      ImageEditor openOnClass:self andSelector:#browseActionImage
   686      Icon flushCachedIcons"
   687     
   688     ^ Icon constantNamed:'UIPainter class browseActionImage'
   689         ifAbsentPut:[
   690             (Depth8Image new)
   691                 width:11;
   692                 height:12;
   693                 photometric:(#palette);
   694                 bitsPerSample:(#[ 8 ]);
   695                 samplesPerPixel:(1);
   696                 bits:(ByteArray 
   697                             fromPackedString:'
   698 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
   699 U%IVU5YRU%URZ%IR@EITT ART&,@@@@@T%MR@@@@@@@@@@@@T @@@@@@');
   700                 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 ];
   701                 mask:((ImageMask new)
   702                             width:11;
   703                             height:12;
   704                             bits:(ByteArray fromPackedString:'A@@N@F;@?>A?0G>@O8A?0O? [,@N@@P@');
   705                             yourself);
   706                 yourself
   707         ]
   708 !
   709 
   710 builderIcon
   711     "This resource specification was automatically generated
   712      by the ImageEditor of ST/X."
   713 
   714     "Do not manually edit this!! If it is corrupted,
   715      the ImageEditor may not be able to read the specification."
   716 
   717     "
   718      self builderIcon inspect
   719      ImageEditor openOnClass:self andSelector:#builderIcon
   720      Icon flushCachedIcons
   721     "
   722 
   723     <resource: #image>
   724 
   725     ^Icon
   726         constantNamed:'UIPainter builderIcon'
   727         ifAbsentPut:[(Depth1Image width:48 height:48 photometric:#whiteIs0) bits:(ByteArray fromPackedString:'
   728 @@@@@@@@O??????<H@@@@@@DH_@@@@@DH_@OC?>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
   729 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
   730 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 
   731 IBQHIDDPNA!!ONG$P@@@@@@@@'); yourself]
   732 !
   733 
   734 defaultIcon
   735     <resource: #programImage>
   736 
   737     ^ ToolbarIconLibrary startUIPainterIcon
   738 
   739     "Created: / 10-02-2007 / 14:45:56 / cg"
   740     "Modified: / 17-09-2007 / 11:36:33 / cg"
   741 !
   742 
   743 delta
   744     "This resource specification was automatically generated
   745      by the ImageEditor of ST/X."
   746 
   747     "Do not manually edit this!! If it is corrupted,
   748      the ImageEditor may not be able to read the specification."
   749 
   750     "
   751      self delta inspect
   752      ImageEditor openOnClass:self andSelector:#delta
   753      Icon flushCachedIcons
   754     "
   755 
   756     <resource: #image>
   757 
   758     ^Icon
   759         constantNamed:'UIPainter delta'
   760         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:'
   761 @@@@@@@@A@@J@AD@HHA@PG?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   762 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself]
   763 !
   764 
   765 editTableIcon
   766     <resource: #programImage>
   767 
   768     ^ SystemBrowser tableColumnsIcon
   769 !
   770 
   771 helpIcon
   772     <resource: #programImage>
   773 
   774     ^ Icon helpIcon
   775 !
   776 
   777 hideToolBarIcon
   778     <resource: #programImage>
   779 
   780     ^ ToolbarIconLibrary hideToolBarIcon
   781 !
   782 
   783 iconAlignB
   784     <resource: #image>
   785     "This resource specification was automatically generated
   786      by the ImageEditor of ST/X."
   787     "Do not manually edit this!! If it is corrupted,
   788      the ImageEditor may not be able to read the specification."
   789     "
   790      self iconAlignB inspect
   791      ImageEditor openOnClass:self andSelector:#iconAlignB
   792      Icon flushCachedIcons"
   793     
   794     ^ Icon constantNamed:'UIPainter class iconAlignB'
   795         ifAbsentPut:[
   796             (Depth2Image new)
   797                 width:22;
   798                 height:22;
   799                 photometric:(#palette);
   800                 bitsPerSample:(#( 2 ));
   801                 samplesPerPixel:(1);
   802                 bits:(ByteArray 
   803                             fromPackedString:'
   804 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@
   805 @G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@');
   806                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
   807                 mask:((ImageMask new)
   808                             width:22;
   809                             height:22;
   810                             bits:(ByteArray 
   811                                         fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@');
   812                             yourself);
   813                 yourself
   814         ]
   815 !
   816 
   817 iconAlignL
   818     <resource: #image>
   819     "This resource specification was automatically generated
   820      by the ImageEditor of ST/X."
   821     "Do not manually edit this!! If it is corrupted,
   822      the ImageEditor may not be able to read the specification."
   823     "
   824      self iconAlignL inspect
   825      ImageEditor openOnClass:self andSelector:#iconAlignL
   826      Icon flushCachedIcons"
   827     
   828     ^ Icon constantNamed:'UIPainter class iconAlignL'
   829         ifAbsentPut:[
   830             (Depth2Image new)
   831                 width:22;
   832                 height:22;
   833                 photometric:(#palette);
   834                 bitsPerSample:(#( 2 ));
   835                 samplesPerPixel:(1);
   836                 bits:(ByteArray 
   837                             fromPackedString:'
   838 @@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@
   839 @(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@');
   840                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
   841                 mask:((ImageMask new)
   842                             width:22;
   843                             height:22;
   844                             bits:(ByteArray 
   845                                         fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@');
   846                             yourself);
   847                 yourself
   848         ]
   849 !
   850 
   851 iconAlignLR
   852     <resource: #image>
   853     "This resource specification was automatically generated
   854      by the ImageEditor of ST/X."
   855     "Do not manually edit this!! If it is corrupted,
   856      the ImageEditor may not be able to read the specification."
   857     "
   858      self iconAlignLR inspect
   859      ImageEditor openOnClass:self andSelector:#iconAlignLR
   860      Icon flushCachedIcons"
   861     
   862     ^ Icon constantNamed:'UIPainter class iconAlignLR'
   863         ifAbsentPut:[
   864             (Depth2Image new)
   865                 width:22;
   866                 height:22;
   867                 photometric:(#palette);
   868                 bitsPerSample:(#( 2 ));
   869                 samplesPerPixel:(1);
   870                 bits:(ByteArray 
   871                             fromPackedString:'
   872 @@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(_??2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??2 @@(@@@B E@(@@@B @@(@@@B @
   873 @(@@@B @@(UUUR @@(_??B @@(@@@B @@(@@@B @@@@@@@@E@@@@@@@@');
   874                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
   875                 mask:((ImageMask new)
   876                             width:22;
   877                             height:22;
   878                             bits:(ByteArray 
   879                                         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 @@@@@@@@');
   880                             yourself);
   881                 yourself
   882         ]
   883 !
   884 
   885 iconAlignR
   886     <resource: #image>
   887     "This resource specification was automatically generated
   888      by the ImageEditor of ST/X."
   889     "Do not manually edit this!! If it is corrupted,
   890      the ImageEditor may not be able to read the specification."
   891     "
   892      self iconAlignR inspect
   893      ImageEditor openOnClass:self andSelector:#iconAlignR
   894      Icon flushCachedIcons"
   895     
   896     ^ Icon constantNamed:'UIPainter class iconAlignR'
   897         ifAbsentPut:[
   898             (Depth2Image new)
   899                 width:22;
   900                 height:22;
   901                 photometric:(#palette);
   902                 bitsPerSample:(#( 2 ));
   903                 samplesPerPixel:(1);
   904                 bits:(ByteArray 
   905                             fromPackedString:'
   906 @@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@_??2 @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUUR @@G???2 @@@@@@B E@@@@@B @@@@@@B @
   907 @@@@@B @@@@EUR @@@@G?2 @@@@@@B @@@@@@B @@@@@@@@E@@@@@@@@');
   908                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
   909                 mask:((ImageMask new)
   910                             width:22;
   911                             height:22;
   912                             bits:(ByteArray 
   913                                         fromPackedString:'@@@@@@@@@@A A?? A?? A?? A?? @@A @@A G?? G?? G?? G?? @@A @@A @G? @G? @G? @G? @@A @@@@@@@@');
   914                             yourself);
   915                 yourself
   916         ]
   917 !
   918 
   919 iconAlignT
   920     <resource: #image>
   921     "This resource specification was automatically generated
   922      by the ImageEditor of ST/X."
   923     "Do not manually edit this!! If it is corrupted,
   924      the ImageEditor may not be able to read the specification."
   925     "
   926      self iconAlignT inspect
   927      ImageEditor openOnClass:self andSelector:#iconAlignT
   928      Icon flushCachedIcons"
   929     
   930     ^ Icon constantNamed:'UIPainter class iconAlignT'
   931         ifAbsentPut:[
   932             (Depth2Image new)
   933                 width:22;
   934                 height:22;
   935                 photometric:(#palette);
   936                 bitsPerSample:(#( 2 ));
   937                 samplesPerPixel:(1);
   938                 bits:(ByteArray 
   939                             fromPackedString:'
   940 @@@@@@@@@@@@@@@@@@@@@@@@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@@
   941 @@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
   942                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
   943                 mask:((ImageMask new)
   944                             width:22;
   945                             height:22;
   946                             bits:(ByteArray 
   947                                         fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@');
   948                             yourself);
   949                 yourself
   950         ]
   951 !
   952 
   953 iconAlignTB
   954     <resource: #image>
   955     "This resource specification was automatically generated
   956      by the ImageEditor of ST/X."
   957     "Do not manually edit this!! If it is corrupted,
   958      the ImageEditor may not be able to read the specification."
   959     "
   960      self iconAlignTB inspect
   961      ImageEditor openOnClass:self andSelector:#iconAlignTB
   962      Icon flushCachedIcons"
   963     
   964     ^ Icon constantNamed:'UIPainter class iconAlignTB'
   965         ifAbsentPut:[
   966             (Depth2Image new)
   967                 width:22;
   968                 height:22;
   969                 photometric:(#palette);
   970                 bitsPerSample:(#( 2 ));
   971                 samplesPerPixel:(1);
   972                 bits:(ByteArray 
   973                             fromPackedString:'
   974 @@@@@@@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@@
   975 @G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@');
   976                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
   977                 mask:((ImageMask new)
   978                             width:22;
   979                             height:22;
   980                             bits:(ByteArray 
   981                                         fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@');
   982                             yourself);
   983                 yourself
   984         ]
   985 !
   986 
   987 iconCenterH
   988     <resource: #image>
   989     "This resource specification was automatically generated
   990      by the ImageEditor of ST/X."
   991     "Do not manually edit this!! If it is corrupted,
   992      the ImageEditor may not be able to read the specification."
   993     "
   994      self iconCenterH inspect
   995      ImageEditor openOnClass:self andSelector:#iconCenterH
   996      Icon flushCachedIcons"
   997     
   998     ^ Icon constantNamed:'UIPainter class iconCenterH'
   999         ifAbsentPut:[
  1000             (Depth2Image new)
  1001                 width:22;
  1002                 height:22;
  1003                 photometric:(#palette);
  1004                 bitsPerSample:(#( 2 ));
  1005                 samplesPerPixel:(1);
  1006                 bits:(ByteArray 
  1007                             fromPackedString:'
  1008 @@@@@@@@@@@@@@@@@(@J@B @@(@J@B @@(UZUR @@(?:?R @@(@J@B @@(@J@B @@(@J@B @@@@J@@@@@EUZUU@@@O?:?=@@@@@J@@@@@(@J@B @@(@J@B @
  1009 @(@J@B @@(EZUB@@@(O:=B @@(@J@B @@(@J@B @@@@@@@@@@@@@@@@@');
  1010                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1011                 mask:((ImageMask new)
  1012                             width:22;
  1013                             height:22;
  1014                             bits:(ByteArray 
  1015                                         fromPackedString:'@@@@@@@@@C@@A?>@A?>@A?>@A?>@@C@@@C@@G?? G?? G?? G??#@C@@@C@C@?<@@?<A@?<@@?<@@C@@@@@A@@@@');
  1016                             yourself);
  1017                 yourself
  1018         ]
  1019 !
  1020 
  1021 iconCenterHInFrame
  1022     <resource: #image>
  1023     "This resource specification was automatically generated
  1024      by the ImageEditor of ST/X."
  1025     "Do not manually edit this!! If it is corrupted,
  1026      the ImageEditor may not be able to read the specification."
  1027     "
  1028      self iconCenterHInFrame inspect
  1029      ImageEditor openOnClass:self andSelector:#iconCenterHInFrame
  1030      Icon flushCachedIcons"
  1031     
  1032     ^ Icon constantNamed:'UIPainter class iconCenterHInFrame'
  1033         ifAbsentPut:[
  1034             (Depth2Image new)
  1035                 width:22;
  1036                 height:22;
  1037                 photometric:(#palette);
  1038                 bitsPerSample:(#( 2 ));
  1039                 samplesPerPixel:(1);
  1040                 bits:(ByteArray 
  1041                             fromPackedString:'
  1042 @@@@@@@@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@
  1043 H8@@@@2@HHEUUBB@H8O?=B2@HL@@@CB@H@@@@@B@J******@@@@@@@@@');
  1044                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1045                 mask:((ImageMask new)
  1046                             width:22;
  1047                             height:22;
  1048                             bits:(ByteArray 
  1049                                         fromPackedString:'@@@@_??8P@@HW??(U?>(U?>(U?>(T@@(T@@(W??(W??(W??(W??+T@@(T@@+T?<(T?<)T?<(W??(P@@H_??9@@@@');
  1050                             yourself);
  1051                 yourself
  1052         ]
  1053 !
  1054 
  1055 iconCenterV
  1056     <resource: #image>
  1057     "This resource specification was automatically generated
  1058      by the ImageEditor of ST/X."
  1059     "Do not manually edit this!! If it is corrupted,
  1060      the ImageEditor may not be able to read the specification."
  1061     "
  1062      self iconCenterV inspect
  1063      ImageEditor openOnClass:self andSelector:#iconCenterV
  1064      Icon flushCachedIcons"
  1065     
  1066     ^ Icon constantNamed:'UIPainter class iconCenterV'
  1067         ifAbsentPut:[
  1068             (Depth2Image new)
  1069                 width:22;
  1070                 height:22;
  1071                 photometric:(#palette);
  1072                 bitsPerSample:(#( 2 ));
  1073                 samplesPerPixel:(1);
  1074                 bits:(ByteArray 
  1075                             fromPackedString:'
  1076 @@@@@@@@@@@@@@@@@@@@@@@@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@@
  1077 @@@M@E@@@@@M@@@@B**EJ*(@B(*@J*(@@@@@@@@@@@@@@@@@@@@@@@@@');
  1078                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1079                 mask:((ImageMask new)
  1080                             width:22;
  1081                             height:22;
  1082                             bits:(ByteArray 
  1083                                         fromPackedString:'@@@@@@@@@@@@@G @@G @@G'' G''''!!G'''' G'''' G'''' O??0O??0G'''' G'''' G'''' G'''' @G''#@G @@G C@@@@@@@@@@@@');
  1084                             yourself);
  1085                 yourself
  1086         ]
  1087 !
  1088 
  1089 iconCenterVInFrame
  1090     <resource: #image>
  1091     "This resource specification was automatically generated
  1092      by the ImageEditor of ST/X."
  1093     "Do not manually edit this!! If it is corrupted,
  1094      the ImageEditor may not be able to read the specification."
  1095     "
  1096      self iconCenterVInFrame inspect
  1097      ImageEditor openOnClass:self andSelector:#iconCenterVInFrame
  1098      Icon flushCachedIcons"
  1099     
  1100     ^ Icon constantNamed:'UIPainter class iconCenterVInFrame'
  1101         ifAbsentPut:[
  1102             (Depth2Image new)
  1103                 width:22;
  1104                 height:22;
  1105                 photometric:(#palette);
  1106                 bitsPerSample:(#( 2 ));
  1107                 samplesPerPixel:(1);
  1108                 bits:(ByteArray 
  1109                             fromPackedString:'
  1110 @@@@@@@@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@
  1111 HE@G@@B@H@@G@@B@H:*E@J2@HL3@L3B@H@@@@@B@J******@@@@@@@@@');
  1112                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1113                 mask:((ImageMask new)
  1114                             width:22;
  1115                             height:22;
  1116                             bits:(ByteArray 
  1117                                         fromPackedString:'@@@B_??9P@@HW??(TG (W'' (W''''*W''''(W''''*W'''')W''''(W'''')W''''+W''''*W''''*W''''(W'' )TG (W??(P@@H_??8@@@@');
  1118                             yourself);
  1119                 yourself
  1120         ]
  1121 !
  1122 
  1123 iconDistributeH
  1124     <resource: #image>
  1125     "This resource specification was automatically generated
  1126      by the ImageEditor of ST/X."
  1127     "Do not manually edit this!! If it is corrupted,
  1128      the ImageEditor may not be able to read the specification."
  1129     "
  1130      self iconDistributeH inspect
  1131      ImageEditor openOnClass:self andSelector:#iconDistributeH
  1132      Icon flushCachedIcons"
  1133     
  1134     ^ Icon constantNamed:'UIPainter class iconDistributeH'
  1135         ifAbsentPut:[
  1136             (Depth2Image new)
  1137                 width:22;
  1138                 height:22;
  1139                 photometric:(#palette);
  1140                 bitsPerSample:(#( 2 ));
  1141                 samplesPerPixel:(1);
  1142                 bits:(ByteArray 
  1143                             fromPackedString:'
  1144 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@E@@E@G@@G@@G@G@@G@@G@GHBGHBG@GHBGHBG@GJ*GJ*G@GHBGHBG@GHBGHBG@GB*GJ G@GB*GJ G@
  1145 G@@G@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
  1146                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1147                 mask:((ImageMask new)
  1148                             width:22;
  1149                             height:22;
  1150                             bits:(ByteArray 
  1151                                         fromPackedString:'@@@@@@@@@@@@@@@@<G <<G <<G ?<G =>O1?>O1????<>O1<>O1><G <<G ><G <<G ?@@@A@@@@@@@@@@@@@@@A');
  1152                             yourself);
  1153                 yourself
  1154         ]
  1155 !
  1156 
  1157 iconDistributeV
  1158     <resource: #image>
  1159     "This resource specification was automatically generated
  1160      by the ImageEditor of ST/X."
  1161     "Do not manually edit this!! If it is corrupted,
  1162      the ImageEditor may not be able to read the specification."
  1163     "
  1164      self iconDistributeV inspect
  1165      ImageEditor openOnClass:self andSelector:#iconDistributeV
  1166      Icon flushCachedIcons"
  1167     
  1168     ^ Icon constantNamed:'UIPainter class iconDistributeV'
  1169         ifAbsentPut:[
  1170             (Depth2Image new)
  1171                 width:22;
  1172                 height:22;
  1173                 photometric:(#palette);
  1174                 bitsPerSample:(#( 2 ));
  1175                 samplesPerPixel:(1);
  1176                 bits:(ByteArray 
  1177                             fromPackedString:'
  1178 @@@@@@@@@@UUUT@@@@???4@@@@@@@@@@@@@*(@@@@@JB@@@@@@JB@@@@@@JB@@@@@@J*(@@@@@@@@@@@@@UUUT@@@@???4@@@@@@@@@@@@J*(@@@@@JB@@@@
  1179 @@JB@@@@@@@B@@@@@@@*(@@@@@@@@@@@@@UUUT@@@@???4@@@@@@@@@@');
  1180                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1181                 mask:((ImageMask new)
  1182                             width:22;
  1183                             height:22;
  1184                             bits:(ByteArray 
  1185                                         fromPackedString:'A??@A??@A??CA??@@G0@@A@@@A@@@A@@@G0CA??@A??@A??@A??@@G0C@A@@@A@@@A@@@G0AA??AA??@A??@A??B');
  1186                             yourself);
  1187                 yourself
  1188         ]
  1189 !
  1190 
  1191 iconResizeB
  1192     <resource: #image>
  1193     "This resource specification was automatically generated
  1194      by the ImageEditor of ST/X."
  1195     "Do not manually edit this!! If it is corrupted,
  1196      the ImageEditor may not be able to read the specification."
  1197     "
  1198      self iconResizeB inspect
  1199      ImageEditor openOnClass:self andSelector:#iconResizeB
  1200      Icon flushCachedIcons"
  1201     
  1202     ^ Icon constantNamed:'UIPainter class iconResizeB'
  1203         ifAbsentPut:[
  1204             (Depth2Image new)
  1205                 width:22;
  1206                 height:22;
  1207                 photometric:(#palette);
  1208                 bitsPerSample:(#( 2 ));
  1209                 samplesPerPixel:(1);
  1210                 bits:(ByteArray 
  1211                             fromPackedString:'
  1212 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@@@@@@M@@@@@@@M@M@@@@@M@M@@@@@M@M@@@@@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@@@@@@M@@
  1213 @@@@@E@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@');
  1214                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1215                 mask:((ImageMask new)
  1216                             width:22;
  1217                             height:22;
  1218                             bits:(ByteArray 
  1219                                         fromPackedString:'@@@@@@@@@@@@@G A@G @@G'' @G'' @G''#@G'' G''''"G'''' G''''!!G'''' G'''' O?7 G'''' CCG O??0O??0@@@A@@@@@@@@');
  1220                             yourself);
  1221                 yourself
  1222         ]
  1223 !
  1224 
  1225 iconResizeL
  1226     <resource: #image>
  1227     "This resource specification was automatically generated
  1228      by the ImageEditor of ST/X."
  1229     "Do not manually edit this!! If it is corrupted,
  1230      the ImageEditor may not be able to read the specification."
  1231     "
  1232      self iconResizeL inspect
  1233      ImageEditor openOnClass:self andSelector:#iconResizeL
  1234      Icon flushCachedIcons"
  1235     
  1236     ^ Icon constantNamed:'UIPainter class iconResizeL'
  1237         ifAbsentPut:[
  1238             (Depth2Image new)
  1239                 width:22;
  1240                 height:22;
  1241                 photometric:(#palette);
  1242                 bitsPerSample:(#( 2 ));
  1243                 samplesPerPixel:(1);
  1244                 bits:(ByteArray 
  1245                             fromPackedString:'
  1246 @@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(AUUU@@@(C???@@@(@@@@@E@(@@@@@@@(@@@@@@
  1247 @(@@@@@@@(AU@@@@@(C?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@');
  1248                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1249                 mask:((ImageMask new)
  1250                             width:22;
  1251                             height:22;
  1252                             bits:(ByteArray 
  1253                                         fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@FP@@F?? G?? G?? F?? FP@@FP@@F? @G? @G? @F? @FP@@@@@@@@@@');
  1254                             yourself);
  1255                 yourself
  1256         ]
  1257 !
  1258 
  1259 iconResizeLR
  1260     <resource: #image>
  1261     "This resource specification was automatically generated
  1262      by the ImageEditor of ST/X."
  1263     "Do not manually edit this!! If it is corrupted,
  1264      the ImageEditor may not be able to read the specification."
  1265     "
  1266      self iconResizeLR inspect
  1267      ImageEditor openOnClass:self andSelector:#iconResizeLR
  1268      Icon flushCachedIcons"
  1269     
  1270     ^ Icon constantNamed:'UIPainter class iconResizeLR'
  1271         ifAbsentPut:[
  1272             (Depth2Image new)
  1273                 width:22;
  1274                 height:22;
  1275                 photometric:(#palette);
  1276                 bitsPerSample:(#( 2 ));
  1277                 samplesPerPixel:(1);
  1278                 bits:(ByteArray 
  1279                             fromPackedString:'
  1280 @@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(???2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(AUTB @@(C?<B @@(@@@B E@(@@@B @@(@@@B @
  1281 @(@@@B @@(AUTB @@(C?<B @@(@@@B @@(@@@B @@@@@@@@E@@@@@@@@');
  1282                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1283                 mask:((ImageMask new)
  1284                             width:22;
  1285                             height:22;
  1286                             bits:(ByteArray 
  1287                                         fromPackedString:'@@@@@@@@F@A G?? G?? G?? G?? F@A FPI F?= G?? G?? F?= FPI FPI F?= G?? G?? F?= FPI @@@@@@@@');
  1288                             yourself);
  1289                 yourself
  1290         ]
  1291 !
  1292 
  1293 iconResizeR
  1294     <resource: #image>
  1295     "This resource specification was automatically generated
  1296      by the ImageEditor of ST/X."
  1297     "Do not manually edit this!! If it is corrupted,
  1298      the ImageEditor may not be able to read the specification."
  1299     "
  1300      self iconResizeR inspect
  1301      ImageEditor openOnClass:self andSelector:#iconResizeR
  1302      Icon flushCachedIcons"
  1303     
  1304     ^ Icon constantNamed:'UIPainter class iconResizeR'
  1305         ifAbsentPut:[
  1306             (Depth2Image new)
  1307                 width:22;
  1308                 height:22;
  1309                 photometric:(#palette);
  1310                 bitsPerSample:(#( 2 ));
  1311                 samplesPerPixel:(1);
  1312                 bits:(ByteArray 
  1313                             fromPackedString:'
  1314 @@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@???R @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUTB @@O??<B @@@@@@B E@@@@@B @@@@@@B @
  1315 @@@@@B @@@@ETB @@@@O<B @@@@@@B @@@@@@B @@@@@@@@E@@@@@@@@');
  1316                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1317                 mask:((ImageMask new)
  1318                             width:22;
  1319                             height:22;
  1320                             bits:(ByteArray 
  1321                                         fromPackedString:'@@@@@@@@@@A A?? A?? A?? A?? @@A @@I G?= G?? G?? G?= @@I @@I @G= @G? @G? @G= @@I @@@@@@@@');
  1322                             yourself);
  1323                 yourself
  1324         ]
  1325 !
  1326 
  1327 iconResizeT
  1328     <resource: #image>
  1329     "This resource specification was automatically generated
  1330      by the ImageEditor of ST/X."
  1331     "Do not manually edit this!! If it is corrupted,
  1332      the ImageEditor may not be able to read the specification."
  1333     "
  1334      self iconResizeT inspect
  1335      ImageEditor openOnClass:self andSelector:#iconResizeT
  1336      Icon flushCachedIcons"
  1337     
  1338     ^ Icon constantNamed:'UIPainter class iconResizeT'
  1339         ifAbsentPut:[
  1340             (Depth2Image new)
  1341                 width:22;
  1342                 height:22;
  1343                 photometric:(#palette);
  1344                 bitsPerSample:(#( 2 ));
  1345                 samplesPerPixel:(1);
  1346                 bits:(ByteArray 
  1347                             fromPackedString:'
  1348 @@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@E@@@@@@@M@@@M@M@M@@@M@M@M@@@M@M@M@@@M@M@M@@@@@M@M@@@@@M@M@@@@@M@M@@
  1349 @@@M@M@@@@@M@@@@@@@M@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
  1350                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1351                 mask:((ImageMask new)
  1352                             width:22;
  1353                             height:22;
  1354                             bits:(ByteArray 
  1355                                         fromPackedString:'@@@@@@@@@@@AO??0O??0CCG G'''' O?7 G'''' G'''' G''''!!G'''' G''''"@G'' @G''#@G'' @G'' @G @@G A@@@@@@@@@@@@');
  1356                             yourself);
  1357                 yourself
  1358         ]
  1359 !
  1360 
  1361 iconResizeTB
  1362     <resource: #image>
  1363     "This resource specification was automatically generated
  1364      by the ImageEditor of ST/X."
  1365     "Do not manually edit this!! If it is corrupted,
  1366      the ImageEditor may not be able to read the specification."
  1367     "
  1368      self iconResizeTB inspect
  1369      ImageEditor openOnClass:self andSelector:#iconResizeTB
  1370      Icon flushCachedIcons"
  1371     
  1372     ^ Icon constantNamed:'UIPainter class iconResizeTB'
  1373         ifAbsentPut:[
  1374             (Depth2Image new)
  1375                 width:22;
  1376                 height:22;
  1377                 photometric:(#palette);
  1378                 bitsPerSample:(#( 2 ));
  1379                 samplesPerPixel:(1);
  1380                 bits:(ByteArray 
  1381                             fromPackedString:'
  1382 @@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@G@@@@@@@G@@@@@@@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@@@G@@@@@@
  1383 @G@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@');
  1384                 colorMapFromArray:#[ 0 0 0 255 255 255 0 0 127 170 170 170 ];
  1385                 mask:((ImageMask new)
  1386                             width:22;
  1387                             height:22;
  1388                             bits:(ByteArray 
  1389                                         fromPackedString:'@@@B@@@@@@@BO??0O??2G#C@G'''' G/?0G''''#G'''' G'''' G'''' G'''' G''''"G/?0G'''' G#C@O??1O??0@@@A@@@B@@@@');
  1390                             yourself);
  1391                 yourself
  1392         ]
  1393 ! !
  1394 
  1395 !UIPainter class methodsFor:'interface specs'!
  1396 
  1397 dialogSpecForDefiningClassAndSelector
  1398     "This resource specification was automatically generated
  1399      by the UIPainter of ST/X."
  1400 
  1401     "Do not manually edit this!! If it is corrupted,
  1402      the UIPainter may not be able to read the specification."
  1403 
  1404     "
  1405      UIPainter new openOnClass:UIPainter andSelector:#dialogSpecForDefiningClassAndSelector
  1406      UIPainter new openInterface:#dialogSpecForDefiningClassAndSelector
  1407     "
  1408 
  1409     <resource: #canvas>
  1410 
  1411     ^
  1412      
  1413        #(#FullSpec
  1414           #window: 
  1415            #(#WindowSpec
  1416               #name: 'GUI Painter'
  1417               #layout: #(#LayoutFrame 291 0 130 0 637 0 289 0)
  1418               #label: 'GUI Painter'
  1419               #min: #(#Point 350 160)
  1420               #bounds: #(#Rectangle 291 130 638 290)
  1421               #usePreferredExtent: false
  1422           )
  1423           #component: 
  1424            #(#SpecCollection
  1425               #collection: 
  1426                #(
  1427                  #(#FramedBoxSpec
  1428                     #name: 'FramedBox'
  1429                     #layout: #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0)
  1430                     #component: 
  1431                      #(#SpecCollection
  1432                         #collection: 
  1433                          #(
  1434                            #(#LabelSpec
  1435                               #name: 'selectorLabel'
  1436                               #layout: #(#AlignmentOrigin 67 0.11 29 0 1 0.5)
  1437                               #label: 'Selector:'
  1438                               #translateLabel: true
  1439                               #adjust: #right
  1440                               #resizeForLabel: true
  1441                           )
  1442                            #(#InputFieldSpec
  1443                               #name: 'methodNameField'
  1444                               #layout: #(#LayoutFrame 70 0.11 18 0 4 1.0 40 0)
  1445                               #tabable: true
  1446                               #model: #methodNameChannel
  1447                               #group: #inputGroup
  1448                           )
  1449                            #(#LabelSpec
  1450                               #name: 'classLabel'
  1451                               #layout: #(#AlignmentOrigin 67 0.11 54 0 1 0.5)
  1452                               #label: 'Class:'
  1453                               #translateLabel: true
  1454                               #adjust: #right
  1455                               #resizeForLabel: true
  1456                           )
  1457                            #(#InputFieldSpec
  1458                               #name: 'classNameField'
  1459                               #layout: #(#LayoutFrame 70 0.11 43 0 4 1.0 65 0)
  1460                               #tabable: true
  1461                               #model: #classNameChannel
  1462                               #group: #inputGroup
  1463                           )
  1464                            #(#LabelSpec
  1465                               #name: 'superClassLabel'
  1466                               #layout: #(#AlignmentOrigin 67 0.11 79 0 1 0.5)
  1467                               #label: 'Superclass:'
  1468                               #translateLabel: true
  1469                               #adjust: #right
  1470                               #resizeForLabel: true
  1471                           )
  1472                            #(#ComboBoxSpec
  1473                               #name: 'superclassNameComboBox'
  1474                               #layout: #(#LayoutFrame 70 0.11 68 0 4 1.0 90 0)
  1475                               #tabable: true
  1476                               #model: #superclassNameChannel
  1477                               #comboList: #superclassNameDefaults
  1478                           )
  1479                         )
  1480                     )
  1481                     #label: 'Define Class And Selector'
  1482                     #labelPosition: #topLeft
  1483                     #translateLabel: true
  1484                 )
  1485                  #(#UISubSpecification
  1486                     #name: 'subSpec'
  1487                     #layout: #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1)
  1488                     #majorKey: #ToolApplicationModel
  1489                     #minorKey: #windowSpecForCommitWithoutChannels
  1490                 )
  1491               )
  1492           )
  1493       )
  1494 
  1495     "Modified: / 13.8.1998 / 19:59:44 / cg"
  1496 !
  1497 
  1498 dialogSpecForDefiningGridParameters
  1499     "This resource specification was automatically generated
  1500      by the UIPainter of ST/X."
  1501 
  1502     "Do not manually edit this!! If it is corrupted,
  1503      the UIPainter may not be able to read the specification."
  1504 
  1505     "
  1506      UIPainter new openOnClass:UIPainter andSelector:#dialogSpecForDefiningGridParameters
  1507      UIPainter new openInterface:#dialogSpecForDefiningGridParameters
  1508     "
  1509 
  1510     <resource: #canvas>
  1511 
  1512     ^ 
  1513      #(FullSpec
  1514         name: dialogSpecForDefiningGridParameters
  1515         window: 
  1516        (WindowSpec
  1517           label: 'GUI Painter'
  1518           name: 'GUI Painter'
  1519           min: (Point 300 200)
  1520           max: (Point 300 200)
  1521           bounds: (Rectangle 16 46 298 244)
  1522         )
  1523         component: 
  1524        (SpecCollection
  1525           collection: (
  1526            (FramedBoxSpec
  1527               label: 'Grid Parameter'
  1528               name: 'FramedBox'
  1529               layout: (LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0)
  1530               labelPosition: topLeft
  1531               translateLabel: true
  1532               component: 
  1533              (SpecCollection
  1534                 collection: (
  1535                  (CheckBoxSpec
  1536                     label: 'Show Grid'
  1537                     name: 'ShowGridCheckBox'
  1538                     layout: (Point 13 14)
  1539                     model: showGrid
  1540                     translateLabel: true
  1541             activeHelpKey: showGrid
  1542                   )
  1543                  (CheckBoxSpec
  1544                     label: 'Align To Grid'
  1545                     name: 'AlignCheckBox'
  1546                     layout: (Point 13 42)
  1547                     model: alignToGrid
  1548                     translateLabel: true
  1549             activeHelpKey: alignToGrid
  1550                   )
  1551                  (LabelSpec
  1552                     label: 'Horizontal Pixels:'
  1553                     name: 'HorizontalPixelsLabel'
  1554                     layout: (AlignmentOrigin 138 0 89 0 1 0.5)
  1555                     translateLabel: true
  1556                     resizeForLabel: true
  1557                     adjust: right
  1558                   )
  1559                  (InputFieldSpec
  1560                     name: 'HorizontalPixelsField'
  1561                     layout: (LayoutFrame 144 0 77 0 197 0 99 0)
  1562                     model: hspace
  1563                     group: inputGroup
  1564                     type: numberOrNil
  1565                     acceptOnPointerLeave: false
  1566                   )
  1567                  (LabelSpec
  1568                     label: 'Vertical Pixels:'
  1569                     name: 'VerticalPixelsLabel'
  1570                     layout: (AlignmentOrigin 139 0 114 0 1 0.5)
  1571                     translateLabel: true
  1572                     resizeForLabel: true
  1573                     adjust: right
  1574                   )
  1575                  (InputFieldSpec
  1576                     name: 'VerticalPixelsField'
  1577                     layout: (LayoutFrame 144 0 102 0 197 0 124 0)
  1578                     model: vspace
  1579                     group: inputGroup
  1580                     type: numberOrNil
  1581                     acceptOnPointerLeave: false
  1582                   )
  1583                  )
  1584                
  1585               )
  1586             )
  1587            (UISubSpecification
  1588               name: 'subSpec'
  1589               layout: (LayoutFrame 0 0.0 -29 1 0 1.0 -5 1)
  1590               majorKey: ToolApplicationModel
  1591               minorKey: windowSpecForCommitWithoutChannels
  1592             )
  1593            )
  1594          
  1595         )
  1596       )
  1597 !
  1598 
  1599 dialogSpecForDefiningPortAndPageName
  1600     "This resource specification was automatically generated
  1601      by the UIPainter of ST/X."
  1602 
  1603     "Do not manually edit this!! If it is corrupted,
  1604      the UIPainter may not be able to read the specification."
  1605 
  1606     "
  1607      UIPainter new openOnClass:UIPainter andSelector:#dialogSpecForDefiningPortAndPageName
  1608      UIPainter new openInterface:#dialogSpecForDefiningPortAndPageName
  1609     "
  1610 
  1611     <resource: #canvas>
  1612 
  1613     ^ 
  1614      #(FullSpec
  1615         name: dialogSpecForDefiningPortAndPageName
  1616         window: 
  1617        (WindowSpec
  1618           label: 'GUI Painter'
  1619           name: 'GUI Painter'
  1620           min: (Point 350 140)
  1621           max: (Point 500 140)
  1622           bounds: (Rectangle 0 0 346 138)
  1623         )
  1624         component: 
  1625        (SpecCollection
  1626           collection: (
  1627            (FramedBoxSpec
  1628               label: 'Define Service and Pagename'
  1629               name: 'FramedBox'
  1630               layout: (LayoutFrame 0 0.0 3 0.0 0 1.0 -34 1.0)
  1631               labelPosition: topLeft
  1632               translateLabel: true
  1633               component: 
  1634              (SpecCollection
  1635                 collection: (
  1636                  (LabelSpec
  1637                     label: 'Service (or Port):'
  1638                     name: 'portLabel'
  1639                     layout: (AlignmentOrigin 67 0.11 29 0 1 0.5)
  1640                     translateLabel: true
  1641                     resizeForLabel: true
  1642                     adjust: right
  1643                   )
  1644                  (ComboBoxSpec
  1645                     name: 'ComboBox1'
  1646                     layout: (LayoutFrame 70 0.11 18 0 4 1.0 40 0)
  1647                     model: serviceOrPortNameChannel
  1648                     acceptOnPointerLeave: false
  1649                     comboList: runningServerPorts
  1650                   )
  1651                  (LabelSpec
  1652                     label: 'Pagename:'
  1653                     name: 'pageNameLabel'
  1654                     layout: (AlignmentOrigin 67 0.11 54 0 1 0.5)
  1655                     translateLabel: true
  1656                     resizeForLabel: true
  1657                     adjust: right
  1658                   )
  1659                  (InputFieldSpec
  1660                     name: 'pageNameNameField'
  1661                     layout: (LayoutFrame 70 0.11 43 0 4 1.0 65 0)
  1662                     tabable: true
  1663                     model: pageNameNameChannel
  1664                     group: inputGroup
  1665                     acceptOnPointerLeave: false
  1666                   )
  1667                  )
  1668                
  1669               )
  1670             )
  1671            (UISubSpecification
  1672               name: 'subSpec'
  1673               layout: (LayoutFrame 0 0.0 -29 1 0 1.0 -5 1)
  1674               majorKey: ToolApplicationModel
  1675               minorKey: windowSpecForCommitWithoutChannels
  1676             )
  1677            )
  1678          
  1679         )
  1680       )
  1681 !
  1682 
  1683 windowSpec
  1684     "This resource specification was automatically generated
  1685      by the UIPainter of ST/X."
  1686 
  1687     "Do not manually edit this!! If it is corrupted,
  1688      the UIPainter may not be able to read the specification."
  1689 
  1690     "
  1691      UIPainter new openOnClass:UIPainter andSelector:#windowSpec
  1692      UIPainter new openInterface:#windowSpec
  1693      UIPainter open
  1694     "
  1695 
  1696     <resource: #canvas>
  1697 
  1698     ^ 
  1699      #(FullSpec
  1700         name: windowSpec
  1701         window: 
  1702        (WindowSpec
  1703           label: 'GUI Painter'
  1704           name: 'GUI Painter'
  1705           min: (Point 560 460)
  1706           bounds: (Rectangle 0 0 834 575)
  1707           menu: menu
  1708           icon: defaultIcon
  1709         )
  1710         component: 
  1711        (SpecCollection
  1712           collection: (
  1713            (ViewSpec
  1714               name: 'mainPanel'
  1715               layout: (LayoutFrame 0 0 0 0 0 1 -24 1)
  1716               component: 
  1717              (SpecCollection
  1718                 collection: (
  1719                  (ViewSpec
  1720                     name: 'ToolBar'
  1721                     layout: (LayoutFrame 0 0 0 0 0 1 32 0)
  1722                     visibilityChannel: toolBarVisibleHolder
  1723                     component: 
  1724                    (SpecCollection
  1725                       collection: (
  1726                        (ActionButtonSpec
  1727                           label: 'hideToolBarIcon'
  1728                           name: 'HideToolBarButton'
  1729                           layout: (LayoutFrame 0 0 0 0 13 0 0 1)
  1730                           activeHelpKey: hideToolBar
  1731                           hasCharacterOrientedLabel: false
  1732                           translateLabel: true
  1733                           model: hideToolbar
  1734                           postBuildCallback: hideToolBarButtonCreated:
  1735                         )
  1736                        (MenuPanelSpec
  1737                           name: 'menuToolbarView'
  1738                           layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0)
  1739                           visibilityChannel: toolBarVisibleHolder
  1740                           menu: menuToolbar
  1741                           textDefault: true
  1742                         )
  1743                        )
  1744                      
  1745                     )
  1746                   )
  1747                  (ViewSpec
  1748                     name: 'EditToolBar'
  1749                     layout: (LayoutFrame 0 0 30 0 0 1 62 0)
  1750                     visibilityChannel: editToolBarVisibleHolder
  1751                     component: 
  1752                    (SpecCollection
  1753                       collection: (
  1754                        (ActionButtonSpec
  1755                           label: 'hideToolBarIcon'
  1756                           name: 'HideEditToolBarButton'
  1757                           layout: (LayoutFrame 0 0 0 0 13 0 0 1)
  1758                           activeHelpKey: hideToolBar
  1759                           hasCharacterOrientedLabel: false
  1760                           translateLabel: true
  1761                           model: hideEditToolbar
  1762                           postBuildCallback: hideToolBarButtonCreated:
  1763                         )
  1764                        (MenuPanelSpec
  1765                           name: 'EditToolBar1'
  1766                           layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0)
  1767                           visibilityChannel: editToolBarVisibleHolder
  1768                           menu: editToolbar
  1769                           textDefault: true
  1770                         )
  1771                        )
  1772                      
  1773                     )
  1774                   )
  1775                  (VariableHorizontalPanelSpec
  1776                     name: 'Painter'
  1777                     layout: (LayoutFrame 0 0.0 60 0.0 0 1.0 0 1.0)
  1778                     level: 1
  1779                     component: 
  1780                    (SpecCollection
  1781                       collection: (
  1782                        (ArbitraryComponentSpec
  1783                           name: 'treeView'
  1784                           tabable: true
  1785                           menu: menuEdit
  1786                           hasHorizontalScrollBar: true
  1787                           hasVerticalScrollBar: true
  1788                           miniScrollerHorizontal: true
  1789                           miniScrollerVertical: true
  1790                           hasBorder: false
  1791                           component: treeView
  1792                         )
  1793                        (ViewSpec
  1794                           name: 'specHolderView'
  1795                           level: 0
  1796                           component: 
  1797                          (SpecCollection
  1798                             collection: (
  1799                              (MenuPanelSpec
  1800                                 name: 'menuToolbar2View'
  1801                                 layout: (LayoutFrame 2 0.0 2 0 -2 1.0 32 0)
  1802                                 level: 0
  1803                                 tabable: true
  1804                                 menu: menuToolbar2
  1805                               )
  1806                              (NoteBookViewSpec
  1807                                 name: 'noteBook'
  1808                                 layout: (LayoutFrame 2 0.0 32 0.0 -2 1.0 -28 1.0)
  1809                                 level: 0
  1810                                 enableChannel: enableChannel
  1811                                 tabable: true
  1812                                 model: tabModel
  1813                                 menu: tabList
  1814                                 translateLabel: true
  1815                                 canvas: noteBookView
  1816                               )
  1817                              (HorizontalPanelViewSpec
  1818                                 name: 'HorizontalPanel1'
  1819                                 layout: (LayoutFrame 2 0 -26 1 -2 1 -2 1)
  1820                                 horizontalLayout: fit
  1821                                 verticalLayout: fit
  1822                                 horizontalSpace: 3
  1823                                 verticalSpace: 3
  1824                                 reverseOrderIfOKAtLeft: true
  1825                                 component: 
  1826                                (SpecCollection
  1827                                   collection: (
  1828                                    (ActionButtonSpec
  1829                                       label: 'Cancel'
  1830                                       name: 'cancelButton'
  1831                                       activeHelpKey: commitCancel
  1832                                       translateLabel: true
  1833                                       tabable: true
  1834                                       model: cancel
  1835                                       enableChannel: modifiedChannel
  1836                                       extent: (Point 274 24)
  1837                                     )
  1838                                    (ActionButtonSpec
  1839                                       label: 'OK'
  1840                                       name: 'acceptButton'
  1841                                       activeHelpKey: commitOK
  1842                                       translateLabel: true
  1843                                       tabable: true
  1844                                       model: accept
  1845                                       enableChannel: modifiedChannel
  1846                                       extent: (Point 274 24)
  1847                                     )
  1848                                    )
  1849                                  
  1850                                 )
  1851                               )
  1852                              )
  1853                            
  1854                           )
  1855                         )
  1856                        )
  1857                      
  1858                     )
  1859                     handles: (Any 0.3 1.0)
  1860                   )
  1861                  )
  1862                
  1863               )
  1864             )
  1865            (UISubSpecification
  1866               name: 'infoBarSubSpec'
  1867               layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
  1868               level: 1
  1869               majorKey: ToolApplicationModel
  1870               minorKey: windowSpecForInfoBar
  1871             )
  1872            )
  1873          
  1874         )
  1875       )
  1876 ! !
  1877 
  1878 !UIPainter class methodsFor:'menu specs'!
  1879 
  1880 cutCopyPasteMenuSlice
  1881     "This resource specification was automatically generated
  1882      by the MenuEditor of ST/X."
  1883 
  1884     "Do not manually edit this!! If it is corrupted,
  1885      the MenuEditor may not be able to read the specification."
  1886 
  1887     "
  1888      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar
  1889      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp
  1890     "
  1891 
  1892     <resource: #menu>
  1893 
  1894     ^ 
  1895      #(Menu
  1896         (
  1897          (MenuItem
  1898             activeHelpKey: editCut
  1899             enabled: canCutHolder
  1900             label: 'Cut'
  1901             itemValue: deleteSelection
  1902             translateLabel: true
  1903             isButton: true
  1904             labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon)
  1905           )
  1906          (MenuItem
  1907             activeHelpKey: editCopy
  1908             enabled: canCopyHolder
  1909             label: 'Copy'
  1910             itemValue: copySelection
  1911             translateLabel: true
  1912             isButton: true
  1913             labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon)
  1914           )
  1915          (MenuItem
  1916             activeHelpKey: editPaste
  1917             enabled: canPasteKeepingLayoutHolder
  1918             label: 'Paste with Layout'
  1919             itemValue: pasteWithLayout
  1920             translateLabel: true
  1921             isButton: true
  1922             labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon)
  1923           )
  1924          (MenuItem
  1925             activeHelpKey: editDelete
  1926             enabled: canCutHolder
  1927             label: 'Delete'
  1928             itemValue: deleteTotalSelection
  1929             translateLabel: true
  1930             isButton: true
  1931             isVisible: false
  1932             labelImage: (ResourceRetriever ToolbarIconLibrary deleteWidgetIcon)
  1933           )
  1934          (MenuItem
  1935             label: '-'
  1936           )
  1937          (MenuItem
  1938             activeHelpKey: editUndo
  1939             enabled: hasUndoHistoryHolder
  1940             label: 'Undo'
  1941             itemValue: undoLast
  1942             translateLabel: true
  1943             isButton: true
  1944             labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon)
  1945           )
  1946          )
  1947         nil
  1948         nil
  1949       )
  1950 !
  1951 
  1952 editToolbar
  1953     "This resource specification was automatically generated
  1954      by the MenuEditor of ST/X."
  1955 
  1956     "Do not manually edit this!! If it is corrupted,
  1957      the MenuEditor may not be able to read the specification."
  1958 
  1959     "
  1960      MenuEditor new openOnClass:UIPainter andSelector:#editToolbar
  1961      (Menu new fromLiteralArrayEncoding:(UIPainter editToolbar)) startUp
  1962     "
  1963 
  1964     <resource: #menu>
  1965 
  1966     ^ 
  1967      #(Menu
  1968         (
  1969          (MenuItem
  1970             label: 'moveItems'
  1971             translateLabel: true
  1972             submenuChannel: moveInListMenuSlice
  1973             isMenuSlice: true
  1974           )
  1975          (MenuItem
  1976             label: '-'
  1977           )
  1978          (MenuItem
  1979             label: 'gridItems'
  1980             translateLabel: true
  1981             submenuChannel: gridMenuSlice
  1982             isMenuSlice: true
  1983           )
  1984          )
  1985         nil
  1986         nil
  1987       )
  1988 !
  1989 
  1990 gridMenuSlice
  1991     "This resource specification was automatically generated
  1992      by the MenuEditor of ST/X."
  1993 
  1994     "Do not manually edit this!! If it is corrupted,
  1995      the MenuEditor may not be able to read the specification."
  1996 
  1997     "
  1998      MenuEditor new openOnClass:Workflow::WorksheetEditor andSelector:#zoomMenuSlice
  1999      (Menu new fromLiteralArrayEncoding:(Workflow::WorksheetEditor zoomMenuSlice)) startUp
  2000     "
  2001 
  2002     <resource: #menu>
  2003 
  2004     ^ 
  2005      #(Menu
  2006         (
  2007          (MenuItem
  2008             label: 'ShowGrid'
  2009             translateLabel: true
  2010             isButton: true
  2011             indication: gridShownHolder
  2012             labelImage: (ResourceRetriever ToolbarIconLibrary gridIcon)
  2013             activeHelpKey: showGrid
  2014           )
  2015          (MenuItem
  2016             label: 'AlignToGrid'
  2017             translateLabel: true
  2018             isButton: true
  2019             indication: alignToGridHolder
  2020             labelImage: (ResourceRetriever ToolbarIconLibrary gridAlignIcon)
  2021             activeHelpKey: alignToGrid
  2022           )
  2023          )
  2024         nil
  2025         nil
  2026       )
  2027 !
  2028 
  2029 menu
  2030     "This resource specification was automatically generated
  2031      by the MenuEditor of ST/X."
  2032 
  2033     "Do not manually edit this!! If it is corrupted,
  2034      the MenuEditor may not be able to read the specification."
  2035 
  2036 
  2037     "
  2038      MenuEditor new openOnClass:UIPainter andSelector:#menu
  2039      (Menu new fromLiteralArrayEncoding:(UIPainter menu)) startUp
  2040     "
  2041 
  2042     <resource: #menu>
  2043 
  2044     ^ 
  2045      #(Menu
  2046         (
  2047          (MenuItem
  2048             label: '&File'
  2049             translateLabel: true
  2050             submenuChannel: menuFile
  2051             keepLinkedMenu: true
  2052           )
  2053          (MenuItem
  2054             label: 'Edit'
  2055             translateLabel: true
  2056             submenuChannel: menuEdit
  2057           )
  2058          (MenuItem
  2059             label: 'View'
  2060             translateLabel: true
  2061             submenu: 
  2062            (Menu
  2063               (
  2064                (MenuItem
  2065                   activeHelpKey: settingsCanvas
  2066                   label: 'Canvas'
  2067                   translateLabel: true
  2068                   indication: painterShown
  2069                 )
  2070                (MenuItem
  2071                   activeHelpKey: settingsGallery
  2072                   label: 'Gallery'
  2073                   translateLabel: true
  2074                   indication: galleryShown
  2075                 )
  2076                (MenuItem
  2077                   label: '-'
  2078                 )
  2079                (MenuItem
  2080                   label: 'Toolbar'
  2081                   translateLabel: true
  2082                   hideMenuOnActivated: false
  2083                   indication: toolBarVisibleHolder
  2084                 )
  2085                (MenuItem
  2086                   label: 'Editor Toolbar'
  2087                   translateLabel: true
  2088                   hideMenuOnActivated: false
  2089                   indication: editToolBarVisibleHolder
  2090                 )
  2091                (MenuItem
  2092                   label: '-'
  2093                 )
  2094                (MenuItem
  2095                   label: 'Load Sketch as Background...'
  2096                   itemValue: useSketch
  2097                   translateLabel: true
  2098                 )
  2099                (MenuItem
  2100                   label: 'Load Image as Background...'
  2101                   itemValue: useBackgroundImage
  2102                   translateLabel: true
  2103                 )
  2104                )
  2105               nil
  2106               nil
  2107             )
  2108           )
  2109          (MenuItem
  2110             label: 'Align'
  2111             translateLabel: true
  2112             submenuChannel: menuAlign
  2113           )
  2114          (MenuItem
  2115             label: 'Generate'
  2116             translateLabel: true
  2117             isVisible: isNotEditingSpecOnly
  2118             submenu: 
  2119            (Menu
  2120               (
  2121                (MenuItem
  2122                   activeHelpKey: generateAspectMethods
  2123                   enabled: hasSpecClass
  2124                   label: 'Aspect Methods'
  2125                   itemValue: doGenerateAspectMethods
  2126                   translateLabel: true
  2127                 )
  2128                (MenuItem
  2129                   activeHelpKey: generateAspectMethodFor
  2130                   enabled: hasSpecClass
  2131                   label: 'Aspect Method For...'
  2132                   itemValue: doGenerateAspectMethodFor
  2133                   translateLabel: true
  2134                 )
  2135                (MenuItem
  2136                   enabled: hasSpecClass
  2137                   label: 'Menu Stub Methods'
  2138                   itemValue: doGenerateMenuMethods
  2139                   translateLabel: true
  2140                 )
  2141                (MenuItem
  2142                   label: '-'
  2143                 )
  2144                (MenuItem
  2145                   activeHelpKey: generateHookMethods
  2146                   enabled: hasSpecClass
  2147                   label: 'Hook Methods'
  2148                   itemValue: doGenerateHookMethods
  2149                   translateLabel: true
  2150                 )
  2151                )
  2152               nil
  2153               nil
  2154             )
  2155           )
  2156          (MenuItem
  2157             label: 'Test'
  2158             translateLabel: true
  2159             submenu: 
  2160            (Menu
  2161               (
  2162                (MenuItem
  2163                   activeHelpKey: testStartApplication
  2164                   label: 'Start Application'
  2165                   itemValue: doStartApplication
  2166                   translateLabel: true
  2167                   isVisible: isNotEditingSpecOnly
  2168                 )
  2169                (MenuItem
  2170                   label: '-'
  2171                   isVisible: isNotEditingSpecOnly
  2172                 )
  2173                (MenuItem
  2174                   activeHelpKey: testGeometryTestMode
  2175                   label: 'Geometry Test/Set Mode'
  2176                   translateLabel: true
  2177                   indication: testMode:
  2178                 )
  2179                )
  2180               nil
  2181               nil
  2182             )
  2183           )
  2184          (MenuItem
  2185             label: 'Settings'
  2186             translateLabel: true
  2187             submenu: 
  2188            (Menu
  2189               (
  2190                (MenuItem
  2191                   activeHelpKey: settingsAspectsAsInstances
  2192                   label: 'Aspects as InstanceVariables'
  2193                   translateLabel: true
  2194                   isVisible: isNotEditingSpecOnly
  2195                   indication: generateAspectsAsInstanceVariables:
  2196                 )
  2197                (MenuItem
  2198                   activeHelpKey: settingsRedefineAspectMethods
  2199                   label: 'Redefine Aspect Methods'
  2200                   translateLabel: true
  2201                   isVisible: isNotEditingSpecOnly
  2202                   indication: redefineAspectMethods:
  2203                 )
  2204                (MenuItem
  2205                   activeHelpKey: settingsGenerateCommentedCode
  2206                   label: 'Generate Commented Code'
  2207                   translateLabel: true
  2208                   isVisible: isNotEditingSpecOnly
  2209                   indication: generateCommentedCode:
  2210                 )
  2211                (MenuItem
  2212                   label: 'AutoAccept on Selection-Change '
  2213                   translateLabel: true
  2214                   indication: autoAcceptOnSelectionChange
  2215                 )
  2216                (MenuItem
  2217                   label: '-'
  2218                 )
  2219                (MenuItem
  2220                   activeHelpKey: settingsUndoManager
  2221                   enabled: hasUndoHistory
  2222                   label: 'Undo Manager...'
  2223                   itemValue: openUndoMenu
  2224                   translateLabel: true
  2225                 )
  2226                (MenuItem
  2227                   activeHelpKey: settingsGridManager
  2228                   label: 'Grid Manager...'
  2229                   itemValue: doDefineGrid
  2230                   translateLabel: true
  2231                 )
  2232                )
  2233               nil
  2234               nil
  2235             )
  2236           )
  2237          (MenuItem
  2238             label: 'History'
  2239             translateLabel: true
  2240             isVisible: isStandAlone
  2241             submenuChannel: menuHistory
  2242           )
  2243          (MenuItem
  2244             label: 'MENU_Help'
  2245             translateLabel: true
  2246             startGroup: conditionalRight
  2247             submenu: 
  2248            (Menu
  2249               (
  2250                (MenuItem
  2251                   activeHelpKey: helpTutorial
  2252                   label: 'Tutorial'
  2253                   itemValue: openHTMLDocument:
  2254                   translateLabel: true
  2255                   argument: 'tools/uipainter/TOP.html'
  2256                 )
  2257                (MenuItem
  2258                   label: '-'
  2259                 )
  2260                (MenuItem
  2261                   activeHelpKey: helpFunctions
  2262                   label: 'Functions'
  2263                   itemValue: openHTMLDocument:
  2264                   translateLabel: true
  2265                   argument: 'tools/uipainter/Functions.html'
  2266                 )
  2267                (MenuItem
  2268                   activeHelpKey: helpExamples
  2269                   label: 'Examples'
  2270                   itemValue: openHTMLDocument:
  2271                   translateLabel: true
  2272                   argument: 'tools/uipainter/Examples.html'
  2273                 )
  2274                (MenuItem
  2275                   label: '-'
  2276                 )
  2277                (MenuItem
  2278                   activeHelpKey: helpHelpTool
  2279                   label: 'Help Tool'
  2280                   itemValue: openHTMLDocument:
  2281                   translateLabel: true
  2282                   argument: 'tools/uipainter/HelpTool.html'
  2283                 )
  2284                (MenuItem
  2285                   activeHelpKey: helpLayoutTool
  2286                   label: 'Layout Tool'
  2287                   itemValue: openHTMLDocument:
  2288                   translateLabel: true
  2289                   argument: 'tools/uipainter/LayoutTool.html'
  2290                 )
  2291                (MenuItem
  2292                   label: '-'
  2293                 )
  2294                (MenuItem
  2295                   activeHelpKey: helpSelectedWidget
  2296                   label: 'Selected Widget'
  2297                   itemValue: doOpenWidgetDocumentation
  2298                   translateLabel: true
  2299                 )
  2300                (MenuItem
  2301                   label: '-'
  2302                 )
  2303                (MenuItem
  2304                   activeHelpKey: helpShowHelp
  2305                   label: 'Show Help Texts'
  2306                   translateLabel: true
  2307                   indication: showingHelp:
  2308                 )
  2309                (MenuItem
  2310                   label: '-'
  2311                 )
  2312                (MenuItem
  2313                   activeHelpKey: aboutThisAppliaction
  2314                   label: 'About this Application...'
  2315                   itemValue: openAboutThisApplication
  2316                   translateLabel: true
  2317                 )
  2318                )
  2319               nil
  2320               nil
  2321             )
  2322           )
  2323          )
  2324         nil
  2325         nil
  2326       )
  2327 !
  2328 
  2329 menuAlign
  2330     "This resource specification was automatically generated
  2331      by the MenuEditor of ST/X."
  2332 
  2333     "Do not manually edit this!! If it is corrupted,
  2334      the MenuEditor may not be able to read the specification."
  2335 
  2336     "
  2337      MenuEditor new openOnClass:UIPainter andSelector:#menuAlign
  2338      (Menu new fromLiteralArrayEncoding:(UIPainter menuAlign)) startUp
  2339     "
  2340 
  2341     <resource: #menu>
  2342 
  2343     ^ 
  2344      #(Menu
  2345         (
  2346          (MenuItem
  2347             activeHelpKey: alignSelectionLeft
  2348             enabled: canMoveOrAlignSelection
  2349             label: 'Left'
  2350             itemValue: alignSelectionLeft
  2351             translateLabel: true
  2352             labelImage: (ResourceRetriever UIPainter iconAlignL 'Left')
  2353           )
  2354          (MenuItem
  2355             activeHelpKey: alignSelectionRight
  2356             enabled: canMoveOrAlignSelection
  2357             label: 'Right'
  2358             itemValue: alignSelectionRight
  2359             translateLabel: true
  2360             labelImage: (ResourceRetriever UIPainter iconAlignR 'Right')
  2361           )
  2362          (MenuItem
  2363             activeHelpKey: alignSelectionTop
  2364             enabled: canMoveOrAlignSelection
  2365             label: 'Top'
  2366             itemValue: alignSelectionTop
  2367             translateLabel: true
  2368             labelImage: (ResourceRetriever UIPainter iconAlignT 'Top')
  2369           )
  2370          (MenuItem
  2371             activeHelpKey: alignSelectionBottom
  2372             enabled: canMoveOrAlignSelection
  2373             label: 'Bottom'
  2374             itemValue: alignSelectionBottom
  2375             translateLabel: true
  2376             labelImage: (ResourceRetriever UIPainter iconAlignB 'Bottom')
  2377           )
  2378          (MenuItem
  2379             label: '-'
  2380           )
  2381          (MenuItem
  2382             activeHelpKey: alignResizeSelectionLeft
  2383             enabled: canMoveOrAlignSelection
  2384             label: 'Resize Left'
  2385             itemValue: alignResizeSelectionLeft
  2386             translateLabel: true
  2387             labelImage: (ResourceRetriever UIPainter iconResizeL 'Resize Left')
  2388           )
  2389          (MenuItem
  2390             activeHelpKey: alignResizeSelectionRight
  2391             enabled: canMoveOrAlignSelection
  2392             label: 'Resize Right'
  2393             itemValue: alignResizeSelectionRight
  2394             translateLabel: true
  2395             labelImage: (ResourceRetriever UIPainter iconResizeR 'Resize Right')
  2396           )
  2397          (MenuItem
  2398             activeHelpKey: alignResizeSelectionTop
  2399             enabled: canMoveOrAlignSelection
  2400             label: 'Resize Top'
  2401             itemValue: alignResizeSelectionTop
  2402             translateLabel: true
  2403             labelImage: (ResourceRetriever UIPainter iconResizeT 'Resize Top')
  2404           )
  2405          (MenuItem
  2406             activeHelpKey: alignResizeSelectionBottom
  2407             enabled: canMoveOrAlignSelection
  2408             label: 'Resize Bottom'
  2409             itemValue: alignResizeSelectionBottom
  2410             translateLabel: true
  2411             labelImage: (ResourceRetriever UIPainter iconResizeB 'Resize Bottom')
  2412           )
  2413          (MenuItem
  2414             activeHelpKey: alignSelectionLeftAndRight
  2415             enabled: canResizeSelection
  2416             label: 'Left && Right'
  2417             itemValue: alignSelectionLeftAndRight
  2418             translateLabel: true
  2419             labelImage: (ResourceRetriever UIPainter iconResizeLR 'Left && Right')
  2420           )
  2421          (MenuItem
  2422             activeHelpKey: alignSelectionTopAndBottom
  2423             enabled: canResizeSelection
  2424             label: 'Top && Bottom'
  2425             itemValue: alignSelectionTopAndBottom
  2426             translateLabel: true
  2427             labelImage: (ResourceRetriever UIPainter iconResizeTB 'Top && Bottom')
  2428           )
  2429          (MenuItem
  2430             label: '-'
  2431           )
  2432          (MenuItem
  2433             activeHelpKey: alignSelectionCenterHor
  2434             enabled: canMoveOrAlignSelection
  2435             label: 'Center Horizontal'
  2436             itemValue: alignSelectionCenterHor
  2437             translateLabel: true
  2438             labelImage: (ResourceRetriever UIPainter iconCenterH 'Center Horizontal')
  2439           )
  2440          (MenuItem
  2441             activeHelpKey: centerSelectionHor
  2442             enabled: canMoveOrAlignSelection
  2443             label: 'Center Horizontal in Frame'
  2444             itemValue: centerSelectionHor
  2445             translateLabel: true
  2446             labelImage: (ResourceRetriever UIPainter iconCenterHInFrame 'Center Horizontal in Frame')
  2447           )
  2448          (MenuItem
  2449             activeHelpKey: alignSelectionCenterVer
  2450             enabled: canMoveOrAlignSelection
  2451             label: 'Center Vertical'
  2452             itemValue: alignSelectionCenterVer
  2453             translateLabel: true
  2454             labelImage: (ResourceRetriever UIPainter iconCenterV 'Center Vertical')
  2455           )
  2456          (MenuItem
  2457             activeHelpKey: centerSelectionVer
  2458             enabled: canMoveOrAlignSelection
  2459             label: 'Center Vertical in Frame'
  2460             itemValue: centerSelectionVer
  2461             translateLabel: true
  2462             labelImage: (ResourceRetriever UIPainter iconCenterVInFrame 'Center Vertical in Frame')
  2463           )
  2464          (MenuItem
  2465             label: '-'
  2466           )
  2467          (MenuItem
  2468             activeHelpKey: spreadSelectionHor
  2469             enabled: canMoveOrAlignSelection
  2470             label: 'Distribute Horizontal'
  2471             itemValue: spreadSelectionHor
  2472             translateLabel: true
  2473             labelImage: (ResourceRetriever UIPainter iconDistributeH 'Distribute Horizontal')
  2474           )
  2475          (MenuItem
  2476             activeHelpKey: spreadSelectionVer
  2477             enabled: canMoveOrAlignSelection
  2478             label: 'Distribute Vertical'
  2479             itemValue: spreadSelectionVer
  2480             translateLabel: true
  2481             labelImage: (ResourceRetriever UIPainter iconDistributeV 'Distribute Vertical')
  2482           )
  2483          )
  2484         nil
  2485         nil
  2486       )
  2487 !
  2488 
  2489 menuEdit
  2490     "This resource specification was automatically generated
  2491      by the MenuEditor of ST/X."
  2492 
  2493     "Do not manually edit this!! If it is corrupted,
  2494      the MenuEditor may not be able to read the specification."
  2495 
  2496 
  2497     "
  2498      MenuEditor new openOnClass:UIPainter andSelector:#menuEdit
  2499      (Menu new fromLiteralArrayEncoding:(UIPainter menuEdit)) startUp
  2500     "
  2501 
  2502     <resource: #menu>
  2503 
  2504     ^ 
  2505      #(Menu
  2506         (
  2507          (MenuItem
  2508             activeHelpKey: editUndo
  2509             enabled: hasUndoHistory
  2510             label: 'Undo'
  2511             itemValue: undoLast
  2512             nameKey: undo
  2513           )
  2514          (MenuItem
  2515             label: '-'
  2516           )
  2517          (MenuItem
  2518             activeHelpKey: editCut
  2519             enabled: canCutHolder
  2520             label: 'Cut'
  2521             itemValue: deleteSelection
  2522           )
  2523          (MenuItem
  2524             activeHelpKey: editCopy
  2525             enabled: canCopyHolder
  2526             label: 'Copy'
  2527             itemValue: copySelection
  2528           )
  2529          (MenuItem
  2530             activeHelpKey: editPaste
  2531             enabled: canPasteHolder
  2532             label: 'Paste'
  2533             itemValue: pasteBuffer
  2534           )
  2535          (MenuItem
  2536             activeHelpKey: pasteWithLayout
  2537             enabled: canPasteKeepingLayoutHolder
  2538             label: 'Paste with Layout'
  2539             itemValue: pasteWithLayout
  2540           )
  2541          (MenuItem
  2542             activeHelpKey: editPaste
  2543             enabled: canPasteKeepingLayoutHolder
  2544             label: 'Paste Keeping Absolute Position'
  2545             itemValue: pasteKeepingPosition
  2546           )
  2547          (MenuItem
  2548             activeHelpKey: editDelete
  2549             enabled: canCutHolder
  2550             label: 'Delete'
  2551             itemValue: deleteTotalSelection
  2552           )
  2553          (MenuItem
  2554             activeHelpKey: replaceBy
  2555             enabled: canReplaceSelection
  2556             label: 'Replace By...'
  2557             itemValue: doAskAndReplaceWidgetBy
  2558           )
  2559          (MenuItem
  2560             activeHelpKey: wrapInto
  2561             enabled: canWrapSelection
  2562             label: 'Wrap Into...'
  2563             itemValue: doAskAndWrapWidgetInto
  2564           )
  2565          (MenuItem
  2566             label: '-'
  2567           )
  2568          (MenuItem
  2569             enabled: canMoveSelection
  2570             label: 'Move'
  2571             submenuChannel: menuMove
  2572           )
  2573          (MenuItem
  2574             enabled: canMoveOrAlignSelection
  2575             label: 'Align'
  2576             submenuChannel: menuAlign
  2577           )
  2578          (MenuItem
  2579             enabled: hasSelection
  2580             label: 'Dimension'
  2581             submenu: 
  2582            (Menu
  2583               (
  2584                (MenuItem
  2585                   activeHelpKey: editDimensionCopyLayout
  2586                   enabled: hasSingleSelection
  2587                   label: 'Copy Layout'
  2588                   itemValue: copyLayout
  2589                 )
  2590                (MenuItem
  2591                   activeHelpKey: editDimensionPasteLayout
  2592                   enabled: canMoveOrAlignSelection
  2593                   label: 'Paste Layout'
  2594                   itemValue: pasteLayout
  2595                 )
  2596                (MenuItem
  2597                   activeHelpKey: editDimensionExchangeLayouts
  2598                   enabled: canExchangeSelectionLayouts
  2599                   label: 'Exchange Layouts'
  2600                   itemValue: exchangeLayouts
  2601                 )
  2602                (MenuItem
  2603                   label: '-'
  2604                 )
  2605                (MenuItem
  2606                   activeHelpKey: editDimensionCopyExtent
  2607                   enabled: hasSingleSelection
  2608                   label: 'Copy Extent'
  2609                   itemValue: copyExtent
  2610                 )
  2611                (MenuItem
  2612                   activeHelpKey: editDimensionPasteExtent
  2613                   enabled: canMoveOrAlignSelection
  2614                   label: 'Paste Extent'
  2615                   itemValue: pasteExtent
  2616                 )
  2617                (MenuItem
  2618                   activeHelpKey: editDimensionPasteWidth
  2619                   enabled: canMoveOrAlignSelection
  2620                   label: 'Paste Width'
  2621                   itemValue: pasteWidth
  2622                 )
  2623                (MenuItem
  2624                   activeHelpKey: editDimensionPasteHeight
  2625                   enabled: canMoveOrAlignSelection
  2626                   label: 'Paste Height'
  2627                   itemValue: pasteHeight
  2628                 )
  2629                (MenuItem
  2630                   label: '-'
  2631                 )
  2632                (MenuItem
  2633                   activeHelpKey: editDimensionDefaultExtent
  2634                   enabled: canMoveOrAlignSelection
  2635                   label: 'Set Default Extent'
  2636                   itemValue: setToDefaultExtent
  2637                 )
  2638                (MenuItem
  2639                   activeHelpKey: editDimensionDefaultWidth
  2640                   enabled: canMoveOrAlignSelection
  2641                   label: 'Set Default Width'
  2642                   itemValue: setToDefaultWidth
  2643                 )
  2644                (MenuItem
  2645                   activeHelpKey: editDimensionDefaultHeight
  2646                   enabled: canMoveOrAlignSelection
  2647                   label: 'Set Default Height'
  2648                   itemValue: setToDefaultHeight
  2649                 )
  2650                )
  2651               nil
  2652               nil
  2653             )
  2654           )
  2655          (MenuItem
  2656             label: '-'
  2657           )
  2658          (MenuItem
  2659             activeHelpKey: editOpenSpecDocumentation
  2660             label: 'Open Widget Documentation'
  2661             itemValue: doOpenWidgetDocumentation
  2662             enabled: hasOneSelectionOtherThanCanvas
  2663           )
  2664          (MenuItem
  2665             activeHelpKey: referToConfigDatabase
  2666             label: 'Refer to Config Database'
  2667             itemValue: configSelection
  2668             isVisible: false
  2669           )
  2670          (MenuItem
  2671             label: '-'
  2672             isVisible: false
  2673           )
  2674          (MenuItem
  2675             activeHelpKey: drawEdit
  2676             label: 'Draw Edit'
  2677             itemValue: shapeEdit
  2678             isVisible: false
  2679           )
  2680          (MenuItem
  2681             label: '-'
  2682           )
  2683          (MenuItem
  2684             activeHelpKey: sortItems
  2685             label: 'Sort Selected Items by Position'
  2686             itemValue: doSortItems
  2687             enabled: hasMultipleSelectionOtherThanCanvas
  2688           )
  2689          (MenuItem
  2690             activeHelpKey: groupWithLayout
  2691             enabled: canGroup
  2692             label: 'Group with Layout'
  2693             itemValue: groupWithLayout
  2694           )
  2695          (MenuItem
  2696             activeHelpKey: ungroup
  2697             enabled: canUngroup
  2698             label: 'Ungroup'
  2699             itemValue: ungroup
  2700           )
  2701          (MenuItem
  2702             activeHelpKey: ungroupWithLayout
  2703             enabled: canUngroup
  2704             label: 'Ungroup with Layout'
  2705             itemValue: ungroupWithLayout
  2706           )
  2707          (MenuItem
  2708             label: '-'
  2709           )
  2710          (MenuItem
  2711             activeHelpKey: editBrowseViewClass
  2712             enabled: hasOneSelectionOtherThanCanvas
  2713             label: 'Browse Widget Class'
  2714             itemValue: doBrowseViewClass
  2715           )
  2716          (MenuItem
  2717             activeHelpKey: editInspectView
  2718             enabled: hasOneSelectionOtherThanCanvas
  2719             label: 'Inspect Widget'
  2720             itemValue: doInspectView
  2721           )
  2722          (MenuItem
  2723             activeHelpKey: editBrowseViewClass
  2724             label: 'Browse Specification Class'
  2725             itemValue: doBrowseSpecificationClass
  2726             enabled: hasOneSelectionOtherThanCanvas
  2727           )
  2728          (MenuItem
  2729             activeHelpKey: editInspectSpec
  2730             label: 'Inspect Spec'
  2731             itemValue: doInspectSpec
  2732             enabled: hasOneSelectionOtherThanCanvas
  2733           )
  2734          (MenuItem
  2735             label: '-'
  2736           )
  2737          (MenuItem
  2738             activeHelpKey: editSaveSpecForSelection
  2739             enabled: hasOneSelectionOtherThanCanvas
  2740             label: 'Save Spec of Selection...'
  2741             itemValue: doSaveElementSpecAs
  2742           )
  2743          )
  2744         nil
  2745         nil
  2746       )
  2747 !
  2748 
  2749 menuFile
  2750     "This resource specification was automatically generated
  2751      by the MenuEditor of ST/X."
  2752 
  2753     "Do not manually edit this!! If it is corrupted,
  2754      the MenuEditor may not be able to read the specification."
  2755 
  2756     "
  2757      MenuEditor new openOnClass:UIPainter andSelector:#menuFile
  2758      (Menu new fromLiteralArrayEncoding:(UIPainter menuFile)) startUp
  2759     "
  2760 
  2761     <resource: #menu>
  2762 
  2763     ^ 
  2764      #(Menu
  2765               (
  2766                (MenuItem
  2767                   activeHelpKey: fileNew
  2768                   label: 'New'
  2769                   itemValue: doNew
  2770                   translateLabel: true
  2771                   isVisible: isStandAlone
  2772                 )
  2773                (MenuItem
  2774                   label: '-'
  2775                   isVisible: isStandAlone
  2776                 )
  2777                (MenuItem
  2778                   activeHelpKey: fileLoad
  2779                   label: 'Load...'
  2780                   itemValue: doLoad
  2781                   translateLabel: true
  2782                   isVisible: isStandAlone
  2783                 )
  2784                (MenuItem
  2785                   activeHelpKey: fileLoadSubspec
  2786                   label: 'Load Subspec...'
  2787                   itemValue: doLoadSubspec
  2788                   translateLabel: true
  2789                   isVisible: isStandAlone
  2790                 )
  2791                (MenuItem
  2792                   label: '-'
  2793                   isVisible: isStandAlone
  2794                 )
  2795                (MenuItem
  2796                   activeHelpKey: fileSave
  2797                   label: 'Save'
  2798                   itemValue: doSave
  2799                   translateLabel: true
  2800                 )
  2801                (MenuItem
  2802                   activeHelpKey: fileSaveAs
  2803                   label: 'Save As...'
  2804                   itemValue: doSaveAs
  2805                   translateLabel: true
  2806                 )
  2807                (MenuItem
  2808                   label: '-'
  2809                 )
  2810                (MenuItem
  2811                   activeHelpKey: fileSaveAs
  2812                   label: 'Define Class and Selector...'
  2813                   itemValue: doDefineClassAndSelector
  2814                   translateLabel: true
  2815                   isVisible: isStandAlone
  2816                 )
  2817                (MenuItem
  2818                   activeHelpKey: filePickAnInterface
  2819                   label: 'Pick a Window Spec...'
  2820                   itemValue: doPickAView
  2821                   translateLabel: true
  2822                 )
  2823                (MenuItem
  2824                   label: '-'
  2825                 )
  2826                (MenuItem
  2827                   label: 'Launch'
  2828                   itemValue: doStartApplication
  2829                   translateLabel: true
  2830                 )
  2831                (MenuItem
  2832                   enabled: canInstallAsWebPageHolder
  2833                   label: 'Install as WebPage'
  2834                   itemValue: doInstallAsWebPage
  2835                   translateLabel: true
  2836                 )
  2837                (MenuItem
  2838                   label: '-'
  2839                 )
  2840                (MenuItem
  2841                   activeHelpKey: fileShowWindowSpec
  2842                   label: 'Show Window Spec'
  2843                   itemValue: doWindowSpec
  2844                   translateLabel: true
  2845                   isVisible: isStandAlone
  2846                 )
  2847                (MenuItem
  2848                   activeHelpKey: fileBrowseClass
  2849                   enabled: hasSpecClass
  2850                   label: 'Browse Applications Class'
  2851                   itemValue: doBrowseClass
  2852                   translateLabel: true
  2853                   isVisible: isStandAlone
  2854                 )
  2855                (MenuItem
  2856                   activeHelpKey: fileBrowseAspectMethods
  2857                   enabled: hasSpecClass
  2858                   label: 'Browse Applications Aspect Methods'
  2859                   itemValue: doBrowseAspectMethods
  2860                   translateLabel: true
  2861                 )
  2862                (MenuItem
  2863                   label: '-'
  2864                   isVisible: isStandAlone
  2865                 )
  2866                (MenuItem
  2867                   activeHelpKey: fileExit
  2868                   label: 'Exit'
  2869                   itemValue: closeRequest
  2870                   translateLabel: true
  2871                   isVisible: isStandAlone
  2872                 )
  2873                )
  2874               nil
  2875               nil
  2876             )
  2877 !
  2878 
  2879 menuMove
  2880     "This resource specification was automatically generated
  2881      by the MenuEditor of ST/X."
  2882 
  2883     "Do not manually edit this!! If it is corrupted,
  2884      the MenuEditor may not be able to read the specification."
  2885 
  2886     "
  2887      MenuEditor new openOnClass:UIPainter andSelector:#menuMove
  2888      (Menu new fromLiteralArrayEncoding:(UIPainter menuMove)) startUp
  2889     "
  2890 
  2891     <resource: #menu>
  2892 
  2893     ^
  2894      
  2895        #(#Menu
  2896           
  2897            #(
  2898              #(#MenuItem
  2899                 #label: 'Up'
  2900                 #translateLabel: true
  2901                 #value: #doStepUp
  2902                 #activeHelpKey: #moveWidgetUp
  2903                 #enabled: #canChangeOrderInContainer
  2904                 #labelImage: #(#ResourceRetriever #Icon #upIcon 'Up')
  2905             )
  2906              #(#MenuItem
  2907                 #label: 'Down'
  2908                 #translateLabel: true
  2909                 #value: #doStepDown
  2910                 #activeHelpKey: #moveWidgetDown
  2911                 #enabled: #canChangeOrderInContainer
  2912                 #labelImage: #(#ResourceRetriever #Icon #downIcon 'Down')
  2913             )
  2914              #(#MenuItem
  2915                 #label: 'Into'
  2916                 #translateLabel: true
  2917                 #value: #doStepIn
  2918                 #activeHelpKey: #moveWidgetInto
  2919                 #enabled: #canMoveSelectionIntoContainer
  2920                 #labelImage: #(#ResourceRetriever #Icon #downRightIcon 'Into')
  2921             )
  2922              #(#MenuItem
  2923                 #label: 'Out'
  2924                 #translateLabel: true
  2925                 #value: #doStepOut
  2926                 #activeHelpKey: #moveWidgetOut
  2927                 #enabled: #canMoveSelectionOutOfContainer
  2928                 #labelImage: #(#ResourceRetriever #Icon #leftDownIcon 'Out')
  2929             )
  2930           ) nil
  2931           nil
  2932       )
  2933 !
  2934 
  2935 menuReplaceWidget
  2936     "This resource specification was automatically generated
  2937      by the MenuEditor of ST/X."
  2938 
  2939     "Do not manually edit this!! If it is corrupted,
  2940      the MenuEditor may not be able to read the specification."
  2941 
  2942     "
  2943      MenuEditor new openOnClass:UIPainter andSelector:#menuReplaceWidget
  2944      (Menu new fromLiteralArrayEncoding:(UIPainter menuReplaceWidget)) startUp
  2945     "
  2946 
  2947     <resource: #menu>
  2948 
  2949     ^ 
  2950      #(Menu
  2951         (
  2952          (MenuItem
  2953             activeHelpKey: replaceBy
  2954             enabled: canChangeOrderInContainer
  2955             label: 'Replace By...'
  2956             itemValue: doAskAndReplaceWidgetBy
  2957             translateLabel: true
  2958           )
  2959          )
  2960         nil
  2961         nil
  2962       )
  2963 !
  2964 
  2965 menuToolbar
  2966     "This resource specification was automatically generated
  2967      by the MenuEditor of ST/X."
  2968 
  2969     "Do not manually edit this!! If it is corrupted,
  2970      the MenuEditor may not be able to read the specification."
  2971 
  2972     "
  2973      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar
  2974      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp
  2975     "
  2976 
  2977     <resource: #menu>
  2978 
  2979     ^ 
  2980      #(Menu
  2981         (
  2982          (MenuItem
  2983             activeHelpKey: testStartApplication
  2984             label: 'Start'
  2985             itemValue: doStartApplication
  2986             translateLabel: true
  2987             isButton: true
  2988             labelImage: (ResourceRetriever ToolbarIconLibrary start22x22Icon)
  2989           )
  2990          (MenuItem
  2991             enabled: canInstallAsWebPageHolder
  2992             label: 'Install as WebPage'
  2993             itemValue: doInstallAsWebPage
  2994             translateLabel: true
  2995             isButton: true
  2996             isVisible: installAsWebPageVisible
  2997             labelImage: (ResourceRetriever XPToolbarIconLibrary installAsWebPage24x24Icon)
  2998           )
  2999          (MenuItem
  3000             label: '-'
  3001           )
  3002          (MenuItem
  3003             activeHelpKey: fileNew
  3004             label: 'New'
  3005             itemValue: doNew
  3006             translateLabel: true
  3007             isButton: true
  3008             isVisible: isStandAlone
  3009             labelImage: (ResourceRetriever ToolbarIconLibrary newWindowSpecIcon)
  3010           )
  3011          (MenuItem
  3012             label: '-'
  3013             isVisible: isStandAlone
  3014           )
  3015          (MenuItem
  3016             activeHelpKey: fileLoad
  3017             label: 'Load'
  3018             itemValue: doLoad
  3019             translateLabel: true
  3020             isButton: true
  3021             isVisible: isStandAlone
  3022             labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon)
  3023           )
  3024          (MenuItem
  3025             activeHelpKey: fileSave
  3026             label: 'Save'
  3027             itemValue: doSave
  3028             translateLabel: true
  3029             isButton: true
  3030             labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon)
  3031           )
  3032          (MenuItem
  3033             label: '-'
  3034           )
  3035          (MenuItem
  3036             label: 'CutCopyPaste'
  3037             translateLabel: true
  3038             submenuChannel: cutCopyPasteMenuSlice
  3039             isMenuSlice: true
  3040           )
  3041          (MenuItem
  3042             label: '-'
  3043             startGroup: right
  3044           )
  3045          (MenuItem
  3046             activeHelpKey: settingsCanvas
  3047             label: 'Canvas'
  3048             translateLabel: true
  3049             indication: painterShown
  3050           )
  3051          (MenuItem
  3052             activeHelpKey: settingsGallery
  3053             label: 'Gallery'
  3054             translateLabel: true
  3055             indication: galleryShown
  3056           )
  3057          )
  3058         nil
  3059         nil
  3060       )
  3061 !
  3062 
  3063 menuToolbar2
  3064     "This resource specification was automatically generated
  3065      by the MenuEditor of ST/X."
  3066 
  3067     "Do not manually edit this!! If it is corrupted,
  3068      the MenuEditor may not be able to read the specification."
  3069 
  3070 
  3071     "
  3072      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar2
  3073      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar2)) startUp
  3074     "
  3075 
  3076     <resource: #menu>
  3077 
  3078     ^ 
  3079      #(Menu
  3080         (
  3081          (MenuItem
  3082             activeHelpKey: alignSelectionLeft
  3083             enabled: canMoveOrAlignSelection
  3084             label: 'Align Left'
  3085             itemValue: alignSelectionLeft
  3086             isButton: true
  3087             labelImage: (ResourceRetriever nil iconAlignL)
  3088           )
  3089          (MenuItem
  3090             activeHelpKey: alignSelectionRight
  3091             enabled: canMoveOrAlignSelection
  3092             label: 'Align Right'
  3093             itemValue: alignSelectionRight
  3094             isButton: true
  3095             labelImage: (ResourceRetriever nil iconAlignR)
  3096           )
  3097          (MenuItem
  3098             activeHelpKey: alignSelectionTop
  3099             enabled: canMoveOrAlignSelection
  3100             label: 'Align Top'
  3101             itemValue: alignSelectionTop
  3102             isButton: true
  3103             labelImage: (ResourceRetriever nil iconAlignT)
  3104           )
  3105          (MenuItem
  3106             activeHelpKey: alignSelectionBottom
  3107             enabled: canMoveOrAlignSelection
  3108             label: 'Align Bottom'
  3109             itemValue: alignSelectionBottom
  3110             isButton: true
  3111             labelImage: (ResourceRetriever nil iconAlignB)
  3112           )
  3113          (MenuItem
  3114             activeHelpKey: alignSelectionLeftAndRight
  3115             enabled: canResizeSelection
  3116             label: 'Align Left & Right'
  3117             itemValue: alignSelectionLeftAndRight
  3118             isButton: true
  3119             labelImage: (ResourceRetriever nil iconResizeLR)
  3120           )
  3121          (MenuItem
  3122             activeHelpKey: alignSelectionTopAndBottom
  3123             enabled: canResizeSelection
  3124             label: 'Align Top & Bottom'
  3125             itemValue: alignSelectionTopAndBottom
  3126             isButton: true
  3127             labelImage: (ResourceRetriever nil iconResizeTB)
  3128           )
  3129          (MenuItem
  3130             label: ''
  3131           )
  3132          (MenuItem
  3133             activeHelpKey: changePositionLeft
  3134             enabled: canMoveOrAlignSelection
  3135             label: 'Move Left'
  3136             itemValue: moveSelectionLeft
  3137             isButton: true
  3138             hideMenuOnActivated: false
  3139             triggerOnDown: true
  3140             labelImage: (ResourceRetriever nil arrowLeft)
  3141           )
  3142          (MenuItem
  3143             activeHelpKey: changePositionRight
  3144             enabled: canMoveOrAlignSelection
  3145             label: 'Move Right'
  3146             itemValue: moveSelectionRight
  3147             isButton: true
  3148             hideMenuOnActivated: false
  3149             triggerOnDown: true
  3150             labelImage: (ResourceRetriever nil arrowRight)
  3151           )
  3152          (MenuItem
  3153             activeHelpKey: changePositionUp
  3154             enabled: canMoveOrAlignSelection
  3155             label: 'Move Up'
  3156             itemValue: moveSelectionUp
  3157             isButton: true
  3158             hideMenuOnActivated: false
  3159             triggerOnDown: true
  3160             labelImage: (ResourceRetriever nil arrowUp)
  3161           )
  3162          (MenuItem
  3163             activeHelpKey: changePositionDown
  3164             enabled: canMoveOrAlignSelection
  3165             label: 'Move Down'
  3166             itemValue: moveSelectionDown
  3167             isButton: true
  3168             hideMenuOnActivated: false
  3169             triggerOnDown: true
  3170             labelImage: (ResourceRetriever nil arrowDown)
  3171           )
  3172          (MenuItem
  3173             activeHelpKey: changeMoveDelta
  3174             label: 'Move by'
  3175             nameKey: MoveByMenu
  3176             isButton: true
  3177             submenu: 
  3178            (Menu
  3179               (
  3180                (MenuItem
  3181                   label: '1'
  3182                   itemValue: setMoveByStep:
  3183                   argument: 1
  3184                 )
  3185                (MenuItem
  3186                   label: '5'
  3187                   itemValue: setMoveByStep:
  3188                   argument: 5
  3189                 )
  3190                (MenuItem
  3191                   label: '10'
  3192                   itemValue: setMoveByStep:
  3193                   argument: 10
  3194                 )
  3195                (MenuItem
  3196                   label: '24'
  3197                   itemValue: setMoveByStep:
  3198                   argument: 24
  3199                 )
  3200                (MenuItem
  3201                   label: '30'
  3202                   itemValue: setMoveByStep:
  3203                   argument: 30
  3204                 )
  3205                (MenuItem
  3206                   label: '100'
  3207                   itemValue: setMoveByStep:
  3208                   argument: 100
  3209                 )
  3210                (MenuItem
  3211                   label: '-'
  3212                 )
  3213                (MenuItem
  3214                   label: 'Enter Value...'
  3215                   itemValue: askForMoveByStep
  3216                 )
  3217                )
  3218               nil
  3219               nil
  3220             )
  3221             labelImage: (ResourceRetriever UIPainter delta)
  3222           )
  3223          (MenuItem
  3224             activeHelpKey: editOpenSpecDocumentation
  3225             label: 'Widget Documentation'
  3226             itemValue: doOpenWidgetDocumentation
  3227             isButton: true
  3228             startGroup: right
  3229             labelImage: (ResourceRetriever Icon helpIcon)
  3230           )
  3231          )
  3232         nil
  3233         nil
  3234       )
  3235 !
  3236 
  3237 moveInListMenuSlice
  3238     "This resource specification was automatically generated
  3239      by the MenuEditor of ST/X."
  3240 
  3241     "Do not manually edit this!! If it is corrupted,
  3242      the MenuEditor may not be able to read the specification."
  3243 
  3244     "
  3245      MenuEditor new openOnClass:UIPainter andSelector:#editToolbar
  3246      (Menu new fromLiteralArrayEncoding:(UIPainter editToolbar)) startUp
  3247     "
  3248 
  3249     <resource: #menu>
  3250 
  3251     ^ 
  3252      #(Menu
  3253         (
  3254          (MenuItem
  3255             activeHelpKey: moveWidgetUp
  3256             enabled: canChangeOrderInContainer
  3257             label: 'Move Up'
  3258             itemValue: doStepUp
  3259             translateLabel: true
  3260             isButton: true
  3261             labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetUpIcon)
  3262           )
  3263          (MenuItem
  3264             activeHelpKey: moveWidgetDown
  3265             enabled: canChangeOrderInContainer
  3266             label: 'Move Down'
  3267             itemValue: doStepDown
  3268             translateLabel: true
  3269             isButton: true
  3270             labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetDownIcon)
  3271           )
  3272          (MenuItem
  3273             activeHelpKey: moveWidgetInto
  3274             enabled: canMoveSelectionIntoContainer
  3275             label: 'Move Into'
  3276             itemValue: doStepIn
  3277             translateLabel: true
  3278             isButton: true
  3279             labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetDownRightIcon)
  3280           )
  3281          (MenuItem
  3282             activeHelpKey: moveWidgetOut
  3283             enabled: canMoveSelectionOutOfContainer
  3284             label: 'Move Out'
  3285             itemValue: doStepOut
  3286             translateLabel: true
  3287             isButton: true
  3288             labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetLeftDownIcon)
  3289           )
  3290          )
  3291         nil
  3292         nil
  3293       )
  3294 ! !
  3295 
  3296 !UIPainter class methodsFor:'private class access'!
  3297 
  3298 applicationClassQuery
  3299     ^ ApplicationClassQuery
  3300 ! !
  3301 
  3302 !UIPainter methodsFor:'aspects'!
  3303 
  3304 alignToGridHolder
  3305     |holder|
  3306 
  3307     (holder := builder bindingAt:#alignToGridHolder) isNil ifTrue:[
  3308         holder := (self class settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue.
  3309         builder aspectAt:#alignToGridHolder put: holder.
  3310         holder addDependent:self.
  3311     ].
  3312     ^ holder
  3313 !
  3314 
  3315 aspectFor:aKey
  3316     "returns the aspect for aKey or nil"
  3317 
  3318     ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
  3319 !
  3320 
  3321 canChangeOrderInContainer
  3322     "returns a boolean value holder which is true if the widget order can be changed 
  3323      within their container"
  3324 
  3325     ^ builder booleanValueAspectFor:#canChangeOrderInContainer
  3326 !
  3327 
  3328 canExchangeSelectionLayouts
  3329     "returns a boolean value holder which is true in case that the selection 
  3330      consists of exactly 2 components
  3331      and all widgets in the selection can change its layout through to a move or
  3332      align operation"
  3333 
  3334     ^ builder booleanValueAspectFor:#canExchangeSelectionLayouts
  3335 !
  3336 
  3337 canInstallAsWebPage
  3338     ^ specClass notNil
  3339        and:[ specClass isSubclassOf:WebApplicationModel ]
  3340 
  3341     "Created: / 14-01-2008 / 17:34:56 / cg"
  3342 !
  3343 
  3344 canInstallAsWebPageHolder
  3345     ^ builder 
  3346             valueAspectFor:#canInstallAsWebPageHolder
  3347             initialValue:(self canInstallAsWebPage).
  3348 
  3349     "Created: / 14-01-2008 / 17:36:04 / cg"
  3350 !
  3351 
  3352 canMoveOrAlignSelection
  3353     "returns a boolean value holder which is true in case that any selection exists
  3354      and all widgets in the selection can change their layout through to a move or
  3355      align operation"
  3356 
  3357     ^ builder booleanValueAspectFor:#canMoveOrAlignSelection
  3358 !
  3359 
  3360 canMoveSelection
  3361     "true if move-in/move-out/move-up and down are enabled"
  3362 
  3363     treeView hasOneSelectionOtherThanCanvas ifFalse:[^ false].
  3364     ^ self canChangeOrderInContainer value 
  3365      or: [ self canMoveSelectionOutOfContainer value 
  3366      or: [ self canMoveSelectionIntoContainer value ]]
  3367 !
  3368 
  3369 canMoveSelectionIntoContainer
  3370     "returns true in case that at least one widget is selected and can change its container
  3371      widget to an element below"
  3372 
  3373     ^ builder booleanValueAspectFor:#canMoveSelectionIntoContainer
  3374 !
  3375 
  3376 canMoveSelectionOutOfContainer
  3377     "returns a boolean value holder which is true in case that at least one widget is selected
  3378      which is contained within another component"
  3379 
  3380     ^ builder booleanValueAspectFor:#canMoveSelectionOutOfContainer
  3381 !
  3382 
  3383 canPasteHolder
  3384 
  3385     |holder|
  3386     (holder := builder bindingAt:#canPasteHolder) isNil ifTrue:[
  3387         holder := [ self canPaste ].
  3388     ].
  3389     ^ holder
  3390 !
  3391 
  3392 canPasteKeepingLayoutHolder
  3393     ^ self canPasteHolder
  3394 !
  3395 
  3396 canReplaceSelection
  3397     treeView hasOneSelectionOtherThanCanvas ifFalse:[^ false].
  3398     ^ true
  3399 !
  3400 
  3401 canResizeSelection
  3402     "returns a boolean value holder which is true in case that any selection exists
  3403      and all widgets in the selection can be resized"
  3404 
  3405     ^ builder booleanValueAspectFor:#canResizeSelection
  3406 !
  3407 
  3408 canWrapSelection
  3409     treeView hasOneSelectionOtherThanCanvas ifFalse:[^ false].
  3410     ^ true
  3411 !
  3412 
  3413 editToolBarVisibleHolder
  3414     |holder|
  3415 
  3416     (holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[
  3417         holder := self class defaultEditToolbarVisible asValue.
  3418         builder aspectAt:#editToolBarVisibleHolder put: holder.
  3419         holder addDependent:self.
  3420     ].
  3421     ^ holder
  3422 !
  3423 
  3424 enableChannel
  3425     "true if modifications are allowed otherwise in test mode"
  3426 
  3427     ^ builder valueAspectFor:#enableChannel initialValue:true
  3428 !
  3429 
  3430 enableChannel2
  3431     "true if modifications are allowed otherwise running test"
  3432 
  3433     ^ self painter enableChannel
  3434 !
  3435 
  3436 galleryShown
  3437     "returns a boolean value holder which is set to true if the gallery is shown"
  3438 
  3439     |holder|
  3440 
  3441     (holder := builder bindingAt:#galleryShown) isNil ifTrue:[
  3442         builder aspectAt:#galleryShown put:(holder :=  true asValue).
  3443         holder addDependent:self
  3444     ].
  3445     ^ holder
  3446 
  3447 !
  3448 
  3449 gridShownHolder
  3450     |holder|
  3451 
  3452     (holder := builder bindingAt:#gridShownHolder) isNil ifTrue:[
  3453         holder := (self class settings at: #GridShown ifAbsent: [painter gridShown]) asValue.
  3454         builder aspectAt:#gridShownHolder put: holder.
  3455         holder addDependent:self.
  3456     ].
  3457     ^ holder
  3458 !
  3459 
  3460 hasMultipleSelectionOtherThanCanvas
  3461     "returns a value holder which is true in case that multiple widget other than the root are selected"
  3462 
  3463     ^ builder booleanValueAspectFor:#hasMultipleSelectionOtherThanCanvas
  3464 !
  3465 
  3466 hasOneSelectionOtherThanCanvas
  3467     "returns a value holder which is true in case that one widget is selected
  3468      other than the root"
  3469 
  3470     ^ builder booleanValueAspectFor:#hasOneSelectionOtherThanCanvas
  3471 !
  3472 
  3473 hasSelectionOtherThanCanvas
  3474     "returns a value holder which is true in case that any widget other than the root is selected"
  3475 
  3476     ^ builder booleanValueAspectFor:#hasSelectionOtherThanCanvas
  3477 !
  3478 
  3479 hasUndoHistory
  3480     ^ self painter hasUndoHistory
  3481 !
  3482 
  3483 hasUndoHistoryHolder
  3484     ^ self painter hasUndoHistoryHolder
  3485 !
  3486 
  3487 installAsWebPageVisible
  3488     ^ true
  3489 
  3490     "Created: / 14-01-2008 / 17:46:05 / cg"
  3491 !
  3492 
  3493 noteBookView
  3494     "returns the notebook view; initialize the tools embedded in the notebook"
  3495 
  3496     |noteBook|
  3497 
  3498     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  3499         noteBook := View new.
  3500         builder aspectAt:#noteBookView put:noteBook.
  3501 
  3502         layoutTool := self createToolApplication:UILayoutTool        spec:#windowSpec in:noteBook.
  3503         helpTool   := self createToolApplication:UIHelpTool          spec:#innerSpec  in:noteBook.
  3504         specTool   := self createToolApplication:UISpecificationTool spec:#windowSpec in:noteBook.
  3505 
  3506         helpTool loadFromClass:specClass.
  3507     ].
  3508     ^ noteBook
  3509 
  3510     "Modified: / 31-08-2006 / 10:11:15 / cg"
  3511 !
  3512 
  3513 painterShown
  3514     "returns a boolean value holder which is set to true if the painter is shown"
  3515 
  3516     |holder|
  3517 
  3518     (holder := builder bindingAt:#painterShown) isNil ifTrue:[
  3519         builder aspectAt:#painterShown put:(holder :=  true asValue).
  3520         holder addDependent:self
  3521     ].
  3522     ^ holder
  3523 
  3524 !
  3525 
  3526 tabList
  3527     "returns a value holder which keeps a list of the section labels in the notebook"
  3528 
  3529     |tabs holder|
  3530 
  3531     (holder := builder bindingAt:#tabList) isNil ifTrue:[
  3532         tabs := #(Basics Details Layout).
  3533         builder aspectAt:#tabList put:(holder :=  (resources array:tabs) asValue).
  3534     ].
  3535     ^ holder
  3536 !
  3537 
  3538 tabModel
  3539     "returns a value holder which keeps the label of the current section in the notebook"
  3540 
  3541     |holder|
  3542 
  3543     (holder := builder bindingAt:#tabModel) isNil ifTrue:[
  3544         holder := AspectAdaptor new subject:self; forAspect:#tabSelection.
  3545         builder aspectAt:#tabModel put:holder.
  3546     ].
  3547     ^ holder
  3548 !
  3549 
  3550 toolBarVisibleHolder
  3551     |holder|
  3552 
  3553     (holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[
  3554         holder := self class defaultToolbarVisible asValue.
  3555         builder aspectAt:#toolBarVisibleHolder put: holder.
  3556         holder addDependent:self.
  3557     ].
  3558     ^ holder
  3559 !
  3560 
  3561 treeView
  3562     "returns the tree view which holds all widget"
  3563 
  3564     ^ treeView
  3565 !
  3566 
  3567 valueOfCanPasteWithKeepingLayout
  3568     <resource: #obsolete>
  3569     self obsoleteMethodWarning:'stupid name - use #canPasteKeepingLayoutHolder'.
  3570     ^ self canPasteKeepingLayoutHolder
  3571 ! !
  3572 
  3573 !UIPainter methodsFor:'building editors'!
  3574 
  3575 XXopenDataSetColumnEditor
  3576     "opens a Table Column Editor on current widget"
  3577 
  3578     |cls editor specTool columnHolder tableSelector columns isEditingSpecOnly|
  3579 
  3580     isEditingSpecOnly := self isEditingSpecOnly.
  3581 
  3582     isEditingSpecOnly ifFalse:[
  3583         (cls := self resolveName:specClassName) isNil ifTrue:[
  3584             self askForSaving ifTrue:[cls := self resolveName:specClassName].
  3585         ].
  3586         cls isNil ifTrue:[^ self].
  3587     ].
  3588 
  3589     self acceptOrIgnoreSectionModification.
  3590 
  3591     editor   := DataSetBuilder new.
  3592     editor masterApplication:self.
  3593     specTool := self specTool.
  3594 
  3595     isEditingSpecOnly ifFalse:[
  3596         editor specClass: cls.
  3597         editor rowClassName:(specTool specification rowClassName).
  3598     ].
  3599     columnHolder  := specTool aspectFor:#columnHolder.
  3600     tableSelector := columnHolder value.
  3601 
  3602     tableSelector := tableSelector notEmptyOrNil 
  3603                         ifTrue:[tableSelector asSymbol]
  3604                         ifFalse:[nil].
  3605 
  3606     (isEditingSpecOnly not
  3607     and:[tableSelector notNil 
  3608     and:[cls class includesSelector:tableSelector]]) ifTrue:[
  3609         editor openModalOnClass:cls andSelector:tableSelector
  3610     ] ifFalse:[
  3611         editor editingSpecOnly:true.
  3612 
  3613         columns := specTool specification columns.
  3614         columns size ~~ 0 ifTrue:[
  3615             editor openModalOnResourceSpec:columns
  3616         ] ifFalse:[
  3617             editor openModal
  3618         ].
  3619     ].
  3620 
  3621     isEditingSpecOnly ifFalse:[
  3622         editor hasSaved ifTrue:[
  3623             specTool specification 
  3624                 columns:nil;
  3625                 rowClassName:(editor rowClassName).
  3626 
  3627             tableSelector = editor specSelector ifFalse:[
  3628                 columnHolder value:(editor specSelector).
  3629                 self accept.
  3630             ].
  3631             ^ self
  3632         ].
  3633     ].
  3634 
  3635     tableSelector isNil ifTrue:[
  3636         editor hasSaved ifTrue:[
  3637             editor modified ifFalse:[
  3638                 specTool specification 
  3639                     columns:(editor acceptedColumns);
  3640                     rowClassName:(editor rowClassName).
  3641                 self modifiedChannel value:true.
  3642             ].
  3643         ].
  3644     ].
  3645 
  3646     "Modified: / 12-01-2008 / 10:31:47 / cg"
  3647 !
  3648 
  3649 openDataSetColumnEditor
  3650     "opens a Table Column Editor on current widget"
  3651 
  3652     |cls editor specTool columnHolder tableSelector columns isEditingSpecOnly|
  3653 
  3654     self isModified ifTrue:[
  3655         "/ force editFields to accept
  3656         self acceptChannel value:true; value:false.
  3657     ].
  3658 
  3659     specTool := self specTool.
  3660     columnHolder := specTool aspectFor:#columnHolder.
  3661     tableSelector := columnHolder value.
  3662 
  3663     tableSelector notEmptyOrNil ifTrue:[
  3664         tableSelector := tableSelector asSymbol.
  3665     ] ifFalse:[
  3666         tableSelector := nil.
  3667     ].
  3668 
  3669     isEditingSpecOnly := true.
  3670 
  3671     (tableSelector notNil and:[self isEditingSpecOnly not]) ifTrue:[
  3672         (cls := self resolveName:specClassName) notNil ifTrue:[
  3673             isEditingSpecOnly := false.
  3674         ].
  3675     ].
  3676     editor := DataSetBuilder new.
  3677     editor masterApplication:self.
  3678 
  3679     isEditingSpecOnly ifFalse:[
  3680         editor specClass:cls.
  3681         editor rowClassName:(specTool specification rowClassName).
  3682     ].
  3683 
  3684     isEditingSpecOnly ifFalse:[
  3685         editor openModalOnClass:cls andSelector:tableSelector.
  3686 
  3687         editor hasSaved ifTrue:[
  3688             specTool specification 
  3689                 columns:nil;
  3690                 rowClassName:(editor rowClassName).
  3691 
  3692             tableSelector = editor specSelector ifFalse:[
  3693                 columnHolder value:(editor specSelector).
  3694                 self accept.
  3695             ].
  3696         ].
  3697         ^ self
  3698     ].
  3699 
  3700     editor editingSpecOnly:true.
  3701 
  3702     columns := specTool specification columns.
  3703 
  3704     columns size ~~ 0 ifTrue:[
  3705         editor openModalOnResourceSpec:columns
  3706     ] ifFalse:[
  3707         editor openModal
  3708     ].
  3709 
  3710     editor hasSaved ifTrue:[
  3711         columnHolder value:nil.
  3712 
  3713         specTool specification 
  3714             columns:(editor acceptedColumns);
  3715             rowClassName:(editor rowClassName).
  3716 
  3717         columnHolder value:nil.
  3718         self modifiedChannel value:true.
  3719     ].
  3720 !
  3721 
  3722 openEditMenu
  3723     "opens a Menu Editor on current widget for the standard menu
  3724      (accessed via #menu or #menuSelector)"
  3725 
  3726     ^ self
  3727         openEditMenuFor:#menu
  3728         and:#menuSelector
  3729 !
  3730 
  3731 openEditMenuFor:menuSelector and:menuSelectorSelector
  3732     "opens a Menu Editor on the current widget.
  3733      The arguments menuSelector (typically: #menu) 
  3734      and menuSelectorSelector (typically: #menuSelector) can be passed in
  3735      for widgets with a secondary menu (with different selectors)"
  3736 
  3737     |cls selectorOrMenu editor selectedSpec windowSpec holder|
  3738 
  3739     self isEditingSpecOnly ifFalse:[
  3740         "/ normal mode
  3741         (cls := self resolveName:specClassName) isNil ifTrue:[
  3742             self askForSaving ifTrue:[cls := self resolveName:specClassName].
  3743         ].
  3744         cls isNil ifTrue:[^ self].
  3745     ].
  3746 
  3747     self acceptOrIgnoreSectionModification.
  3748     windowSpec := self specTool specification.
  3749 
  3750     self isEditingSpecOnly ifTrue:[
  3751         selectorOrMenu := windowSpec perform:menuSelector
  3752     ] ifFalse:[
  3753         (selectorOrMenu := (windowSpec perform:menuSelectorSelector)) notNil ifTrue:[
  3754             selectorOrMenu := selectorOrMenu asSymbol
  3755         ] ifFalse:[
  3756             "/ cg: q&d hack ...
  3757             selectorOrMenu := nil.
  3758 
  3759             (selectedSpec := treeView propertySelected) notNil ifTrue:[
  3760                 Error handle:[:ex |
  3761                     selectorOrMenu := nil.
  3762                 ] do:[
  3763                     selectorOrMenu := selectedSpec view asMenu.
  3764                 ]
  3765             ].
  3766         ].
  3767     ].
  3768 
  3769     editor := MenuEditor new.
  3770     editor masterApplication:self.
  3771     self isEditingSpecOnly ifFalse:[
  3772         editor specClass: cls.
  3773         editor useHelpTool:(self helpTool).
  3774     ].
  3775 
  3776     (self isEditingSpecOnly or:[selectorOrMenu class == Menu]) ifTrue: [
  3777         editor openModalOnMenu:(selectorOrMenu).
  3778         editor hasSaved ifTrue:[
  3779             windowSpec perform:menuSelector asMutator with:(editor savedSpec).
  3780             self accept.
  3781         ].
  3782     ] ifFalse: [
  3783         editor openModalOnClass:cls andSelector:selectorOrMenu.
  3784         editor hasSaved ifTrue:[
  3785             holder := self specTool aspectFor:menuSelector.
  3786             holder value:(editor specSelector).
  3787             self accept.
  3788         ].
  3789     ].
  3790 
  3791     "Modified: / 12-01-2008 / 10:31:41 / cg"
  3792 !
  3793 
  3794 openHierarchicalListEditor
  3795     "opens a Hierarchical List Editor on current widget"
  3796 
  3797     |selector editor spec|
  3798 
  3799     (self resolveName:specClassName) isNil ifTrue:[
  3800         self askForSaving ifFalse: [^self]
  3801     ].
  3802 
  3803     spec := self specTool specification.
  3804     (selector := spec hierarchicalList) notNil ifTrue:[
  3805         selector := selector asSymbol
  3806     ].
  3807 
  3808     editor := HierarchicalListEditor new.
  3809     editor masterApplication:self.
  3810     editor openModalOnClass:specClassName andSelector:selector.
  3811 
  3812     editor specSelector ~= selector ifTrue:[
  3813         editor hasSaved ifTrue:[
  3814             spec hierarchicalList:editor specSelector.
  3815             self modifiedChannel value:true.
  3816             self accept
  3817         ]
  3818     ]
  3819 
  3820     "Modified: / 16.7.1998 / 18:15:46 / cg"
  3821 !
  3822 
  3823 openSubSpecBrowser
  3824     "opens a browser on the current subspecification"
  3825 
  3826     self withSpecClassAndSelectorDo:[:cls :sel |
  3827         cls theMetaclass browse:sel.
  3828     ].
  3829 !
  3830 
  3831 openSubSpecGUIPainter
  3832     "opens a GUI Painter on the current subspecification"
  3833 
  3834     self withSpecClassAndSelectorDo:[:cls :sel |
  3835         self class 
  3836             openOnClass:cls theMetaclass soleInstance 
  3837             andSelector:sel.
  3838     ].        
  3839 
  3840     "Modified: / 5.11.2001 / 16:51:46 / cg"
  3841 !
  3842 
  3843 openTabListEditor
  3844     "opens a Tab List Editor on current widget"
  3845 
  3846     |selector editor spec cls holder|
  3847 
  3848     (cls := self resolveName:specClassName) isNil ifTrue:[
  3849         self askForSaving ifTrue:[cls := self resolveName:specClassName].
  3850     ].
  3851     cls isNil ifTrue:[^ self].
  3852 
  3853     self acceptOrIgnoreSectionModification.
  3854     spec := self specTool specification.
  3855 
  3856     (selector := spec listSelector) isArray 
  3857         ifTrue: [^self warn: 'Cannot open the Tab List Editor on an array!!'].
  3858 
  3859     editor := TabListEditor new.
  3860     editor masterApplication:self.
  3861     editor openModalOnClass:cls andSelector:selector.
  3862 
  3863     editor hasSaved ifTrue:[
  3864         holder := self specTool aspectFor:#listSelector.
  3865 
  3866         holder value ~= editor specSelector ifTrue:[
  3867             holder value:editor specSelector.
  3868             self accept.
  3869         ]
  3870     ].
  3871 
  3872     "Modified: / 12-01-2008 / 10:31:34 / cg"
  3873 !
  3874 
  3875 withSpecClassAndSelectorDo:aTwoArgBlock
  3876     "helper for open GUI Painter/open Browser on the current subspecification"
  3877 
  3878     |spec cls meta sel|
  3879 
  3880     (self resolveName:specClassName) isNil ifTrue:[
  3881         self askForSaving ifFalse: [^self]
  3882     ]. 
  3883 
  3884     spec := self specTool specification.
  3885     cls := spec majorKey.
  3886     cls isNil ifTrue:[
  3887         cls := specClassName.
  3888     ].
  3889     (cls := self resolveName:cls inClass:(Smalltalk at: specClassName asSymbol)) isNil ifTrue:[
  3890         spec majorKey isNil ifTrue:[
  3891             ^ self warn:'Cannot find class (no majorKey specified).'.
  3892         ].
  3893         ^ self warn:('Cannot find class ', spec majorKey allBold, '.').
  3894     ].
  3895     sel := spec minorKey.
  3896     meta := cls class whichClassIncludesSelector:sel.
  3897     meta isNil ifTrue:[
  3898         ^ self warn:'Cannot find selector #', (sel ? '') allBold, ' in class ', cls name allBold, '!!'
  3899     ].
  3900 
  3901     aTwoArgBlock value:meta value:spec minorKey.
  3902 ! !
  3903 
  3904 !UIPainter methodsFor:'change & update'!
  3905 
  3906 layoutChanged
  3907     "called by the painter/canvas whenever the layout of the current selected
  3908      widget has changed"
  3909 
  3910     self isModified ifFalse:[
  3911         self layoutTool update.
  3912         self clearModifiedFlag
  3913     ]
  3914 !
  3915 
  3916 propertyChanged
  3917     "called by the painter/canvas whenever the property of the current selected
  3918      widget has changed"
  3919 
  3920     |property spec|
  3921 
  3922     (property := treeView propertySelected) notNil ifTrue:[
  3923         spec := property spec copy.
  3924         self specTool specification:spec.
  3925         self setViewInLayoutTool:(property view) spec:spec.
  3926         self clearModifiedFlag
  3927     ] ifFalse:[
  3928         self layoutTool layoutView notNil ifTrue:[
  3929             self clearModifiedFlag.
  3930             self treeSelectionChanged
  3931         ]
  3932     ]
  3933 !
  3934 
  3935 toolBarVisibilityChanged
  3936     |toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset|
  3937 
  3938     topOffset := 0.
  3939 
  3940     toolBar := self componentAt:#ToolBar.
  3941     toolBar notNil ifTrue:[
  3942         toolBarVisible := self toolBarVisibleHolder value.
  3943         DefaultToolBarVisible := toolBarVisible.
  3944         toolBarVisible ifTrue:[
  3945             topOffset := topOffset + toolBar height.
  3946         ]
  3947     ].
  3948 
  3949     editToolBar := self componentAt:#EditToolBar.
  3950     editToolBar notNil ifTrue:[
  3951         editToolBar layout 
  3952             topOffset:topOffset bottomOffset:(topOffset + editToolBar height).
  3953         "/ force it to recompute its dimension
  3954         editToolBar container notNil ifTrue:[
  3955             editToolBar containerChangedSize.
  3956         ].
  3957         editToolBarVisible := self editToolBarVisibleHolder value.
  3958         DefaultEditToolBarVisible := editToolBarVisible.
  3959         editToolBarVisible ifTrue:[
  3960             topOffset := topOffset + editToolBar height.
  3961         ]
  3962     ].
  3963 
  3964     noteBook := self componentAt:#Painter.
  3965     noteBook notNil ifTrue:[
  3966         noteBook layout topOffset:topOffset.
  3967         "/ force it to recompute its dimension
  3968         noteBook container notNil ifTrue:[
  3969             noteBook containerChangedSize.
  3970         ].
  3971     ].
  3972 
  3973     "Created: / 18-02-2007 / 14:46:22 / cg"
  3974 !
  3975 
  3976 update:something with:aParameter from:changedObject
  3977     "catches change notifications"
  3978 
  3979     |window lbl|
  3980 
  3981     ((changedObject == self toolBarVisibleHolder)
  3982     or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[
  3983         self toolBarVisibilityChanged.
  3984         ^ self
  3985     ].
  3986     changedObject == self gridShownHolder ifTrue:[
  3987         self class settings at: #GridShown  put: changedObject value.
  3988         painter gridShown:changedObject value.
  3989         ^ self
  3990     ].
  3991     changedObject == self alignToGridHolder ifTrue:[
  3992         self class settings at: #GridAlign  put: changedObject value.
  3993         painter gridAlign:changedObject value.
  3994         ^ self
  3995     ].
  3996 
  3997     changedObject == treeView model ifTrue:[
  3998         (something == #selection
  3999         or:[something == #selectionIndex]) ifTrue:[self treeSelectionChanged].
  4000         ^ self
  4001     ].
  4002 
  4003     changedObject == self galleryShown ifTrue:[
  4004         "/ galleryShown toggle changed
  4005         window := selectionPanel window.
  4006         (changedObject value) ifTrue:[
  4007             self raiseUIView:window
  4008         ] ifFalse:[
  4009             self hideUIView:window
  4010         ].
  4011         ^ self
  4012     ].
  4013 
  4014     changedObject == self painterShown ifTrue:[
  4015         "/ canvasShown toggle changed
  4016         window := self painter topView.
  4017         (changedObject value) ifTrue:[
  4018             self raiseUIView:window
  4019         ] ifFalse:[
  4020             self hideUIView:window
  4021         ].
  4022         ^ self
  4023     ].
  4024 
  4025     changedObject == self autoAcceptOnSelectionChange ifTrue:[
  4026         lbl := changedObject value ifTrue:['Apply'] ifFalse:['OK'].
  4027         (builder componentAt:'acceptButton') label:(resources string:lbl).
  4028         ^ self
  4029     ].
  4030 
  4031     "Modified: / 16.7.1998 / 19:09:57 / cg"
  4032 !
  4033 
  4034 updateChannels
  4035     "updates the channels"
  4036 
  4037     |canCutOrCopy|
  4038 
  4039     treeView isNil ifTrue:[^ self].
  4040 
  4041     self canMoveOrAlignSelection        value:(treeView canMoveOrAlignSelection).
  4042     self canResizeSelection             value:(treeView canResizeSelection).
  4043     self canExchangeSelectionLayouts    value:(treeView canExchangeSelectionLayouts).
  4044     self canChangeOrderInContainer      value:(treeView canChangeOrderInContainer).
  4045     self canMoveSelectionIntoContainer  value:(treeView canMoveSelectionIntoContainer).
  4046     self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer).
  4047     self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas).
  4048     self hasSelectionOtherThanCanvas    value:(treeView hasSelectionOtherThanCanvas).
  4049     self hasMultipleSelectionOtherThanCanvas value:(treeView hasMultipleSelectionOtherThanCanvas).
  4050     
  4051     "/ the top-node cannot be cut, copied or pasted.
  4052     canCutOrCopy := treeView selection notEmptyOrNil and:[treeView selection first ~~ 1].
  4053 
  4054     self canCutHolder value: canCutOrCopy.
  4055     self canCopyHolder value: canCutOrCopy.
  4056 
  4057 "/    self modifiedChannel value: false.
  4058 
  4059     "Modified: / 16.7.1998 / 19:13:30 / cg"
  4060 ! !
  4061 
  4062 !UIPainter methodsFor:'defaults'!
  4063 
  4064 defaultNameOfCanvas
  4065     ^ self class defaultNameOfCanvas
  4066 !
  4067 
  4068 defaultWindowSpecClass
  4069     ^ WindowSpec
  4070 ! !
  4071 
  4072 !UIPainter methodsFor:'event handling'!
  4073 
  4074 doesNotUnderstand:aMessage
  4075     "forward misunderstood messages to the painter"
  4076 
  4077     |painter|
  4078 
  4079     painter := self painter.
  4080 
  4081     (painter respondsTo:(aMessage selector)) ifTrue:[
  4082         ^ aMessage sendTo:painter
  4083     ].
  4084     super doesNotUnderstand:aMessage
  4085 
  4086 !
  4087 
  4088 processEvent:anEvent
  4089     "filter keyboard events.
  4090      Return true, if I have eaten the event"
  4091 
  4092     <resource: #keyboard (#CtrlCursorUp #CtrlCursorDown #CtrlCursorLeft #CtrlCursorRight)>
  4093 
  4094     |key|
  4095 
  4096     anEvent isKeyPressEvent ifTrue:[ 
  4097         anEvent targetView == treeView ifFalse:[^ false].
  4098         treeView hasFocus ifFalse:[^ false].
  4099 
  4100         key := anEvent key.
  4101 
  4102 "/        (anEvent rawKey == #Cmdr) ifTrue:[
  4103 "/            self openNameEditorOnTreeSelection.
  4104 "/            ^ true.
  4105 "/        ].
  4106         (anEvent rawKey == #CtrlCursorUp) ifTrue:[ 
  4107             self doStepUp.
  4108             ^ true.
  4109         ].
  4110         (anEvent rawKey == #CtrlCursorDown) ifTrue:[ 
  4111             self doStepDown.
  4112             ^ true.
  4113         ].
  4114         (anEvent rawKey == #CtrlCursorLeft) ifTrue:[ 
  4115             self doStepOut.
  4116             ^ true.
  4117         ].
  4118         (anEvent rawKey == #CtrlCursorRight) ifTrue:[ 
  4119             self doStepIn.
  4120             ^ true.
  4121         ].
  4122     ].
  4123 
  4124     ^ false.
  4125 ! !
  4126 
  4127 !UIPainter methodsFor:'help'!
  4128 
  4129 defaultInfoLabel
  4130     "returns the default info label"
  4131 
  4132     specClassName isNil ifTrue: [^'No class defined.'].
  4133     specSelector isNil ifTrue: [^'No selector defined.'].
  4134     ^ specClassName printString, ' >> ', specSelector
  4135 
  4136     "Modified: / 31-08-2006 / 10:12:03 / cg"
  4137 ! !
  4138 
  4139 !UIPainter methodsFor:'help specs'!
  4140 
  4141 basicHelpTextFromSpecification:specification forKey:aKey
  4142     "redefinable, to allow for subclasses to overwrite the helpTexts of the ui-spec"
  4143 
  4144     ^ specification helpSpec at:aKey ifAbsent:nil
  4145 !
  4146 
  4147 flyByHelpSpec
  4148     |spec painter|
  4149 
  4150     painter := self painter.
  4151 
  4152     spec := self class flyByHelpSpec.
  4153     spec at:#editUndo put:(resources string:'Undo (%1)' 
  4154                         with:(resources string:painter undoHistory labelOfLastUndo)).
  4155 
  4156     spec at:#changePositionDown put:(resources string:
  4157                 (spec at:#changePositionDown) with:painter nPixelsForMoveSelection).
  4158 
  4159     spec at:#changePositionLeft put:(resources string:
  4160                 (spec at:#changePositionLeft) with:painter nPixelsForMoveSelection). 
  4161 
  4162     spec at:#changePositionRight put:(resources string:
  4163                 (spec at:#changePositionRight) with:painter nPixelsForMoveSelection). 
  4164 
  4165     spec at:#changePositionUp put:(resources string:
  4166                 (spec at:#changePositionUp) with:painter nPixelsForMoveSelection). 
  4167 
  4168     ^ spec
  4169 !
  4170 
  4171 helpSpec
  4172     |spec|
  4173 
  4174     spec := self class helpSpec.
  4175     spec at:#editUndo put:(resources string:'Undo (%1)' 
  4176                         with:(resources string:self painter undoHistory labelOfLastUndo)).
  4177     ^ spec
  4178 ! !
  4179 
  4180 !UIPainter methodsFor:'initialization'!
  4181 
  4182 hideToolBarButtonCreated:aButton
  4183     aButton passiveLevel:(MenuPanel defaultLevel). 
  4184 "/    aButton passiveLevel:1.
  4185     aButton activeLevel:-1.
  4186     aButton backgroundColor:(MenuPanel defaultBackgroundColor).
  4187 !
  4188 
  4189 initialize
  4190     |name scroller viewScroller|
  4191 
  4192     super initialize.
  4193 
  4194     modified := false.
  4195 
  4196     aspects := IdentityDictionary new.
  4197     aspects at:#classNameChannel put:'NewApplication' asValue.
  4198     aspects at:#superclassNameChannel put:'ApplicationModel' asValue.
  4199     aspects at:#methodNameChannel put:'windowSpec' asValue.
  4200 
  4201     treeView := TreeView new.
  4202     treeView painter:self.
  4203     treeView windowSpecClass:(self defaultWindowSpecClass).
  4204     treeView selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ].
  4205 
  4206     painterView := StandardSystemView new.
  4207     name := name ? self defaultNameOfCanvas.
  4208     painterView beToolWindow.
  4209     painterView name:name.
  4210     painterView label:name.
  4211     painterView extent:(treeView windowSpecClass defaultExtentInUIPainter).
  4212 
  4213     UseViewScroller == true ifTrue:[
  4214         scroller := HVScrollableView for:ViewScroller in:painterView.
  4215         scroller
  4216             horizontalScrollable:true miniScroller:true;
  4217             verticalScrollable:true; verticalMini:true;
  4218             autoHideScrollBars:false;
  4219             layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout.
  4220         viewScroller := scroller scrolledView.
  4221         painter := UIPainterView new.
  4222         painter extent:300@300.
  4223         viewScroller scrolledView:painter.
  4224     ] ifFalse:[
  4225         painter := UIPainterView in:painterView.
  4226         painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout.
  4227     ].
  4228 
  4229     treeView := treeView canvas:painter specName:name.
  4230     painter treeView:treeView.
  4231     treeView model addDependent:self.
  4232     painter enableChannel:(self enableChannel).
  4233 
  4234     selectionPanel := self selectionPanelClass new.
  4235     selectionPanel allButOpenInterface:#windowSpec.
  4236 ! !
  4237 
  4238 !UIPainter methodsFor:'menus-dynamic'!
  4239 
  4240 menuEdit
  4241     ^ [
  4242         |m i|
  4243 
  4244         m := self class menuEdit.
  4245         m := m decodeAsLiteralArray.
  4246         i := m detectItem:[:item | item nameKey == #undo] ifNone:nil.
  4247         i notNil ifTrue:[
  4248             i label:(resources string:(i label , ' (%1)') 
  4249                         with:(resources string:self painter undoHistory labelOfLastUndo)).
  4250         ].
  4251         "/ m receiver:self.   -- now done in findGuiResources ...
  4252         m findGuiResourcesIn:self.
  4253         m
  4254       ].
  4255 !
  4256 
  4257 menuReplaceWidget
  4258     ^ [
  4259         |m i specAndView spec usefulReplacementSpecClasses|
  4260 
  4261         m := self class menuReplaceWidget.
  4262         m := m decodeAsLiteralArray.
  4263 
  4264         specAndView := self selectedSpecAndView.
  4265         spec := specAndView first.
  4266         spec notNil ifTrue:[
  4267             usefulReplacementSpecClasses := spec usefulReplacementSpecClasses.
  4268             usefulReplacementSpecClasses notEmptyOrNil ifTrue:[
  4269                 m addSeparator.
  4270                 usefulReplacementSpecClasses do:[:eachClass |      
  4271                     |item|
  4272 
  4273                     item := MenuItem  
  4274                                 label:(resources string:'Replace by %1' with:eachClass userFriendlyName)
  4275                                 itemValue:#replaceWidgetByClass: argument:eachClass.
  4276                     item translateLabel:false.
  4277                     m addItem:item.
  4278                 ].
  4279             ].
  4280         ].
  4281 
  4282         m findGuiResourcesIn:self.
  4283         m
  4284       ].
  4285 
  4286     "Modified: / 09-09-2012 / 13:25:09 / cg"
  4287 ! !
  4288 
  4289 !UIPainter methodsFor:'private'!
  4290 
  4291 acceptOrIgnoreSectionModification
  4292     self isModified ifTrue:[
  4293         (self confirm:'Accept changes made to spec ?') ifTrue:[
  4294             self accept
  4295         ]
  4296     ].
  4297 
  4298     "Created: / 12-01-2008 / 10:31:20 / cg"
  4299 !
  4300 
  4301 askForModification
  4302     "asks for window spec modification"
  4303 
  4304     |painter|
  4305 
  4306     painter := self painter.
  4307 
  4308     self askForSectionModification.    
  4309 
  4310     (modified or: [painter isModified or: [self helpTool modified]])
  4311     ifTrue:[
  4312         ((YesNoBox title:(resources string:'Window spec was modified. Exit anyway?'))        
  4313             noText:(resources string:'Cancel');
  4314             yesText:(resources string:'Discard Changes and Exit');
  4315             showAtPointer;
  4316             accepted) ifFalse: [^false].
  4317         self clearModified.
  4318         painter resetModification
  4319     ].
  4320     ^ true
  4321 
  4322     "Modified: / 20.5.1998 / 02:03:16 / cg"
  4323 !
  4324 
  4325 askForSaving
  4326     "asks for defining an application class"
  4327 
  4328     self askForSectionModification.    
  4329 
  4330     ((YesNoBox title:'No application class defined yet!!')        
  4331         noText:'Cancel';
  4332         yesText:'Define';
  4333         showAtPointer;
  4334         accepted) ifFalse: [^false].
  4335 
  4336     self doSave.
  4337 
  4338     ^true
  4339 !
  4340 
  4341 askForSectionModification
  4342     "asks for section modification in the notebook"
  4343 
  4344     self isModified ifTrue:[
  4345         (self confirm:'Accept modifications in section ' , tabSelection printString allBold, '?') ifTrue:[
  4346             self accept
  4347         ] ifFalse: [
  4348             self cancel
  4349         ]
  4350     ]
  4351 !
  4352 
  4353 checkClassAndSelector
  4354     "checks for class & superclass"
  4355 
  4356     |superclass cls|
  4357 
  4358     specClassName isNil ifTrue:[^ false].
  4359 
  4360     cls := self resolveName:specClassName.
  4361 
  4362     cls isNil ifTrue:[
  4363         superclass := self resolveName:specSuperclassName.
  4364 
  4365         superclass isNil ifTrue:[
  4366             self warn:'No class named ' , specSuperclassName , ' exists!!'.
  4367             ^ false.
  4368         ].
  4369 
  4370         (self confirm:'Create class ' , specClassName allBold, '?') ifTrue:[
  4371             cls := superclass 
  4372                         subclass:(specClassName asSymbol)
  4373                         instanceVariableNames:''
  4374                         classVariableNames:''
  4375                         poolDictionaries:''
  4376                         category:'Applications'.
  4377 
  4378             cls name ~= specClassName ifTrue:[
  4379                 self information:'Created new class is ' , cls name.
  4380                 specClassName := cls name
  4381             ].
  4382             ^ true.
  4383         ].
  4384         ^ false.
  4385     ].
  4386     cls isBehavior ifFalse:[
  4387         self warn:'A global named ' , specClassName , ' exists, but it is no class.'.
  4388         ^ false.
  4389     ].
  4390 
  4391     specSuperclassName isBehavior ifFalse:[
  4392         specSuperclassName notEmptyOrNil ifTrue:[
  4393             superclass := self resolveName:specSuperclassName
  4394         ] ifFalse:[
  4395             specSuperclassName := nil.
  4396         ]
  4397     ] ifTrue:[
  4398         superclass := specSuperclassName
  4399     ].
  4400 
  4401     specSuperclassName notNil ifTrue:[
  4402         superclass isNil ifTrue:[
  4403             self warn:'No class named ' , specSuperclassName , ' exists!!'.
  4404             ^ false.
  4405         ].
  4406 
  4407         (cls isSubclassOf:superclass) ifFalse:[
  4408             self information:('A global named ' , specClassName , ' exists,\' ,
  4409                               'but is not a subclass of ' , superclass name , '.\\' ,
  4410                               'Check and try again if that is not what you want.') withCRs.
  4411         ]
  4412     ].
  4413 
  4414     superclass isNil ifTrue:[
  4415         cls notNil ifTrue:[
  4416             specSuperclassName := cls superclass name
  4417         ]
  4418     ].
  4419 
  4420     ^ true
  4421 
  4422     "Modified: 12.8.1997 / 23:39:10 / cg"
  4423 !
  4424 
  4425 createToolApplication:anApplicationClass spec:aSpec in:aView
  4426     |appl applBuilder applWindow|
  4427 
  4428     appl := anApplicationClass new.
  4429     appl createBuilder.
  4430     applBuilder := appl builder.
  4431 
  4432     applWindow  := ApplicationSubView origin:0.0@0.0 corner:1.0@1.0 in:aView.
  4433     applWindow level:0.
  4434     applWindow hiddenOnRealize:true.
  4435 
  4436     appl masterApplication:self.
  4437     applBuilder window:applWindow.
  4438     applWindow client:appl spec:aSpec builder:applBuilder.
  4439     appl modifiedHolder:(self modifiedChannel).
  4440     applBuilder window:applWindow.
  4441 
  4442     ^ appl
  4443 !
  4444 
  4445 hideUIView:aView
  4446     "hides the view which is an application or top view"
  4447 
  4448     aView beIndependent.
  4449     aView unmap.
  4450 !
  4451 
  4452 raiseTabView
  4453     |tool|
  4454 
  4455              self isLayoutToolSelected ifTrue:[tool := layoutTool ]
  4456     ifFalse:[self isHelpToolSelected   ifTrue:[tool := helpTool   ]
  4457     ifFalse:[
  4458         tool := specTool.
  4459         tool notNil ifTrue:[
  4460             ApplicationClassQuery answer:specClass do:[
  4461                     "/ the spectool needs to know, in which nameSpace the application class is located, to find out
  4462                     "/ how to resolve short majorKeys...
  4463                     UISpecification uiMajorKeyBindingNameSpaceQuery 
  4464                         answer:(specClass notNil ifTrue:[specClass nameSpace] ifFalse:Smalltalk)
  4465                         do:[
  4466                             specTool selection:tabSelection 
  4467                         ].
  4468                 ].
  4469         ].
  4470     ]].
  4471 
  4472     (Array with:helpTool with:layoutTool with:specTool) do:[:aTool|
  4473         aTool ~~ tool ifTrue:[
  4474             aTool window beInvisible.
  4475         ].
  4476     ].
  4477     tool notNil ifTrue:[
  4478         tool window beVisible.
  4479     ].
  4480 !
  4481 
  4482 raiseUIView:aView
  4483     "raise the view which is an application or top view"
  4484 
  4485     aView remap.
  4486     aView bePartner.
  4487 !
  4488 
  4489 setClass:cls selector:selector
  4490     "sets the specClass and the specSelector under which the window spec should be saved"
  4491 
  4492     |clsName superClassName|
  4493 
  4494     clsName := cls name.
  4495     superClassName := cls superclass name.
  4496 
  4497     (self aspectFor:#classNameChannel) value:clsName.
  4498     (self aspectFor:#methodNameChannel) value:(selector ? '').
  4499     (self aspectFor:#superclassNameChannel) value:superClassName.
  4500 
  4501     self painter 
  4502             className:clsName 
  4503             superclassName:superClassName
  4504             selector:(selector ? '').
  4505 
  4506     self specClass:clsName.
  4507     specSelector := (selector ? '').
  4508     specSuperclassName := superClassName.
  4509 
  4510     (specClassName notNil and:[ selector notNil ]) ifTrue:[
  4511         self addHistoryEntryForClass:specClass selector:specSelector.
  4512         self updateInfoLabel
  4513     ].
  4514 
  4515     "Modified: / 05-02-1998 / 09:44:58 / stefan"
  4516     "Modified: / 31-08-2006 / 10:14:49 / cg"
  4517 !
  4518 
  4519 setViewInLayoutTool:aView spec:aSpec
  4520     "sets view for layout tool"
  4521 
  4522     |type|
  4523 
  4524     self painter topView == aView ifTrue:[
  4525         type := #Extent
  4526     ] ifFalse:[
  4527         self canvas == aView ifTrue:[
  4528             type := #Extent
  4529         ]
  4530     ].
  4531     self layoutTool layoutView:aView type:type spec:aSpec
  4532 !
  4533 
  4534 specClass
  4535     specClass isNil ifTrue:[
  4536         specClassName notNil ifTrue:[
  4537             specClass := Smalltalk classNamed:specClassName.
  4538             self canInstallAsWebPageHolder value:self canInstallAsWebPage.
  4539         ]
  4540     ].
  4541     ^ specClass
  4542 
  4543     "Created: / 31-08-2006 / 10:08:43 / cg"
  4544     "Modified: / 14-01-2008 / 17:39:32 / cg"
  4545 !
  4546 
  4547 specClass:aClassOrClassName
  4548     "sets the specClass and updates the Help Tool"
  4549 
  4550     aClassOrClassName isBehavior 
  4551         ifTrue: [ specClass := aClassOrClassName.
  4552                   specClassName := aClassOrClassName name ]
  4553         ifFalse:[ specClass := Smalltalk classNamed:aClassOrClassName.
  4554                   specClassName := aClassOrClassName ].
  4555 
  4556     self canInstallAsWebPageHolder value:self canInstallAsWebPage.
  4557     self helpTool loadFromClass:specClass.    
  4558     self clearModifiedFlag.
  4559 
  4560     "Modified: / 14-01-2008 / 17:39:08 / cg"
  4561 ! !
  4562 
  4563 !UIPainter methodsFor:'private-tools'!
  4564 
  4565 canvas
  4566     "returns the canvas view"
  4567 
  4568     UseViewScroller == true ifTrue:[
  4569         ^ painter.
  4570     ].
  4571 
  4572     ^ painter topView.
  4573 "/    ^ treeView canvas
  4574 
  4575     "Modified: / 05-09-2006 / 18:36:32 / cg"
  4576 !
  4577 
  4578 helpTool
  4579     "returns the help tool"
  4580 
  4581     helpTool isNil ifTrue:[self noteBookView].
  4582   ^ helpTool
  4583 !
  4584 
  4585 layoutTool
  4586     "returns the layout tool"
  4587 
  4588     layoutTool isNil ifTrue:[self noteBookView].
  4589   ^ layoutTool
  4590 !
  4591 
  4592 painter
  4593     "returns the canvas view"
  4594 
  4595     ^ painter.
  4596 "/    ^ treeView canvas
  4597 
  4598     "Modified: / 05-09-2006 / 18:36:32 / cg"
  4599 !
  4600 
  4601 specTool
  4602     "returns the spec tool"
  4603 
  4604     specTool isNil ifTrue:[self noteBookView].
  4605   ^ specTool
  4606 ! !
  4607 
  4608 !UIPainter methodsFor:'queries'!
  4609 
  4610 canPaste
  4611     |clipboard sel|
  4612 
  4613     clipboard := painterView getClipboardObject.
  4614 
  4615     (clipboard isCollection 
  4616     and:[ clipboard notEmptyOrNil ]) 
  4617             ifTrue:[sel := clipboard first]
  4618             ifFalse:[sel := clipboard].
  4619 
  4620     ^ (sel isKindOf:UISpecification) 
  4621 "/                    and:[treeSelection size  = 1 
  4622 "/                    and:[treeSelection first == 1 
  4623 "/                         or: [self canPasteInto: treeView selectedNode contents view]]]
  4624 !
  4625 
  4626 hasSpecClass
  4627     "answers whether an application class is defined"
  4628 
  4629     ^ (self resolveName:specClassName) notNil
  4630 !
  4631 
  4632 hasSpecClassAndSelector
  4633     "answers whether an application class and a selector under which
  4634      the window spec is stored is defined"
  4635 
  4636     specSelector size > 1 ifTrue:[
  4637         ^ self hasSpecClass
  4638     ].
  4639     ^ false
  4640 !
  4641 
  4642 isEditingSpecOnly
  4643     ^ self isNotEditingSpecOnly not
  4644 !
  4645 
  4646 isHelpToolSelected
  4647     "answers whether the current selected section in the noteBook is the Help Tool"
  4648 
  4649     ^ tabSelection = UIHelpTool label
  4650 !
  4651 
  4652 isLayoutToolSelected
  4653     "answers whether the current selected section in the noteBook is the Layout Tool"
  4654 
  4655     ^ tabSelection = UILayoutTool label
  4656 !
  4657 
  4658 isModified
  4659     "answers whether the current window spec or a layout is modified"
  4660 
  4661     ^ self modifiedChannel value
  4662 !
  4663 
  4664 isNotEditingSpecOnly
  4665     ^ true
  4666 !
  4667 
  4668 isPainterEnabled
  4669     "answers whether I am running in test mode"
  4670 
  4671     ^ self painter enabled
  4672 !
  4673 
  4674 isUIPainter
  4675     ^ true
  4676 !
  4677 
  4678 listOfAspects
  4679     ^ self painter listOfAspects
  4680 
  4681     "Created: / 12-01-2008 / 19:24:51 / cg"
  4682 !
  4683 
  4684 listOfCallbacks
  4685     ^ self painter listOfCallbacks
  4686 
  4687     "Created: / 12-01-2008 / 19:25:09 / cg"
  4688 ! !
  4689 
  4690 !UIPainter methodsFor:'selection'!
  4691 
  4692 askForUnsavedModifications
  4693     |whatToDo|
  4694 
  4695     self isModified ifFalse:[^ true].
  4696 
  4697     whatToDo := DialogBox 
  4698                     confirmWithCancel:'Accept modifications in section ' , tabSelection printString allBold, ' ?'
  4699                     labels:#('Cancel' 'Ignore' 'Accept')
  4700                     default:3.
  4701     whatToDo isNil ifTrue:[^ false].
  4702     whatToDo == true ifTrue:[
  4703         self accept
  4704     ] ifFalse:[
  4705         self cancel
  4706     ].
  4707 
  4708     ^ true
  4709 !
  4710 
  4711 copySelection
  4712     self painter copySelection.
  4713     self updateChannels.
  4714 !
  4715 
  4716 selectedSpec
  4717     |specAndView|
  4718 
  4719     specAndView := self selectedSpecAndView.
  4720     ^ specAndView first
  4721 !
  4722 
  4723 selectedSpecAndView
  4724     |spec view property|
  4725 
  4726     treeView isCanvasSelected ifTrue:[
  4727         spec := treeView canvasSpec.
  4728         view := self canvas. "/ self painter topView.
  4729     ] ifFalse:[
  4730         (property := treeView propertySelected) notNil ifTrue:[
  4731             treeView canResizeSelectedWidget ifTrue:[
  4732                 view := property view.
  4733             ].
  4734             spec := property spec copy.
  4735         ]
  4736     ].
  4737     ^ Array with:spec with:view
  4738 !
  4739 
  4740 tabSelection
  4741     "returns the label of the current section in the notebook"
  4742 
  4743     ^ tabSelection
  4744 !
  4745 
  4746 tabSelection:something
  4747     "called whenever the section of the notebook has changed"
  4748 
  4749     (something isNil or:[tabSelection = something]) ifTrue:[
  4750         ^ self
  4751     ].
  4752 
  4753     self isModified ifTrue:[
  4754         self autoAcceptOnSelectionChange value ifTrue:[
  4755             self accept
  4756         ] ifFalse:[
  4757             self askForUnsavedModifications ifFalse:[^ self].
  4758         ].
  4759     ].
  4760     tabSelection := something.
  4761     self raiseTabView.
  4762     self cancel.
  4763 !
  4764 
  4765 treeSelectionChanged
  4766     "called whenever the selection of the treeview has changed"
  4767 
  4768     |specAndView view spec|
  4769 
  4770     self askForUnsavedModifications ifFalse:[^ self].
  4771 "/    self isModified ifTrue:[
  4772 "/        (self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[
  4773 "/            self accept
  4774 "/        ]
  4775 "/    ].
  4776 
  4777     specAndView := self selectedSpecAndView.
  4778     spec := specAndView first.
  4779     view := specAndView last.
  4780 
  4781     self setViewInLayoutTool:view spec:spec.
  4782     self specTool specification:spec.
  4783 
  4784     self updateSlicesForSpec:spec andView:view.
  4785     self clearModifiedFlag.
  4786     self updateChannels.
  4787 !
  4788 
  4789 updateSlicesForSpec:spec andView:view
  4790     "fetch slices-info from the spec; add help and geometry slices manually"
  4791 
  4792     |slices "size" list tabComponent|
  4793 
  4794     tabComponent := self componentAt:#noteBook.
  4795 
  4796     spec notNil ifTrue:[
  4797         self helpTool helpKey:(spec activeHelpKey).
  4798         slices := spec class slices.
  4799 
  4800         list := slices collect:[:eachSlice | eachSlice first asString].
  4801         self treeView isCanvasSelected ifFalse:[
  4802             list := list copyWith:(UIHelpTool label)
  4803         ].
  4804         view notNil ifTrue:[
  4805             "/ for now, keep it as an empty slice;
  4806             "/ better when toggling as we do not loos the 'geometry' selection.
  4807             "/ slices notebook should remember the last 'explicit' selected tab.
  4808             true "spec hasLayout" ifTrue:[
  4809                 list := list copyWith:UILayoutTool label.
  4810             ]
  4811         ].
  4812 
  4813 "/        size   := slices size.
  4814 "/        view notNil ifTrue:[
  4815 "/            self treeView isCanvasSelected ifFalse:[
  4816 "/                list := Array new:(size + 2).
  4817 "/                list at:(size + 2) put:(UILayoutTool label).
  4818 "/            ] ifTrue:[
  4819 "/                list := Array new:(size + 1).
  4820 "/                list at:(size + 1) put:(UILayoutTool label).
  4821 "/            ].
  4822 "/        ] ifFalse:[
  4823 "/            list := Array new:(size + 1).
  4824 "/        ].
  4825 "/
  4826 "/        1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
  4827 "/        self treeView isCanvasSelected ifFalse: [
  4828 "/            list at:(size + 1) put:(UIHelpTool label)
  4829 "/        ].
  4830 
  4831         self tabList value:list.
  4832         self showHelp:spec class name for:self.
  4833         tabComponent enabled:true.
  4834 
  4835         (tabSelection := tabComponent selection) isNil ifTrue:[
  4836             tabComponent setSelection:(tabSelection := list first)
  4837         ].
  4838         self raiseTabView
  4839     ] ifFalse:[
  4840         self helpTool helpKey:nil.
  4841         tabComponent enabled:false.
  4842         self defaultInfoLabel.
  4843     ].
  4844 ! !
  4845 
  4846 !UIPainter methodsFor:'settings'!
  4847 
  4848 generateAspectsAsInstanceVariables
  4849     "if on, aspects are held as instance variables;
  4850      if off (the default), they are kept in the bindings dictionary."
  4851 
  4852     ^ UIPainterView generateAspectsAsInstanceVariables
  4853 
  4854     "Created: / 29-07-1998 / 11:17:59 / cg"
  4855     "Modified: / 12-01-2008 / 10:37:43 / cg"
  4856 !
  4857 
  4858 generateAspectsAsInstanceVariables:aBoolean
  4859     "if on, aspects are held as instance variables;
  4860      if off (the default), they are kept in the bindings dictionary."
  4861 
  4862     ^ UIPainterView generateAspectsAsInstanceVariables:aBoolean
  4863 
  4864     "Created: / 29.7.1998 / 11:18:20 / cg"
  4865 !
  4866 
  4867 generateCommentedCode
  4868     "comments in generated aspect methods; yes or no."
  4869 
  4870     ^ UIPainterView generateCommentedCode
  4871 
  4872     "Created: / 12-01-2008 / 10:34:14 / cg"
  4873 !
  4874 
  4875 generateCommentedCode:aBoolean
  4876     "comments in generated aspect methods; yes or no."
  4877 
  4878     UIPainterView generateCommentedCode:aBoolean
  4879 
  4880     "Created: / 12-01-2008 / 10:23:10 / cg"
  4881 !
  4882 
  4883 redefineAspectMethods
  4884     "redefine methods yes or no.
  4885      If a method is defined in super class should the message be reinstalled ?"
  4886 
  4887     ^ UIPainterView redefineAspectMethods
  4888 
  4889     "Modified: / 12-01-2008 / 10:34:07 / cg"
  4890 !
  4891 
  4892 redefineAspectMethods:aBoolean
  4893     "redefine methods yes or no.
  4894      If a method is defined in super class should the message be reinstalled ?"
  4895 
  4896     UIPainterView redefineAspectMethods:aBoolean
  4897 
  4898     "Modified: / 12-01-2008 / 10:23:20 / cg"
  4899 ! !
  4900 
  4901 !UIPainter methodsFor:'startup & release'!
  4902 
  4903 closeRequest
  4904     "asks for permission before closing"
  4905 
  4906     self askForModification ifFalse:[^self].
  4907 
  4908     super closeRequest.
  4909 
  4910     painterView notNil ifTrue:[
  4911         painterView masterApplication:nil.
  4912         painterView closeRequest.
  4913     ].
  4914     treeView notNil ifTrue:[
  4915         treeView model removeDependent:self.
  4916     ].
  4917     selectionPanel notNil ifTrue:[
  4918         selectionPanel masterApplication:nil.
  4919         selectionPanel closeRequest
  4920     ].
  4921     "/ selectionPanel := nil.
  4922     "/ treeView       := nil.
  4923 !
  4924 
  4925 closeRequestFor:aTopView
  4926     "handles a close request for a specific view"
  4927 
  4928     |topView|
  4929 
  4930     (topView := self window) == aTopView ifTrue:[
  4931         super closeRequestFor:aTopView
  4932     ] ifFalse:[
  4933         aTopView = selectionPanel window ifTrue:[
  4934             self galleryShown value:false
  4935         ] ifFalse:[
  4936             aTopView == (self painter topView) ifTrue:[
  4937                 self painterShown value:false
  4938             ] ifFalse:[
  4939                 aTopView closeRequest
  4940             ]
  4941         ].
  4942         topView raise.
  4943     ].
  4944 !
  4945 
  4946 commonPostBuild
  4947     "sets the root of the tree view as first selection;
  4948      sets the grid parameters, if defined"
  4949 
  4950     |cls sel|
  4951 
  4952     cls := self specClass.
  4953     sel := specSelector.
  4954     cls notNil ifTrue:[
  4955         self setClass:cls selector:sel.
  4956 
  4957         (cls respondsTo:sel) ifTrue:[  
  4958             self painter setupFromSpec:(cls perform:sel).
  4959         ]
  4960     ].
  4961 
  4962     self autoAcceptOnSelectionChange addDependent:self.
  4963     self autoAcceptOnSelectionChange value ifTrue:[
  4964         (builder componentAt:'acceptButton') label:(resources string:'Apply')
  4965     ].
  4966 
  4967     "/ using masters infoHolder ?
  4968     (builder aspectAt:#useAlienInfoLabelHolder) == true ifTrue:[
  4969         (builder componentAt:#mainPanel) layout bottomOffset:0.
  4970         (builder componentAt:#infoBarSubSpec) beInvisible
  4971     ].
  4972 
  4973     self updateInfoLabel.
  4974 
  4975     "Modified: / 31-08-2006 / 10:12:53 / cg"
  4976 !
  4977 
  4978 loadFromClass:aClass andSelector:selector
  4979     "loads a window spec by evaluating aMessageString
  4980      (which is something like 'fooClass windowSpec')"
  4981 
  4982     self assert:(aClass isNil or:[aClass isClass]).
  4983 
  4984     self askForModification ifFalse:[^ self].
  4985 
  4986     self setClass:aClass selector:selector.    
  4987 
  4988     (aClass respondsTo:selector) ifTrue:[   
  4989         self loadFromSpec:(aClass perform:selector).
  4990     ]
  4991 !
  4992 
  4993 loadFromMessage:classAndSelector
  4994     "loads a window spec by evaluating aMessageString
  4995      (which is something like 'fooClass windowSpec')"
  4996 
  4997     self askForModification ifFalse:[^ self].
  4998 
  4999     classAndSelector notNil ifTrue:[
  5000         self 
  5001             loadFromClass:classAndSelector methodClass 
  5002             andSelector:classAndSelector methodSelector
  5003     ]
  5004 !
  5005 
  5006 loadFromSpec:aSpec
  5007     "loads a window spec proper"
  5008 
  5009     self askForModification ifFalse:[^ self].
  5010 
  5011     self painter setupFromSpec:aSpec.
  5012 !
  5013 
  5014 openInterface:aSymbol 
  5015     "in addition to opening my interface, also open up a gallery and a painter"
  5016     
  5017     |topView|
  5018 
  5019     self setupSpecClassAndSelector.
  5020 
  5021 "/    treeView := TreeView new.
  5022 "/    treeView windowSpecClass:(self defaultWindowSpecClass).
  5023 "/    treeView 
  5024 "/        selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ].
  5025 
  5026 "/    painterView := StandardSystemView new.
  5027 "/    name := name ? UIPainter defaultNameOfCanvas.
  5028 "/    painterView beToolWindow.
  5029 "/    painterView name:name.
  5030 "/    painterView label:name.
  5031 "/    painterView extent:(treeView windowSpecClass defaultExtentInUIPainter).
  5032 "/    painter := UIPainterView in:painterView.
  5033 "/    painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout.
  5034 "/    treeView := treeView canvas:painter specName:name.
  5035 "/    painter treeView:treeView.
  5036 "/    treeView model addDependent:self.
  5037 "/    painter enableChannel:(self enableChannel).
  5038 
  5039     super openInterface:aSymbol.
  5040 
  5041     topView := self window.
  5042     topView label:'GUI Painter'.
  5043 
  5044 "/    self setupCanvasAndSelectionPanel.
  5045 "/
  5046 "/    selectionPanel window waitUntilVisible.
  5047 "/    painterView window waitUntilVisible.
  5048 "/    self window waitUntilVisible.
  5049 "/    [ Delay waitForSeconds:0.5. self window topView raise ] fork.
  5050 
  5051     "Modified: / 31-08-2006 / 10:13:16 / cg"
  5052 !
  5053 
  5054 openOnClass:aClass
  5055     "opens the GUI Painter on aClass and #windowSpec"
  5056 
  5057     self openOnClass:aClass andSelector:#windowSpec
  5058 !
  5059 
  5060 openOnClass:aClass andSelector:aSelector
  5061     "opens the GUI Painter on aClass and aSelector"
  5062 
  5063     aClass isNil ifTrue:[
  5064         (self confirm:'No class given to the GUI Painter (class was probably renamed?)\\Open anyway (to create a new window spec) ?' withCRs)
  5065         ifFalse:[^ nil].
  5066     ].
  5067 
  5068     specSelector := aSelector.
  5069     specClass := aClass.
  5070     specClassName := aClass name.
  5071 
  5072     self openInterface.
  5073 
  5074 "/    specSelector := aSelector.
  5075 "/    specClass := aClass.
  5076 
  5077     "Modified: / 31-08-2006 / 10:13:31 / cg"
  5078 !
  5079 
  5080 postBuildWith: aBuilder
  5081     super postBuildWith:aBuilder.
  5082 
  5083     (self toolBarVisibleHolder value 
  5084     or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ].
  5085 
  5086     "Created: / 18-02-2007 / 15:03:08 / cg"
  5087 
  5088     self setupPainter.
  5089 
  5090     "Modified: / 22.8.1998 / 17:41:34 / cg"
  5091 !
  5092 
  5093 postOpenWith: aBuilder
  5094     "spread the painter and gallery views on the screen"
  5095 
  5096     |myWindow canvasWindow canvasOrg galleryWindow 
  5097      galleryOrg windowGroup monitorBounds myViewRectangle|
  5098 
  5099     super postOpenWith:aBuilder.
  5100 
  5101     windowGroup := self topApplication windowGroup.
  5102     windowGroup addPreEventHook:self.
  5103 
  5104     treeView selection: #(1).
  5105     aBuilder keyboardProcessor menuBar:nil.
  5106 
  5107     myWindow := self window.
  5108     canvasWindow := self painter topView.
  5109     [selectionPanel isNil] whileTrue:[
  5110         Delay waitForSeconds:0.1.
  5111     ].
  5112 
  5113     galleryWindow := selectionPanel window.
  5114 
  5115     "/ try to lay out things non-overlapping
  5116     "/ but only, if the window manager placed all windows
  5117     "/ on top of each other
  5118     "/ make sure, that all the windows are on the same physical monitor
  5119     monitorBounds := device monitorBoundsAt:self window origin.
  5120     myViewRectangle := myWindow screenBounds.
  5121     (myViewRectangle intersects:galleryWindow screenBounds) ifTrue:[
  5122         galleryOrg := (monitorBounds right - galleryWindow width - 20) 
  5123                       @ 
  5124                       ((myWindow bottom + 20) min:(monitorBounds bottom - galleryWindow height - 20)).
  5125         galleryWindow 
  5126             origin:galleryOrg;
  5127             raise.
  5128     ].
  5129     ((myViewRectangle intersects:canvasWindow screenBounds)
  5130      or:[galleryWindow screenBounds intersects:canvasWindow screenBounds])ifTrue:[          
  5131         canvasOrg := monitorBounds origin + (10@20).
  5132         canvasWindow 
  5133             origin:canvasOrg;
  5134             raise.
  5135     ].
  5136 
  5137     self setupCanvasAndSelectionPanel.
  5138 
  5139 "/    selectionPanel window waitUntilVisible.
  5140 "/    painterView window waitUntilVisible.
  5141 "/    self window waitUntilVisible.
  5142     [   
  5143         Delay waitForSeconds:0.1. 
  5144         myWindow topView raise.
  5145         Delay waitForSeconds:0.25. 
  5146         myWindow topView raise 
  5147     ] fork.
  5148     "Modified: / 13.7.1999 / 21:26:52 / cg"
  5149 !
  5150 
  5151 release
  5152     super release.
  5153 
  5154     painterView notNil ifTrue:[
  5155         painterView destroy.
  5156     ].
  5157     selectionPanel notNil ifTrue:[
  5158         selectionPanel masterApplication:nil.
  5159         selectionPanel window destroy
  5160     ].
  5161     selectionPanel := nil.
  5162     treeView       := nil.
  5163     painterView    := nil.
  5164 !
  5165 
  5166 selectionPanelClass
  5167     ^ SelectionPanelClass
  5168 !
  5169 
  5170 setupCanvasAndSelectionPanel
  5171     |topView galleryWindow icon|
  5172 
  5173     painterView isOpen ifTrue:[
  5174         ^ self.
  5175     ].
  5176 
  5177     icon := self class builderIcon.
  5178 
  5179     topView := self window.
  5180 
  5181     painterView openInGroup:(topView windowGroup).
  5182     painterView application:self.
  5183 
  5184     galleryWindow := selectionPanel window.
  5185     galleryWindow beToolWindow.
  5186     galleryWindow openInGroup:(topView windowGroup).
  5187 
  5188     selectionPanel masterApplication:self.
  5189 
  5190     topView iconLabel:'GUI Painter'.
  5191     topView icon:icon.
  5192     painterView iconLabel:'GUI Canvas'.
  5193     painterView icon:icon.
  5194     galleryWindow iconLabel:'GUI Gallery'.
  5195     galleryWindow icon:icon.
  5196     
  5197     topView isModal ifFalse:[
  5198         topView bePartner.
  5199         painterView bePartner.
  5200         galleryWindow bePartner.
  5201     ]
  5202 !
  5203 
  5204 setupPainter
  5205     "sets the painter's grid parameters, if defined"
  5206 
  5207     |painter settings gridPara hspace vspace|
  5208 
  5209     painter  := self painter.
  5210     settings := self class settings.
  5211     gridPara := painter gridParameters copy.
  5212     hspace   := settings at: #HGridSpace ifAbsent:10.
  5213     vspace   := settings at: #VGridSpace ifAbsent:10.
  5214     gridPara at:1 put:hspace; at:2 put:vspace; at:5 put:hspace; at:6 put:vspace.
  5215     painter gridParameters:gridPara.
  5216     painter gridShown: (settings at: #GridShown ifAbsent:false).
  5217     painter gridAlign: (settings at: #GridAlign ifAbsent:false).
  5218     painter shown ifTrue:[painter clearView].
  5219 
  5220     "Modified: / 22.8.1998 / 17:41:34 / cg"
  5221 !
  5222 
  5223 setupSpecClassAndSelector
  5224     |cls name|
  5225 
  5226     self specClass notNil ifTrue:[
  5227         specClassName isBehavior ifTrue:[
  5228             name := specClassName nameWithoutPrefix.
  5229         ] ifFalse:[
  5230             name := specClassName printString string
  5231         ]
  5232     ].
  5233     (aspects at:#classNameChannel) value:(specClassName ? 'NewApplication').
  5234 
  5235     specSuperclassName isNil ifTrue:[
  5236         specClassName notNil ifTrue:[
  5237             (cls := self resolveName:specClassName) notNil ifTrue:[
  5238                 specSuperclassName := cls superclass name.
  5239             ]
  5240         ]
  5241     ].
  5242     aspects at:#superclassNameChannel
  5243         put:((specSuperclassName notNil 
  5244                 ifTrue:[ specSuperclassName ]
  5245                 ifFalse:[ 'ApplicationModel' ]) asValue).
  5246     aspects at:#superclassNameDefaults
  5247         put:#( 'ApplicationModel' 'SimpleDialog' 'WebApplicationModel') asValue.
  5248     aspects at:#methodNameChannel
  5249         put:((specSelector notNil 
  5250                 ifTrue:[ specSelector asValue ]
  5251                 ifFalse:[ #windowSpec ]) asValue).
  5252 
  5253     "Modified: / 16-01-2008 / 10:44:55 / cg"
  5254 ! !
  5255 
  5256 !UIPainter methodsFor:'user actions'!
  5257 
  5258 accept
  5259     "accepts all modifications done to the attributes of the current section"
  5260 
  5261     |painter layout spec layoutTool layoutView t|
  5262 
  5263     self acceptChannel value:true; value:false.  "/ force editFields to accept
  5264     self clearModifiedFlag.
  5265 
  5266     painter := self painter.
  5267     spec := self specTool specification.
  5268 
  5269     self isLayoutToolSelected ifTrue:[
  5270         layoutTool := self layoutTool.
  5271 
  5272         (layout := layoutTool layout) notNil ifTrue:[
  5273             "/ cg->ca: the following code should be moded to the layoutTool
  5274             "/ (i.e. layoutTool saveInSpec:spec).
  5275 
  5276             layoutTool layoutType == #Extent ifTrue:[
  5277                 layoutView := layoutTool layoutView.
  5278 
  5279                 layoutView == self canvas ifTrue:[
  5280                     layoutView extent:layout.
  5281                     UseViewScroller == true ifTrue:[
  5282                         layoutView container container sizeChanged:nil.
  5283                     ].
  5284                 ] ifFalse:[
  5285                     spec useDefaultExtent:(layoutTool aspectValueFor:#useDefaultExtent).
  5286                     spec useDefaultExtent ifTrue:[
  5287                         "/ temporarily unfreeze the widgets size
  5288                         "/ (but remember, the old setting, which is actually
  5289                         "/ controlled by the resizeForLabel attribute)
  5290                         t := layoutView sizeFixed.
  5291                         layoutView sizeFixed:false.
  5292                         layout := layoutView preferredExtent.    
  5293                         layoutView sizeFixed:t.
  5294                     ].
  5295                     spec usePreferredWidth:(layoutTool aspectValueFor:#usePreferredWidth).
  5296                     spec usePreferredHeight:(layoutTool aspectValueFor:#usePreferredHeight).
  5297                     spec useDynamicPreferredWidth:(layoutTool aspectValueFor:#useDynamicPreferredWidth).
  5298                     spec useDynamicPreferredHeight:(layoutTool aspectValueFor:#useDynamicPreferredHeight).
  5299                     painter setExtent:layout.
  5300                     painter updateFromSpec:spec.
  5301                 ]
  5302             ] ifFalse:[
  5303                 spec useDefaultExtent:false.
  5304                 spec usePreferredWidth:(layoutTool aspectValueFor:#usePreferredWidth).
  5305                 spec usePreferredHeight:(layoutTool aspectValueFor:#usePreferredHeight).
  5306                 spec useDynamicPreferredWidth:(layoutTool aspectValueFor:#useDynamicPreferredWidth).
  5307                 spec useDynamicPreferredHeight:(layoutTool aspectValueFor:#useDynamicPreferredHeight).
  5308                 layoutTool layoutType == #LayoutFrame ifTrue:[
  5309                     spec keepSpaceForOSXResizeHandleH:(layoutTool aspectValueFor:#keepSpaceForOSXResizeHandleH).
  5310                     spec keepSpaceForOSXResizeHandleV:(layoutTool aspectValueFor:#keepSpaceForOSXResizeHandleV).
  5311                 ].
  5312                 painter setLayout:layout.
  5313                 spec layout:layout.
  5314                 painter updateFromSpec:spec.
  5315             ].
  5316         ]
  5317     ] ifFalse:[
  5318         self isHelpToolSelected ifTrue:[
  5319             self helpTool accept.      
  5320             spec activeHelpKey:self helpTool helpKey.
  5321         ].      
  5322         painter updateFromSpec:spec
  5323     ].
  5324 
  5325     self clearModified
  5326 !
  5327 
  5328 addWidget: aSpecClassSymbol
  5329     "adds a widget from aSpecClass to the current widget"
  5330 
  5331     self addWidgetOfSpec: (Array with: (Smalltalk at: aSpecClassSymbol) new)
  5332 !
  5333 
  5334 addWidgetOfSpec: aSpec
  5335     "adds a widget from aSpec to the current widget"
  5336 
  5337     |newSel|
  5338 
  5339     (newSel := painter pasteSpecifications:aSpec keepLayout:false at:0@0) notNil
  5340     ifTrue:[
  5341         painter select: newSel
  5342     ] ifFalse:[   
  5343         ((treeView selection size = 0) or: [treeView selectedNode isNil])
  5344         ifTrue:[                          
  5345             treeView selection: #(1).
  5346         ] ifFalse:[  
  5347             treeView selectNode: (treeView detectNode: [:n| n = treeView selectedNode parent])
  5348         ].
  5349         self addWidgetOfSpec: aSpec
  5350     ]
  5351 
  5352     "Modified: / 05-09-2006 / 18:37:12 / cg"
  5353 !
  5354 
  5355 askForMoveByStep
  5356     "open a dialog to ask for a number"
  5357 
  5358     |s nPixels|
  5359 
  5360     s := Dialog request:'Number of Pixels to Move: '
  5361                 initialAnswer:painter nPixelsForMoveSelection asString.
  5362     s isEmptyOrNil ifTrue:[^ self].
  5363     nPixels := Integer readFrom:s onError:nil.
  5364     nPixels isNil ifTrue:[^ self].
  5365 
  5366     self painter nPixelsForMoveSelection:nPixels
  5367 !
  5368 
  5369 cancel
  5370     "cancels all modifications done to the attributes of the current section; 
  5371      reread the old attributes"
  5372 
  5373     |spec key view|
  5374 
  5375     self isModified ifTrue:[
  5376         (spec := self painter specForSelection) notNil ifTrue:[
  5377             key := spec activeHelpKey.
  5378         ].
  5379         self helpTool helpKey:key.
  5380 
  5381         treeView isCanvasSelected ifTrue: [
  5382             spec := treeView canvasSpec.
  5383         ].
  5384 
  5385         self specTool specification:spec.
  5386         view := self layoutTool layoutView.
  5387 
  5388         self setViewInLayoutTool:view spec:spec.
  5389         spec class == DataSetSpec ifTrue:[
  5390             view notNil ifTrue:[
  5391                 view columnDescriptors:(spec columns)
  5392             ]
  5393         ].        
  5394         self clearModifiedFlag.
  5395         self clearModified.
  5396     ]
  5397 !
  5398 
  5399 hideEditToolbar
  5400     self editToolBarVisibleHolder value:false
  5401 !
  5402 
  5403 hideToolbar
  5404     self toolBarVisibleHolder value:false
  5405 !
  5406 
  5407 replaceWidgetByClass:aSpecOrWidgetClass
  5408     "replace the selected widget by a new instance of aSpecOrWidgetClass,
  5409      which gets the old widget's layout"
  5410 
  5411     |newSpecClass oldSpec newSpec|
  5412 
  5413     treeView isCanvasSelected ifTrue:[
  5414         ^ self
  5415     ].
  5416     (newSpecClass := self specClassFromUsersSpecOrWidgetClass:aSpecOrWidgetClass) isNil ifTrue:[
  5417         ^ newSpecClass
  5418     ].
  5419 
  5420     oldSpec := self selectedSpec.
  5421     newSpec := newSpecClass cloneFrom:oldSpec.
  5422 
  5423     self painter replaceSelectionBy:newSpec.
  5424 
  5425     "Modified: / 05-09-2012 / 19:24:40 / cg"
  5426 !
  5427 
  5428 setMoveByStep:nPixels
  5429     "change the number of pixels by which the step-buttons move the selected widget(s)"
  5430 
  5431     self painter nPixelsForMoveSelection:nPixels
  5432 !
  5433 
  5434 specClassFromUsersSpecOrWidgetClass:aSpecOrWidgetClass
  5435     |newSpecClass|
  5436 
  5437     (aSpecOrWidgetClass isSubclassOf:UISpecification) ifTrue:[
  5438         newSpecClass := aSpecOrWidgetClass.
  5439     ] ifFalse:[
  5440         (aSpecOrWidgetClass isSubclassOf:View) ifTrue:[
  5441             newSpecClass := aSpecOrWidgetClass basicNew specClass.
  5442         ] ifFalse:[
  5443             newSpecClass := nil
  5444         ].
  5445     ].
  5446     newSpecClass isNil ifTrue:[
  5447         Dialog warn:'Invalid Spec- or View-Class: ' , aSpecOrWidgetClass name.
  5448         ^ nil.
  5449     ].
  5450     ^ newSpecClass
  5451 !
  5452 
  5453 useBackgroundImage
  5454     "select bitmap to underly"
  5455 
  5456     |fn|
  5457 
  5458     fn := Dialog requestFileName:'Bitmap Image File ?' pattern:'*.gif;*.tiff;*.jpg;*.png' fromDirectory:'f:'.
  5459     fn isNil ifTrue:[
  5460         ^ self
  5461     ].
  5462     painter useSketchFile:fn
  5463 
  5464     "Created: / 16-01-2008 / 17:49:20 / cg"
  5465 !
  5466 
  5467 useSketch
  5468     "select sketchfile to underly.
  5469      Sketchfiles are generated by notepads, which can offline-store drawn sketches"
  5470 
  5471     |fn|
  5472 
  5473     fn := Dialog requestFileName:'Sketch (Notepad Drawing) ?' pattern:'*.TOP' fromDirectory:'f:'.
  5474     fn isNil ifTrue:[
  5475         ^ self
  5476     ].
  5477     painter useSketchFile:fn
  5478 
  5479     "Created: / 16-01-2008 / 17:49:20 / cg"
  5480 !
  5481 
  5482 wrapWidgetIntoClass:aSpecOrWidgetClass
  5483     "put the selected widget into a new instance of aSpecOrWidgetClass,
  5484      which gets the wrapped widget's layout"
  5485 
  5486     |newSpecClass oldSpec newSpec|
  5487 
  5488     treeView isCanvasSelected ifTrue:[
  5489         ^ self
  5490     ].
  5491     (newSpecClass := self specClassFromUsersSpecOrWidgetClass:aSpecOrWidgetClass) isNil ifTrue:[
  5492         ^ newSpecClass
  5493     ].
  5494 
  5495     oldSpec := self selectedSpec.
  5496     newSpec := newSpecClass new.
  5497     newSpec layout:oldSpec layout.
  5498     newSpec component:oldSpec.
  5499     
  5500     self painter replaceSelectionBy:newSpec.
  5501 
  5502     "Modified: / 05-09-2012 / 19:24:40 / cg"
  5503 ! !
  5504 
  5505 !UIPainter methodsFor:'user actions-menu'!
  5506 
  5507 doAskAndReplaceWidgetBy
  5508     "ask for a widget class,
  5509      and replace the selected widget by a new instance of that one,
  5510      which gets the old widget's layout"
  5511 
  5512     |widgetClass list common selectedSpec|
  5513 
  5514     selectedSpec := self selectedSpec.
  5515     selectedSpec isNil ifTrue:[^ self].
  5516 
  5517     list :=  UISpecification allSubclasses
  5518                 select:[:cls | 
  5519                     [ cls viewClass notNil]
  5520                         on: NotFoundError
  5521                         do:[ false ]
  5522                 ].
  5523     list sort:[:a :b | a name < b name].
  5524 
  5525     common := selectedSpec class commonReplacementClasses.
  5526     common notEmpty ifTrue:[
  5527         list addAllFirst:(common , (Array with:'-')).
  5528     ].
  5529     widgetClass := Dialog 
  5530                         requestClass:'Replace by (Spec or View Class):'
  5531                         list:list
  5532                         okLabel:'OK' 
  5533                         initialAnswer:nil.
  5534     widgetClass isNil ifTrue:[
  5535         ^ self
  5536     ].
  5537     self replaceWidgetByClass:widgetClass
  5538 
  5539     "Modified: / 05-09-2012 / 19:31:22 / cg"
  5540 !
  5541 
  5542 doAskAndWrapWidgetInto
  5543     "ask for a container class,
  5544      and put the selected widget into a new instance of that one,
  5545      which gets the wrapped widget's layout"
  5546 
  5547     |widgetClass list selectedSpec|
  5548 
  5549     selectedSpec := self selectedSpec.
  5550     selectedSpec isNil ifTrue:[^ self].
  5551 
  5552     list :=  UISpecification allSubclasses
  5553                 select:[:cls | 
  5554                     [ cls viewClass notNil
  5555                       and:[ cls supportsSubComponents ]]
  5556                         on: NotFoundError
  5557                         do:[ false ]
  5558                 ].
  5559     list sort:[:a :b | a name < b name].
  5560 
  5561     widgetClass := Dialog 
  5562                         requestClass:'Wrap into (Spec or View Class):'
  5563                         list:list
  5564                         okLabel:'OK' 
  5565                         initialAnswer:nil.
  5566     widgetClass isNil ifTrue:[
  5567         ^ self
  5568     ].
  5569     self wrapWidgetIntoClass:widgetClass
  5570 !
  5571 
  5572 doBrowseActionMethod:aspectSelector
  5573     "browse or create the action method as entered in the field 
  5574      (button beside input field in ui-slice pressed)"
  5575 
  5576     self acceptOrIgnoreSectionModification.
  5577 
  5578     self doBrowseActionMethod:aspectSelector nameAs:aspectSelector
  5579 
  5580     "Modified: / 12-01-2008 / 10:32:12 / cg"
  5581 !
  5582 
  5583 doBrowseActionMethod:aspectSelector nameAs:aspectNameShown
  5584     "browse or create the action method as entered in the field.
  5585      sent by embedded ui-slice's browse class button."
  5586 
  5587     |cls spec aspect code|
  5588 
  5589     cls := self specClass.
  5590     cls isNil ifTrue:[
  5591         Dialog information:'No application class defined.'.
  5592         ^ self
  5593     ].
  5594 
  5595     spec := painter specForSelection.
  5596     spec isNil ifTrue:[^ self].
  5597     aspect := spec perform:aspectSelector.
  5598     aspect isNil ifTrue:[
  5599         Dialog information:(resources 
  5600                                 string:'Please enter an action method name for "%1" first.'
  5601                                 with:(resources string:aspectNameShown) allBold).
  5602         ^ self
  5603     ].
  5604         
  5605     (cls includesSelector:aspect asSymbol) ifFalse:[
  5606         (Dialog confirm:(resources 
  5607                             stringWithCRs:'%1 does not implement %2.\\Create ?'
  5608                             with:(cls name allBold)
  5609                             with:aspect allBold)) 
  5610         ifFalse:[
  5611             (Dialog confirm:(resources 
  5612                                 stringWithCRs:'Browse implementors of %1 ?'
  5613                                 with:aspect allBold)) 
  5614             ifTrue:[
  5615                 SystemBrowser default browseImplementorsOf:aspect
  5616             ].
  5617             ^ self
  5618         ].
  5619         code := painter
  5620             generateActionMethodFor:aspect 
  5621             spec:nil 
  5622             inClass:cls.
  5623         Class packageQuerySignal answer:painter targetClass package do:[
  5624             code readStream fileIn.
  5625         ].
  5626     ].
  5627     SystemBrowser default openInClass:cls selector:aspect
  5628 
  5629     "Modified: / 28-01-2014 / 21:55:56 / cg"
  5630 !
  5631 
  5632 doBrowseAspectClass: aspect
  5633     "sent by embedded ui-slice's 'browse'-class button (for example, subcanvasSpec)."
  5634 
  5635     | spec className class |
  5636 
  5637     spec := painter specForSelection.
  5638     spec isNil ifTrue:[ self error: 'No spec!!'.].      
  5639     className := spec perform: aspect.
  5640     class := self resolveName: className inClass: specClass.
  5641     class isNil ifTrue:[ 
  5642         Dialog warn: (resources string: 'No such class (%1)' with: className). 
  5643         ^ self.
  5644     ].
  5645     Smalltalk browseInClass: (self resolveName: className inClass: specClass)
  5646 
  5647     "Created: / 24-02-2014 / 17:20:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  5648 !
  5649 
  5650 doBrowseAspectClassAndSelector:classAspectAndSelectorAspect
  5651     "sent by embedded ui-slice's browse class button (for example, subcanvasSpec)."
  5652 
  5653     | classAspect selector selectorAspect spec className class |
  5654 
  5655     classAspect := classAspectAndSelectorAspect first. "/ #(#majorKey #minorKey)
  5656     selectorAspect := classAspectAndSelectorAspect second. "/ #(#majorKey #minorKey)
  5657 
  5658     spec := painter specForSelection.
  5659     spec isNil ifTrue:[ self error: 'No spec!!'.].      
  5660     className := spec perform: classAspect.
  5661     class := self resolveName: className inClass: specClass.
  5662     class isNil ifTrue:[ 
  5663         Dialog warn: (resources string: 'No such class (%1)' with: className). 
  5664         ^ self.
  5665     ].
  5666     selector := spec perform: selectorAspect.
  5667     Smalltalk 
  5668         browseInClass: (self resolveName: className inClass: specClass) theMetaclass
  5669         selector:selector
  5670 !
  5671 
  5672 doBrowseAspectMethod:aspectSelector
  5673     "browse or create the aspect method as entered in the field 
  5674     (button beside input field pressed)"
  5675 
  5676     self isModified ifTrue:[ self accept ].
  5677     "/ self acceptOrIgnoreSectionModification.
  5678     self doBrowseAspectMethod:aspectSelector nameAs:aspectSelector
  5679 
  5680     "Modified: / 12-01-2008 / 10:32:15 / cg"
  5681     "Modified (format): / 24-02-2014 / 17:44:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  5682 !
  5683 
  5684 doBrowseAspectMethod:aspectSelector nameAs:aspectNameShown
  5685     "browse or create the aspect method as entered in the field"
  5686 
  5687     |cls spec aspect implementingClass answer|
  5688 
  5689     cls := self specClass.
  5690     cls isNil ifTrue:[
  5691         Dialog information:'No Application Class defined.'.
  5692         ^ self
  5693     ].
  5694 
  5695     spec := painter specForSelection.
  5696     spec isNil ifTrue:[self halt. ^ self].
  5697 
  5698     aspect := spec perform:aspectSelector.
  5699     aspect isString ifFalse:[
  5700         "ignore non-strings (list may be an Array)"
  5701         aspect isNil ifTrue:[
  5702             Dialog information:(resources 
  5703                                     string:'Please enter a Method name for "%1" first.'
  5704                                     with:(resources string:aspectNameShown) allBold).
  5705         ].
  5706         ^ self
  5707     ].
  5708 
  5709     implementingClass := (cls whichClassIncludesSelector:aspect asSymbol).
  5710     implementingClass isNil ifTrue:[
  5711         implementingClass := (cls class whichClassIncludesSelector:aspect asSymbol).
  5712     ].
  5713     implementingClass isNil ifTrue:[
  5714         answer := OptionBox
  5715                           request:(resources 
  5716                                     stringWithCRs:'%1 does not implement %2.\\Create ?'
  5717                                     with:(cls name allBold)
  5718                                     with:aspect allBold)
  5719                           label:'Create/Browse Aspect Method'
  5720                           image:(WarningBox iconBitmap)
  5721                           buttonLabels:#('Cancel' 'Browse Implementors' 'Create & Browse' 'Create' )
  5722                           values:#(abort browseImplementors createAndBrowse create )
  5723                           default:#create
  5724                           onCancel:#abort.
  5725 
  5726         answer == #browseImplementors ifTrue:[
  5727             UserPreferences systemBrowserClass browseImplementorsOf:aspect.
  5728             ^ self
  5729         ].
  5730         answer == #abort ifTrue:[
  5731             ^ self
  5732         ].
  5733 
  5734         self doGenerateAspectMethodsForAll:(Array with:aspect).
  5735         implementingClass := self painter targetClass.
  5736 
  5737         answer == #create ifTrue:[^ self].
  5738     ] ifFalse:[
  5739         (Dialog confirm:(resources string:'Browse the implementation of "%1" ?' with:aspect)) ifFalse:[
  5740             ^ self.
  5741         ].
  5742     ].
  5743 
  5744     UserPreferences systemBrowserClass 
  5745         openInClass:implementingClass selector:aspect
  5746 !
  5747 
  5748 doBrowseAspectMethods
  5749     "opens a browser on all the aspect methods"
  5750 
  5751     |methods|
  5752 
  5753     self painter isModified ifTrue:[
  5754         self warn:'The current window spec has not yet been saved!!\\The System Browser may show the code of the old aspect methods.' withCRs.
  5755     ].
  5756 
  5757     (methods := self painter aspectMethods) isEmpty ifTrue:[
  5758         self warn:'No aspect methods found !!'.
  5759         ^ self.
  5760     ].
  5761     UserPreferences systemBrowserClass 
  5762         browseMethods:methods 
  5763         title:'Aspect methods'.
  5764 !
  5765 
  5766 doBrowseClass
  5767     "opens a System Browser on the specClass"
  5768 
  5769     self painter isModified ifTrue:[
  5770         self warn:'The current window spec has not yet been saved!!\\The System Browser will show the code of the old window spec.' withCRs.
  5771     ].
  5772 
  5773     Smalltalk browseInClass:(self resolveName:specClassName)
  5774 !
  5775 
  5776 doBrowseSpecificationClass
  5777     "opens an browser on the spec class of the selected widget"
  5778 
  5779     |spec|
  5780 
  5781     (spec := self painter specForSelection) isNil ifTrue:[
  5782         treeView isCanvasSelected ifTrue:[
  5783             spec := treeView canvasSpec.
  5784         ]
  5785     ].
  5786     spec notNil ifTrue:[
  5787         spec class browse
  5788     ]
  5789 !
  5790 
  5791 doBrowseViewClass
  5792     "opens a browser on the selected widgets class"
  5793 
  5794     |selection widget|
  5795 
  5796     ((selection := self painter selection) isCollection and: [selection size >= 1]) ifTrue:[
  5797         widget := selection first
  5798     ] ifFalse:[
  5799         widget := selection
  5800     ].
  5801 
  5802     widget scrolledView class browse
  5803 
  5804     "Modified: / 22-01-2011 / 12:02:31 / cg"
  5805 !
  5806 
  5807 doDefineClassAndSelector
  5808     "launches a dialog for defining class, superclass, and selector of the application"
  5809 
  5810     | again readFromModelKeyed |
  5811 
  5812     readFromModelKeyed := [:aKey| |ret|
  5813         ret := (self aspectValueFor:aKey).
  5814         ret isEmptyOrNil ifTrue:[
  5815             ret := nil
  5816         ] ifFalse:[
  5817             ret isString ifTrue:[
  5818                 ret := ret string withoutSeparators.
  5819                 ret := ret isEmpty ifTrue:[nil] ifFalse:[ret asSymbol].
  5820             ].
  5821         ].
  5822         ret
  5823     ].
  5824 
  5825     [
  5826         again := false.
  5827 
  5828         aspects at:#classNameChannel      put:(specClassName  ? 'NewApplication')   asValue.
  5829         aspects at:#methodNameChannel     put:(specSelector   ? 'windowSpec')       asValue.
  5830         aspects at:#superclassNameChannel put:(specSuperclassName ? 'ApplicationModel') asValue.
  5831 
  5832         (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[
  5833             specClassName  := readFromModelKeyed value:#classNameChannel.
  5834             specSelector   := readFromModelKeyed value:#methodNameChannel.
  5835             specSuperclassName := readFromModelKeyed value:#superclassNameChannel.
  5836 
  5837             (again := self checkClassAndSelector not) ifFalse:[
  5838                 self painter 
  5839                     className:specClassName
  5840                     superclassName:specSuperclassName
  5841                     selector:specSelector.
  5842             ].
  5843 
  5844             again ifFalse:[
  5845                 ((Smalltalk at:specClassName asSymbol) notNil
  5846                 and:[ (Smalltalk at:specClassName asSymbol) class includesSelector:specSelector ])
  5847                 ifTrue:[
  5848                     (self confirm:('%1 already implements %2. Overwrite ?' bindWith:specClassName with:specSelector))
  5849                     ifFalse:[
  5850                         again := true.
  5851                     ].
  5852                 ].
  5853             ].
  5854         ] ifFalse: [
  5855             ^nil
  5856         ]
  5857 
  5858     ] doWhile:[again].
  5859 
  5860     specClassName := specClassName isBehavior 
  5861                         ifTrue:[specClassName name]
  5862                         ifFalse:[specClassName].
  5863     specClass := self resolveName: specClassName.  
  5864 
  5865     self clearModifiedFlag.
  5866     self helpTool buildAndMergeFromClass:specClass.
  5867     self updateInfoLabel
  5868 
  5869     "Modified: / 16-07-1998 / 18:26:33 / cg"
  5870     "Modified: / 18-01-2017 / 23:38:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  5871 !
  5872 
  5873 doDefineGrid
  5874     "opens a dialog for the grid parameters"
  5875 
  5876     |hspace vspace bindings painter gridPara settings|
  5877 
  5878     painter  := self painter.
  5879     bindings := IdentityDictionary new.
  5880     gridPara := painter gridParameters copy.
  5881     settings := self class settings.
  5882 
  5883     bindings at:#showGrid    put:((settings at: #GridShown ifAbsent: [painter gridShown]) asValue).
  5884     bindings at:#alignToGrid put:((settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue).
  5885     bindings at:#hspace      put:((gridPara at:1) asValue).
  5886     bindings at:#vspace      put:((gridPara at:2) asValue).
  5887 
  5888     (self openDialogInterface:#dialogSpecForDefiningGridParameters withBindings:bindings) ifFalse:[
  5889         ^ self
  5890     ].
  5891 
  5892     hspace := (bindings at:#hspace) value ? 5.
  5893     vspace := (bindings at:#vspace) value ? 5.
  5894 
  5895     gridPara at:1 put:hspace.
  5896     gridPara at:2 put:vspace.
  5897     gridPara at:5 put:hspace.
  5898     gridPara at:6 put:vspace.
  5899 
  5900     painter gridShown:false. 
  5901     painter gridAlign:false. 
  5902     painter gridParameters:gridPara.
  5903     painter gridAlign:(bindings at:#alignToGrid) value.
  5904     painter gridShown:(bindings at:#showGrid) value.
  5905 
  5906     settings at: #GridShown  put: (bindings at:#showGrid) value.
  5907     settings at: #GridAlign  put: (bindings at:#alignToGrid) value.
  5908     settings at: #HGridSpace put: hspace.
  5909     settings at: #VGridSpace put: vspace.
  5910     painter clearView.
  5911 
  5912     "Modified: / 4.2.1999 / 15:36:34 / cg"
  5913 !
  5914 
  5915 doEditList:listSelector
  5916     "browse or create the aspect method as entered in the field (button beside input fieled pressed)"
  5917 
  5918     |spec list editor|
  5919 
  5920     self acceptOrIgnoreSectionModification.
  5921 
  5922     UIListEditor isNil ifTrue:[^ self].
  5923 
  5924     spec := painter specForSelection.
  5925     spec isNil ifTrue:[^ self].
  5926 
  5927     "Kludge: subject - fetch the AspectAdaptor behind the TypeConverter"
  5928     list := (specTool aspectFor:listSelector) subject value.
  5929     list isNil ifTrue:[
  5930         list := #()
  5931     ].
  5932 
  5933     editor := UIListEditor new.
  5934     editor
  5935         informationLabel:'Edit List';
  5936         list:list;
  5937         useSymbols:(list notEmpty and:[list conform:[:e| e isSymbol]]);    "set use symbols, if all elements are symbols"
  5938         open.
  5939 
  5940 
  5941     editor accepted ifTrue:[
  5942         "Kludge: subject - fetch the AspectAdaptor behind the TypeConverter"
  5943         (specTool aspectFor:listSelector) subject value:editor list.
  5944     ].
  5945 !
  5946 
  5947 doGenerateAspectMethodFor
  5948     |cls aspectList displayedList selectorsToGenerateCode 
  5949      doBrowse methods|
  5950 
  5951     self askForSectionModification.
  5952 
  5953     cls := self painter targetClass.
  5954 
  5955     aspectList := OrderedCollection new.
  5956 
  5957     self painter aspectSelectorsAndTypesDo:[:selector :type |
  5958             |newEntry|
  5959 
  5960             ( #(#modelAspect channelAspect actionSelector valueSelector) includes:type) ifTrue:[
  5961                 ((cls canUnderstand:selector) or:[cls class canUnderstand:selector]) ifFalse:[
  5962                     newEntry := Array with:selector with:type.    
  5963                     (aspectList includes:newEntry) ifFalse:[    
  5964                         aspectList add:newEntry.
  5965                     ]
  5966                 ]
  5967             ]
  5968         ].
  5969     
  5970     aspectList isEmpty ifTrue:[
  5971         self information:'All aspect methods exist.'.
  5972         ^ self.
  5973     ].
  5974 
  5975     aspectList sort:[:a :b | a first < b first].
  5976     displayedList := aspectList collect:[:entry | (((entry first) paddedTo:25) contractTo:25) , ' -> ' , entry second ].
  5977     aspectList := aspectList collect:[:each | each first].
  5978 
  5979     doBrowse := false.    
  5980     selectorsToGenerateCode := Dialog
  5981         choose:'Select aspect(s) for which code shall be generated:' 
  5982         fromList:displayedList 
  5983         values:aspectList 
  5984         initialSelection:nil
  5985         buttons:nil 
  5986         values:nil 
  5987         lines:15 
  5988         cancel:nil 
  5989         multiple:true
  5990         postBuildBlock:[:dialog | 
  5991                             |b|
  5992 
  5993                             b := Button label:'Generate & Browse'.
  5994                             b action:[doBrowse := true. dialog okPressed].
  5995                             b := dialog addButton:b before:dialog okButton.
  5996                        ].
  5997 
  5998     selectorsToGenerateCode isEmptyOrNil ifTrue:[^ self].
  5999 
  6000     self doGenerateAspectMethodsForAll:selectorsToGenerateCode.
  6001 
  6002     "/ refetch - cls is now obsolete
  6003     cls := self painter targetClass.
  6004 
  6005     doBrowse ifTrue:[
  6006         methods := selectorsToGenerateCode 
  6007                         collect:[:sel | cls compiledMethodAt:sel]
  6008                         thenSelect:[:m | m notNil].
  6009 
  6010         UserPreferences systemBrowserClass 
  6011             browseMethods:methods 
  6012             title:'Some Aspect methods'.
  6013     ].
  6014 !
  6015 
  6016 doGenerateAspectMethods
  6017     "generates aspect and action methods for the application class"
  6018 
  6019     self askForSectionModification.
  6020     self withWaitCursorDo:[
  6021         |code|
  6022 
  6023         code := self painter generateAspectMethodCode.
  6024         Class packageQuerySignal answer:painter targetClass package do:[
  6025             code readStream fileIn.
  6026         ]
  6027     ]
  6028 
  6029     "Modified: / 28-01-2014 / 21:56:03 / cg"
  6030 !
  6031 
  6032 doGenerateAspectMethodsForAll:selectorsToGenerateCode
  6033     |code|
  6034 
  6035     code := self painter generateAspectMethodCodeFiltering:selectorsToGenerateCode.
  6036     Class packageQuerySignal answer:painter targetClass package do:[
  6037         code readStream fileIn.
  6038     ]
  6039 
  6040     "Modified: / 28-01-2014 / 21:56:06 / cg"
  6041 !
  6042 
  6043 doGenerateAspectSelectorsMethod
  6044     "generates aspectSelectors method for the exported aspects"
  6045 
  6046     |aspectSelectorsAsString|
  6047 
  6048     self askForSectionModification.
  6049     aspectSelectorsAsString := self painter generateAspectSelectorsMethod.
  6050     aspectSelectorsAsString notEmptyOrNil ifTrue:[
  6051         Class packageQuerySignal answer:painter targetClass package do:[
  6052             (ReadStream on:aspectSelectorsAsString) fileIn.
  6053         ].
  6054     ].
  6055 
  6056     "Modified: / 28-01-2014 / 21:56:09 / cg"
  6057 !
  6058 
  6059 doGenerateHookMethods
  6060     "generates hook methods for the application class"
  6061 
  6062     self askForSectionModification.
  6063 
  6064     Class packageQuerySignal answer:painter targetClass package do:[
  6065         (ReadStream on:painter generateHookMethods) fileIn.
  6066     ]
  6067 
  6068     "Modified: / 28-01-2014 / 21:56:13 / cg"
  6069 !
  6070 
  6071 doGenerateMenuMethods
  6072     "generates menu stub methods for the application class"
  6073 
  6074     self askForSectionModification.
  6075 
  6076     Class packageQuerySignal answer:painter targetClass package do:[
  6077         (ReadStream on:painter generateMenuMethods) fileIn.
  6078     ]
  6079 
  6080     "Created: / 23-08-1998 / 16:10:04 / cg"
  6081 !
  6082 
  6083 doInspectSpec
  6084     "opens an inspector on the spec of the selected widget"
  6085 
  6086     |spec|
  6087 
  6088     (spec := self painter specForSelection) isNil ifTrue:[
  6089         treeView isCanvasSelected ifTrue:[
  6090             spec := treeView canvasSpec.
  6091         ]
  6092     ].
  6093     spec notNil ifTrue:[
  6094         spec inspect.
  6095     ]
  6096 !
  6097 
  6098 doInspectView
  6099     "opens an inspector on the view of the selected widget"
  6100 
  6101     |selection|
  6102 
  6103     ((selection := self painter selection) isCollection and: [selection size >= 1]) ifTrue:[
  6104         selection first inspect
  6105     ] ifFalse: [
  6106         selection inspect
  6107     ]
  6108 
  6109 !
  6110 
  6111 doInstallAsWebPage
  6112     "lets user select a service, page-name and installs the page"
  6113 
  6114     |runningServerPorts again serviceOrPort pageName port serviceLinkName service server app|
  6115 
  6116     runningServerPorts := (HTTPServer runningServers collect:[:s | s port printString]) asOrderedCollection sort.
  6117     serviceOrPort := lastPort ? LastPort ? '8080'.
  6118     pageName := lastPage ? LastPage ? 'myPage'.
  6119 
  6120     [
  6121         again := false.
  6122 
  6123         aspects at:#serviceOrPortNameChannel put:serviceOrPort printString  asValue.
  6124         aspects at:#pageNameNameChannel      put:pageName printString asValue.
  6125         aspects at:#runningServerPorts       put:runningServerPorts.
  6126 
  6127         (self openDialogInterface:#dialogSpecForDefiningPortAndPageName) ifFalse:[^ nil].
  6128 
  6129         port := Integer readFrom:(aspects at:#serviceOrPortNameChannel) value onError:nil.
  6130         port isNil ifTrue:[
  6131             serviceLinkName := (aspects at:#serviceOrPortNameChannel) value.
  6132             service := HTTPPortalService allSubInstances select:[:s | s linkName = serviceLinkName].
  6133             service notEmptyOrNil ifTrue:[
  6134                 again := false.
  6135                 service := service first.    
  6136             ] ifFalse:[
  6137                 Dialog warn:'No such service'
  6138             ].
  6139         ] ifFalse:[
  6140             server := HTTPServer serverOnPort:port.
  6141             service := server 
  6142                         serviceForLink:'/portal'
  6143                         ifAbsent:[
  6144                             service := HTTPPortalService new.
  6145                             service linkName:'/portal'.
  6146                             service class unRegisterServiceOn:server.
  6147                             service registerServiceOn:server.
  6148                         ].
  6149         ].
  6150 
  6151         pageName := (aspects at:#pageNameNameChannel) value.
  6152     ] doWhile:[again].
  6153 
  6154     lastPage := LastPage := pageName.
  6155     lastPort := LastPort := port.
  6156 
  6157     app := self specClass new.
  6158     app webLink:pageName.
  6159     app service:service.
  6160     app defineInterface:(self specSelector).
  6161     app addToService.
  6162 
  6163 "/    self clearModifiedFlag.
  6164 "/    self helpTool buildAndMergeFromClass:specClassName.
  6165     self updateInfoLabel
  6166 
  6167     "Modified: / 15-01-2008 / 14:18:53 / cg"
  6168 !
  6169 
  6170 doLoad
  6171     "opens a ResourceSelectionBrowser for loading a window spec from a class"
  6172 
  6173     self askForModification ifFalse: [^nil].
  6174 
  6175     self loadFromMessage: 
  6176         (ResourceSelectionBrowser
  6177             request: 'Load Window Spec from Class'
  6178             onSuperclass: nil
  6179             andClass: self specClass
  6180             andSelector: specSelector ? #windowSpec
  6181             withResourceTypes: #(canvas))
  6182 
  6183     "Modified: / 31-08-2006 / 10:14:01 / cg"
  6184 !
  6185 
  6186 doLoadSubspec
  6187     "opens a ResourceSelectionBrowser for loading a sub spec from a class"
  6188 
  6189     |classAndSelector class selector|
  6190 
  6191     self askForSectionModification.
  6192 
  6193     classAndSelector := ResourceSelectionBrowser
  6194             request: 'Load Subspec from Class'
  6195             onSuperclass: nil
  6196             andClass: self specClass
  6197             andSelector: specSelector
  6198             withResourceTypes: #(canvas).
  6199 
  6200     classAndSelector isNil ifTrue:[^ self].
  6201     class := classAndSelector methodClass.
  6202     selector := classAndSelector methodSelector.
  6203     (class == specClassName and: [selector == specSelector]) ifTrue: [
  6204         self warn: 'Current interface as subspec not allowed!!'.
  6205         ^ self.
  6206     ].
  6207     (class respondsTo:selector) ifTrue:[
  6208         self addWidgetOfSpec:(Array with: (UISubSpecification new majorKey: class name; minorKey: selector))
  6209     ]
  6210 
  6211     "Modified: / 31-08-2006 / 10:13:56 / cg"
  6212 !
  6213 
  6214 doNew
  6215     "removes all widgets, specClass, and specSelector"
  6216 
  6217     self askForModification ifFalse: [^nil].
  6218     specClass := specClassName := specSelector := nil.
  6219     self painter removeAll.
  6220 "/ self halt.
  6221     treeView canvas topView 
  6222         name:  self defaultNameOfCanvas;
  6223         label: self defaultNameOfCanvas.
  6224     self helpTool doNew.
  6225     self treeSelectionChanged.
  6226     treeView selectedNode changed.
  6227     self tabModel value: self tabList value first.
  6228     self updateInfoLabel.
  6229 
  6230     "Modified: / 31-08-2006 / 10:14:10 / cg"
  6231 !
  6232 
  6233 doOpenAspectClassChooserFor: aspect
  6234     "open a class chooser; when ok, set the aspect to its name
  6235      sent by embedded ui-slice's '...'-class button (for example, subcanvasSpec)."
  6236 
  6237     | spec className class choice|
  6238 
  6239     spec := painter specForSelection.
  6240     spec isNil ifTrue:[ self error: 'No spec!!'.].      
  6241     className := spec perform: aspect.
  6242     class := self resolveName: className inClass: specClass.
  6243     choice := Dialog requestClassName:'Choose class' initialAnswer:(class isNil ifTrue:nil ifFalse:[class name]).
  6244     choice isEmptyOrNil ifTrue:[^ self ].
  6245 
  6246     spec perform: (aspect asMutator) with:choice.
  6247     (specTool aspectFor:aspect) value:choice.
  6248 !
  6249 
  6250 doOpenWidgetDocumentation
  6251     "opens documentation for the selected widget"
  6252 
  6253     |spec document|
  6254 
  6255     (spec := self specForSelection) isNil ifTrue:[
  6256 "/        treeView isCanvasSelected ifTrue:[
  6257 "/            spec := nil
  6258 "/        ]
  6259     ].
  6260     spec notNil ifTrue:[
  6261         document := 'tools/uipainter/', spec documentFileName,'.html'
  6262     ] ifFalse: [
  6263         document := 'tools/uipainter/WindowSpec.html'
  6264     ].
  6265     HTMLDocumentView openFullOnDocumentationFile: document 
  6266 !
  6267 
  6268 doPickAView
  6269     "changes the cursor for picking a view and builds a window spec from it"
  6270 
  6271     |view|
  6272 
  6273     self askForModification ifFalse: [^nil].
  6274 
  6275     (view := Screen current viewFromUser) notNil ifTrue:[
  6276         view == Screen current rootView ifFalse:[
  6277             self painter setupFromSpec:(UISpecification fromView:view topView).
  6278         ]
  6279     ].
  6280 
  6281     self updateInfoLabel
  6282 
  6283 !
  6284 
  6285 doSave
  6286     "saves the window spec"
  6287     
  6288     |code painter specClass extentUsed|
  6289 
  6290     self askForSectionModification.
  6291     self hasSpecClassAndSelector ifFalse:[
  6292         self doDefineClassAndSelector isNil ifTrue:[
  6293             ^ nil
  6294         ]
  6295     ].
  6296 
  6297     specClass := self resolveName:specClassName.
  6298     (specClass notNil and:[ specClass isClass ]) ifFalse:[
  6299         self warn:('Oops - cannot save. Class not found: ' , specClassName).
  6300         ^ nil
  6301     ].
  6302     ApplicationModel forgetDefaultExtentFor:specClass.
  6303 
  6304     painter := self painter.
  6305     painter 
  6306         class:specClass
  6307         superclassName:specSuperclassName
  6308         selector:specSelector.
  6309 
  6310 "/    Transcript showCR:'generating windowSpec code...'.
  6311 
  6312     extentUsed := self canvas extent.
  6313     (extentUsed > (1024 @ 768)) ifTrue:[
  6314         Dialog 
  6315             warn:(resources
  6316                 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.'
  6317                 with:extentUsed printString allBold)
  6318     ].
  6319     (self canvas maxExtent notNil
  6320     and:[ extentUsed > self canvas maxExtent ]) ifTrue:[
  6321         Dialog 
  6322             warn:(resources
  6323                 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.'
  6324                 with:extentUsed printString allBold)
  6325     ].
  6326 
  6327     code := painter generateWindowSpecMethodSource.
  6328     Class packageQuerySignal answer:specClass package do:[
  6329         (ReadStream on:code) fileIn.
  6330     ].
  6331     self doGenerateAspectSelectorsMethod.
  6332     self helpTool doSave.
  6333     self updateInfoLabel.
  6334     self clearModified.
  6335     painter resetModification.
  6336     (specClass respondsTo:specSelector) ifTrue:[
  6337         self addHistoryEntryForClass:specClass selector:specSelector.
  6338     ].
  6339 
  6340     "Modified: / 28-01-2014 / 21:52:32 / cg"
  6341 !
  6342 
  6343 doSaveAs
  6344     "opens a ResourceSelectionBrowser for saving the window spec on a class"
  6345 
  6346     |classAndSelector|
  6347 
  6348     self askForSectionModification.
  6349 "/    self hasSpecClassAndSelector ifTrue:[
  6350 "/        self askForModification ifFalse:[^ false].
  6351 "/    ].
  6352 
  6353     classAndSelector := ResourceSelectionBrowser
  6354             request: 'Save Window Spec in Class'
  6355             onSuperclass: #Object
  6356             andClass: (specClassName ? #ApplicationModel) asSymbol
  6357             andSelector: specSelector ? #windowSpec
  6358             withResourceTypes: #(canvas).
  6359 
  6360     classAndSelector isNil ifTrue:[^ false].
  6361 
  6362     self clearModified.
  6363     self painter resetModification.
  6364 
  6365     specClass := classAndSelector methodClass.
  6366     specClassName := classAndSelector methodClass name.
  6367     specSelector := classAndSelector methodSelector.
  6368     specSuperclassName := specClass superclass name.
  6369     self doSave.
  6370     ^ true
  6371 !
  6372 
  6373 doSaveElementSpecAs
  6374     "opens a ResourceSelectionBrowser for saving a spec for the selected
  6375      elements on a class.
  6376      Useful to save parts for refactoring a spec into
  6377      subSpecifications, for example when putting parts into a tab"
  6378 
  6379     |spec fullSpec classAndSelector subSpecClass subSpecClassName subSpecSelector code|
  6380 
  6381     self askForSectionModification.
  6382 
  6383     (spec := self painter specForSelection) isNil ifTrue:[
  6384         self warn:('Select a single item first').
  6385         ^ false
  6386     ].
  6387 
  6388     classAndSelector := ResourceSelectionBrowser
  6389             request: 'Save Subspec in Class'
  6390             onSuperclass: #Object
  6391             andClass: specClassName
  6392             andSelector: #subSpec
  6393             withResourceTypes: #(canvas).
  6394 
  6395     classAndSelector isNil ifTrue:[^ false].
  6396 
  6397     self clearModified.
  6398     self painter resetModification.
  6399 
  6400     subSpecClass := classAndSelector methodClass.
  6401     subSpecClassName := classAndSelector methodClass name.
  6402     subSpecSelector := classAndSelector methodSelector.
  6403 
  6404     subSpecClass := self resolveName:subSpecClassName.
  6405     (subSpecClass notNil and:[ subSpecClass isClass ]) ifFalse:[
  6406         self warn:('Oops - cannot save - class not found: ' , subSpecClassName).
  6407         ^ false
  6408     ].
  6409 
  6410     spec := painter fullSpecFor:(painter singleSelection).
  6411 
  6412     fullSpec := treeView generateFullSpecForComponents:(Array with:spec) named:subSpecSelector asUppercaseFirst.
  6413     code := painter generateWindowSpecMethodSourceFor:fullSpec class:subSpecClassName selector:subSpecSelector.
  6414     Class packageQuerySignal answer:subSpecClass package do:[
  6415         (ReadStream on:code) fileIn.
  6416     ].
  6417     ^ true
  6418 
  6419     "Modified: / 28-01-2014 / 21:53:35 / cg"
  6420 !
  6421 
  6422 doSelectAspectMethod:aspectSelector
  6423     "open a dialog to select an existing aspect method and enter in the field"
  6424 
  6425     self doSelectAspectMethod:aspectSelector nameAs:aspectSelector
  6426 !
  6427 
  6428 doSelectAspectMethod:aspectSelector nameAs:aspectNameShown
  6429 "/    |cls spec aspect code|
  6430 "/
  6431 "/    cls := self specClass.
  6432 "/    cls isNil ifTrue:[
  6433 "/        Dialog information:'No Application Class defined.'.
  6434 "/        ^ self
  6435 "/    ].
  6436 "/
  6437 "/    spec := painter specForSelection.
  6438 "/    spec isNil ifTrue:[^ self].
  6439 "/    aspect := spec perform:aspectSelector.
  6440 "/    aspect isNil ifTrue:[
  6441 "/        Dialog information:(resources 
  6442 "/                                string:'Please enter a Method name for "%1" first.'
  6443 "/                                with:(resources string:aspectNameShown) allBold).
  6444 "/        ^ self
  6445 "/    ].
  6446 "/        
  6447 "/    (cls implements:aspect asSymbol) ifFalse:[
  6448 "/        (Dialog confirm:(resources 
  6449 "/                            stringWithCRs:'%1 does not implement %2.\\Create ?'
  6450 "/                            with:(cls name allBold)
  6451 "/                            with:aspect allBold)) 
  6452 "/        ifFalse:[
  6453 "/            (Dialog confirm:(resources 
  6454 "/                                stringWithCRs:'Browse implementors of %1 ?'
  6455 "/                                with:aspect allBold)) 
  6456 "/            ifTrue:[
  6457 "/                UserPreferences current systemBrowserClass browseImplementorsOf:aspect
  6458 "/            ].
  6459 "/            ^ self
  6460 "/        ].
  6461 "/        code := painter
  6462 "/            generateAspectMethodFor:aspect 
  6463 "/            spec:nil 
  6464 "/            inClass:cls.
  6465 "/        code readStream fileIn.
  6466 "/    ].
  6467 "/    UserPreferences current systemBrowserClass openInClass:cls selector:aspect
  6468 !
  6469 
  6470 doSortItems
  6471     "sort the selected items by position"
  6472 
  6473     treeView doSortItems
  6474 !
  6475 
  6476 doStartApplication
  6477     "starts the application on the editing window spec"
  6478 
  6479     |cls application|
  6480 
  6481     self hasSpecClassAndSelector ifFalse:[
  6482         self doSave isNil ifTrue: [^nil].
  6483     ] ifTrue: [
  6484         self askForSectionModification.    
  6485         (modified or: [self painter isModified or: [self helpTool modified]])
  6486         ifTrue:
  6487         [
  6488             ((YesNoBox title:'Window Spec was modified!!')        
  6489                 noText:'Cancel';
  6490                 yesText:'Save it and start';
  6491                 showAtPointer;
  6492                 accepted) ifFalse: [^nil].
  6493             self doSave isNil ifTrue: [^nil]
  6494         ]
  6495     ].
  6496 
  6497     cls := self resolveName:specClassName.
  6498     cls isNil ifTrue:[
  6499         self warn:'Oops cannot start application - no class:' , specClassName.
  6500         ^ nil
  6501     ].
  6502     application := cls new.
  6503     (application respondsTo:#openInterface:) ifFalse:[
  6504         (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)
  6505         ifTrue:[
  6506             SimpleDialog new openSpec:(cls perform:specSelector) withBindings:nil.
  6507         ].
  6508         ^ self.
  6509     ].        
  6510     application openInterface:specSelector
  6511 !
  6512 
  6513 doStepDown
  6514     "moves the selected widget(s) one step down in the hierarchy"
  6515 
  6516     treeView doStepOver:1
  6517 !
  6518 
  6519 doStepIn
  6520     "moves the selected widget into the next widget as child"
  6521 
  6522     treeView doStepIn
  6523 !
  6524 
  6525 doStepOut
  6526     "moves the selected widget out of the parent widget"
  6527 
  6528     treeView doStepOut
  6529 !
  6530 
  6531 doStepUp
  6532     "moves the selected widget(s) one step up in the hierarchy"
  6533 
  6534     treeView doStepOver:-1
  6535 !
  6536 
  6537 doWindowSpec
  6538     "opens a code view with the contents of the window spec"
  6539 
  6540     self askForSectionModification.
  6541 
  6542     CodeView 
  6543         openWith: self painter generateWindowSpecMethodSource 
  6544         title: 'Window Spec'
  6545 
  6546 ! !
  6547 
  6548 !UIPainter::ApplicationClassQuery class methodsFor:'documentation'!
  6549 
  6550 documentation
  6551     "This Query answers the application class, that is currently being edited"
  6552 ! !
  6553 
  6554 !UIPainter::TreeView class methodsFor:'documentation'!
  6555 
  6556 documentation
  6557 "
  6558     selection in tree view; only used by the UIPainter
  6559 
  6560     [see also:]
  6561         SelectionInTreeView
  6562         SelectionInTree
  6563         TreeItem
  6564         UIPainter
  6565 
  6566     [author:]
  6567         Claus Atzkern
  6568 "
  6569 
  6570 
  6571 ! !
  6572 
  6573 !UIPainter::TreeView methodsFor:'accessing'!
  6574 
  6575 canvas
  6576     "returns the canvas (UIPainterView)"
  6577 
  6578     ^ model root contents view
  6579 
  6580 
  6581 !
  6582 
  6583 canvas:aCanvas
  6584     "install canvas (UIPainterView)"
  6585 
  6586     self canvas:aCanvas specName:nil
  6587 !
  6588 
  6589 canvas:aCanvas specName:nameOfSpec
  6590     "install canvas (UIPainterView)"
  6591 
  6592     |props|
  6593 
  6594     props := UIPainterView::ViewProperty new.
  6595     props view:aCanvas.
  6596 
  6597     model root:(TreeItem 
  6598                     name:(nameOfSpec ? painter defaultNameOfCanvas) allBold 
  6599                     contents:props).
  6600 
  6601     model root expand.
  6602     self enableChannel:(aCanvas enableChannel).
  6603 !
  6604 
  6605 canvasSpec
  6606     "returns spec assigned to canvas"
  6607 
  6608     |spec list cls canvas|
  6609 
  6610     spec := self windowSpecClass new.
  6611     canvas := self canvas.
  6612 
  6613     spec fromView:(canvas topView) callBack:nil.
  6614 
  6615     windowSpec notNil ifTrue:[
  6616         spec copyValuesFromSpec:windowSpec.
  6617     ].
  6618 
  6619     spec exportedAspects isNil ifTrue:[
  6620         (     (cls  := canvas className) notNil
  6621          and:[(cls  := canvas resolveName:cls) notNil]
  6622         ) ifTrue:[
  6623             list := cls perform:#aspectSelectors ifNotUnderstood:nil.
  6624         ].
  6625         spec setExportedAspectsFrom:list.
  6626         windowSpec notNil ifTrue:[
  6627             windowSpec exportedAspects:(spec exportedAspects).
  6628         ]
  6629     ].
  6630 
  6631     self propertiesDo:[:aProp| 
  6632         |propsSpec|
  6633 
  6634         spec exportedAspectsAddKey:(aProp model) type:nil.
  6635         propsSpec := aProp spec.
  6636         propsSpec aspectSelectors 
  6637                 select:[:a | a isString or:[a isSymbol]] 
  6638                 thenDo:[:aKey|spec exportedAspectsAddKey:aKey type:nil].
  6639         propsSpec actionSelectors 
  6640                 select:[:a | a isString or:[a isSymbol]] 
  6641                 thenDo:[:aKey|spec exportedAspectsAddKey:aKey type:#action].
  6642     ].
  6643   ^ spec
  6644 !
  6645 
  6646 canvasSpec:aSpec
  6647     "update canvas from spec"
  6648 
  6649     |spec|
  6650 
  6651     self setAttributesFromWindowSpec:aSpec.
  6652     spec := aSpec copy.
  6653     spec  menu:nil.
  6654     spec flags:nil.
  6655 
  6656     spec setAttributesIn:(self canvas "topView") with:(UIBuilder new isEditing:true).
  6657 !
  6658 
  6659 exportedAspects
  6660     "returns spec assigned to canvas"
  6661 
  6662     windowSpec isNil ifTrue:[^ #()].
  6663     ^ windowSpec exportedAspects ? #()
  6664 
  6665 !
  6666 
  6667 itemOfView:aView
  6668     "returns item assigned to view or nil"
  6669 
  6670     aView notNil ifTrue:[
  6671         self allItemsDo:[:anItem|
  6672             (anItem contents view == aView) ifTrue:[^ anItem]
  6673         ]
  6674     ].
  6675     ^ nil
  6676 
  6677 
  6678 !
  6679