UIListEditor.st
author Claus Gittinger <cg@exept.de>
Tue, 14 May 2019 09:46:21 +0200
changeset 3663 9d49ecf8661a
parent 2588 2b4338afd9d5
permissions -rw-r--r--
#UI_ENHANCEMENT by cg
class: TabListEditor class
changed:
#canvasSpec
#menu
#windowSpec
cg@2588
     1
"
cg@2588
     2
 COPYRIGHT (c) 2008 by eXept Software AG
cg@2588
     3
              All Rights Reserved
cg@2588
     4
cg@2588
     5
 This software is furnished under a license and may be used
cg@2588
     6
 only in accordance with the terms of that license and with the
cg@2588
     7
 inclusion of the above copyright notice.   This software may not
cg@2588
     8
 be provided or otherwise made available to, or used by, any
cg@2588
     9
 other person.  No title to or ownership of the software is
cg@2588
    10
 hereby transferred.
cg@2588
    11
"
sv@2282
    12
"{ Package: 'stx:libtool2' }"
sv@2282
    13
sv@2282
    14
SimpleDialog subclass:#UIListEditor
sv@2282
    15
	instanceVariableNames:'informationLabel listTextHolder useSymbolsHolder'
sv@2282
    16
	classVariableNames:''
sv@2282
    17
	poolDictionaries:''
sv@2282
    18
	category:'Interface-UIPainter'
sv@2282
    19
!
sv@2282
    20
cg@2588
    21
!UIListEditor class methodsFor:'documentation'!
cg@2588
    22
cg@2588
    23
copyright
cg@2588
    24
"
cg@2588
    25
 COPYRIGHT (c) 2008 by eXept Software AG
cg@2588
    26
              All Rights Reserved
cg@2588
    27
cg@2588
    28
 This software is furnished under a license and may be used
cg@2588
    29
 only in accordance with the terms of that license and with the
cg@2588
    30
 inclusion of the above copyright notice.   This software may not
cg@2588
    31
 be provided or otherwise made available to, or used by, any
cg@2588
    32
 other person.  No title to or ownership of the software is
cg@2588
    33
 hereby transferred.
cg@2588
    34
"
cg@2588
    35
! !
sv@2282
    36
sv@2282
    37
!UIListEditor class methodsFor:'help specs'!
sv@2282
    38
sv@2282
    39
helpSpec
sv@2282
    40
    "This resource specification was automatically generated
sv@2282
    41
     by the UIHelpTool of ST/X."
sv@2282
    42
sv@2282
    43
    "Do not manually edit this!! If it is corrupted,
sv@2282
    44
     the UIHelpTool may not be able to read the specification."
sv@2282
    45
sv@2282
    46
    "
sv@2282
    47
     UIHelpTool openOnClass:UIListEditor    
sv@2282
    48
    "
sv@2282
    49
sv@2282
    50
    <resource: #help>
sv@2282
    51
sv@2282
    52
    ^ super helpSpec addPairsFrom:#(
sv@2282
    53
sv@2282
    54
#useSymbols
sv@2282
    55
'Store list elements as symbols'
sv@2282
    56
sv@2282
    57
)
sv@2282
    58
! !
sv@2282
    59
sv@2282
    60
!UIListEditor class methodsFor:'interface specs'!
sv@2282
    61
sv@2282
    62
windowSpec
sv@2282
    63
    "This resource specification was automatically generated
sv@2282
    64
     by the UIPainter of ST/X."
sv@2282
    65
sv@2282
    66
    "Do not manually edit this!! If it is corrupted,
sv@2282
    67
     the UIPainter may not be able to read the specification."
sv@2282
    68
sv@2282
    69
    "
sv@2282
    70
     UIPainter new openOnClass:UIListEditor andSelector:#windowSpec
sv@2282
    71
     UIListEditor new openInterface:#windowSpec
sv@2282
    72
     UIListEditor open
sv@2282
    73
    "
sv@2282
    74
sv@2282
    75
    <resource: #canvas>
sv@2282
    76
sv@2282
    77
    ^ 
sv@2282
    78
     #(FullSpec
sv@2282
    79
        name: windowSpec
sv@2282
    80
        window: 
sv@2282
    81
       (WindowSpec
sv@2282
    82
          label: 'Edit List'
sv@2282
    83
          name: 'Edit List'
sv@2282
    84
          min: (Point 10 10)
sv@2282
    85
          bounds: (Rectangle 0 0 354 422)
sv@2282
    86
        )
sv@2282
    87
        component: 
