initial checkin
authorStefan Vogel <sv@exept.de>
Mon, 25 Feb 2008 20:11:20 +0100
changeset 2282cc1eded4d84d
parent 2281 e6cc565bff35
child 2283 b14becb50aac
initial checkin
UIListEditor.st
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/UIListEditor.st	Mon Feb 25 20:11:20 2008 +0100
     1.3 @@ -0,0 +1,176 @@
     1.4 +"{ Package: 'stx:libtool2' }"
     1.5 +
     1.6 +SimpleDialog subclass:#UIListEditor
     1.7 +	instanceVariableNames:'informationLabel listTextHolder useSymbolsHolder'
     1.8 +	classVariableNames:''
     1.9 +	poolDictionaries:''
    1.10 +	category:'Interface-UIPainter'
    1.11 +!
    1.12 +
    1.13 +
    1.14 +!UIListEditor class methodsFor:'help specs'!
    1.15 +
    1.16 +helpSpec
    1.17 +    "This resource specification was automatically generated
    1.18 +     by the UIHelpTool of ST/X."
    1.19 +
    1.20 +    "Do not manually edit this!! If it is corrupted,
    1.21 +     the UIHelpTool may not be able to read the specification."
    1.22 +
    1.23 +    "
    1.24 +     UIHelpTool openOnClass:UIListEditor    
    1.25 +    "
    1.26 +
    1.27 +    <resource: #help>
    1.28 +
    1.29 +    ^ super helpSpec addPairsFrom:#(
    1.30 +
    1.31 +#useSymbols
    1.32 +'Store list elements as symbols'
    1.33 +
    1.34 +)
    1.35 +! !
    1.36 +
    1.37 +!UIListEditor class methodsFor:'interface specs'!
    1.38 +
    1.39 +windowSpec
    1.40 +    "This resource specification was automatically generated
    1.41 +     by the UIPainter of ST/X."
    1.42 +
    1.43 +    "Do not manually edit this!! If it is corrupted,
    1.44 +     the UIPainter may not be able to read the specification."
    1.45 +
    1.46 +    "
    1.47 +     UIPainter new openOnClass:UIListEditor andSelector:#windowSpec
    1.48 +     UIListEditor new openInterface:#windowSpec
    1.49 +     UIListEditor open
    1.50 +    "
    1.51 +
    1.52 +    <resource: #canvas>
    1.53 +
    1.54 +    ^ 
    1.55 +     #(FullSpec
    1.56 +        name: windowSpec
    1.57 +        window: 
    1.58 +       (WindowSpec
    1.59 +          label: 'Edit List'
    1.60 +          name: 'Edit List'
    1.61 +          min: (Point 10 10)
    1.62 +          bounds: (Rectangle 0 0 354 422)
    1.63 +        )
    1.64 +        component: 
    1.65 +       (SpecCollection
    1.66 +          collection: (
    1.67 +           (LabelSpec
    1.68 +              name: 'Label1'
    1.69 +              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 28 0)
    1.70 +              translateLabel: true
    1.71 +              labelChannel: informationLabel
    1.72 +            )
    1.73 +           (TextEditorSpec
    1.74 +              name: 'TextEditor1'
    1.75 +              layout: (LayoutFrame 0 0 30 0 0 1 -63 1)
    1.76 +              model: listTextHolder
    1.77 +              hasHorizontalScrollBar: true
    1.78 +              hasVerticalScrollBar: true
    1.79 +              viewClassName: ''
    1.80 +            )
    1.81 +           (CheckBoxSpec
    1.82 +              label: 'Use Symbols'
    1.83 +              name: 'CheckBox1'
    1.84 +              layout: (LayoutFrame 5 0 368 0 141 0 390 0)
    1.85 +              activeHelpKey: useSymbols
    1.86 +              model: useSymbolsHolder
    1.87 +              translateLabel: true
    1.88 +            )
    1.89 +           (HorizontalPanelViewSpec
    1.90 +              name: 'HorizontalPanel1'
    1.91 +              layout: (LayoutFrame 0 0 -33 1 0 1 0 1)
    1.92 +              horizontalLayout: fitSpace
    1.93 +              verticalLayout: center
    1.94 +              horizontalSpace: 3
    1.95 +              verticalSpace: 3
    1.96 +              component: 
    1.97 +             (SpecCollection
    1.98 +                collection: (
    1.99 +                 (ActionButtonSpec
   1.100 +                    label: 'Cancel'
   1.101 +                    name: 'Button1'
   1.102 +                    translateLabel: true
   1.103 +                    model: doCancel
   1.104 +                    extent: (Point 172 22)
   1.105 +                  )
   1.106 +                 (ActionButtonSpec
   1.107 +                    label: 'OK'
   1.108 +                    name: 'Button2'
   1.109 +                    translateLabel: true
   1.110 +                    model: doAccept
   1.111 +                    isDefault: true
   1.112 +                    extent: (Point 173 22)
   1.113 +                  )
   1.114 +                 )
   1.115 +               
   1.116 +              )
   1.117 +            )
   1.118 +           )
   1.119 +         
   1.120 +        )
   1.121 +      )
   1.122 +! !
   1.123 +
   1.124 +!UIListEditor methodsFor:'accessing'!
   1.125 +
   1.126 +informationLabel
   1.127 +    ^ informationLabel
   1.128 +!
   1.129 +
   1.130 +informationLabel:something
   1.131 +    informationLabel := something.
   1.132 +!
   1.133 +
   1.134 +list
   1.135 +    "answer the list as an array"
   1.136 +
   1.137 +    |list|
   1.138 +
   1.139 +    list := self listTextHolder value asStringCollection asArray.
   1.140 +    self useSymbolsHolder value ifTrue:[
   1.141 +        list := list collect:[:e| e asSymbol].
   1.142 +    ].
   1.143 +
   1.144 +    ^ list
   1.145 +!
   1.146 +
   1.147 +list:anArray
   1.148 +    self listTextHolder value:anArray asStringCollection asString.
   1.149 +!
   1.150 +
   1.151 +useSymbols:aBoolean
   1.152 +    self useSymbolsHolder value:aBoolean
   1.153 +! !
   1.154 +
   1.155 +!UIListEditor methodsFor:'aspects'!
   1.156 +
   1.157 +listTextHolder
   1.158 +    <resource: #uiAspect>
   1.159 +
   1.160 +    listTextHolder isNil ifTrue:[
   1.161 +        listTextHolder := '' asValue.
   1.162 +    ].
   1.163 +    ^ listTextHolder.
   1.164 +!
   1.165 +
   1.166 +useSymbolsHolder
   1.167 +    <resource: #uiAspect>
   1.168 +
   1.169 +    useSymbolsHolder isNil ifTrue:[
   1.170 +        useSymbolsHolder := false asValue.
   1.171 +    ].
   1.172 +    ^ useSymbolsHolder.
   1.173 +! !
   1.174 +
   1.175 +!UIListEditor class methodsFor:'documentation'!
   1.176 +
   1.177 +version
   1.178 +    ^ '$Header$'
   1.179 +! !