UIPainter.st
changeset 755 cfbbec0a33c6
parent 743 d58a3e7e39d5
child 765 27936ff059d3
equal deleted inserted replaced
754:04e802a6a920 755:cfbbec0a33c6
    44 
    44 
    45 !
    45 !
    46 
    46 
    47 documentation
    47 documentation
    48 "
    48 "
    49     GUI-Builder:
    49     The GUI Painter allows the user to build its own applications providing a graphical
    50     this class allows the user to build its own applications providing a graphical
    50     user interface to building components and to define the behavior of the components
    51     user interface to buildin components and to define the behavior of the components
       
    52     during runtime. The resulting specifications can be installed as methods on 
    51     during runtime. The resulting specifications can be installed as methods on 
    53     classes, typically subclasses of an ApplicationModel. These specifications
    52     classes, typically subclasses of an ApplicationModel. These specifications
    54     are used by the UIBuilder to generate the application window and its component
    53     are used by the UIBuilder to generate the application window and its component
    55     structues when open the application.
    54     structues when open the application.
    56 
    55 
   193 'Sets the width of the selected widgets to the width of the last copied layout/extent.'
   192 'Sets the width of the selected widgets to the width of the last copied layout/extent.'
   194 
   193 
   195 #editInspectSpec
   194 #editInspectSpec
   196 'Opens an inspector on the spec of the selected widget.'
   195 'Opens an inspector on the spec of the selected widget.'
   197 
   196 
       
   197 #editInspectView
       
   198 'Opens an inspector on the view of the selected widget.'
       
   199 
   198 #editOpenSpecDocumentation
   200 #editOpenSpecDocumentation
   199 'Opens the documentation of the selected widget.'
   201 'Opens the documentation of the selected widget.'
   200 
   202 
   201 #fileBrowseAspectMethods
   203 #fileBrowseAspectMethods
   202 'Opens a System Browser to browse the aspect methods.'
   204 'Opens a System Browser to browse the aspect methods.'
   225 #generateAspectMethods
   227 #generateAspectMethods
   226 'Generates aspect methods for defined aspect selectors of the widgets.'
   228 'Generates aspect methods for defined aspect selectors of the widgets.'
   227 
   229 
   228 #generateHookMethods
   230 #generateHookMethods
   229 'Generates startup/release methods. (#closeRequest, #postBuildWith:, #postOpenWith:)'
   231 'Generates startup/release methods. (#closeRequest, #postBuildWith:, #postOpenWith:)'
       
   232 
       
   233 #helpExamples
       
   234 'Opens a HTML-Browser on the documentation file with some examples of the GUI Painter.'
       
   235 
       
   236 #helpFunctions
       
   237 'Opens a HTML-Browser on the documentation file with the functions of the GUI Painter.'
       
   238 
       
   239 #helpLayoutTool
       
   240 'Opens a HTML-Browser on the documentation file of the Layout Tool.'
       
   241 
       
   242 #helpSelectedWidget
       
   243 'Opens a HTML-Browser on the documentation file of the selected widget.'
   230 
   244 
   231 #moveWidgetDown
   245 #moveWidgetDown
   232 'Moves the selected widget one step down.'
   246 'Moves the selected widget one step down.'
   233 
   247 
   234 #moveWidgetInto
   248 #moveWidgetInto
   588                           )
   602                           )
   589                            #(#CheckBoxSpec
   603                            #(#CheckBoxSpec
   590                               #name: 'AlignCheckBox'
   604                               #name: 'AlignCheckBox'
   591                               #layout: #(#Point 23 52)
   605                               #layout: #(#Point 23 52)
   592                               #model: #alignToGrid
   606                               #model: #alignToGrid
   593                               #label: 'Align to Grid'
   607                               #label: 'Align To Grid'
   594                           )
   608                           )
   595                            #(#LabelSpec
   609                            #(#LabelSpec
   596                               #name: 'HorizontalPixelsLabel'
   610                               #name: 'HorizontalPixelsLabel'
   597                               #layout: #(#AlignmentOrigin 148 0 99 0 1 0.5)
   611                               #layout: #(#AlignmentOrigin 148 0 99 0 1 0.5)
   598                               #label: 'Horizontal Pixels:'
   612                               #label: 'Horizontal Pixels:'
   653      
   667      
   654        #(#FullSpec
   668        #(#FullSpec
   655           #window: 
   669           #window: 
   656            #(#WindowSpec
   670            #(#WindowSpec
   657               #name: 'GUI Painter'
   671               #name: 'GUI Painter'
   658               #layout: #(#LayoutFrame 50 0 310 0 579 0 796 0)
   672               #layout: #(#LayoutFrame 123 0 269 0 662 0 743 0)
   659               #label: 'GUI Painter'
   673               #label: 'GUI Painter'
   660               #min: #(#Point 10 10)
   674               #min: #(#Point 540 490)
   661               #max: #(#Point 1160 870)
   675               #max: #(#Point 1160 870)
   662               #bounds: #(#Rectangle 50 310 580 797)
   676               #bounds: #(#Rectangle 123 269 663 744)
   663               #menu: #menu
   677               #menu: #menu
   664               #usePreferredExtent: false
   678               #usePreferredExtent: false
   665           )
   679           )
   666           #component: 
   680           #component: 
   667            #(#SpecCollection
   681            #(#SpecCollection
   764                                         #verticalLayout: #fit
   778                                         #verticalLayout: #fit
   765                                         #horizontalSpace: 0
   779                                         #horizontalSpace: 0
   766                                         #verticalSpace: 0
   780                                         #verticalSpace: 0
   767                                     )
   781                                     )
   768                                      #(#ActionButtonSpec
   782                                      #(#ActionButtonSpec
   769                                         #name: 'openSpecDocumentationButton'
   783                                         #name: 'openWidgetDocumentationButton'
   770                                         #layout: #(#LayoutFrame -32 1 -1 0 0 1 31 0)
   784                                         #layout: #(#LayoutFrame -32 1 -1 0 0 1 31 0)
   771                                         #activeHelpKey: #editOpenSpecDocumentation
   785                                         #activeHelpKey: #editOpenSpecDocumentation
   772                                         #hasCharacterOrientedLabel: false
   786                                         #hasCharacterOrientedLabel: false
   773                                         #label: 'helpIcon'
   787                                         #label: 'helpIcon'
   774                                         #model: #openSpecDocumentation
   788                                         #model: #openWidgetDocumentation
   775                                     )
   789                                     )
   776                                      #(#ActionButtonSpec
   790                                      #(#ActionButtonSpec
   777                                         #name: 'cancelButton'
   791                                         #name: 'cancelButton'
   778                                         #layout: #(#LayoutFrame 2 0 -26 1 -1 0.5 -2 1)
   792                                         #layout: #(#LayoutFrame 2 0 -26 1 -1 0.5 -2 1)
   779                                         #activeHelpKey: #cancel
   793                                         #activeHelpKey: #commitCancel
   780                                         #label: 'Cancel'
   794                                         #label: 'Cancel'
   781                                         #tabable: true
   795                                         #tabable: true
   782                                         #model: #cancel
   796                                         #model: #cancel
   783                                         #enableChannel: #modifiedChannel
   797                                         #enableChannel: #modifiedChannel
   784                                     )
   798                                     )
   785                                      #(#ActionButtonSpec
   799                                      #(#ActionButtonSpec
   786                                         #name: 'acceptButton'
   800                                         #name: 'acceptButton'
   787                                         #layout: #(#LayoutFrame 1 0.5 -26 1 -2 1 -2 1)
   801                                         #layout: #(#LayoutFrame 1 0.5 -26 1 -2 1 -2 1)
   788                                         #activeHelpKey: #accept
   802                                         #activeHelpKey: #commitOK
   789                                         #label: 'OK'
   803                                         #label: 'OK'
   790                                         #tabable: true
   804                                         #tabable: true
   791                                         #model: #accept
   805                                         #model: #accept
   792                                         #enableChannel: #modifiedChannel
   806                                         #enableChannel: #modifiedChannel
   793                                     )
   807                                     )
   813 
   827 
   814 windowSpecWithTranscriptHelp
   828 windowSpecWithTranscriptHelp
   815     "This resource specification was automatically generated
   829     "This resource specification was automatically generated
   816      by the UIPainter of ST/X."
   830      by the UIPainter of ST/X."
   817 
   831 
   818     "Do not manually edit this. If it is corrupted,
   832     "Do not manually edit this!! If it is corrupted,
   819      the UIPainter may not be able to read the specification."
   833      the UIPainter may not be able to read the specification."
   820 
   834 
   821     "
   835     "
   822      UIPainter new openOnClass:UIPainter andSelector:#windowSpecWithTranscriptHelp
   836      UIPainter new openOnClass:UIPainter andSelector:#windowSpecWithTranscriptHelp
   823      UIPainter new openInterface:#windowSpecWithTranscriptHelp
   837      UIPainter new openInterface:#windowSpecWithTranscriptHelp
   829      
   843      
   830        #(#FullSpec
   844        #(#FullSpec
   831           #window: 
   845           #window: 
   832            #(#WindowSpec
   846            #(#WindowSpec
   833               #name: 'GUI Painter'
   847               #name: 'GUI Painter'
   834               #layout: #(#LayoutFrame 575 0 296 0 1127 0 833 0)
   848               #layout: #(#LayoutFrame 177 0 249 0 716 0 723 0)
   835               #label: 'GUI Painter'
   849               #label: 'GUI Painter'
   836               #min: #(#Point 10 10)
   850               #min: #(#Point 10 10)
   837               #max: #(#Point 1160 870)
   851               #max: #(#Point 1160 870)
   838               #bounds: #(#Rectangle 575 296 1128 834)
   852               #bounds: #(#Rectangle 177 249 717 724)
   839               #menu: #menu
   853               #menu: #menu
   840               #usePreferredExtent: false
   854               #usePreferredExtent: false
   841           )
   855           )
   842           #component: 
   856           #component: 
   843            #(#SpecCollection
   857            #(#SpecCollection
   959                                                             #activeHelpKey: #cancel
   973                                                             #activeHelpKey: #cancel
   960                                                             #label: 'Cancel'
   974                                                             #label: 'Cancel'
   961                                                             #tabable: true
   975                                                             #tabable: true
   962                                                             #model: #cancel
   976                                                             #model: #cancel
   963                                                             #enableChannel: #modifiedChannel
   977                                                             #enableChannel: #modifiedChannel
   964                                                             #extent: #(#Point 183 24)
   978                                                             #extent: #(#Point 178 24)
   965                                                         )
   979                                                         )
   966                                                          #(#ActionButtonSpec
   980                                                          #(#ActionButtonSpec
   967                                                             #name: 'acceptButton'
   981                                                             #name: 'acceptButton'
   968                                                             #activeHelpKey: #accept
   982                                                             #activeHelpKey: #accept
   969                                                             #label: 'OK'
   983                                                             #label: 'OK'
   970                                                             #tabable: true
   984                                                             #tabable: true
   971                                                             #model: #accept
   985                                                             #model: #accept
   972                                                             #enableChannel: #modifiedChannel
   986                                                             #enableChannel: #modifiedChannel
   973                                                             #extent: #(#Point 183 24)
   987                                                             #extent: #(#Point 179 24)
   974                                                         )
   988                                                         )
   975                                                       )
   989                                                       )
   976                                                   )
   990                                                   )
   977                                                   #horizontalLayout: #fitSpace
   991                                                   #horizontalLayout: #fitSpace
   978                                                   #verticalLayout: #fitSpace
   992                                                   #verticalLayout: #fitSpace
  1075                           #value: #doSaveAs
  1089                           #value: #doSaveAs
  1076                           #activeHelpKey: #fileSaveAs
  1090                           #activeHelpKey: #fileSaveAs
  1077                       )
  1091                       )
  1078                        #(#MenuItem
  1092                        #(#MenuItem
  1079                           #label: 'Define Class And Selector...'
  1093                           #label: 'Define Class And Selector...'
  1080                           #value: #defineClassAndSelector
  1094                           #value: #doDefineClassAndSelector
  1081                           #activeHelpKey: #fileSaveAs
  1095                           #activeHelpKey: #fileSaveAs
  1082                       )
  1096                       )
  1083                        #(#MenuItem
  1097                        #(#MenuItem
  1084                           #label: '-'
  1098                           #label: '-'
  1085                       )
  1099                       )
  1218                       )
  1232                       )
  1219                        #(#MenuItem
  1233                        #(#MenuItem
  1220                           #label: 'Undo Manager...'
  1234                           #label: 'Undo Manager...'
  1221                           #value: #openUndoMenu
  1235                           #value: #openUndoMenu
  1222                           #activeHelpKey: #settingsUndoManager
  1236                           #activeHelpKey: #settingsUndoManager
       
  1237                           #enabled: #hasUndoHistory
  1223                       )
  1238                       )
  1224                        #(#MenuItem
  1239                        #(#MenuItem
  1225                           #label: 'Grid Manager...'
  1240                           #label: 'Grid Manager...'
  1226                           #value: #gridMenu
  1241                           #value: #doDefineGrid
  1227                           #activeHelpKey: #settingsGridManager
  1242                           #activeHelpKey: #settingsGridManager
  1228                       )
  1243                       )
  1229                     ) nil
  1244                     ) nil
  1230                     nil
  1245                     nil
  1231                 )
  1246                 )
  1241                  #(#Menu
  1256                  #(#Menu
  1242                     
  1257                     
  1243                      #(
  1258                      #(
  1244                        #(#MenuItem
  1259                        #(#MenuItem
  1245                           #label: 'Tutorial'
  1260                           #label: 'Tutorial'
  1246                           #translateLabel: true
       
  1247                           #value: #openHTMLDocument:
  1261                           #value: #openHTMLDocument:
  1248                           #activeHelpKey: #helpTutorial
  1262                           #activeHelpKey: #helpTutorial
  1249                           #argument: 'tools/uipainter/TOP.html'
  1263                           #argument: 'tools/uipainter/TOP.html'
  1250                       )
  1264                       )
  1251                        #(#MenuItem
  1265                        #(#MenuItem
  1252                           #label: '-'
  1266                           #label: '-'
  1253                       )
  1267                       )
  1254                        #(#MenuItem
  1268                        #(#MenuItem
  1255                           #label: 'Functions'
  1269                           #label: 'Functions'
  1256                           #translateLabel: true
       
  1257                           #value: #openHTMLDocument:
  1270                           #value: #openHTMLDocument:
  1258                           #activeHelpKey: #helpTutorial
  1271                           #activeHelpKey: #helpFunctions
  1259                           #argument: 'tools/uipainter/Functions.html'
  1272                           #argument: 'tools/uipainter/Functions.html'
  1260                       )
  1273                       )
  1261                        #(#MenuItem
  1274                        #(#MenuItem
  1262                           #label: 'Examples'
  1275                           #label: 'Examples'
  1263                           #translateLabel: true
       
  1264                           #value: #openHTMLDocument:
  1276                           #value: #openHTMLDocument:
  1265                           #activeHelpKey: #helpTutorial
  1277                           #activeHelpKey: #helpExamples
  1266                           #argument: 'tools/uipainter/Examples.html'
  1278                           #argument: 'tools/uipainter/Examples.html'
  1267                       )
  1279                       )
  1268                        #(#MenuItem
  1280                        #(#MenuItem
  1269                           #label: '-'
  1281                           #label: '-'
  1270                       )
  1282                       )
  1271                        #(#MenuItem
  1283                        #(#MenuItem
       
  1284                           #label: 'Help Tool'
       
  1285                           #value: #openHTMLDocument:
       
  1286                           #activeHelpKey: #helpHelpTool
       
  1287                           #argument: 'tools/uipainter/HelpTool.html'
       
  1288                       )
       
  1289                        #(#MenuItem
       
  1290                           #label: 'Layout Tool'
       
  1291                           #value: #openHTMLDocument:
       
  1292                           #activeHelpKey: #helpLayoutTool
       
  1293                           #argument: 'tools/uipainter/Layout.html'
       
  1294                       )
       
  1295                        #(#MenuItem
       
  1296                           #label: '-'
       
  1297                       )
       
  1298                        #(#MenuItem
       
  1299                           #label: 'Selected Widget'
       
  1300                           #value: #openWidgetDocumentation
       
  1301                           #activeHelpKey: #helpSelectedWidget
       
  1302                           #enabled: #hasOneSelectionOtherThanCanvas
       
  1303                       )
       
  1304                        #(#MenuItem
       
  1305                           #label: '-'
       
  1306                       )
       
  1307                        #(#MenuItem
  1272                           #label: 'Show Help Texts'
  1308                           #label: 'Show Help Texts'
  1273                           #translateLabel: true
       
  1274                           #activeHelpKey: #helpShowHelp
  1309                           #activeHelpKey: #helpShowHelp
  1275                           #indication: #showHelp:
  1310                           #indication: #showHelp:
  1276                       )
  1311                       )
  1277                     ) nil
  1312                     ) nil
  1278                     nil
  1313                     nil
  1396 
  1431 
  1397 menuEdit
  1432 menuEdit
  1398     "This resource specification was automatically generated
  1433     "This resource specification was automatically generated
  1399      by the MenuEditor of ST/X."
  1434      by the MenuEditor of ST/X."
  1400 
  1435 
  1401     "Do not manually edit this. If it is corrupted,
  1436     "Do not manually edit this!! If it is corrupted,
  1402      the MenuEditor may not be able to read the specification."
  1437      the MenuEditor may not be able to read the specification."
  1403 
  1438 
  1404     "
  1439     "
  1405      MenuEditor new openOnClass:UIPainter andSelector:#menuEdit
  1440      MenuEditor new openOnClass:UIPainter andSelector:#menuEdit
  1406      (Menu new fromLiteralArrayEncoding:(UIPainter menuEdit)) startUp
  1441      (Menu new fromLiteralArrayEncoding:(UIPainter menuEdit)) startUp
  1464              #(#MenuItem
  1499              #(#MenuItem
  1465                 #label: '-'
  1500                 #label: '-'
  1466             )
  1501             )
  1467              #(#MenuItem
  1502              #(#MenuItem
  1468                 #label: 'Move'
  1503                 #label: 'Move'
       
  1504                 #enabled: #canMoveSelection
  1469                 #submenuChannel: #menuMove
  1505                 #submenuChannel: #menuMove
  1470             )
  1506             )
  1471              #(#MenuItem
  1507              #(#MenuItem
  1472                 #label: 'Dimension'
  1508                 #label: 'Dimension'
  1473                 #enabled: #hasSelection
  1509                 #enabled: #hasSelection
  1541             )
  1577             )
  1542              #(#MenuItem
  1578              #(#MenuItem
  1543                 #label: '-'
  1579                 #label: '-'
  1544             )
  1580             )
  1545              #(#MenuItem
  1581              #(#MenuItem
  1546                 #label: 'Open Spec Documentation'
  1582                 #label: 'Open Widget Documentation'
  1547                 #value: #openSpecDocumentation
  1583                 #value: #openWidgetDocumentation
  1548                 #activeHelpKey: #editOpenSpecDocumentation
  1584                 #activeHelpKey: #editOpenSpecDocumentation
       
  1585             )
       
  1586              #(#MenuItem
       
  1587                 #label: '-'
       
  1588             )
       
  1589              #(#MenuItem
       
  1590                 #label: 'Inspect View'
       
  1591                 #value: #inspectView
       
  1592                 #activeHelpKey: #editInspectView
       
  1593                 #enabled: #hasOneSelectionOtherThanCanvas
  1549             )
  1594             )
  1550              #(#MenuItem
  1595              #(#MenuItem
  1551                 #label: 'Inspect Spec'
  1596                 #label: 'Inspect Spec'
  1552                 #value: #inspectSpec
  1597                 #value: #inspectSpec
  1553                 #activeHelpKey: #editInspectSpec
  1598                 #activeHelpKey: #editInspectSpec
  1559 
  1604 
  1560 menuMove
  1605 menuMove
  1561     "This resource specification was automatically generated
  1606     "This resource specification was automatically generated
  1562      by the MenuEditor of ST/X."
  1607      by the MenuEditor of ST/X."
  1563 
  1608 
  1564     "Do not manually edit this. If it is corrupted,
  1609     "Do not manually edit this!! If it is corrupted,
  1565      the MenuEditor may not be able to read the specification."
  1610      the MenuEditor may not be able to read the specification."
  1566 
  1611 
  1567     "
  1612     "
  1568      MenuEditor new openOnClass:UIPainter andSelector:#menuMove
  1613      MenuEditor new openOnClass:UIPainter andSelector:#menuMove
  1569      (Menu new fromLiteralArrayEncoding:(UIPainter menuMove)) startUp
  1614      (Menu new fromLiteralArrayEncoding:(UIPainter menuMove)) startUp
  1578            #(
  1623            #(
  1579              #(#MenuItem
  1624              #(#MenuItem
  1580                 #label: 'Up'
  1625                 #label: 'Up'
  1581                 #value: #doStepUp
  1626                 #value: #doStepUp
  1582                 #activeHelpKey: #moveWidgetUp
  1627                 #activeHelpKey: #moveWidgetUp
  1583                 #enabled: #canMoveOrAlignSelection
  1628                 #enabled: #canChangeOrderInContainer
  1584                 #labelImage: #(#ResourceRetriever #ToolApplicationModel #upIcon 'Up')
  1629                 #labelImage: #(#ResourceRetriever #ToolApplicationModel #upIcon 'Up')
  1585             )
  1630             )
  1586              #(#MenuItem
  1631              #(#MenuItem
  1587                 #label: 'Down'
  1632                 #label: 'Down'
  1588                 #value: #doStepDown
  1633                 #value: #doStepDown
  1589                 #activeHelpKey: #moveWidgetDown
  1634                 #activeHelpKey: #moveWidgetDown
  1590                 #enabled: #canMoveOrAlignSelection
  1635                 #enabled: #canChangeOrderInContainer
  1591                 #labelImage: #(#ResourceRetriever #ToolApplicationModel #downIcon 'Down')
  1636                 #labelImage: #(#ResourceRetriever #ToolApplicationModel #downIcon 'Down')
  1592             )
  1637             )
  1593              #(#MenuItem
  1638              #(#MenuItem
  1594                 #label: 'Into'
  1639                 #label: 'Into'
  1595                 #value: #doStepIn
  1640                 #value: #doStepIn
  1835 
  1880 
  1836 
  1881 
  1837 !
  1882 !
  1838 
  1883 
  1839 transcriptHelp
  1884 transcriptHelp
  1840     "get whether the help transcript is turned on/off
  1885     "answer whether the help transcript is turned on/off
  1841     "
  1886     "
  1842     ^self class settings at: #transcriptHelp 
  1887     ^self class settings at: #TranscriptHelp 
  1843         ifAbsent: [self class settings at: #transcriptHelp put: false]
  1888         ifAbsent: [self class settings at: #TranscriptHelp put: false]
  1844 !
  1889 !
  1845 
  1890 
  1846 transcriptHelp:aBoolean
  1891 transcriptHelp:aBoolean
  1847     "turn on/off the help transcript
  1892     "turn on/off the help transcript
  1848     "
  1893     "
  1849     self class settings at: #transcriptHelp put: aBoolean
  1894     self class settings at: #TranscriptHelp put: aBoolean
  1850 
  1895 
  1851 ! !
  1896 ! !
  1852 
  1897 
  1853 !UIPainter methodsFor:'actions'!
  1898 !UIPainter methodsFor:'actions'!
  1854 
  1899 
  1932     self isModified ifTrue:[
  1977     self isModified ifTrue:[
  1933         (spec := self painter specForSelection) notNil ifTrue:[
  1978         (spec := self painter specForSelection) notNil ifTrue:[
  1934             key := spec activeHelpKey.
  1979             key := spec activeHelpKey.
  1935         ].
  1980         ].
  1936         self helpTool helpKey:key.
  1981         self helpTool helpKey:key.
       
  1982 
       
  1983         treeView isCanvasSelected ifTrue: [
       
  1984             spec := treeView canvasSpec.
       
  1985         ].
  1937         self specTool specification:spec.
  1986         self specTool specification:spec.
  1938         view := self layoutTool layoutView.
  1987         view := self layoutTool layoutView.
  1939 
  1988 
  1940         self setViewInLayoutTool:view.
  1989         self setViewInLayoutTool:view.
  1941         spec class == DataSetSpec ifTrue:[
  1990         spec class == DataSetSpec ifTrue:[
  1949 inspectSpec
  1998 inspectSpec
  1950     "inspect the selected specification"
  1999     "inspect the selected specification"
  1951 
  2000 
  1952     |spec|
  2001     |spec|
  1953 
  2002 
  1954     (spec := self painter specForSelection) isNil ifTrue:[
  2003     (spec := self specForSelection) isNil ifTrue:[
  1955         treeView isCanvasSelected ifTrue:[
  2004         treeView isCanvasSelected ifTrue:[
  1956             spec := treeView canvasSpec.
  2005             spec := treeView canvasSpec.
  1957         ]
  2006         ]
  1958     ].
  2007     ].
  1959     spec notNil ifTrue:[
  2008     spec notNil ifTrue:[
  1960         spec inspect
  2009         spec inspect
  1961     ]
  2010     ]
  1962 
  2011 
  1963     "Created: / 10.3.1998 / 18:11:42 / stefan"
  2012 
  1964     "Modified: / 10.3.1998 / 18:19:55 / stefan"
  2013 !
       
  2014 
       
  2015 inspectView
       
  2016     "inspect the view of the selected specification"
       
  2017 
       
  2018     |selection view|
       
  2019 
       
  2020     ((selection := self painter selection) isCollection and: [selection size >= 1]) ifTrue:[
       
  2021         selection first inspect
       
  2022     ] ifFalse: [
       
  2023         selection inspect
       
  2024     ]
       
  2025 
  1965 !
  2026 !
  1966 
  2027 
  1967 moveSelectionDown
  2028 moveSelectionDown
  1968     "move selected components down
  2029     "move selected components down
  1969     "
  2030     "
  1989     "
  2050     "
  1990     self painter moveSelectionUp
  2051     self painter moveSelectionUp
  1991 
  2052 
  1992 !
  2053 !
  1993 
  2054 
  1994 openSpecDocumentation
  2055 openWidgetDocumentation
  1995     "open documentation for the selected specification"
  2056     "open documentation for the selected widget"
  1996 
  2057 
  1997     |spec|
  2058     |spec document|
  1998 
  2059 
  1999     (spec := self painter specForSelection) isNil ifTrue:[
  2060     (spec := self specForSelection) isNil ifTrue:[
  2000         treeView isCanvasSelected ifTrue:[
  2061         treeView isCanvasSelected ifTrue:[
  2001             spec := treeView canvasSpec.
  2062             spec := nil
  2002         ]
  2063         ]
  2003     ].
  2064     ].
  2004     spec notNil ifTrue:[
  2065     spec notNil ifTrue:[
  2005         HTMLDocumentView openFullOnDocumentationFile: 'tools/uipainter/', spec userFriendlyName,'.html'
  2066         document := 'tools/uipainter/Widgets/', spec userFriendlyName,'.html'
  2006     ]
  2067     ] ifFalse: [
       
  2068         document := 'tools/uipainter/TOP.html#THEWIDGETSANDHOWDOTHEYWORK'
       
  2069     ].
       
  2070     HTMLDocumentView openFullOnDocumentationFile: document 
       
  2071 
       
  2072 
  2007 ! !
  2073 ! !
  2008 
  2074 
  2009 !UIPainter methodsFor:'aspects'!
  2075 !UIPainter methodsFor:'aspects'!
  2010 
  2076 
  2011 aspectFor:aKey
  2077 aspectFor:aKey
  2024     "returns a boolean value holder which is true in case that any selection exists
  2090     "returns a boolean value holder which is true in case that any selection exists
  2025      and all widgets in the selection can change its layout through to a move or
  2091      and all widgets in the selection can change its layout through to a move or
  2026      align operation
  2092      align operation
  2027     "
  2093     "
  2028     ^ builder booleanValueAspectFor:#canMoveOrAlignSelection
  2094     ^ builder booleanValueAspectFor:#canMoveOrAlignSelection
       
  2095 !
       
  2096 
       
  2097 canMoveSelection
       
  2098 
       
  2099     ^self canChangeOrderInContainer value | 
       
  2100      self canMoveSelectionOutOfContainer value |
       
  2101      self canMoveSelectionOutOfContainer value
  2029 !
  2102 !
  2030 
  2103 
  2031 canMoveSelectionIntoContainer
  2104 canMoveSelectionIntoContainer
  2032     "returns a boolean value holder which is true in case that one component is selected
  2105     "returns a boolean value holder which is true in case that one component is selected
  2033      and can change its container widget to the next element in the list which will have
  2106      and can change its container widget to the next element in the list which will have
  2083 
  2156 
  2084     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  2157     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  2085         noteBook   := View new.
  2158         noteBook   := View new.
  2086         layoutTool := UILayoutTool new.
  2159         layoutTool := UILayoutTool new.
  2087         helpTool   := UIHelpTool   new.
  2160         helpTool   := UIHelpTool   new.
  2088         helpTool helpSpecFrom:specClass.
  2161         helpTool buildFromClass:specClass.
  2089         specTool   := UISpecificationTool new.
  2162         specTool   := UISpecificationTool new.
  2090         channel    := self modifiedChannel.
  2163         channel    := self modifiedChannel.
  2091 
  2164 
  2092         layoutTool masterApplication:self.
  2165         layoutTool masterApplication:self.
  2093         specTool   masterApplication:self.
  2166         specTool   masterApplication:self.
  2131     "returns a value holder which keeps a list of labels assigned to the tabs
  2204     "returns a value holder which keeps a list of labels assigned to the tabs
  2132     "
  2205     "
  2133     |holder|
  2206     |holder|
  2134 
  2207 
  2135     (holder := builder bindingAt:#tabList) isNil ifTrue:[
  2208     (holder := builder bindingAt:#tabList) isNil ifTrue:[
  2136         builder aspectAt:#tabList put:(holder :=  ValueHolder new).
  2209         builder aspectAt:#tabList put:(holder :=  #(Basics Details Layout) asValue).
  2137         holder value:#( 'Properties' ).
       
  2138     ].
  2210     ].
  2139     ^ holder
  2211     ^ holder
  2140 !
  2212 !
  2141 
  2213 
  2142 tabModel
  2214 tabModel
  2545         self painter resetModification
  2617         self painter resetModification
  2546     ].
  2618     ].
  2547     ^true
  2619     ^true
  2548 !
  2620 !
  2549 
  2621 
  2550 defineClassAndSelector
       
  2551     "launch a dialog to define class, superclass and method"
       
  2552 
       
  2553     |again tmp|
       
  2554 
       
  2555     [
       
  2556         again := false.
       
  2557 
       
  2558         (tmp := specClass) isNil ifTrue:[tmp := 'NewApplication'].
       
  2559         aspects at:#classNameChannel put:tmp asValue.
       
  2560 
       
  2561         (tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec'].
       
  2562         aspects at:#methodNameChannel put:tmp asValue.
       
  2563 
       
  2564         (tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel'].
       
  2565         aspects at:#superclassNameChannel put:tmp asValue.
       
  2566 
       
  2567         (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[
       
  2568 
       
  2569             specClass    := (self aspectFor:#classNameChannel) value.
       
  2570             specSelector := (self aspectFor:#methodNameChannel) value.
       
  2571             specSelector notNil ifTrue:[specSelector := specSelector asSymbol].
       
  2572             specSuperclass := (self aspectFor:#superclassNameChannel) value.
       
  2573 
       
  2574             (again := self checkClassAndSelector not) ifFalse:[
       
  2575                 self painter className:specClass
       
  2576                         superclassName:specSuperclass
       
  2577                               selector:specSelector.
       
  2578             ]
       
  2579         ]
       
  2580         ifFalse:
       
  2581         [
       
  2582             ^nil
       
  2583         ]
       
  2584 
       
  2585     ] doWhile:[again].
       
  2586 
       
  2587     self specClass:specClass.
       
  2588     self helpTool modified: true
       
  2589 !
       
  2590 
       
  2591 gridMenu
       
  2592     "open a dialog for grip parameters configuration
       
  2593     "
       
  2594     |hspace vspace bindings painter gridPara|
       
  2595 
       
  2596     painter  := self painter.
       
  2597     bindings := IdentityDictionary new.
       
  2598     gridPara := painter gridParameters copy.
       
  2599 
       
  2600     bindings at:#showGrid    put:(painter gridShown asValue).
       
  2601     bindings at:#alignToGrid put:(painter gridAlign asValue).
       
  2602     bindings at:#hspace      put:((gridPara at:1) asValue).
       
  2603     bindings at:#vspace      put:((gridPara at:2) asValue).
       
  2604 
       
  2605     (self openDialogInterface:#dialogSpecForDefiningGridParameters withBindings:bindings) ifFalse:[
       
  2606         ^ self
       
  2607     ].
       
  2608 
       
  2609     hspace := (bindings at:#hspace) value ? 5.
       
  2610     vspace := (bindings at:#vspace) value ? 5.
       
  2611 
       
  2612     gridPara at:1 put:hspace.
       
  2613     gridPara at:2 put:vspace.
       
  2614     gridPara at:5 put:hspace.
       
  2615     gridPara at:6 put:vspace.
       
  2616 
       
  2617     painter gridShown:false.
       
  2618     painter gridAlign:false.
       
  2619     painter gridParameters:gridPara.
       
  2620     painter gridAlign:(bindings at:#alignToGrid) value.
       
  2621     painter gridShown:(bindings at:#showGrid) value.
       
  2622     painter clear.
       
  2623     painter clear.
       
  2624 
       
  2625 !
       
  2626 
       
  2627 hideUIView:aView
  2622 hideUIView:aView
  2628     "hide the view which is an application or top view
  2623     "hide the view which is an application or top view
  2629     "
  2624     "
  2630     aView beIndependent.
  2625     aView beIndependent.
  2631     aView unmap.
  2626     aView unmap.
  2661         msg := aString asCollectionOfWords.
  2656         msg := aString asCollectionOfWords.
  2662         (msg size == 2 and:
  2657         (msg size == 2 and:
  2663         [(cls := self resolveName:(msg at:1)) notNil])
  2658         [(cls := self resolveName:(msg at:1)) notNil])
  2664         ifTrue:
  2659         ifTrue:
  2665         [
  2660         [
  2666             specClass := cls name.
  2661             self specClass:cls.
  2667             specSuperclass := cls superclass name.
  2662             specSuperclass := cls superclass name.
  2668             specSelector := (msg at: 2) asSymbol.
  2663             specSelector := (msg at: 2) asSymbol.
  2669             ^true
  2664             ^true
  2670         ]
  2665         ]
  2671     ].
  2666     ].
  2716 
  2711 
  2717 specClass:aClass
  2712 specClass:aClass
  2718 
  2713 
  2719     specClass := aClass isBehavior ifTrue:[aClass name]
  2714     specClass := aClass isBehavior ifTrue:[aClass name]
  2720                                    ifFalse:[aClass].
  2715                                    ifFalse:[aClass].
  2721     self helpTool helpSpecFrom:specClass.
  2716 
  2722 
  2717     self helpTool buildFromClass:specClass.    
  2723     "Modified: / 5.2.1998 / 09:42:57 / stefan"
  2718     self helpTool updateList.
       
  2719     self modifiedChannel value: false. 
       
  2720 
  2724 ! !
  2721 ! !
  2725 
  2722 
  2726 !UIPainter methodsFor:'private tools'!
  2723 !UIPainter methodsFor:'private tools'!
  2727 
  2724 
  2728 helpTool
  2725 helpTool
  2876         self helpTool helpKey:(spec activeHelpKey).
  2873         self helpTool helpKey:(spec activeHelpKey).
  2877         slices := spec class slices.
  2874         slices := spec class slices.
  2878         size   := slices size.
  2875         size   := slices size.
  2879 
  2876 
  2880         view notNil ifTrue:[
  2877         view notNil ifTrue:[
  2881             list := Array new:(size + 2).
  2878             self treeView isCanvasSelected 
  2882             list at:(size + 2) put:(UILayoutTool label).
  2879             ifFalse:
       
  2880             [
       
  2881                 list := Array new:(size + 2).
       
  2882                 list at:(size + 2) put:(UILayoutTool label).
       
  2883             ]
       
  2884             ifTrue:
       
  2885             [
       
  2886                 list := Array new:(size + 1).
       
  2887                 list at:(size + 1) put:(UILayoutTool label).
       
  2888             ].
  2883         ] ifFalse:[
  2889         ] ifFalse:[
  2884             list := Array new:(size + 1).
  2890             list := Array new:(size + 1).
  2885         ].
  2891         ].
       
  2892 
  2886         1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
  2893         1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
  2887         list at:(size + 1) put:(UIHelpTool   label).
  2894         self treeView isCanvasSelected ifFalse: [list at:(size + 1) put:(UIHelpTool label)].
  2888 
  2895 
  2889         self tabList value:list.
  2896         self tabList value:list.
  2890         self show:(spec class name).
  2897         self show:(spec class name).
  2891         tabComponent enabled:true.
  2898         tabComponent enabled:true.
  2892 
  2899 
  2908         clipboard := self getSelection.
  2915         clipboard := self getSelection.
  2909 
  2916 
  2910         clipboard isCollection ifTrue:[clipboard notEmpty ifTrue:[sel := clipboard first]]
  2917         clipboard isCollection ifTrue:[clipboard notEmpty ifTrue:[sel := clipboard first]]
  2911                               ifFalse:[sel := clipboard].
  2918                               ifFalse:[sel := clipboard].
  2912 
  2919 
  2913         canPaste := (sel isKindOf:UISpecification) and:
  2920         canPaste := (sel isKindOf:UISpecification) and: 
  2914                     [treeView selection size  = 1 
  2921                     [treeView selection size  = 1 
  2915                     and:[treeView selection first == 1 
  2922                     and:[treeView selection first == 1 
  2916                     or: [self canPasteInto: treeView selectedNode contents view]]]
  2923                     or: [self canPasteInto: treeView selectedNode contents view]]]
  2917     ].
  2924     ].
  2918 
  2925 
  2919     self valueOfCanCut value: canCutOrCopy.
  2926     self valueOfCanCut value: canCutOrCopy.
  2920     self valueOfCanCopy value: canCutOrCopy.
  2927     self valueOfCanCopy value: canCutOrCopy.
  2921     self valueOfCanPaste value: canPaste.             
  2928     self valueOfCanPaste value: canPaste.            
  2922     self valueOfCanPasteWithKeepingLayout value: (canPaste &  self canKeepLayoutInSelection).
  2929     self valueOfCanPasteWithKeepingLayout value: (canPaste &  self canKeepLayoutInSelection).
  2923 
  2930 
  2924 
  2931 
  2925 ! !
  2932 ! !
  2926 
  2933 
  2982         readStream := aMessage readStream.
  2989         readStream := aMessage readStream.
  2983         (aClass := Smalltalk at: (readStream upTo: $ ) asSymbol) notNil
  2990         (aClass := Smalltalk at: (readStream upTo: $ ) asSymbol) notNil
  2984         ifTrue:
  2991         ifTrue:
  2985         [
  2992         [
  2986             aSelector :=  readStream upToEnd asSymbol.
  2993             aSelector :=  readStream upToEnd asSymbol.
  2987             self setClass: aClass selector: aSelector.
  2994             self setClass: aClass selector: aSelector.    
  2988             (aClass respondsTo:aSelector) 
  2995             (aClass respondsTo:aSelector) 
  2989             ifTrue:
  2996             ifTrue:
  2990             [
  2997             [
  2991                 self painter setupFromSpec:(aClass perform:aSelector).
  2998                 self painter setupFromSpec:(aClass perform:aSelector).
  2992                 treeView selection: #(1). 
  2999                 treeView selection: #(1). 
  3052     topView := self window.
  3059     topView := self window.
  3053 
  3060 
  3054     topView label:'GUI Painter'.
  3061     topView label:'GUI Painter'.
  3055 
  3062 
  3056     painterView openInGroup:(topView windowGroup).
  3063     painterView openInGroup:(topView windowGroup).
  3057 
       
  3058     painterView application:self.
       
  3059     painterView open.
  3064     painterView open.
       
  3065     painterView application:self.     
  3060 
  3066 
  3061     painterView application:self.
  3067     painterView application:self.
  3062     selectionPanel := UISelectionPanel new.
  3068     selectionPanel := UISelectionPanel new.
  3063     selectionPanel allButOpenInterface:#windowSpec.
  3069     selectionPanel allButOpenInterface:#windowSpec.
  3064     selectionPanel window openInGroup:(topView windowGroup).
  3070     selectionPanel window openInGroup:(topView windowGroup).
  3077     selectionPanel window bePartner.
  3083     selectionPanel window bePartner.
  3078 
  3084 
  3079     selectionPanel window iconLabel:'GUI Painter'.
  3085     selectionPanel window iconLabel:'GUI Painter'.
  3080     selectionPanel window icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  3086     selectionPanel window icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  3081 
  3087 
  3082     ActiveHelp startFor:self.
       
  3083 !
  3088 !
  3084 
  3089 
  3085 openOnClass:aClass
  3090 openOnClass:aClass
  3086     "open up an interface builder
  3091     "open up an interface builder
  3087     "
  3092     "
  3118     "Modified: / 5.2.1998 / 09:48:15 / stefan"
  3123     "Modified: / 5.2.1998 / 09:48:15 / stefan"
  3119 !
  3124 !
  3120 
  3125 
  3121 postOpenWith: aBuilder
  3126 postOpenWith: aBuilder
  3122 
  3127 
       
  3128     |painter settings gridPara hspace vspace|
       
  3129 
  3123     super postOpenWith: aBuilder.
  3130     super postOpenWith: aBuilder.
  3124 
  3131 
  3125     treeView selection: (Array with: 1).
  3132     treeView selection: (Array with: 1).
  3126     self treeSelection.
  3133     self treeSelection.   
  3127     self tabSelection: 'Basics'
  3134 
       
  3135     painter  := self painter.
       
  3136     settings := self class settings.
       
  3137     gridPara := painter gridParameters copy.
       
  3138     hspace   := settings at: #HGridSpace ifAbsent: [10].
       
  3139     vspace   := settings at: #VGridSpace ifAbsent: [10].
       
  3140     gridPara at:1 put:hspace; at:2 put:vspace; at:5 put:hspace; at:6 put:vspace.
       
  3141     painter gridParameters:gridPara.
       
  3142     painter gridShown: (settings at: #GridShown ifAbsent: [false]).
       
  3143     painter gridAlign: (settings at: #GridAlign ifAbsent: [false]).
       
  3144     painter clear.
  3128 
  3145 
  3129 
  3146 
  3130 ! !
  3147 ! !
  3131 
  3148 
  3132 !UIPainter methodsFor:'user actions'!
  3149 !UIPainter methodsFor:'user actions'!
  3184         treeView class defaultFont: (font on: device).
  3201         treeView class defaultFont: (font on: device).
  3185         treeView font: treeView class defaultFont
  3202         treeView font: treeView class defaultFont
  3186     ]
  3203     ]
  3187 !
  3204 !
  3188 
  3205 
       
  3206 doDefineClassAndSelector
       
  3207     "launch a dialog to define class, superclass, and selector"
       
  3208 
       
  3209     |again tmp helpDict helpKey|
       
  3210 
       
  3211     [
       
  3212         again := false.
       
  3213 
       
  3214         (tmp := specClass) isNil ifTrue:[tmp := 'NewApplication'].
       
  3215         aspects at:#classNameChannel put:tmp asValue.
       
  3216 
       
  3217         (tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec'].
       
  3218         aspects at:#methodNameChannel put:tmp asValue.
       
  3219 
       
  3220         (tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel'].
       
  3221         aspects at:#superclassNameChannel put:tmp asValue.
       
  3222 
       
  3223         (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[
       
  3224 
       
  3225             specClass    := (self aspectFor:#classNameChannel) value.
       
  3226             specSelector := (self aspectFor:#methodNameChannel) value.
       
  3227             specSelector notNil ifTrue:[specSelector := specSelector asSymbol].
       
  3228             specSuperclass := (self aspectFor:#superclassNameChannel) value.
       
  3229 
       
  3230             (again := self checkClassAndSelector not) ifFalse:[
       
  3231                 self painter className:specClass
       
  3232                         superclassName:specSuperclass
       
  3233                               selector:specSelector.
       
  3234             ]
       
  3235         ]
       
  3236         ifFalse:
       
  3237         [
       
  3238             ^nil
       
  3239         ]
       
  3240 
       
  3241     ] doWhile:[again].
       
  3242 
       
  3243     specClass := specClass isBehavior ifTrue:[specClass name]
       
  3244                                       ifFalse:[specClass].
       
  3245 
       
  3246     helpDict := self helpTool dictionary.
       
  3247     helpKey  := self helpTool helpKey.
       
  3248     self helpTool buildFromClass:specClass.    
       
  3249     self helpTool dictionary declareAllFrom: helpDict.
       
  3250     self helpTool updateList.
       
  3251     self helpTool helpKey: helpKey.
       
  3252     self modifiedChannel value: false.
       
  3253     self helpTool modified: true.
       
  3254 !
       
  3255 
       
  3256 doDefineGrid
       
  3257     "open a dialog for grip parameters configuration
       
  3258     "
       
  3259     |hspace vspace bindings painter gridPara settings|
       
  3260 
       
  3261     painter  := self painter.
       
  3262     bindings := IdentityDictionary new.
       
  3263     gridPara := painter gridParameters copy.
       
  3264 
       
  3265     bindings at:#showGrid    put:((self class settings at: #GridShown ifAbsent: [painter gridShown]) asValue).
       
  3266     bindings at:#alignToGrid put:((self class settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue).
       
  3267     bindings at:#hspace      put:((gridPara at:1) asValue).
       
  3268     bindings at:#vspace      put:((gridPara at:2) asValue).
       
  3269 
       
  3270     (self openDialogInterface:#dialogSpecForDefiningGridParameters withBindings:bindings) ifFalse:[
       
  3271         ^ self
       
  3272     ].
       
  3273 
       
  3274     hspace := (bindings at:#hspace) value ? 5.
       
  3275     vspace := (bindings at:#vspace) value ? 5.
       
  3276 
       
  3277     gridPara at:1 put:hspace.
       
  3278     gridPara at:2 put:vspace.
       
  3279     gridPara at:5 put:hspace.
       
  3280     gridPara at:6 put:vspace.
       
  3281 
       
  3282     painter gridShown:false. 
       
  3283     painter gridAlign:false. 
       
  3284     painter gridParameters:gridPara.
       
  3285     painter gridAlign:(bindings at:#alignToGrid) value.
       
  3286     painter gridShown:(bindings at:#showGrid) value.
       
  3287     settings := self class settings.
       
  3288     settings at: #GridShown  put: (bindings at:#showGrid) value.
       
  3289     settings at: #GridAlign  put: (bindings at:#alignToGrid) value.
       
  3290     settings at: #HGridSpace put: hspace.
       
  3291     settings at: #VGridSpace put: vspace.
       
  3292     painter clear.
       
  3293 
       
  3294 !
       
  3295 
  3189 doGenerateAspectMethods
  3296 doGenerateAspectMethods
  3190     "generate aspect and action methods
  3297     "generate aspect and action methods
  3191     "
  3298     "
  3192     |code|
  3299     |code|
  3193 
  3300 
  3194     self treeSelection. "accept modifications"
  3301     self treeSelection. "accept modifications"
  3195 
  3302 
  3196     self hasSpecClassAndSelector ifFalse:[
  3303     self hasSpecClassAndSelector ifFalse:[
  3197         self defineClassAndSelector
  3304         self doDefineClassAndSelector
  3198     ].
  3305     ].
  3199 
  3306 
  3200     self checkClassAndSelector ifFalse:[
  3307     self checkClassAndSelector ifFalse:[
  3201         ^ self
  3308         ^ self
  3202     ].
  3309     ].
  3216     |code|
  3323     |code|
  3217 
  3324 
  3218     self treeSelection. "accept modifications"
  3325     self treeSelection. "accept modifications"
  3219 
  3326 
  3220     self hasSpecClassAndSelector ifFalse:[
  3327     self hasSpecClassAndSelector ifFalse:[
  3221         self defineClassAndSelector
  3328         self doDefineClassAndSelector
  3222     ].
  3329     ].
  3223 
  3330 
  3224     self checkClassAndSelector ifFalse:[
  3331     self checkClassAndSelector ifFalse:[
  3225         ^ self
  3332         ^ self
  3226     ].
  3333     ].
  3285     self askForModification ifFalse: [^nil].
  3392     self askForModification ifFalse: [^nil].
  3286     specClass := specSelector := nil.
  3393     specClass := specSelector := nil.
  3287     self painter removeAll.
  3394     self painter removeAll.
  3288     treeView canvas topView name:  UIPainter defaultNameOfCanvas.
  3395     treeView canvas topView name:  UIPainter defaultNameOfCanvas.
  3289     treeView canvas topView label: UIPainter defaultNameOfCanvas.
  3396     treeView canvas topView label: UIPainter defaultNameOfCanvas.
  3290     self helpTool reset.
  3397     self helpTool doNew.
  3291     treeView selection:#(1).
  3398     treeView selection:#(1).
  3292     self treeSelection.
  3399     self treeSelection.
  3293     self updateInfoLabel.
  3400     self updateInfoLabel.
  3294 !
  3401 !
  3295 
  3402 
  3328     |code painter|
  3435     |code painter|
  3329 
  3436 
  3330     self treeSelection. "ask for modification"
  3437     self treeSelection. "ask for modification"
  3331 
  3438 
  3332     self hasSpecClassAndSelector ifFalse:[
  3439     self hasSpecClassAndSelector ifFalse:[
  3333          (self defineClassAndSelector) isNil ifTrue: [^nil]
  3440          (self doDefineClassAndSelector) isNil ifTrue: [^nil]
  3334     ].
  3441     ].
  3335 
  3442 
  3336     (specClass notNil and: [(Smalltalk at: specClass asSymbol) isClass])
  3443     (specClass notNil and: [(Smalltalk at: specClass asSymbol) isClass])
  3337     ifFalse: 
  3444     ifFalse: 
  3338     [   
  3445     [   
  3354     painter className:specClass
  3461     painter className:specClass
  3355        superclassName:specSuperclass
  3462        superclassName:specSuperclass
  3356              selector:specSelector.
  3463              selector:specSelector.
  3357 
  3464 
  3358     code := painter generateWindowSpecMethodSource withCRs.
  3465     code := painter generateWindowSpecMethodSource withCRs.
  3359     painter resetModification.
  3466 
  3360     (ReadStream on:code) fileIn.
  3467     (ReadStream on:code) fileIn.
  3361 
  3468 
  3362     self helpTool installHelpSpecsOnClass:specClass.
  3469     self helpTool installHelpSpecsOnClass:specClass.
  3363 
  3470 
  3364     self updateInfoLabel.
  3471     self updateInfoLabel.
  3580         ]
  3687         ]
  3581     ].
  3688     ].
  3582   ^ nil
  3689   ^ nil
  3583 
  3690 
  3584 
  3691 
       
  3692 !
       
  3693 
       
  3694 lastDrawnMaster
       
  3695     "returns the lastDrawnMaster
       
  3696     "
       
  3697   ^ lastDrawnMaster
       
  3698 
       
  3699 
  3585 ! !
  3700 ! !
  3586 
  3701 
  3587 !UIPainter::TreeView methodsFor:'accessing property'!
  3702 !UIPainter::TreeView methodsFor:'accessing property'!
  3588 
  3703 
  3589 propertiesDo:aOneArgBlock
  3704 propertiesDo:aOneArgBlock
  3935     self showDirectoryIndicator: true.
  4050     self showDirectoryIndicator: true.
  3936     self showDirectoryIndicatorForRoot: false.
  4051     self showDirectoryIndicatorForRoot: false.
  3937 
  4052 
  3938     self model iconAction: 
  4053     self model iconAction: 
  3939     [:aNode|
  4054     [:aNode|
  3940         |specClass|
  4055         |specClass|       
  3941         (specClass := aNode contents spec) isNil 
  4056         (specClass := aNode contents spec) isNil 
  3942         ifTrue:  
  4057         ifTrue:  
  3943         [
  4058         [
  3944             WindowSpec icon
  4059             WindowSpec icon
  3945         ]
  4060         ]
  3952             ] 
  4067             ] 
  3953             ifFalse:
  4068             ifFalse:
  3954             [
  4069             [
  3955                 specClass class icon
  4070                 specClass class icon
  3956             ]
  4071             ]
  3957         ]
  4072         ]. 
  3958     ].
  4073     ].
  3959 
  4074 
  3960     self model labelAction: 
  4075     self model labelAction: 
  3961     [:aNode|
  4076     [:aNode|
  3962         |spec|
  4077         |spec|