UISpecificationTool.st
author Claus Gittinger <cg@exept.de>
Sat, 04 Oct 1997 16:14:08 +0200
changeset 324 2898d6c12330
parent 307 fe559a9136d9
child 346 38ea269664f8
permissions -rw-r--r--
checkin from browser
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
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    68
#showRoot
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    69
'show or hide the first element into the hierarchical list.'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    70
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    71
#tabOrientation
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    72
'where to place the tabs'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    73
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    74
#menuHolder
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    75
'selector or holder of the middle button menu'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    76
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    77
#galleryModel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    78
'a holder, which keeps the label of the current selected tab or nil.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    79
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    80
#listHolder
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    81
'gets a list or list holder'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    82
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    83
#document
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    84
'a holder which keeps the document name to be shown.'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    85
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
    86
#hierarchicalList
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
    87
'gets a hierarchical list or a holder which keeps a hierarchical list entry; the value must be a member of class TreeItem.'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
    88
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
    89
#maxChars
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    90
'set the maximum number of characters that are allowed in the editfield.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    91
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    92
#action
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    93
'action evaluated when the button is pressed or released which depends on the setting of triggerOnDown flag, either set the press-action and clear any release-action or vice versa, set the release-action and clear the press-action.'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
    94
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    95
#canvasSelector
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    96
'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
    97
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    98
#enableChannel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
    99
'enable the view - selection changes are allowed'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   100
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   101
#middleButtonPressed
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   102
'called if the middle button is pressed; you can open a menu'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   103
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   104
#showDirectoyIndication
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   105
'show or hide the open/closed indicator on nodes which contains children'
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   106
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   107
#oneTabPerLine
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   108
'draw only one tab per line'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   109
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   110
#defaultLabel
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   111
'set the default label which will be set if nothing selected.'
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   112
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   113
#hierarchicalListButton
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   114
'opens the hierarchical list editor, which generates and installs a hierarchical list.'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   115
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   116
#arbitraryView
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   117
'the widget class shown represented by the arbitrary component or a selector which returns a widget class.'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   118
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   119
#id
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   120
'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
   121
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   122
#sizeAsDefault
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   123
'the size of the widget depends on its label. In case of a fixed Layout nothing will change.'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   124
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   125
#selectionHolder
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   126
'the one which keeps the selection.'
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   127
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   128
#canvas
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   129
'gets a widget placed into the notebook'
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   130
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   131
#level
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   132
'set the level relative to its superView'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   133
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   134
#majorKey
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   135
'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
   136
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   137
#isMultiSelect
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   138
'enable/disable multiple selections.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   139
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   140
#gallerySelection
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   141
'a holder, which keeps the specification of the current selected widget or nil.'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   142
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   143
#gallerySelectors
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   144
'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
   145
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   146
#beDefault
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   147
'show/dont show a return-key image after the label'
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   148
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   149
#canvasArgument
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   150
'the argument to the selector or none'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   151
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   152
#backgroundColor
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   153
'set the background color'
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   154
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   155
#typeConverter
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   156
'convert the fields string value to some object'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   157
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   158
#showLines
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   159
'show or hide lines'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   160
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   161
#label
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   162
'the label of the widget'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   163
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   164
#minorKey
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   165
'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
   166
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   167
#showFrame
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   168
'show the frame'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   169
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   170
#autoRepeat
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   171
'repeat the action as long as the button is pressed; to have this behavior the ''isTriggerOnDown'' state must be enabled'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   172
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   173
#booleanHolder
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   174
'a boolean holder which keeps the state'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   175
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   176
#menuButton
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   177
'pressing the button will open the menu editor on the specified menu selector.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   178
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   179
#galleryLabels
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   180
'a list of tab labels'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   181
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   182
#tabLabels
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   183
'a list or list holder which provides the labels assigned to the tabs.'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   184
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   185
#fileSelectionTreeRoot
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   186
'a holder, which keeps the pathname of the root directory (first entry into the list).'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   187
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   188
#foregroundColor
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   189
'set the foreground color'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   190
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   191
#tabWidget
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   192
'select the tab style'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   193
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   194
#clientKey
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   195
'returns an application which provides the builder. On default the application itself is used.'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   196
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   197
#valueChangeSelector
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   198
'called whenever the selection changed. If the selector ends with '':'' the method is invoked with the current selection.'
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   199
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   200
#fontMenu
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   201
'set the font for the widget'
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   202
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   203
#doubleClickSelector
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   204
'define the double click action which is evaluated on double click in case of a none nil selection. If the selector ends with '':'' the method is invoked with the current selection.'
303
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   205
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   206
#isTriggerOnDown
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   207
'if true, the action is evaluated when the button is pressed'
798e309561f1 checkin from browser
ca
parents: 294
diff changeset
   208
307
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   209
#borderWidth
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   210
'width of the border'
fe559a9136d9 changes caused by update of help tool
ca
parents: 303
diff changeset
   211