sv@2282
    88
       (SpecCollection
sv@2282
    89
          collection: (
sv@2282
    90
           (LabelSpec
sv@2282
    91
              name: 'Label1'
sv@2282
    92
              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 28 0)
sv@2282
    93
              translateLabel: true
sv@2282
    94
              labelChannel: informationLabel
sv@2282
    95
            )
sv@2282
    96
           (TextEditorSpec
sv@2282
    97
              name: 'TextEditor1'
sv@2282
    98
              layout: (LayoutFrame 0 0 30 0 0 1 -63 1)
sv@2282
    99
              model: listTextHolder
sv@2282
   100
              hasHorizontalScrollBar: true
sv@2282
   101
              hasVerticalScrollBar: true
sv@2282
   102
              viewClassName: ''
sv@2282
   103
            )
sv@2282
   104
           (CheckBoxSpec
sv@2282
   105
              label: 'Use Symbols'
sv@2282
   106
              name: 'CheckBox1'
sv@2282
   107
              layout: (LayoutFrame 5 0 368 0 141 0 390 0)
sv@2282
   108
              activeHelpKey: useSymbols
sv@2282
   109
              model: useSymbolsHolder
sv@2282
   110
              translateLabel: true
sv@2282
   111
            )
sv@2282
   112
           (HorizontalPanelViewSpec
sv@2282
   113
              name: 'HorizontalPanel1'
sv@2282
   114
              layout: (LayoutFrame 0 0 -33 1 0 1 0 1)
sv@2282
   115
              horizontalLayout: fitSpace
sv@2282
   116
              verticalLayout: center
sv@2282
   117
              horizontalSpace: 3
sv@2282
   118
              verticalSpace: 3
sv@2282
   119
              component: 
sv@2282
   120
             (SpecCollection
sv@2282
   121
                collection: (
sv@2282
   122
                 (ActionButtonSpec
sv@2282
   123
                    label: 'Cancel'
sv@2282
   124
                    name: 'Button1'
sv@2282
   125
                    translateLabel: true
sv@2282
   126
                    model: doCancel
sv@2282
   127
                    extent: (Point 172 22)
sv@2282
   128
                  )
sv@2282
   129
                 (ActionButtonSpec
sv@2282
   130
                    label: 'OK'
sv@2282
   131
                    name: 'Button2'
sv@2282
   132
                    translateLabel: true
sv@2282
   133
                    model: doAccept
sv@2282
   134
                    isDefault: true
sv@2282
   135
                    extent: (Point 173 22)
sv@2282
   136
                  )
sv@2282
   137
                 )
sv@2282
   138
               
sv@2282
   139
              )
sv@2282
   140
            )
sv@2282
   141
           )
sv@2282
   142
         
sv@2282
   143
        )
sv@2282
   144
      )
sv@2282
   145
! !
sv@2282
   146
sv@2282
   147
!UIListEditor methodsFor:'accessing'!
sv@2282
   148
sv@2282
   149
informationLabel
sv@2282
   150
    ^ informationLabel
sv@2282
   151
!
sv@2282
   152
sv@2282
   153
informationLabel:something
sv@2282
   154
    informationLabel := something.
sv@2282
   155
!
sv@2282
   156
sv@2282
   157
list
sv@2282
   158
    "answer the list as an array"
sv@2282
   159
sv@2282
   160
    |list|
sv@2282
   161
sv@2282
   162
    list := self listTextHolder value asStringCollection asArray.
sv@2282
   163
    self useSymbolsHolder value ifTrue:[
sv@2282
   164
        list := list collect:[:e| e asSymbol].
sv@2282
   165
    ].
sv@2282
   166
sv@2282
   167
    ^ list
sv@2282
   168
!
sv@2282
   169
sv@2282
   170
list:anArray
sv@2282
   171
    self listTextHolder value:anArray asStringCollection asString.
sv@2282
   172
!
sv@2282
   173
sv@2282
   174
useSymbols:aBoolean
sv@2282
   175
    self useSymbolsHolder value:aBoolean
sv@2282
   176
! !
sv@2282
   177
sv@2282
   178
!UIListEditor methodsFor:'aspects'!
sv@2282
   179
sv@2282
   180
listTextHolder
sv@2282
   181
    <resource: #uiAspect>
sv@2282
   182
sv@2282
   183
    listTextHolder isNil ifTrue:[
sv@2282
   184
        listTextHolder := '' asValue.
sv@2282
   185
    ].
sv@2282
   186
    ^ listTextHolder.
sv@2282
   187
!
sv@2282
   188
sv@2282
   189
useSymbolsHolder
sv@2282
   190
    <resource: #uiAspect>
sv@2282
   191
sv@2282
   192
    useSymbolsHolder isNil ifTrue:[
sv@2282
   193
        useSymbolsHolder := false asValue.
sv@2282
   194
    ].
sv@2282
   195
    ^ useSymbolsHolder.
sv@2282
   196
! !
sv@2282
   197
sv@2282
   198
!UIListEditor class methodsFor:'documentation'!
sv@2282
   199
sv@2282
   200
version
sv@2282
   201
    ^ '$Header$'
cg@2588
   202
!
cg@2588
   203
cg@2588
   204
version_CVS
cg@2588
   205
    ^ '$Header$'
sv@2282
   206
! !