UIPainter.st
changeset 345 c4d8f4c74c26
parent 344 741504924199
child 347 84460ca6aa7f
equal deleted inserted replaced
344:741504924199 345:c4d8f4c74c26
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 'From Smalltalk/X, Version:3.2.1 on 18-oct-1997 at 4:31:48 pm'                  !
    14 'From Smalltalk/X, Version:3.2.1 on 22-oct-1997 at 2:41:23 pm'                  !
    15 
    15 
    16 ApplicationModel subclass:#UIPainter
    16 ApplicationModel subclass:#UIPainter
    17 	instanceVariableNames:'treeView selectionPanel tabSelection specClass specSelector
    17 	instanceVariableNames:'treeView selectionPanel tabSelection specClass specSelector
    18 		specSuperclass aspects layoutCanvas helpCanvas specCanvas
    18 		specSuperclass aspects layoutCanvas helpCanvas specCanvas
    19 		transcript'
    19 		transcript'
   312 
   312 
   313 iconAlignTB
   313 iconAlignTB
   314     "returns image assigned to align top and bottom
   314     "returns image assigned to align top and bottom
   315     "
   315     "
   316     ^ Image fromFile:'b_alignTB.xbm'
   316     ^ Image fromFile:'b_alignTB.xbm'
       
   317 
       
   318 !
       
   319 
       
   320 iconInstall
       
   321     ^ Image fromFile:'SaveButton.tiff'
       
   322 
   317 
   323 
   318 !
   324 !
   319 
   325 
   320 iconStepDown
   326 iconStepDown
   321     "returns image assigned to step down (change hierarchy).
   327     "returns image assigned to step down (change hierarchy).
   493      
   499      
   494        #(#FullSpec
   500        #(#FullSpec
   495           #'window:' 
   501           #'window:' 
   496            #(#WindowSpec
   502            #(#WindowSpec
   497               #'name:' 'Tree-View'
   503               #'name:' 'Tree-View'
   498               #'layout:' #(#LayoutFrame 143 0 224 0 656 0 684 0)
   504               #'layout:' #(#LayoutFrame 216 0 173 0 729 0 633 0)
   499               #'label:' 'Tree-View'
   505               #'label:' 'Tree-View'
   500               #'min:' #(#Point 10 10)
   506               #'min:' #(#Point 10 10)
   501               #'max:' #(#Point 1160 870)
   507               #'max:' #(#Point 1160 870)
   502               #'bounds:' #(#Rectangle 143 224 657 685)
   508               #'bounds:' #(#Rectangle 216 173 730 634)
   503           )
   509           )
   504           #'component:' 
   510           #'component:' 
   505            #(#SpecCollection
   511            #(#SpecCollection
   506               #'collection:' 
   512               #'collection:' 
   507                #(
   513                #(
   508                  #(#MenuPanelSpec
   514                  #(#MenuPanelSpec
   509                     #'name:' 'menuPullDown'
   515                     #'name:' 'menuPullDown'
   510                     #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0)
   516                     #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0)
   511                     #'tabable:' true
   517                     #'tabable:' true
   512                     #'menu:' #menuPullDown
   518                     #'menu:' #menuPullDown
   513                 )
       
   514                  #(#ToggleSpec
       
   515                     #'name:' 'galleryLabel'
       
   516                     #'layout:' #(#LayoutFrame -162 1.0 1 0 -82 1.0 23 0)
       
   517                     #'activeHelpKey:' #galleryShown
       
   518                     #'label:' 'Gallery'
       
   519                     #'model:' #galleryShown
       
   520                     #'isTriggerOnDown:' true
       
   521                     #'showLamp:' true
       
   522                     #'lampColor:' #(#Color 100.0 100.0 0.0)
       
   523                 )
       
   524                  #(#ToggleSpec
       
   525                     #'name:' 'painterLabel'
       
   526                     #'layout:' #(#LayoutFrame -81 1.0 1 0 -1 1.0 23 0)
       
   527                     #'activeHelpKey:' #painterShown
       
   528                     #'label:' 'Painter'
       
   529                     #'model:' #painterShown
       
   530                     #'isTriggerOnDown:' true
       
   531                     #'showLamp:' true
       
   532                     #'lampColor:' #(#Color 100.0 100.0 0.0)
       
   533                 )
   519                 )
   534                  #(#HorizontalPanelViewSpec
   520                  #(#HorizontalPanelViewSpec
   535                     #'name:' 'menuContainer'
   521                     #'name:' 'menuContainer'
   536                     #'layout:' #(#LayoutFrame 0 0.0 26 0 0 1.0 58 0)
   522                     #'layout:' #(#LayoutFrame 0 0.0 26 0 0 1.0 58 0)
   537                     #'component:' 
   523                     #'component:' 
   542                               #'name:' 'menuChangeHierarchy'
   528                               #'name:' 'menuChangeHierarchy'
   543                               #'activeHelpKey:' #menuChangeHierarchy
   529                               #'activeHelpKey:' #menuChangeHierarchy
   544                               #'enableChannel:' #hasOneSelectionOtherThanCanvas
   530                               #'enableChannel:' #hasOneSelectionOtherThanCanvas
   545                               #'menu:' #menuChangeHierarchy
   531                               #'menu:' #menuChangeHierarchy
   546                               #'showSeparatingLines:' true
   532                               #'showSeparatingLines:' true
   547                               #'extent:' #(#Point 123 32)
   533                               #'extent:' #(#Point 103 32)
   548                           )
   534                           )
   549                            #(#MenuPanelSpec
   535                            #(#MenuPanelSpec
   550                               #'name:' 'menuAlignment'
   536                               #'name:' 'menuAlignment'
   551                               #'activeHelpKey:' #menuAlignment
   537                               #'activeHelpKey:' #menuAlignment
   552                               #'enableChannel:' #canMoveOrAlignSelection
   538                               #'enableChannel:' #canMoveOrAlignSelection
   646                                                #(#NoteBookViewSpec
   632                                                #(#NoteBookViewSpec
   647                                                   #'name:' 'noteBook'
   633                                                   #'name:' 'noteBook'
   648                                                   #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -30 1.0)
   634                                                   #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -30 1.0)
   649                                                   #'enableChannel:' #enableChannel
   635                                                   #'enableChannel:' #enableChannel
   650                                                   #'tabable:' true
   636                                                   #'tabable:' true
       
   637                                                   #'model:' #tabModel
   651                                                   #'menu:' #tabList
   638                                                   #'menu:' #tabList
   652                                                   #'style:' 
   639                                                   #'style:' #(#FontDescription #helvetica #medium #roman 10)
   653                                                    #(#FontDescription
       
   654                                                       #helvetica #medium
       
   655                                                       #roman 10
       
   656                                                   )
       
   657                                                   #'model:' #tabModel
       
   658                                                   #'canvas:' #noteBookView
   640                                                   #'canvas:' #noteBookView
   659                                               )
   641                                               )
   660                                                #(#HorizontalPanelViewSpec
   642                                                #(#HorizontalPanelViewSpec
   661                                                   #'name:' 'modifyPanel'
   643                                                   #'name:' 'modifyPanel'
   662                                                   #'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0)
   644                                                   #'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0)
   678                                                             #'activeHelpKey:' #accept
   660                                                             #'activeHelpKey:' #accept
   679                                                             #'label:' 'ok'
   661                                                             #'label:' 'ok'
   680                                                             #'tabable:' true
   662                                                             #'tabable:' true
   681                                                             #'model:' #accept
   663                                                             #'model:' #accept
   682                                                             #'enableChannel:' #modifiedChannel
   664                                                             #'enableChannel:' #modifiedChannel
   683                                                             #'extent:' #(#Point 165 24)
   665                                                             #'extent:' #(#Point 166 24)
   684                                                         )
   666                                                         )
   685                                                       )
   667                                                       )
   686                                                   )
   668                                                   )
   687                                                   #'horizontalLayout:' #fitSpace
   669                                                   #'horizontalLayout:' #fitSpace
   688                                                   #'verticalLayout:' #fitSpace
   670                                                   #'verticalLayout:' #fitSpace
  1084           
  1066           
  1085            #(
  1067            #(
  1086              #(#MenuItem
  1068              #(#MenuItem
  1087                 #'label:' 'stepUp'
  1069                 #'label:' 'stepUp'
  1088                 #'value:' #doStepUp
  1070                 #'value:' #doStepUp
  1089                 #'labelImage:' 
  1071                 #'labelImage:' #(#ResourceRetriever #UIPainter #iconStepUp)
  1090                  #(#ResourceRetriever
       
  1091                     #UIPainter #iconStepUp
       
  1092                 )
       
  1093             )
  1072             )
  1094              #(#MenuItem
  1073              #(#MenuItem
  1095                 #'label:' 'stepDown'
  1074                 #'label:' 'stepDown'
  1096                 #'value:' #doStepDown
  1075                 #'value:' #doStepDown
  1097                 #'labelImage:' 
  1076                 #'labelImage:' #(#ResourceRetriever #UIPainter #iconStepDown)
  1098                  #(#ResourceRetriever
       
  1099                     #UIPainter #iconStepDown
       
  1100                 )
       
  1101             )
       
  1102              #(#MenuItem
       
  1103                 #'label:' '-'
       
  1104             )
  1077             )
  1105              #(#MenuItem
  1078              #(#MenuItem
  1106                 #'label:' 'stepIn'
  1079                 #'label:' 'stepIn'
  1107                 #'value:' #doStepIn
  1080                 #'value:' #doStepIn
  1108                 #'enabled:' #canMoveSelectionIntoContainer
  1081                 #'enabled:' #canMoveSelectionIntoContainer
  1109                 #'labelImage:' 
  1082                 #'labelImage:' #(#ResourceRetriever #UIPainter #iconStepIn)
  1110                  #(#ResourceRetriever
       
  1111                     #UIPainter #iconStepIn
       
  1112                 )
       
  1113             )
  1083             )
  1114              #(#MenuItem
  1084              #(#MenuItem
  1115                 #'label:' 'stepOut'
  1085                 #'label:' 'stepOut'
  1116                 #'value:' #doStepOut
  1086                 #'value:' #doStepOut
  1117                 #'enabled:' #canMoveSelectionOutOfContainer
  1087                 #'enabled:' #canMoveSelectionOutOfContainer
  1118                 #'labelImage:' 
  1088                 #'labelImage:' #(#ResourceRetriever #UIPainter #iconStepOut)
  1119                  #(#ResourceRetriever
       
  1120                     #UIPainter #iconStepOut
       
  1121                 )
       
  1122             )
  1089             )
  1123           ) nil
  1090           ) nil
  1124           nil
  1091           nil
  1125       )
  1092       )
  1126 !
  1093 !
  1242                        #(#MenuItem
  1209                        #(#MenuItem
  1243                           #'label:' 'class && method ...'
  1210                           #'label:' 'class && method ...'
  1244                           #'value:' #defineClassAndSelector
  1211                           #'value:' #defineClassAndSelector
  1245                       )
  1212                       )
  1246                        #(#MenuItem
  1213                        #(#MenuItem
  1247                           #'label:' '='
  1214                           #'label:' '-'
  1248                       )
  1215                       )
  1249                        #(#MenuItem
  1216                        #(#MenuItem
  1250                           #'label:' 'install window spec.'
  1217                           #'label:' 'install window spec.'
  1251                           #'value:' #doInstallSpec
  1218                           #'value:' #doInstallSpec
  1252                           #'enabled:' #hasSpecClassAndSelector
       
  1253                       )
  1219                       )
  1254                        #(#MenuItem
  1220                        #(#MenuItem
  1255                           #'label:' 'install help spec.'
  1221                           #'label:' 'install help spec.'
  1256                           #'value:' #doInstallHelp
  1222                           #'value:' #doInstallHelp
  1257                           #'enabled:' #hasSpecClass
  1223                           #'enabled:' #hasSpecClass
  1258                       )
  1224                       )
  1259                        #(#MenuItem
  1225                        #(#MenuItem
  1260                           #'label:' '-'
       
  1261                       )
       
  1262                        #(#MenuItem
       
  1263                           #'label:' 'install aspects'
  1226                           #'label:' 'install aspects'
  1264                           #'value:' #doInstallAspects
  1227                           #'value:' #doInstallAspects
  1265                           #'enabled:' #hasSpecClass
  1228                           #'enabled:' #hasSpecClass
  1266                       )
  1229                       )
  1267                        #(#MenuItem
  1230                        #(#MenuItem
  1268                           #'label:' '='
  1231                           #'label:' '-'
  1269                       )
  1232                       )
  1270                        #(#MenuItem
  1233                        #(#MenuItem
  1271                           #'label:' 'show window spec.'
  1234                           #'label:' 'show window spec.'
  1272                           #'value:' #doWindowSpec
  1235                           #'value:' #doWindowSpec
  1273                       )
  1236                       )
  1274                        #(#MenuItem
  1237                        #(#MenuItem
  1275                           #'label:' '='
       
  1276                       )
       
  1277                        #(#MenuItem
       
  1278                           #'label:' 'browse application'
  1238                           #'label:' 'browse application'
  1279                           #'value:' #doBrowseAppClass
  1239                           #'value:' #doBrowseAppClass
  1280                           #'enabled:' #hasSpecClass
       
  1281                       )
       
  1282                        #(#MenuItem
       
  1283                           #'label:' 'start  application'
       
  1284                           #'value:' #doStartApplication
       
  1285                           #'enabled:' #hasSpecClass
  1240                           #'enabled:' #hasSpecClass
  1286                       )
  1241                       )
  1287                     ) nil
  1242                     ) nil
  1288                     nil
  1243                     nil
  1289                 )
  1244                 )
  1301                           #'indication:' #'testMode:'
  1256                           #'indication:' #'testMode:'
  1302                       )
  1257                       )
  1303                     ) nil
  1258                     ) nil
  1304                     nil
  1259                     nil
  1305                 )
  1260                 )
       
  1261             )
       
  1262              #(#MenuItem
       
  1263                 #'label:' ''
       
  1264             )
       
  1265              #(#MenuItem
       
  1266                 #'label:' 'Gallery'
       
  1267                 #'indication:' #galleryShown
       
  1268             )
       
  1269              #(#MenuItem
       
  1270                 #'label:' 'Canvas'
       
  1271                 #'indication:' #painterShown
       
  1272             )
       
  1273              #(#MenuItem
       
  1274                 #'label:' ''
       
  1275             )
       
  1276              #(#MenuItem
       
  1277                 #'label:' '-'
       
  1278             )
       
  1279              #(#MenuItem
       
  1280                 #'label:' 'Install'
       
  1281                 #'value:' #doInstallSpec
       
  1282                 #'labelImage:' #(#ResourceRetriever nil #iconInstall 'Install')
       
  1283             )
       
  1284              #(#MenuItem
       
  1285                 #'label:' '-'
       
  1286             )
       
  1287              #(#MenuItem
       
  1288                 #'label:' 'Run'
       
  1289                 #'value:' #doStartApplication
       
  1290             )
       
  1291              #(#MenuItem
       
  1292                 #'label:' '-'
  1306             )
  1293             )
  1307           ) nil
  1294           ) nil
  1308           nil
  1295           nil
  1309       )
  1296       )
  1310 ! !
  1297 ! !
  2066         ].
  2053         ].
  2067         topView raise.
  2054         topView raise.
  2068     ].
  2055     ].
  2069 !
  2056 !
  2070 
  2057 
  2071 openInterface
  2058 openInterface:aSymbol
  2072     "open interfaces
  2059     "open interfaces
  2073     "
  2060     "
  2074     |painterView painter cls topView w icon|
  2061     |painterView painter cls topView|
  2075 
  2062 
  2076     aspects := IdentityDictionary new.
  2063     aspects := IdentityDictionary new.
  2077 
  2064 
  2078     aspects at:#classNameChannel put:(
  2065     aspects at:#classNameChannel put:(
  2079         (specClass notNil ifTrue:[specClass]
  2066         (specClass notNil ifTrue:[specClass]
  2106 
  2093 
  2107     treeView := treeView canvas:painter.
  2094     treeView := treeView canvas:painter.
  2108     painter treeView:treeView.
  2095     painter treeView:treeView.
  2109     treeView model addDependent:self.
  2096     treeView model addDependent:self.
  2110 
  2097 
  2111     super openInterface.
  2098     super openInterface:aSymbol.
       
  2099 
  2112     transcript := (self builder componentAt:#Transcript) scrolledView.
  2100     transcript := (self builder componentAt:#Transcript) scrolledView.
  2113     topView := self window.
  2101     topView := self window.
  2114     topView bePartner.
  2102     topView bePartner.
  2115     topView label:'GUI Builder'.
  2103     topView label:'GUI Painter'.
  2116 
  2104 
  2117     painterView openInGroup:(topView windowGroup).
  2105     painterView openInGroup:(topView windowGroup).
  2118     painterView bePartner.
  2106     painterView bePartner.
  2119     painterView application:self.
  2107     painterView application:self.
  2120     painterView open.
  2108     painterView open.
  2121 
  2109 
  2122     painterView application:self.
  2110     painterView application:self.
  2123     selectionPanel := UISelectionPanel new.
  2111     selectionPanel := UISelectionPanel new.
  2124     selectionPanel allButOpenInterface:#windowSpec.
  2112     selectionPanel allButOpenInterface:#windowSpec.
  2125     w := selectionPanel window.
  2113     selectionPanel window openInGroup:(topView windowGroup).
  2126     w openInGroup:(topView windowGroup).
  2114     selectionPanel window bePartner.
  2127     w bePartner.
       
  2128     selectionPanel openWindow.
  2115     selectionPanel openWindow.
  2129     selectionPanel masterApplication:self.
  2116     selectionPanel masterApplication:self.
  2130 
  2117 
  2131     icon := Image fromFile:'bitmaps/UIPainter.xbm' resolution:100.
  2118     topView iconLabel:'GUI Painter'.
  2132 
  2119     topView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2133     topView iconLabel:'Builder'.
  2120 
  2134     topView icon:icon.
  2121     painterView iconLabel:'GUI Painter'.
  2135 
  2122     painterView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2136     painterView iconLabel:'Builder'.
  2123 
  2137     painterView icon:icon.
  2124     selectionPanel window iconLabel:'GUI Painter'.
  2138 
  2125     selectionPanel window icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2139     w iconLabel:'Builder'.
  2126 
  2140     w icon:icon.
  2127     "Modified: 1.8.1997 / 14:22:10 / cg"
  2141 
       
  2142     "Modified: 18.10.1997 / 15:09:42 / cg"
       
  2143 !
  2128 !
  2144 
  2129 
  2145 openNewWindowCanvas
  2130 openNewWindowCanvas
  2146     "open new
  2131     "open new
  2147     "
  2132     "
  3063 initialize
  3048 initialize
  3064     "initialization; set multiple select and model
  3049     "initialization; set multiple select and model
  3065     "
  3050     "
  3066     super initialize.
  3051     super initialize.
  3067     self multipleSelectOk:true.
  3052     self multipleSelectOk:true.
  3068 
       
  3069     "Modified: 19.9.1997 / 16:57:12 / stefan"
       
  3070 ! !
  3053 ! !
  3071 
  3054 
  3072 !UIPainter::TreeView methodsFor:'private'!
  3055 !UIPainter::TreeView methodsFor:'private'!
  3073 
  3056 
  3074 figureFor:aNode
  3057 figureFor:aNode