294
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   212
#useIndex
65cb680c74e4 add some helptext
ca
parents: 172
diff changeset
   213
'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
   214
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   215
)
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   216
! !
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   217
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   218
!UISpecificationTool class methodsFor:'interface specs'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   219
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   220
windowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   221
    "this window spec was automatically generated by the ST/X UIPainter"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   222
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   223
    "do not manually edit this - the painter/builder may not be able to
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   224
     handle the specification if its corrupted."
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   225
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   226
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   227
     UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   228
     UISpecificationTool new openInterface:#windowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   229
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   230
    "UISpecificationTool open"
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   231
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   232
    <resource: #canvas>
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   233
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   234
    ^
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   235
     
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   236
       #(#FullSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   237
          #'window:' 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   238
           #(#WindowSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   239
              #'name:' 'uIPainterView'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   240
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   241
              #'label:' 'unnamed canvas'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   242
              #'bounds:' #(#Rectangle 0 0 300 300)
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   243
          )
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   244
          #'component:' 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   245
           #(#SpecCollection
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   246
              #'collection:' 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   247
               #(
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   248
                 #(#ViewSpec
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   249
                    #'name:' 'Frame'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   250
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   251
                )
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
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   257
!UISpecificationTool methodsFor:'accessing'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   258
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   259
specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   260
    "gets current edit specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   261
    "
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   262
    ^ specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   263
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   264
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   265
!
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   266
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   267
specification:aSpec
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   268
    "sets current edit specification
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   269
    "
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   270
    aSpec isNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   271
        specChannel   := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   272
        specification := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   273
        aspects       := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   274
    ] ifFalse:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   275
        specification class == aSpec class ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   276
            specification := aSpec.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   277
          ^ specChannel value:specification.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   278
        ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   279
        specification  := aSpec.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   280
        aspects        := IdentityDictionary new.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   281
        specChannel    := specification asValue.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   282
        specification class addBindingsTo:aspects for:specification channel:specChannel.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   283
        aspects do:[:el| el addDependent:self ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   284
    ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   285
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   286
    selection notNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   287
        (builder componentAt:#Frame) destroySubViews.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   288
        selection := nil.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   289
    ].
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   290
! !
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   291
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   292
!UISpecificationTool methodsFor:'accessing channels'!
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   293
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   294
modifiedHolder:aValueHolder
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   295
    "set the value holder set to true in case of modifying attributes
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   296
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   297
    modifiedHolder notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   298
        modifiedHolder removeDependent:self. 
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   299
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   300
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   301
    (modifiedHolder := aValueHolder) notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   302
        modifiedHolder addDependent:self.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   303
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   304
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   305
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   306
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   307
!UISpecificationTool methodsFor:'bindings'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   308
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   309
aspectFor:aKey
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   310
    "returns aspect for a key or nil
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   311
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   312
    aspects notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   313
        ^ aspects at:aKey ifAbsent:nil
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   314
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   315
    ^ super aspectFor:aKey
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   316
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   317
! !
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   318
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   319
!UISpecificationTool methodsFor:'change & update'!
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   320
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   321
update
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   322
    "reload specification
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   323
    "
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   324
    specChannel notNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   325
        specChannel value:specification.
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   326
    ]
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   327
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   328
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   329
!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   330
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   331
update:something with:someArgument from:someone
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   332
    "any attribute changed its state in the current specification
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   333
    "
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   334
    someone ~~ modifiedHolder ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   335
        modifiedHolder value ~~ true ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   336
            modifiedHolder value:true
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   337
        ]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   338
    ]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   339
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   340
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   341
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   342
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   343
!UISpecificationTool methodsFor:'selection'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   344
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   345
selection:something
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   346
    "selection changed
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   347
    "
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   348
    |slices idx spec frame|
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   349
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   350
    specification notNil ifTrue:[
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   351
        slices := specification class slices.
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   352
        idx:= slices findFirst:[:aSlice| aSlice first = something ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   353
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   354
        idx ~~ 0 ifTrue:[
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   355
            spec := specification class perform:((slices at:idx) last).
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   356
        ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   357
    ].
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   358
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   359
    spec ~= selection ifTrue:[
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   360
        frame := builder componentAt:#Frame.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   361
        frame destroySubViews.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   362
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   363
        spec notNil ifTrue:[
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   364
            builder buildFromSpec:spec in:frame.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   365
            frame allViewBackground:(frame viewBackground).
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   366
            frame realizeAllSubViews.
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   367
        ]
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   368
    ].
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 164
diff changeset
   369
    selection := spec.
164
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   370
! !
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   371
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   372
!UISpecificationTool class methodsFor:'documentation'!
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   373
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   374
version
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   375
    ^ '$Header$'
1bc26edd0d3e intitial checkin
ca
parents:
diff changeset
   376
! !