UIPainter.st
changeset 366 68b0e0a329a4
parent 365 1610933f0e94
child 368 9e588f397bc9
equal deleted inserted replaced
365:1610933f0e94 366:68b0e0a329a4
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     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 
       
    13 
    12 
    14 ApplicationModel subclass:#UIPainter
    13 ApplicationModel subclass:#UIPainter
    15 	instanceVariableNames:'treeView selectionPanel tabSelection specClass specSelector
    14 	instanceVariableNames:'treeView selectionPanel tabSelection specClass specSelector
    16 		specSuperclass aspects layoutCanvas helpCanvas specCanvas
    15 		specSuperclass aspects layoutCanvas helpCanvas specCanvas
    17 		transcript'
    16 		transcript'
   424 
   423 
   425     "Modified: / 29.10.1997 / 03:19:29 / cg"
   424     "Modified: / 29.10.1997 / 03:19:29 / cg"
   426 ! !
   425 ! !
   427 
   426 
   428 !UIPainter class methodsFor:'interface specs'!
   427 !UIPainter class methodsFor:'interface specs'!
       
   428 
       
   429 gridParametersSpec
       
   430     "this window spec was automatically generated by the ST/X UIPainter"
       
   431 
       
   432     "do not manually edit this - the painter/builder may not be able to
       
   433      handle the specification if its corrupted."
       
   434 
       
   435     "
       
   436      UIPainter new openOnClass:UIPainter andSelector:#gridParametersSpec
       
   437      UIPainter new openInterface:#gridParametersSpec
       
   438     "
       
   439     "UIPainter open"
       
   440 
       
   441     <resource: #canvas>
       
   442 
       
   443     ^
       
   444 
       
   445        #(#FullSpec
       
   446           #'window:' 
       
   447            #(#WindowSpec
       
   448               #'name:' 'Grid Parameters:'
       
   449               #'layout:' #(#LayoutFrame 219 0 193 0 484 0 366 0)
       
   450               #'label:' 'Grid Parameters:'
       
   451               #'min:' #(#Point 10 10)
       
   452               #'max:' #(#Point 1280 1024)
       
   453               #'bounds:' #(#Rectangle 219 193 485 367)
       
   454           )
       
   455           #'component:' 
       
   456            #(#SpecCollection
       
   457               #'collection:' 
       
   458                #(
       
   459                  #(#LabelSpec
       
   460                     #'name:' 'gridParameters'
       
   461                     #'layout:' #(#LayoutOrigin 0 0 0 0)
       
   462                     #'label:' 'Grid Parameters:'
       
   463                     #'adjust:' #left
       
   464                     #'resizeForLabel:' true
       
   465                 )
       
   466                  #(#CheckBoxSpec
       
   467                     #'name:' 'show'
       
   468                     #'layout:' #(#Point 30 31)
       
   469                     #'model:' #showGrid
       
   470                     #'label:' 'show grid'
       
   471                 )
       
   472                  #(#CheckBoxSpec
       
   473                     #'name:' 'align'
       
   474                     #'layout:' #(#Point 30 57)
       
   475                     #'model:' #alignToGrid
       
   476                     #'label:' 'align to grid'
       
   477                 )
       
   478                  #(#LabelSpec
       
   479                     #'name:' 'hrzLabel'
       
   480                     #'layout:' #(#Point 90 94)
       
   481                     #'label:' 'pixels horizontal'
       
   482                     #'resizeForLabel:' true
       
   483                 )
       
   484                  #(#InputFieldSpec
       
   485                     #'name:' 'hrzField'
       
   486                     #'layout:' #(#LayoutFrame 33 0 91 0 86 0 113 0)
       
   487                     #'model:' #hspace
       
   488                     #'type:' #numberOrNil
       
   489                 )
       
   490                  #(#LabelSpec
       
   491                     #'name:' 'vrtLabel'
       
   492                     #'layout:' #(#Point 90 118)
       
   493                     #'label:' 'pixels vertical'
       
   494                     #'resizeForLabel:' true
       
   495                 )
       
   496                  #(#InputFieldSpec
       
   497                     #'name:' 'vrtField'
       
   498                     #'layout:' #(#LayoutFrame 33 0 115 0 86 0 137 0)
       
   499                     #'model:' #vspace
       
   500                     #'type:' #numberOrNil
       
   501                 )
       
   502                  #(#HorizontalPanelViewSpec
       
   503                     #'name:' 'horizontalPanelView1'
       
   504                     #'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0)
       
   505                     #'component:' 
       
   506                      #(#SpecCollection
       
   507                         #'collection:' 
       
   508                          #(
       
   509                            #(#ActionButtonSpec
       
   510                               #'name:' 'cancel'
       
   511                               #'label:' 'cancel'
       
   512                               #'model:' #cancel
       
   513                               #'extent:' #(#Point 128 24)
       
   514                           )
       
   515                            #(#ActionButtonSpec
       
   516                               #'name:' 'accept'
       
   517                               #'label:' 'accept'
       
   518                               #'model:' #accept
       
   519                               #'extent:' #(#Point 129 24)
       
   520                           )
       
   521                         )
       
   522                     )
       
   523                     #'horizontalLayout:' #fitSpace
       
   524                     #'verticalLayout:' #fitSpace
       
   525                     #'horizontalSpace:' 3
       
   526                     #'verticalSpace:' 3
       
   527                 )
       
   528               )
       
   529           )
       
   530       )
       
   531 
       
   532 
       
   533 !
   429 
   534 
   430 nameAndSelectorSpec
   535 nameAndSelectorSpec
   431     "this window spec was automatically generated by the ST/X UIPainter"
   536     "this window spec was automatically generated by the ST/X UIPainter"
   432 
   537 
   433     "do not manually edit this - the painter/builder may not be able to
   538     "do not manually edit this - the painter/builder may not be able to
   911             )
  1016             )
   912              #(#MenuItem
  1017              #(#MenuItem
   913                 #'label:' 'undo'
  1018                 #'label:' 'undo'
   914                 #'nameKey:' #undo
  1019                 #'nameKey:' #undo
   915                 #'enabled:' #hasUndoHistory
  1020                 #'enabled:' #hasUndoHistory
       
  1021                 #'shortcutKeyCharacter:' #Cmdu
   916                 #'value:' #undoLast
  1022                 #'value:' #undoLast
   917             )
  1023             )
   918              #(#MenuItem
  1024              #(#MenuItem
   919                 #'label:' '-'
  1025                 #'label:' '-'
   920             )
  1026             )
  1219                                     #'indication:' #'gridShown:'
  1325                                     #'indication:' #'gridShown:'
  1220                                 )
  1326                                 )
  1221                                  #(#MenuItem
  1327                                  #(#MenuItem
  1222                                     #'label:' 'align'
  1328                                     #'label:' 'align'
  1223                                     #'indication:' #'gridAlign:'
  1329                                     #'indication:' #'gridAlign:'
       
  1330                                 )
       
  1331                                  #(#MenuItem
       
  1332                                     #'label:' '-'
       
  1333                                 )
       
  1334                                  #(#MenuItem
       
  1335                                     #'label:' 'menu'
       
  1336                                     #'value:' #gridMenu
  1224                                 )
  1337                                 )
  1225                               ) nil
  1338                               ) nil
  1226                               nil
  1339                               nil
  1227                           )
  1340                           )
  1228                       )
  1341                       )
  2102         ]
  2215         ]
  2103     ].
  2216     ].
  2104 
  2217 
  2105     treeView model removeDependent:self.
  2218     treeView model removeDependent:self.
  2106     self painter release.
  2219     self painter release.
       
  2220     ColorMenu releaseResources.
  2107 
  2221 
  2108     selectionPanel notNil ifTrue:[
  2222     selectionPanel notNil ifTrue:[
  2109         selectionPanel masterApplication:nil.
  2223         selectionPanel masterApplication:nil.
  2110         selectionPanel closeRequest
  2224         selectionPanel closeRequest
  2111     ].
  2225     ].
  2363         ]
  2477         ]
  2364 
  2478 
  2365     ] doWhile:[again].
  2479     ] doWhile:[again].
  2366 
  2480 
  2367     self specClass:specClass.
  2481     self specClass:specClass.
       
  2482 !
       
  2483 
       
  2484 gridMenu
       
  2485     "open a dialog for grip parameters configuration
       
  2486     "
       
  2487     |hspace vspace bindings painter gridPara|
       
  2488 
       
  2489     painter  := self painter.
       
  2490     bindings := IdentityDictionary new.
       
  2491     gridPara := painter gridParameters copy.
       
  2492 
       
  2493     bindings at:#showGrid    put:(painter gridShown asValue).
       
  2494     bindings at:#alignToGrid put:(painter gridAlign asValue).
       
  2495     bindings at:#hspace      put:((gridPara at:1) asValue).
       
  2496     bindings at:#vspace      put:((gridPara at:2) asValue).
       
  2497 
       
  2498     (self openDialogInterface:#gridParametersSpec withBindings:bindings) ifFalse:[
       
  2499         ^ self
       
  2500     ].
       
  2501 
       
  2502     hspace := (bindings at:#hspace) value ? 5.
       
  2503     vspace := (bindings at:#vspace) value ? 5.
       
  2504 
       
  2505     gridPara at:1 put:hspace.
       
  2506     gridPara at:2 put:vspace.
       
  2507     gridPara at:5 put:hspace.
       
  2508     gridPara at:6 put:vspace.
       
  2509 
       
  2510     painter gridShown:false.
       
  2511     painter gridAlign:false.
       
  2512     painter gridParameters:gridPara.
       
  2513     painter gridAlign:(bindings at:#alignToGrid) value.
       
  2514     painter gridShown:(bindings at:#showGrid) value.
       
  2515 
       
  2516 
  2368 ! !
  2517 ! !
  2369 
  2518 
  2370 !UIPainter methodsFor:'user interaction - move'!
  2519 !UIPainter methodsFor:'user interaction - move'!
  2371 
  2520 
  2372 doStepDown
  2521 doStepDown