UIPainter.st
changeset 81 7493e2437af5
parent 77 0d3cc25662d6
child 87 cc6d70449622
equal deleted inserted replaced
80:3316c52ef2b7 81:7493e2437af5
    66     <resource: #canvas>
    66     <resource: #canvas>
    67 
    67 
    68     ^
    68     ^
    69      
    69      
    70        #(#FullSpec
    70        #(#FullSpec
    71           #'isOpaque:' true
       
    72           #'window:' 
    71           #'window:' 
    73            #(#WindowSpec
    72            #(#WindowSpec
    74               #'name:' 'uIPainterView'
    73               #'name:' 'uIPainterView'
    75               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
    74               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
    76               #'isOpaque:' true
       
    77               #'label:' 'unnamed'
    75               #'label:' 'unnamed'
    78               #'bounds:' #(#Rectangle 0 0 300 300)
    76               #'bounds:' #(#Rectangle 0 0 300 300)
    79           )
    77           )
    80           #'component:' 
    78           #'component:' 
    81            #(#SpecCollection
    79            #(#SpecCollection
    82               #'collection:' 
    80               #'collection:' 
    83                #(
    81                #(
    84                  #(#LabelSpec
    82                  #(#LabelSpec
    85                     #'name:' 'label1'
    83                     #'name:' 'label1'
    86                     #'layout:' #(#LayoutFrame 10 0 50 0 110 0 70 0)
    84                     #'layout:' #(#LayoutFrame 10 0 50 0 110 0 70 0)
    87                     #'isOpaque:' true
       
    88                     #'label:' 'class:'
    85                     #'label:' 'class:'
    89                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
    86                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
    90                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
    87                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
    91                     #'initiallyInvisible:' false
    88                     #'initiallyInvisible:' false
       
    89                     #'translateLabel:' false
    92                     #'level:' 0
    90                     #'level:' 0
    93                     #'adjust:' #right
    91                     #'adjust:' #right
    94                     #'hasCharacterOrientedLabel:' true
    92                     #'hasCharacterOrientedLabel:' true
    95                 )
    93                 )
    96                  #(#LabelSpec
    94                  #(#LabelSpec
    97                     #'name:' 'label2'
    95                     #'name:' 'label2'
    98                     #'layout:' #(#LayoutFrame 10 0 90 0 110 0 110 0)
    96                     #'layout:' #(#LayoutFrame 10 0 90 0 110 0 110 0)
    99                     #'isOpaque:' true
       
   100                     #'label:' 'superclass:'
    97                     #'label:' 'superclass:'
   101                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
    98                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   102                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
    99                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   103                     #'initiallyInvisible:' false
   100                     #'initiallyInvisible:' false
       
   101                     #'translateLabel:' false
   104                     #'level:' 0
   102                     #'level:' 0
   105                     #'adjust:' #right
   103                     #'adjust:' #right
   106                     #'hasCharacterOrientedLabel:' true
   104                     #'hasCharacterOrientedLabel:' true
   107                 )
   105                 )
   108                  #(#LabelSpec
   106                  #(#LabelSpec
   109                     #'name:' 'label3'
   107                     #'name:' 'label3'
   110                     #'layout:' #(#LayoutFrame 10 0 130 0 110 0 150 0)
   108                     #'layout:' #(#LayoutFrame 10 0 130 0 110 0 150 0)
   111                     #'isOpaque:' true
       
   112                     #'label:' 'selector:'
   109                     #'label:' 'selector:'
   113                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   110                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   114                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   111                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   115                     #'initiallyInvisible:' false
   112                     #'initiallyInvisible:' false
       
   113                     #'translateLabel:' false
   116                     #'level:' 0
   114                     #'level:' 0
   117                     #'adjust:' #right
   115                     #'adjust:' #right
   118                     #'hasCharacterOrientedLabel:' true
   116                     #'hasCharacterOrientedLabel:' true
   119                 )
   117                 )
   120                  #(#InputFieldSpec
   118                  #(#InputFieldSpec
   121                     #'name:' 'classNameField'
   119                     #'name:' 'classNameField'
   122                     #'layout:' #(#LayoutFrame 120 0 50 0 289 0 69 0)
   120                     #'layout:' #(#LayoutFrame 120 0 50 0 289 0 69 0)
   123                     #'isOpaque:' true
       
   124                     #'initiallyDisabled:' false
       
   125                     #'initiallyInvisible:' false
       
   126                     #'model:' #classNameChannel
   121                     #'model:' #classNameChannel
   127                     #'isReadOnly:' false
       
   128                     #'tabable:' true
   122                     #'tabable:' true
   129                     #'immediateAccept:' false
   123                     #'immediateAccept:' false
   130                     #'acceptOnLeave:' true
   124                     #'acceptOnLeave:' true
   131                     #'acceptOnReturn:' true
   125                     #'acceptOnReturn:' true
   132                     #'acceptOnTab:' true
   126                     #'acceptOnTab:' true
   134                     #'hasBorder:' false
   128                     #'hasBorder:' false
   135                 )
   129                 )
   136                  #(#InputFieldSpec
   130                  #(#InputFieldSpec
   137                     #'name:' 'superclassNameField'
   131                     #'name:' 'superclassNameField'
   138                     #'layout:' #(#LayoutFrame 120 0 90 0 289 0 109 0)
   132                     #'layout:' #(#LayoutFrame 120 0 90 0 289 0 109 0)
   139                     #'isOpaque:' true
       
   140                     #'initiallyDisabled:' false
       
   141                     #'initiallyInvisible:' false
       
   142                     #'model:' #superclassNameChannel
   133                     #'model:' #superclassNameChannel
   143                     #'isReadOnly:' false
       
   144                     #'tabable:' true
   134                     #'tabable:' true
   145                     #'immediateAccept:' false
   135                     #'immediateAccept:' false
   146                     #'acceptOnLeave:' true
   136                     #'acceptOnLeave:' true
   147                     #'acceptOnReturn:' true
   137                     #'acceptOnReturn:' true
   148                     #'acceptOnTab:' true
   138                     #'acceptOnTab:' true
   150                     #'hasBorder:' false
   140                     #'hasBorder:' false
   151                 )
   141                 )
   152                  #(#InputFieldSpec
   142                  #(#InputFieldSpec
   153                     #'name:' 'methodNameField'
   143                     #'name:' 'methodNameField'
   154                     #'layout:' #(#LayoutFrame 120 0 130 0 289 0 149 0)
   144                     #'layout:' #(#LayoutFrame 120 0 130 0 289 0 149 0)
   155                     #'isOpaque:' true
       
   156                     #'initiallyDisabled:' false
       
   157                     #'initiallyInvisible:' false
       
   158                     #'model:' #methodNameChannel
   145                     #'model:' #methodNameChannel
   159                     #'isReadOnly:' false
       
   160                     #'tabable:' true
   146                     #'tabable:' true
   161                     #'immediateAccept:' false
   147                     #'immediateAccept:' false
   162                     #'acceptOnLeave:' true
   148                     #'acceptOnLeave:' true
   163                     #'acceptOnReturn:' true
   149                     #'acceptOnReturn:' true
   164                     #'acceptOnTab:' true
   150                     #'acceptOnTab:' true
   166                     #'hasBorder:' false
   152                     #'hasBorder:' false
   167                 )
   153                 )
   168                  #(#ActionButtonSpec
   154                  #(#ActionButtonSpec
   169                     #'name:' 'button1'
   155                     #'name:' 'button1'
   170                     #'layout:' #(#LayoutFrame 30 0 250 0 129 0 279 0)
   156                     #'layout:' #(#LayoutFrame 30 0 250 0 129 0 279 0)
   171                     #'isOpaque:' true
       
   172                     #'label:' 'cancel'
   157                     #'label:' 'cancel'
   173                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   158                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   174                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   159                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   175                     #'initiallyInvisible:' false
   160                     #'translateLabel:' false
   176                     #'tabable:' true
   161                     #'tabable:' true
   177                     #'isDefault:' false
       
   178                     #'defaultable:' false
       
   179                     #'model:' #cancel
   162                     #'model:' #cancel
   180                     #'hasCharacterOrientedLabel:' true
   163                     #'isTriggerOnDown:' false
   181                     #'isDecorated:' false
       
   182                     #'initiallyDisabled:' false
       
   183                 )
   164                 )
   184                  #(#ActionButtonSpec
   165                  #(#ActionButtonSpec
   185                     #'name:' 'button2'
   166                     #'name:' 'button2'
   186                     #'layout:' #(#LayoutFrame 160 0 250 0 259 0 279 0)
   167                     #'layout:' #(#LayoutFrame 160 0 250 0 259 0 279 0)
   187                     #'isOpaque:' true
       
   188                     #'label:' 'ok'
   168                     #'label:' 'ok'
   189                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   169                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   190                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   170                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   191                     #'initiallyInvisible:' false
   171                     #'translateLabel:' false
   192                     #'tabable:' true
   172                     #'tabable:' true
   193                     #'isDefault:' true
   173                     #'isDefault:' true
   194                     #'defaultable:' false
       
   195                     #'model:' #accept
   174                     #'model:' #accept
   196                     #'hasCharacterOrientedLabel:' true
   175                     #'isTriggerOnDown:' false
   197                     #'isDecorated:' false
       
   198                     #'initiallyDisabled:' false
       
   199                 )
   176                 )
   200                  #(#LabelSpec
   177                  #(#LabelSpec
   201                     #'name:' 'boxLabel'
   178                     #'name:' 'boxLabel'
   202                     #'layout:' #(#LayoutOrigin 78 0 11 0)
   179                     #'layout:' #(#LayoutOrigin 78 0 11 0)
   203                     #'isOpaque:' true
       
   204                     #'label:' 'class & selector for code'
   180                     #'label:' 'class & selector for code'
   205                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   181                     #'foregroundColor:' #(#Color 0.0 0.0 0.0)
   206                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   182                     #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993)
   207                     #'initiallyInvisible:' false
   183                     #'initiallyInvisible:' false
       
   184                     #'translateLabel:' false
   208                     #'level:' 0
   185                     #'level:' 0
   209                     #'adjust:' #center
   186                     #'adjust:' #center
   210                     #'hasCharacterOrientedLabel:' true
   187                     #'hasCharacterOrientedLabel:' true
   211                 )
   188                 )
   212               )
   189               )
   895 doPickAView
   872 doPickAView
   896     |view className methodName cls sel accepted spec s|
   873     |view className methodName cls sel accepted spec s|
   897 
   874 
   898     view := Display viewFromUser.
   875     view := Display viewFromUser.
   899     view isNil ifTrue:[^ self].
   876     view isNil ifTrue:[^ self].
   900 
       
   901     spec := UISpecification fromView:view topView.
   877     spec := UISpecification fromView:view topView.
   902 
   878 
   903     "/ ok, got it
   879     "/ ok, got it
   904     workView setupFromSpec:spec.
   880     workView setupFromSpec:spec.
   905     workView className:view class name.
   881     workView className:view class name.
   932     box title:(resources string:'Which file ?').
   908     box title:(resources string:'Which file ?').
   933     box selectingDirectory:false.
   909     box selectingDirectory:false.
   934     box pattern:'*.*'.
   910     box pattern:'*.*'.
   935     box action:[:aFile| self saveAs:aFile ].
   911     box action:[:aFile| self saveAs:aFile ].
   936     box open
   912     box open
   937 ! !
   913 !
   938 
       
   939 !UIPainter ignoredMethodsFor:'user interaction - menu'!
       
   940 
   914 
   941 doSource
   915 doSource
   942    |code v|
   916    |code v|
   943 
   917 
   944    code := workView generateCode.
   918    code := workView generateCode.
   946    v contents:code.
   920    v contents:code.
   947    v label:(workView applicationName).
   921    v label:(workView applicationName).
   948     ^ self
   922     ^ self
   949 
   923 
   950     "Modified: 5.9.1995 / 21:02:05 / claus"
   924     "Modified: 5.9.1995 / 21:02:05 / claus"
   951 ! !
   925 !
   952 
       
   953 !UIPainter methodsFor:'user interaction - menu'!
       
   954 
   926 
   955 doToggleTest
   927 doToggleTest
   956     workView testMode:(workView testMode not)
   928     workView testMode:(workView testMode not)
   957 !
   929 !
   958 
   930 
  1088         ]
  1060         ]
  1089     ].
  1061     ].
  1090     ^ menu
  1062     ^ menu
  1091 ! !
  1063 ! !
  1092 
  1064 
       
  1065 !UIPainter::ButtonPanel methodsFor:'queries'!
       
  1066 
       
  1067 specClass
       
  1068     ^ HorizontalPanelViewSpec
       
  1069 ! !
       
  1070 
  1093 !UIPainter class methodsFor:'documentation'!
  1071 !UIPainter class methodsFor:'documentation'!
  1094 
  1072 
  1095 version
  1073 version
  1096     ^ '$Header$'
  1074     ^ '$Header$'
  1097 ! !
  1075 ! !