UISpecificationTool.st
author ca
Tue, 26 Aug 1997 17:45:24 +0200
changeset 294 65cb680c74e4
parent 172 10e8e0510baa
child 303 798e309561f1
permissions -rw-r--r--
add some helptext
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     1
"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by eXept Software AG
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     4
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    11
"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    12
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    13
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    14
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    15
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    16
ApplicationModel subclass:#UISpecificationTool
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    17
	instanceVariableNames:'modifiedHolder aspects specification selection specChannel'
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    18
	classVariableNames:''
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    19
	poolDictionaries:''
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    20
	category:'Interface-UIPainter'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    21
!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    22
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    23
!UISpecificationTool class methodsFor:'documentation'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    24
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    25
copyright
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    26
"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    27
 COPYRIGHT (c) 1995 by eXept Software AG
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    28
              All Rights Reserved
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    29
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    30
 This software is furnished under a license and may be used
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    35
 hereby transferred.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    36
"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    37
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    38
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    39
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    40
!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    41
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    42
documentation
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    43
"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    44
    used by the UIPainter to manipulate the specifications of the selected component
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    45
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    46
    [author:]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    47
        Claus Atzkern
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    48
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    49
    [see also:]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    50
        UIPainter
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    51
        UILayoutTool
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    52
        UIHelpTool
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    53
"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    54
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
    55
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    56
!UISpecificationTool class methodsFor:'help specs'!
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    57
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    58
helpSpec
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    59
    "return a dictionary filled with helpKey -> helptext associations.
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    60
     These are used by the activeHelp tool."
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    61
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    62
    "
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    63
    UIHelpTool openOnClass:UISpecificationTool    
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    64
    "
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    65
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    66
  ^ super helpSpec addPairsFrom:#(
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    67
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    68
#menuHolder
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    69
'selector or holder of the middle button menu'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    70
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    71
#galleryModel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    72
'a holder, which keeps the label of the current selected tab or nil.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    73
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    74
#listHolder
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    75
'gets a list or list holder'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    76
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    77
#maxChars
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    78
'set the maximum number of characters that are allowed in the editfield.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    79
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    80
#canvasSelector
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    81
'after open the application specified by the clientKey, this selector if not nil will be evaluated,'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    82
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    83
#enableChannel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    84
'enable the view - selection changes are allowed'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    85
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    86
#canvas
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    87
'gets a widget placed into the notebook'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    88
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    89
#middleButtonPressed
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    90
'called if the middle button is pressed; you can open a menu'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    91
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    92
#defaultLabel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    93
'set the default label which will be set if nothing selected.'
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    94
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    95
#id
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    96
'enter the name of the field here. This ID can be used by the application to access components, using #componentAt:<key>'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    97
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    98
#selectionHolder
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    99
'the one which keeps the selection and in case of a ''SelectionInList'' model the list.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   100
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   101
#level
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   102
'set the level relative to its superView'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   103
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   104
#majorKey
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   105
'name of the class which provides the window specification or in case of nil the application itself is used'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   106
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   107
#isMultiSelect
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   108
'enable/disable multiple selections.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   109
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   110
#gallerySelectors
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   111
'the list of selectors specify which interface specification should be used dependent on the tab pressed. Each selector must return an interfaceSpec. On default the #windowSpec method is used'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   112
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   113
#gallerySelection
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   114
'a holder, which keeps the specification of the current selected widget or nil.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   115
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   116
#canvasArgument
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   117
'the argument to the selector or none'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   118
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   119
#typeConverter
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   120
'convert the fields string value to some object'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   121
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   122
#backgroundColor
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   123
'set the background color'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   124
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   125
#minorKey
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   126
'the selector specifies which interface specification to be used. The selector must return an interfaceSpec. On default the #windowSpec method is used'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   127
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   128
#menuButton
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   129
'pressing the button will open the menu editor on the specified menu selector.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   130
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   131
#galleryLabels
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   132
'a list of tab labels'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   133
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   134
#selectionModel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   135
'the one which keeps the selection and in case of a ''SelectionInList'' model the list.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   136
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   137
#tabLabels
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   138
'a list or list holder which provides the labels assigned to the tabs.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   139
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   140
#foregroundColor
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   141
'set the foreground color'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   142
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   143
#tabWidget
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   144
'select the tab style'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   145
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   146
#valueChangeSelector
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   147
'called whenever the selection changed'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   148
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   149
#doubleClickSelector
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   150
'define the double click action which is evaluated on double click in case of a none nil selection'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   151
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   152
#fontMenu
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   153
'set the font for the widget'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   154
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   155
#clientKey
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   156
'returns an application which provides the builder. On default the application itself is used.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   157
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   158
#useIndex
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   159
'set/clear the useIndex flag. If set, the index of the selection is used otherwise the selected string.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   160
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   161
#tabOrientation
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   162
'where to place the tabs'
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   163
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   164
)
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   165
! !
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   166
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   167
!UISpecificationTool class methodsFor:'interface specs'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   168
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   169
windowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   170
    "this window spec was automatically generated by the ST/X UIPainter"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   171
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   172
    "do not manually edit this - the painter/builder may not be able to
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   173
     handle the specification if its corrupted."
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   174
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   175
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   176
     UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   177
     UISpecificationTool new openInterface:#windowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   178
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   179
    "UISpecificationTool open"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   180
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   181
    <resource: #canvas>
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   182
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   183
    ^
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   184
     
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   185
       #(#FullSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   186
          #'window:' 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   187
           #(#WindowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   188
              #'name:' 'uIPainterView'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   189
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   190
              #'label:' 'unnamed canvas'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   191
              #'bounds:' #(#Rectangle 0 0 300 300)
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   192
          )
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   193
          #'component:' 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   194
           #(#SpecCollection
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   195
              #'collection:' 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   196
               #(
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   197
                 #(#ViewSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   198
                    #'name:' 'Frame'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   199
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   200
                )
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   201
              )
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   202
          )
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   203
      )
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   204
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   205
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   206
!UISpecificationTool methodsFor:'accessing'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   207
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   208
specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   209
    "gets current edit specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   210
    "
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   211
    ^ specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   212
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   213
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   214
!
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   215
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   216
specification:aSpec
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   217
    "sets current edit specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   218
    "
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   219
    aSpec isNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   220
        specChannel   := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   221
        specification := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   222
        aspects       := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   223
    ] ifFalse:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   224
        specification class == aSpec class ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   225
            specification := aSpec.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   226
          ^ specChannel value:specification.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   227
        ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   228
        specification  := aSpec.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   229
        aspects        := IdentityDictionary new.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   230
        specChannel    := specification asValue.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   231
        specification class addBindingsTo:aspects for:specification channel:specChannel.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   232
        aspects do:[:el| el addDependent:self ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   233
    ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   234
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   235
    selection notNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   236
        (builder componentAt:#Frame) destroySubViews.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   237
        selection := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   238
    ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   239
! !
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   240
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   241
!UISpecificationTool methodsFor:'accessing channels'!
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   242
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   243
modifiedHolder:aValueHolder
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   244
    "set the value holder set to true in case of modifying attributes
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   245
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   246
    modifiedHolder notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   247
        modifiedHolder removeDependent:self. 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   248
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   249
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   250
    (modifiedHolder := aValueHolder) notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   251
        modifiedHolder addDependent:self.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   252
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   253
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   254
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   255
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   256
!UISpecificationTool methodsFor:'bindings'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   257
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   258
aspectFor:aKey
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   259
    "returns aspect for a key or nil
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   260
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   261
    aspects notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   262
        ^ aspects at:aKey ifAbsent:nil
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   263
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   264
    ^ super aspectFor:aKey
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   265
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   266
! !
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   267
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   268
!UISpecificationTool methodsFor:'change & update'!
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   269
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   270
update
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   271
    "reload specification
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   272
    "
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   273
    specChannel notNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   274
        specChannel value:specification.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   275
    ]
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   276
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   277
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   278
!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   279
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   280
update:something with:someArgument from:someone
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   281
    "any attribute changed its state in the current specification
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   282
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   283
    someone ~~ modifiedHolder ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   284
        modifiedHolder value ~~ true ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   285
            modifiedHolder value:true
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   286
        ]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   287
    ]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   288
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   289
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   290
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   291
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   292
!UISpecificationTool methodsFor:'selection'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   293
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   294
selection:something
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   295
    "selection changed
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   296
    "
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   297
    |slices idx spec frame|
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   298
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   299
    specification notNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   300
        slices := specification class slices.
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   301
        idx:= slices findFirst:[:aSlice| aSlice first = something ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   302
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   303
        idx ~~ 0 ifTrue:[
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   304
            spec := specification class perform:((slices at:idx) last).
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   305
        ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   306
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   307
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   308
    spec ~= selection ifTrue:[
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   309
        frame := builder componentAt:#Frame.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   310
        frame destroySubViews.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   311
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   312
        spec notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   313
            builder buildFromSpec:spec in:frame.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   314
            frame allViewBackground:(frame viewBackground).
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   315
            frame realizeAllSubViews.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   316
        ]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   317
    ].
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   318
    selection := spec.
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   319
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   320
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   321
!UISpecificationTool class methodsFor:'documentation'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   322
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   323
version
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   324
    ^ '$Header$'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   325
! !