TabulatorSpecification.st
changeset 161 5b6e284959a4
parent 158 431e38dfc5ab
child 189 62771f258ef8
equal deleted inserted replaced
160:61d95c5f5102 161:5b6e284959a4
    54 !
    54 !
    55 
    55 
    56 examples 
    56 examples 
    57 "
    57 "
    58     Example use (in a ListView):
    58     Example use (in a ListView):
    59 
    59                                                                         [exBegin]
    60 	|listView tabSpec entry|
    60         |listView tabSpec entry|
    61 
    61 
    62 	listView := ListView new.
    62         listView := ListView new.
    63 
    63 
    64 	tabSpec := TabulatorSpecification new.
    64         tabSpec := TabulatorSpecification new.
    65 	tabSpec unit:#inch.
    65         tabSpec unit:#inch.
    66 	tabSpec positions:#(0     1     2.5    3.5    4       5        ).
    66         tabSpec positions:#(0     1     2.5    3.5    4       5        ).
    67 	tabSpec align:    #(#left #left #right #right #center #decimal ).
    67         tabSpec align:    #(#left #left #right #right #center #decimal ).
    68 
    68 
    69 	entry := MultiColListEntry new.
    69         entry := MultiColListEntry new.
    70 	entry tabulatorSpecification:tabSpec.
    70         entry tabulatorSpecification:tabSpec.
    71 	entry colAt:1 put:'left';
    71         entry colAt:1 put:'left';
    72 	      colAt:2 put:'left';
    72               colAt:2 put:'left';
    73 	      colAt:3 put:'right';
    73               colAt:3 put:'right';
    74 	      colAt:4 put:'right';
    74               colAt:4 put:'right';
    75 	      colAt:5 put:'center';
    75               colAt:5 put:'center';
    76 	      colAt:6 put:'.decimal'.
    76               colAt:6 put:'.decimal'.
    77 
    77 
    78 	listView at:1 put:entry.
    78         listView at:1 put:entry.
    79 
    79 
    80 	entry := MultiColListEntry new.
    80         entry := MultiColListEntry new.
    81 	entry tabulatorSpecification:tabSpec.
    81         entry tabulatorSpecification:tabSpec.
    82 	entry colAt:1 put:'col1';
    82         entry colAt:1 put:'col1';
    83 	      colAt:2 put:'col2';
    83               colAt:2 put:'col2';
    84 	      colAt:3 put:'col3';
    84               colAt:3 put:'col3';
    85 	      colAt:4 put:'col4';
    85               colAt:4 put:'col4';
    86 	      colAt:5 put:'col5';
    86               colAt:5 put:'col5';
    87 	      colAt:6 put:'col6.decimal'.
    87               colAt:6 put:'col6.decimal'.
    88 
    88 
    89 	listView at:2 put:entry.
    89         listView at:2 put:entry.
    90 
    90 
    91 	entry := MultiColListEntry new.
    91         entry := MultiColListEntry new.
    92 	entry tabulatorSpecification:tabSpec.
    92         entry tabulatorSpecification:tabSpec.
    93 	entry colAt:1 put:'foo';
    93         entry colAt:1 put:'foo';
    94 	      colAt:2 put:'fooBar';
    94               colAt:2 put:'fooBar';
    95 	      colAt:3 put:'bar';
    95               colAt:3 put:'bar';
    96 	      colAt:4 put:'barFoo';
    96               colAt:4 put:'barFoo';
    97 	      colAt:5 put:'baz';
    97               colAt:5 put:'baz';
    98 	      colAt:6 put:'1234.56'.
    98               colAt:6 put:'1234.56'.
    99 
    99 
   100 	listView at:3 put:entry.
   100         listView at:3 put:entry.
   101 	listView open
   101         listView open
       
   102                                                                         [exEnd]
   102 
   103 
   103 
   104 
   104     defining field positions in millimeter :
   105     defining field positions in millimeter :
   105 
   106                                                                         [exBegin]
   106 	|listView tabSpec entry|
   107         |listView tabSpec entry|
   107 
   108 
   108 	listView := ListView new.
   109         listView := ListView new.
   109 
   110 
   110 	tabSpec := TabulatorSpecification new.
   111         tabSpec := TabulatorSpecification new.
   111 	tabSpec unit:#mm.
   112         tabSpec unit:#mm.
   112 	tabSpec positions:#(0 10 20 40).
   113         tabSpec positions:#(0 10 20 40).
   113 	tabSpec align:    #left.          
   114         tabSpec align:    #left.          
   114 
   115 
   115 	entry := MultiColListEntry new.
   116         entry := MultiColListEntry new.
   116 	entry tabulatorSpecification:tabSpec.
   117         entry tabulatorSpecification:tabSpec.
   117 	entry colAt:1 put:'1';
   118         entry colAt:1 put:'1';
   118 	      colAt:2 put:'2';
   119               colAt:2 put:'2';
   119 	      colAt:3 put:'3';
   120               colAt:3 put:'3';
   120 	      colAt:4 put:'4'.
   121               colAt:4 put:'4'.
   121 
   122 
   122 	listView at:1 put:entry.
   123         listView at:1 put:entry.
   123 
   124 
   124 	entry := MultiColListEntry new.
   125         entry := MultiColListEntry new.
   125 	entry tabulatorSpecification:tabSpec.
   126         entry tabulatorSpecification:tabSpec.
   126 	entry colAt:1 put:'aa';
   127         entry colAt:1 put:'aa';
   127 	      colAt:2 put:'bb';
   128               colAt:2 put:'bb';
   128 	      colAt:3 put:'cc';
   129               colAt:3 put:'cc';
   129 	      colAt:4 put:'dd'.
   130               colAt:4 put:'dd'.
   130 
   131 
   131 	listView at:2 put:entry.
   132         listView at:2 put:entry.
   132 
   133 
   133 	listView open
   134         listView open
       
   135                                                                         [exEnd]
   134 
   136 
   135     defining field widths in millimeter :
   137     defining field widths in millimeter :
   136 
   138                                                                         [exBegin]
   137 	|listView tabSpec entry|
   139         |listView tabSpec entry|
   138 
   140 
   139 	listView := ListView new.
   141         listView := ListView new.
   140 
   142 
   141 	tabSpec := TabulatorSpecification new.
   143         tabSpec := TabulatorSpecification new.
   142 	tabSpec unit:#mm.
   144         tabSpec unit:#mm.
   143 	tabSpec widths:#(10 10 20 10).
   145         tabSpec widths:#(10 10 20 10).
   144 	tabSpec align:    #left.        
   146         tabSpec align:    #left.        
   145 
   147 
   146 	entry := MultiColListEntry new.
   148         entry := MultiColListEntry new.
   147 	entry tabulatorSpecification:tabSpec.
   149         entry tabulatorSpecification:tabSpec.
   148 	entry colAt:1 put:'1';
   150         entry colAt:1 put:'1';
   149 	      colAt:2 put:'2';
   151               colAt:2 put:'2';
   150 	      colAt:3 put:'3';
   152               colAt:3 put:'3';
   151 	      colAt:4 put:'4'.
   153               colAt:4 put:'4'.
   152 
   154 
   153 	listView at:1 put:entry.
   155         listView at:1 put:entry.
   154 
   156 
   155 	entry := MultiColListEntry new.
   157         entry := MultiColListEntry new.
   156 	entry tabulatorSpecification:tabSpec.
   158         entry tabulatorSpecification:tabSpec.
   157 	entry colAt:1 put:'aa';
   159         entry colAt:1 put:'aa';
   158 	      colAt:2 put:'bb';
   160               colAt:2 put:'bb';
   159 	      colAt:3 put:'cc';
   161               colAt:3 put:'cc';
   160 	      colAt:4 put:'dd'.
   162               colAt:4 put:'dd'.
   161 
   163 
   162 	listView at:2 put:entry.
   164         listView at:2 put:entry.
   163 
   165 
   164 	listView open
   166         listView open
       
   167                                                                         [exEnd]
   165 
   168 
   166     defining field widths in pixels :
   169     defining field widths in pixels :
   167 
   170                                                                         [exBegin]
   168 	|listView tabSpec entry|
   171         |listView tabSpec entry|
   169 
   172 
   170 	listView := ListView new.
   173         listView := ListView new.
   171 
   174 
   172 	tabSpec := TabulatorSpecification new.
   175         tabSpec := TabulatorSpecification new.
   173 	tabSpec unit:#pixel.
   176         tabSpec unit:#pixel.
   174 	tabSpec widths:#(50 30 30 50).
   177         tabSpec widths:#(50 30 30 50).
   175 	tabSpec align:    #left.        
   178         tabSpec align:    #left.        
   176 
   179 
   177 	entry := MultiColListEntry new.
   180         entry := MultiColListEntry new.
   178 	entry tabulatorSpecification:tabSpec.
   181         entry tabulatorSpecification:tabSpec.
   179 	entry colAt:1 put:'1';
   182         entry colAt:1 put:'1';
   180 	      colAt:2 put:'2';
   183               colAt:2 put:'2';
   181 	      colAt:3 put:'3';
   184               colAt:3 put:'3';
   182 	      colAt:4 put:'4'.
   185               colAt:4 put:'4'.
   183 
   186 
   184 	listView at:1 put:entry.
   187         listView at:1 put:entry.
   185 
   188 
   186 	entry := MultiColListEntry new.
   189         entry := MultiColListEntry new.
   187 	entry tabulatorSpecification:tabSpec.
   190         entry tabulatorSpecification:tabSpec.
   188 	entry colAt:1 put:'aa';
   191         entry colAt:1 put:'aa';
   189 	      colAt:2 put:'bb';
   192               colAt:2 put:'bb';
   190 	      colAt:3 put:'cc';
   193               colAt:3 put:'cc';
   191 	      colAt:4 put:'dd'.
   194               colAt:4 put:'dd'.
   192 
   195 
   193 	listView at:2 put:entry.
   196         listView at:2 put:entry.
   194 
   197 
   195 	listView open
   198         listView open
       
   199                                                                         [exEnd]
   196 "
   200 "
   197 ! !
   201 ! !
   198 
   202 
   199 !TabulatorSpecification class methodsFor:'instance creation'!
   203 !TabulatorSpecification class methodsFor:'instance creation'!
   200 
   204 
   394 ! !
   398 ! !
   395 
   399 
   396 !TabulatorSpecification class methodsFor:'documentation'!
   400 !TabulatorSpecification class methodsFor:'documentation'!
   397 
   401 
   398 version
   402 version
   399     ^ '$Header: /cvs/stx/stx/libwidg2/TabulatorSpecification.st,v 1.10 1996-04-25 17:31:31 cg Exp $'
   403     ^ '$Header: /cvs/stx/stx/libwidg2/TabulatorSpecification.st,v 1.11 1996-04-27 18:22:36 cg Exp $'
   400 ! !
   404 ! !