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