DataSetColumn.st
author Claus Gittinger <cg@exept.de>
Tue, 11 May 2004 14:50:21 +0200
changeset 2704 0a09fd78eb54
parent 2694 82289374e92e
child 2710 fcfa161492ae
permissions -rw-r--r--
ColorEditDialog made public
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     1
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     4
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e22c45e26653 intitial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    11
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    12
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    13
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    14
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    15
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
    16
"{ Package: 'stx:libwidg2' }"
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
    17
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    18
Object subclass:#DataSetColumn
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
    19
	instanceVariableNames:'columnNumber dataSet width description buttonExtent rendererType
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
    20
		backgroundColor foregroundColor rowSeparatorSelector
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    21
		showColSeparator showRowSeparator columnAlignment label
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    22
		containsText columnAdaptor descWidth descMinWidth
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
    23
		longStringCompression minValue maxValue'
1712
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
    24
	classVariableNames:''
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
    25
	poolDictionaries:''
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
    26
	category:'Views-DataSet'
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    27
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    28
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    29
!DataSetColumn class methodsFor:'documentation'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    30
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    31
copyright
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    32
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    33
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    34
              All Rights Reserved
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    35
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    36
 This software is furnished under a license and may be used
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    37
 only in accordance with the terms of that license and with the
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    38
 inclusion of the above copyright notice.   This software may not
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    39
 be provided or otherwise made available to, or used by, any
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    40
 other person.  No title to or ownership of the software is
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    41
 hereby transferred.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    42
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    43
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    44
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    45
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    46
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    47
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    48
documentation
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    49
"
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    50
    represent one single column description of a DataSetView
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    51
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    52
    [Instance variables:]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    53
647
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
    54
        columnNumber    <Integer>               sequence number (into list of columns)
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    55
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    56
        dataSet         <DSVColumnView>         the view it belongs to
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    57
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    58
        width           <Integer>               width of column
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    59
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    60
        description     <DataSetColumnSpec>     the column description
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    61
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    62
        buttonExtent    <Point>                 extent of drawable form
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    63
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    64
        rendererType    <Type>                  renderer type (cached value from
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    65
                                                the column specification).
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    66
647
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
    67
        backgroundColor <Color or nil>          background color of all cells or nil
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
    68
                                                (nil: use default background color).
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    69
647
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
    70
        foregroundColor <Color or nil>          foreground color of all cells or nil
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
    71
                                                (nil: use default foreground color).
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    72
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    73
        columnAlignment <Symbol>                align text/icon #left #right or #center
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    74
                                                in row (on default: #left).
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    75
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    76
        label           <label/icon or nil>     label resolved by the builder shown
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    77
                                                in the column description field.
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
    78
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    79
        readSelector    <Symbol>                cached readSelector (from the spec)
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    80
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    81
        columnAdaptor   <nil or any>            if non-nil, that one is asked (via
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    82
                                                read-writeSelectors to extract a column
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    83
                                                from a row object.
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    84
                                                If nil, the row object is used itself.
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
    85
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    86
        showColSeparator <Boolean>              true: vertical separators are enabled;
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    87
                                                separator between columns
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    88
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    89
        showRowSeparator <Boolean>              true: horizontal separators are enabled;
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    90
                                                separator between rows
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    91
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    92
        rowSeparatorSelector <Selector or nil>  access specific showRowSeparator state
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
    93
                                                for a cell
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
    94
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    95
    [from description:]
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    96
        fgSelector      <Selector or nil>       access specific foreground color for
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    97
                                                a cell
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    98
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    99
        bgSelector      <Selector or nil>       access specific background color for
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   100
                                                a cell
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   101
1725
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   102
        numberOfRowsProbedForColumnSize         the number of rows which are queries
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   103
                                <Integer>       in order to compute the columns width.
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   104
                                                (for scrollBar/col width computation)
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   105
                                                Notice, if its expensive to fetch rows
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   106
                                                (dataBase apps), this should be small.
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   107
                                                Default:15
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   108
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   109
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   110
    [author:]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   111
        Claus Atzkern
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   112
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   113
    [see also:]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   114
        DataSetColumnSpec
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   115
        DSVColumnView
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   116
        DataSetView
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   117
"
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   118
! !
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   119
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   120
!DataSetColumn class methodsFor:'utilities'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   121
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   122
shortenedStringFor:aString on:aGC maxWidth:maxWidth
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   123
    "common code to shorten a string; used in both the DSV label- and column Views,  
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   124
     if the string is too long for the column"
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   125
2221
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   126
    |widthOf3Dots wRest shortenedLabel lUsed lMin lMax|
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   127
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   128
    aString isString ifFalse:[^ aString].
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   129
    (aString widthOn:aGC) > maxWidth ifFalse:[aString].
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   130
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   131
    widthOf3Dots := '...' widthOn:aGC.
2221
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   132
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   133
    lMin := 1.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   134
    lMax := aString size.
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   135
    [ 
2221
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   136
        lUsed := (lMax + lMin) // 2.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   137
        wRest := aString widthFrom:1 to:lUsed on:aGC.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   138
        wRest > (maxWidth-widthOf3Dots) ifTrue:[
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   139
            lMax := lUsed - 1.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   140
        ] ifFalse:[
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   141
            lMin := lUsed + 1.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   142
        ].
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   143
        lMin < lMax
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   144
    ] whileTrue.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   145
    shortenedLabel := aString copyFrom:1 to:lUsed.
19a1500f8113 write to a column no longer installs the
james
parents: 2211
diff changeset
   146
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   147
    shortenedLabel isEmpty ifTrue:[
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   148
        ((aString first asString , '..') widthOn:aGC) < maxWidth ifTrue:[
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   149
            "/ only two dots and the first character
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   150
            ^ (aString first asString , '..')
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   151
        ]
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   152
    ].
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   153
    ^ (shortenedLabel , '...').
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   154
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   155
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   156
!DataSetColumn methodsFor:'accessing'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   157
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   158
at:aRowNr
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   159
    "get the value of the raw at an index, aRowNr
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   160
    "
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   161
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   162
    |row|
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   163
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   164
    row := dataSet at:aRowNr.
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   165
    ^ self extractColFromRow:row rowNr:aRowNr.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   166
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   167
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   168
at:aRowNr put:something
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   169
    "set the value of the raw at an index, aRowNr
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   170
    "
1059
18f81ba4860d if there is a columnAdaptor,
tz
parents: 1043
diff changeset
   171
    |row newRow|
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   172
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   173
    row := dataSet at:aRowNr.
2419
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   174
    self storeCol:something inRow:row.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   175
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   176
1558
00b34d71898a columnAdaptor also used when retrieving a ComboBoxes list.
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   177
columnAdaptor
00b34d71898a columnAdaptor also used when retrieving a ComboBoxes list.
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   178
    ^ columnAdaptor
00b34d71898a columnAdaptor also used when retrieving a ComboBoxes list.
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   179
!
00b34d71898a columnAdaptor also used when retrieving a ComboBoxes list.
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   180
1712
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
   181
columnAdaptor:anAdapter
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
   182
    columnAdaptor := anAdapter.
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
   183
!
5511cc404d6b accessor for columnAdapter (can now be a valueHolder)
ca
parents: 1592
diff changeset
   184
807
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   185
description
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   186
    "returns the column description
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   187
    "
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   188
    ^ description
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   189
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   190
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   191
!
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   192
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   193
label
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   194
    "get the label assigned to the column
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   195
    "
891
f4d2ed9d3b88 checkin from browser
ca
parents: 883
diff changeset
   196
    ^ label
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   197
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   198
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   199
!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   200
2419
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   201
longStringCompression:aBoolean
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   202
    ^ longStringCompression ? true
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   203
!
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   204
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   205
rendererType
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   206
    "returns my renderer type
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   207
    "
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   208
    ^ rendererType
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   209
! !
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   210
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   211
!DataSetColumn methodsFor:'accessing-colors'!
1565
ca
parents: 1559
diff changeset
   212
ca
parents: 1559
diff changeset
   213
backgroundColor
ca
parents: 1559
diff changeset
   214
    "returns the background color or nil
ca
parents: 1559
diff changeset
   215
    "
ca
parents: 1559
diff changeset
   216
    ^ backgroundColor == dataSet backgroundColor ifTrue:[nil]
ca
parents: 1559
diff changeset
   217
                                                ifFalse:[backgroundColor]
ca
parents: 1559
diff changeset
   218
ca
parents: 1559
diff changeset
   219
!
ca
parents: 1559
diff changeset
   220
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   221
backgroundColor: aColor
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   222
    backgroundColor := aColor
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   223
!
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   224
1565
ca
parents: 1559
diff changeset
   225
backgroundColorAt:aRowNr
ca
parents: 1559
diff changeset
   226
    "returns the background color for a row at list index a rowNr
ca
parents: 1559
diff changeset
   227
    "
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   228
    description backgroundSelector notNil ifTrue:[
1565
ca
parents: 1559
diff changeset
   229
        ^ self backgroundColorFor:(dataSet at:aRowNr) at:aRowNr
ca
parents: 1559
diff changeset
   230
    ].
ca
parents: 1559
diff changeset
   231
    ^ backgroundColor
ca
parents: 1559
diff changeset
   232
!
ca
parents: 1559
diff changeset
   233
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   234
backgroundColorFor:aRow at:aRowNr     
1565
ca
parents: 1559
diff changeset
   235
    "returns the background color for a row at list index a rowNr
ca
parents: 1559
diff changeset
   236
    "
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   237
    |bgSelector bg|
1565
ca
parents: 1559
diff changeset
   238
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   239
    bgSelector := description backgroundSelector.
1565
ca
parents: 1559
diff changeset
   240
    bgSelector notNil ifTrue:[
1924
634dd19b10bf allow use of a column adaptor for fg/bg colors
ca
parents: 1818
diff changeset
   241
        columnAdaptor notNil ifTrue:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   242
            bg := columnAdaptor perform:bgSelector withOptionalArgument:aRow and:aRowNr and:columnNumber and:dataSet
1565
ca
parents: 1559
diff changeset
   243
        ] ifFalse:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   244
            bg := aRow perform:bgSelector withOptionalArgument:aRowNr and:columnNumber and:dataSet
1565
ca
parents: 1559
diff changeset
   245
        ].
1928
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   246
        bg notNil ifTrue:[
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   247
            (bg isColor or:[bg isImageOrForm]) ifTrue:[
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   248
                ^ bg
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   249
            ].
1950
ps
parents: 1940
diff changeset
   250
            self halt:'unexpected bg (not color or image)'.
1928
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   251
        ]
1565
ca
parents: 1559
diff changeset
   252
    ].
ca
parents: 1559
diff changeset
   253
    ^ backgroundColor
ca
parents: 1559
diff changeset
   254
!
ca
parents: 1559
diff changeset
   255
ca
parents: 1559
diff changeset
   256
foregroundColor
ca
parents: 1559
diff changeset
   257
    "returns the foreground color or nil
ca
parents: 1559
diff changeset
   258
    "
ca
parents: 1559
diff changeset
   259
    ^ foregroundColor == dataSet foregroundColor ifTrue:[nil]
ca
parents: 1559
diff changeset
   260
                                                ifFalse:[foregroundColor]
ca
parents: 1559
diff changeset
   261
ca
parents: 1559
diff changeset
   262
!
ca
parents: 1559
diff changeset
   263
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   264
foregroundColor: aColor
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   265
    foregroundColor := aColor
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   266
!
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   267
1565
ca
parents: 1559
diff changeset
   268
foregroundColorFor:aRow at:aRowNr
ca
parents: 1559
diff changeset
   269
    "returns the foreground color for a row at list index a rowNr
ca
parents: 1559
diff changeset
   270
    "
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   271
    |fgSelector fg|
1565
ca
parents: 1559
diff changeset
   272
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   273
    fgSelector := description foregroundSelector.
1565
ca
parents: 1559
diff changeset
   274
    fgSelector notNil ifTrue:[
1924
634dd19b10bf allow use of a column adaptor for fg/bg colors
ca
parents: 1818
diff changeset
   275
        columnAdaptor notNil ifTrue:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   276
            fg := columnAdaptor perform:fgSelector withOptionalArgument:aRow and:aRowNr and:columnNumber and:dataSet
1565
ca
parents: 1559
diff changeset
   277
        ] ifFalse:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   278
            fg := aRow perform:fgSelector withOptionalArgument:aRowNr and:dataSet
1565
ca
parents: 1559
diff changeset
   279
        ].
1928
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   280
        fg notNil ifTrue:[
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   281
            (fg isColor or:[fg isImageOrForm]) ifTrue:[
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   282
                ^ fg
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   283
            ].
1950
ps
parents: 1940
diff changeset
   284
            self halt:'unexpected fg (not color or image)'.
1928
2dcf8e62af64 debug: care for non-color to be returned from fg/bg message.
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   285
        ]
1565
ca
parents: 1559
diff changeset
   286
    ].
ca
parents: 1559
diff changeset
   287
    ^ foregroundColor
ca
parents: 1559
diff changeset
   288
! !
ca
parents: 1559
diff changeset
   289
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   290
!DataSetColumn methodsFor:'accessing-dimension'!
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   291
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   292
minWidth
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   293
    "get the minimum width required by the column
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   294
    "
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   295
    descMinWidth notNil ifTrue:[
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   296
        ^ descMinWidth
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   297
    ].
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   298
    width := nil.
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   299
  ^ self width
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   300
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   301
!
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   302
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   303
minimumRequiredWidth
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   304
    "returns the minimum required width
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   305
    "
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   306
    |minWidth|
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   307
1940
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   308
    descMinWidth notNil ifTrue:[
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   309
        minWidth := DSVLabelView tabSpacing max:2.
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   310
      ^ minWidth // 2 + minWidth
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   311
    ].
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   312
1940
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   313
    minWidth := dataSet separatorSize + (2 * dataSet horizontalSpacing).
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   314
  ^ minWidth + label preferredWidth.
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   315
!
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   316
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   317
setDescWidth:aWidth
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   318
    "set a fixed width
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   319
    "
1940
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   320
    descMinWidth := 1.
50cf5e9dea10 allow resizing less than label size
ca
parents: 1937
diff changeset
   321
    descMinWidth := width := descWidth := self minimumRequiredWidth max:aWidth.
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   322
!
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   323
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   324
width
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   325
    "returns the width in pixels
1725
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   326
     Warning: 
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   327
        only the first numberOfRowsProbedForColumnSize are probed,
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   328
        in case the access is expensive (dataBase apps)
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   329
     If the descriptor defines a width, that is used, and the items
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   330
     are not probed at all."
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   331
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   332
    |max       "{ Class:SmallInteger }"
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   333
     listSize  "{ Class:SmallInteger }"|
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   334
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   335
    width notNil ifTrue:[^ width].              "/ already computed
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   336
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   337
    descMinWidth notNil ifTrue:[
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   338
        width := descMinWidth.
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   339
      ^ width
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   340
    ].
1482
b703fd600f73 support of relative values
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   341
2017
5cbe1d46c01d isReal -> isLimitedPrecisionReal
Claus Gittinger <cg@exept.de>
parents: 1984
diff changeset
   342
    (descWidth ~~ 0 and:[descWidth isLimitedPrecisionReal not]) ifTrue:[
1493
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   343
        width := descMinWidth := descWidth.
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   344
      ^ width
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   345
    ].
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   346
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   347
    width := description minWidth max:(label preferredWidth).
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   348
2017
5cbe1d46c01d isReal -> isLimitedPrecisionReal
Claus Gittinger <cg@exept.de>
parents: 1984
diff changeset
   349
    descWidth isLimitedPrecisionReal ifTrue:[
2093
0dff6d4c173a bug fix: relative width (two coluns with 0.5)
ca
parents: 2074
diff changeset
   350
        width := width max:(descWidth * dataSet innerWidth) rounded.
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   351
      ^ width
1482
b703fd600f73 support of relative values
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   352
    ].
b703fd600f73 support of relative values
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   353
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   354
    containsText ifTrue:[
1725
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   355
        "/ take maximum numberOfRowsProbedForColumnSize entries to calculate the width;
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   356
        "/ can be resized later if neccessary
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   357
        listSize := dataSet size.
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   358
        max := listSize min:description numberOfRowsProbedForColumnSize.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   359
1526
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   360
        max ~~ 0 ifTrue:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   361
            1 to:max do:[:rowNr| |row|
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   362
                row := dataSet at:rowNr.
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
   363
                width := width max:(self widthOfLabel:(self shownValueForRow:row rowNr:rowNr))
1526
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   364
            ].
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
   365
            width := width max:(self widthOfLabel:(self shownValueForRow:(dataSet at:listSize) rowNr:listSize))
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   366
        ].
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   367
        description editorType ~~ #None ifTrue:[
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   368
            width := width + (dataSet font widthOn:dataSet device)
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   369
        ].
1493
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   370
    ] ifFalse:[
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   371
        max := 1
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   372
    ].
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   373
    width := width + buttonExtent x + dataSet separatorSize + (2 * dataSet horizontalSpacing).
1493
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   374
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   375
    max ~~ 0 ifTrue:[
1526
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   376
        descMinWidth := width.
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   377
        description usePreferredWidth ifTrue:[
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   378
            descWidth := width
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   379
        ]
1493
045378a0c25e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   380
    ].
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   381
  ^ width
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   382
1725
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   383
    "Modified: / 25.2.2000 / 14:29:16 / cg"
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   384
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   385
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   386
!DataSetColumn methodsFor:'drawing'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   387
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   388
drawLabel:aLabelToDraw atX:xLeft y:yTop
2420
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   389
    "draw aLabelToDraw; handle columnAlignment"
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   390
2581
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   391
    |drawnLabel x space prevClip mustUndoClip 
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   392
     labelWidth leftPart leftShift indexOfFirstDigit indexOfFirstNonDigit|
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   393
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   394
    space := dataSet horizontalSpacing.
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   395
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   396
    drawnLabel := aLabelToDraw.
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   397
    labelWidth := drawnLabel widthOn:dataSet.
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   398
2419
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   399
    (longStringCompression ~~ false
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   400
    and:[ drawnLabel isString 
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   401
    and:[ labelWidth > width]]) ifTrue:[
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   402
        drawnLabel := self class shortenedStringFor:drawnLabel on:dataSet maxWidth:width-space.
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   403
        labelWidth := drawnLabel widthOn:dataSet.
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   404
    ].
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   405
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   406
    columnAlignment == #left ifTrue:[
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   407
        x  := xLeft + space.
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   408
    ] ifFalse:[
2420
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   409
        columnAlignment == #decimal ifTrue:[
2581
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   410
            (drawnLabel includes:$.) ifTrue:[
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   411
                leftPart := drawnLabel upTo:$..
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   412
            ] ifFalse:[
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   413
                leftPart := drawnLabel.
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   414
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   415
                indexOfFirstDigit := drawnLabel findFirst:[:char | char isDigit].
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   416
                indexOfFirstDigit ~~ 0 ifTrue:[
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   417
                    indexOfFirstNonDigit := drawnLabel findFirst:[:char | char isDigit not] startingAt:indexOfFirstDigit+1.
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   418
                    indexOfFirstNonDigit ~~ 0 ifTrue:[
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   419
                        leftPart := drawnLabel copyTo:indexOfFirstNonDigit-1.
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   420
                    ].
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   421
                ].
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   422
            ].
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   423
            leftShift := leftPart widthOn:dataSet.
2b6656c0b046 care for numbers without decimal point in decimal adjust
Claus Gittinger <cg@exept.de>
parents: 2578
diff changeset
   424
            x := (width // 2) - leftShift.
2420
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   425
        ] ifFalse:[
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   426
            x := width - labelWidth.
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   427
2420
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   428
            columnAlignment == #right ifTrue:[x := x - space]
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   429
                                     ifFalse:[x := x // 2].
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   430
        ].
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   431
    "/ cg: old code (did not right-align if string is larger than width
9b4e4333004a added #decimal columnAlignment.
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
   432
    "/        x := xLeft + (x max:0).
1586
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   433
1587
c82f9a0f73e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1586
diff changeset
   434
        "/ new code: always right-align.
c82f9a0f73e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1586
diff changeset
   435
        x := xLeft + x.
c82f9a0f73e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1586
diff changeset
   436
c82f9a0f73e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1586
diff changeset
   437
        "/ must clip left, if string is too large
c82f9a0f73e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1586
diff changeset
   438
        x < xLeft ifTrue:[
1586
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   439
            "/ must clip ...
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   440
            prevClip := dataSet clippingRectangleOrNil.
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   441
            mustUndoClip := true.
1591
6996391ee3ba Avoid obsolete method. (stefan)
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
   442
            dataSet clippingRectangle:(Rectangle 
1586
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   443
                                left:xLeft top:yTop 
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   444
                                width:width height:(drawnLabel heightOn:dataSet)).
1586
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   445
        ].
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   446
    ].
1447
aaebe212f08a drawLabel:aLabel atX:xLeft y:yTop
ah
parents: 1268
diff changeset
   447
2443
e88b4123061a changes to allow for Object>>displayOn:x:y: to work correctly
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   448
"/    drawnLabel isImageOrForm ifTrue:[
e88b4123061a changes to allow for Object>>displayOn:x:y: to work correctly
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   449
"/        y := yTop.
e88b4123061a changes to allow for Object>>displayOn:x:y: to work correctly
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   450
"/    ] ifFalse:[
e88b4123061a changes to allow for Object>>displayOn:x:y: to work correctly
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   451
"/        y := (yTop + dataSet rowFontAscent)
e88b4123061a changes to allow for Object>>displayOn:x:y: to work correctly
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   452
"/    ].
2592
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   453
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   454
"/    drawnLabel isString ifFalse:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   455
"/        y := yTop + (drawnLabel ascentOn:dataSet).
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   456
"/    ] ifTrue:[
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   457
"/        y := yTop + dataSet rowFontAscent
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   458
"/    ].
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   459
"/    drawnLabel displayOn:dataSet x:x y:y.
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   460
ab64fbe4fb1e resize #rowHeight if a display label does not match the computed rowHeight
ca
parents: 2581
diff changeset
   461
    dataSet displayLabel:drawnLabel x:x y:yTop.
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   462
1586
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   463
    mustUndoClip == true ifTrue:[
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   464
        dataSet clippingRectangle:prevClip    
c87e9c9b298f always right-align a right-aligned field
Claus Gittinger <cg@exept.de>
parents: 1565
diff changeset
   465
    ].
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   466
!
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   467
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   468
drawLabelsAtX:xLeft y:yTop h:h from:start to:stop
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   469
    "redraw labels from start to stop
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   470
    "
2613
2de5a812418b nomore win-workaround for drawbug when filling a rectangle
ca
parents: 2592
diff changeset
   471
    |fg y yT x hspace lblHg bg label row isSel|
2578
13400c9f2b26 bugfix Windows: drawing selection background color
ca
parents: 2542
diff changeset
   472
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   473
    yT := yTop.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   474
    hspace := dataSet horizontalSpacing.
1100
376515452be4 support of all styles; windows and next
ca
parents: 1092
diff changeset
   475
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   476
    start to:stop do:[:aRowNr|
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   477
        row := dataSet at:aRowNr.
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   478
        y := yT.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   479
        x := xLeft.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   480
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   481
     "/ GET BACKGROUND AND FOREGROUND-COLOR
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   482
     "/ ===================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   483
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   484
        isSel := dataSet isSelected:aRowNr inColumn:columnNumber.
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   485
2578
13400c9f2b26 bugfix Windows: drawing selection background color
ca
parents: 2542
diff changeset
   486
        isSel ifTrue:[        
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   487
            (      description editorType ~~ #None
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   488
              and:[dataSet selectedColIndex == columnNumber]
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   489
            ) ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   490
                isSel := false
1115
7f3f4581c3d3 clear background
ca
parents: 1113
diff changeset
   491
            ]
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   492
        ].
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   493
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   494
        (isSel and:[description showSelectionHighLighted]) ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   495
            "/ SHOW SELECTED( MUST REDRAW BACKGROUND )
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   496
            "/ =======================================
2151
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   497
            fg := dataSet selectionForegroundColor.
50f8723054e7 selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   498
            bg := dataSet selectionBackgroundColor.
2578
13400c9f2b26 bugfix Windows: drawing selection background color
ca
parents: 2542
diff changeset
   499
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   500
            dataSet paint:bg.
2613
2de5a812418b nomore win-workaround for drawbug when filling a rectangle
ca
parents: 2592
diff changeset
   501
            dataSet fillRectangleX:x y:y width:width height:h.
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   502
        ] ifFalse:[
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   503
            description backgroundSelector notNil ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   504
                "/ MUST REDRAW BACKGROUND
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   505
                "/ ======================
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   506
                bg := self backgroundColorFor:row at:aRowNr.
1565
ca
parents: 1559
diff changeset
   507
ca
parents: 1559
diff changeset
   508
                bg ~~ backgroundColor ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   509
                    bg := dataSet colorOnDevice:bg
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   510
                ].
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   511
                dataSet paint:bg.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   512
                dataSet fillRectangleX:x y:y width:width height:h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   513
            ] ifFalse:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   514
                bg := backgroundColor
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   515
            ].
1100
376515452be4 support of all styles; windows and next
ca
parents: 1092
diff changeset
   516
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   517
            fg := self foregroundColorFor:row at:aRowNr.
1565
ca
parents: 1559
diff changeset
   518
ca
parents: 1559
diff changeset
   519
            fg ~~ foregroundColor ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   520
                fg := dataSet colorOnDevice:fg
1565
ca
parents: 1559
diff changeset
   521
            ].
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   522
        ].
833
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   523
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   524
     "/ GET AND DRAW LABEL
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   525
     "/ ==================
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   526
        (self isRowVisible:aRowNr) ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   527
            rendererType == #rowSelector ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   528
                isSel ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   529
                    label := dataSet rowSelectorForm.
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   530
                    x  := x + hspace.
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   531
                ] ifFalse:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   532
                    label := nil
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   533
                ]
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   534
            ] ifFalse:[
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   535
                (isSel and:[dataSet hasOpenEditor]) ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   536
                    label := nil
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   537
                ]  ifFalse:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   538
                    label := self shownValueForRow:row rowNr:aRowNr
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   539
                ]
1589
8bb71707b51a remove any color emphasis when displaying the selection.
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
   540
            ].
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   541
            label notNil ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   542
                "/ care for a dark-colored label,
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   543
                "/ with a dark selection-bg color
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   544
                (isSel and:[label isString and:[label hasChangeOfEmphasis]]) ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   545
                    "/ take away the labels own color info
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   546
                    label := label emphasisAllRemove:#color.
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   547
                ].
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   548
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   549
                lblHg := self heightOfLabel:label.
1589
8bb71707b51a remove any color emphasis when displaying the selection.
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
   550
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   551
                lblHg ~~ 0 ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   552
                    y := y + (h - lblHg // 2).
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   553
                    dataSet paint:fg on:bg.
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   554
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   555
                    (label isSequenceable and:[label isString not]) ifFalse:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   556
                        self drawLabel:label atX:x y:y
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   557
                    ] ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   558
                        label do:[:el|
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   559
                            el notNil ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   560
                                self drawLabel:el atX:x y:y.
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   561
                                y := y + (el heightOn:dataSet).
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   562
                            ]
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   563
                        ]
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   564
                    ].
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   565
                ]
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   566
            ].
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   567
        ].
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   568
        yT := yT + h
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   569
    ]
833
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   570
!
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   571
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   572
drawSeparatorsAtX:xLeft y:yTop h:h from:start to:stop
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   573
    "redraw separators for cells between start and stop
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   574
    "
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   575
    |is3D
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   576
     xL    "{ Class:SmallInteger }"
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   577
     xR    "{ Class:SmallInteger }"
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   578
     yB    "{ Class:SmallInteger }"
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   579
     yT    "{ Class:SmallInteger }"
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   580
     times "{ Class:SmallInteger }"
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   581
    |
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   582
    (showColSeparator or:[showRowSeparator]) ifFalse:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   583
        ^ self
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   584
    ].
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   585
    is3D := dataSet has3Dseparators.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   586
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   587
    is3D ifTrue:[dataSet paint:(dataSet separatorDarkColor)]
2638
f2b2ecc2c851 use user defined color for drawing separators in OneD mode
ca
parents: 2636
diff changeset
   588
        ifFalse:[dataSet paint:(dataSet separatorOneDColor)].
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   589
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   590
    times := stop - start + 1.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   591
    xL    := xLeft.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   592
    xR    := xL - 1 + width.
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   593
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   594
    showRowSeparator ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   595
     "/ DRAW SEPARATORS AT BOTTOM( DARK COLOR )
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   596
     "/ =======================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   597
        yB := yTop - 1 + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   598
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   599
        rowSeparatorSelector isNil ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   600
            times timesRepeat:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   601
                dataSet displayLineFromX:xL y:yB toX:xR y:yB.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   602
                yB := yB + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   603
            ]
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   604
        ] ifFalse:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   605
            start to:stop do:[:idx|
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   606
                ((dataSet at:idx) perform:rowSeparatorSelector) ~~ false ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   607
                    dataSet displayLineFromX:xL y:yB toX:xR y:yB
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   608
                ].
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   609
                yB := yB + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   610
            ]
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   611
        ]
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   612
    ].
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   613
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   614
    showColSeparator ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   615
     "/ DRAW SEPARATORS AT RIGHT( DARK COLOR )
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   616
     "/ ======================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   617
        yT := yTop.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   618
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   619
        times timesRepeat:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   620
            dataSet displayLineFromX:xR y:yT toX:xR y:(yT - 1 + h).
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   621
            yT := yT + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   622
        ]
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   623
    ].
1089
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   624
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   625
    is3D ifFalse:[
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   626
        ^ self
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   627
    ].
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   628
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   629
    dataSet paint:(dataSet separatorLightColor).
1040
c8e6a2ed7928 use the same background color for a selected rowSelector
ca
parents: 1007
diff changeset
   630
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   631
    (     columnNumber == 1
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   632
      or:[(dataSet columnAt:(columnNumber - 1)) showColSeparator]
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   633
    ) ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   634
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   635
     "/ DRAW SEPARATORS AT LEFT( LIGHT COLOR )
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   636
     "/ ======================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   637
        yT := yTop.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   638
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   639
        times timesRepeat:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   640
            dataSet displayLineFromX:xL y:yT toX:xL y:(yT - 1 + h).
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   641
            yT := yT + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   642
        ].
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   643
    ] ifFalse:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   644
        xL := xL - 1
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   645
    ].
1092
bc003bc88972 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1089
diff changeset
   646
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   647
    showRowSeparator ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   648
     "/ DRAW SEPARATORS AT TOP( LIGHT COLOR )
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   649
     "/ =====================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   650
        yT := yTop.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   651
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   652
        rowSeparatorSelector isNil ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   653
            times timesRepeat:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   654
                dataSet displayLineFromX:xL y:yT toX:xR y:yT.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   655
                yT := yT + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   656
            ]
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   657
        ] ifFalse:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   658
         "/ CHECK WHETHER PREVIOUS ROW HAS A SEPARATOR AT BOTTOM
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   659
         "/ ====================================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   660
            start to:stop do:[:idx|
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   661
                (    idx == 1
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   662
                  or:[((dataSet at:(idx - 1)) perform:rowSeparatorSelector) ~~ false]
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   663
                ) ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   664
                    dataSet displayLineFromX:xL y:yT toX:xR y:yT.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   665
                ].
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   666
                yT := yT + h.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   667
            ]
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   668
        ]
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   669
    ].
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   670
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   671
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   672
invalidate
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   673
    "invalidate width of column; forces a recomputation
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   674
    "
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   675
    width := nil.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   676
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   677
!
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   678
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   679
redrawX:xLeft y:yTop h:h from:start to:stop
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   680
    "redraw rows between start and stop
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   681
    "
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   682
    |rH "{ Class:SmallInteger }"
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   683
     y  "{ Class:SmallInteger }"
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   684
    |
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   685
    rH := dataSet rowHeight.
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   686
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   687
    description backgroundSelector isNil ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   688
        dataSet paint:backgroundColor.
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   689
        dataSet fillRectangleX:xLeft y:yTop width:width height:h
1115
7f3f4581c3d3 clear background
ca
parents: 1113
diff changeset
   690
    ].
7f3f4581c3d3 clear background
ca
parents: 1113
diff changeset
   691
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   692
 "/ DRAW CELLS: BACKGROUND/FOREGROUND/LABEL
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   693
 "/ =======================================
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   694
    self drawLabelsAtX:xLeft y:yTop h:rH from:start to:stop.
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   695
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   696
 "/ DRAW INDICATORS
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   697
 "/ ===============
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   698
    (rendererType == #ComboBox or:[rendererType == #ComboList]) ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   699
        y := yTop.
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   700
        start to:stop do:[:rowNr|
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   701
            (self isRowVisible:rowNr) ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   702
                (self hasChoices:rowNr) ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   703
                    dataSet drawComboButtonAtX:xLeft y:y w:width
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   704
                ].
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   705
            ].
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   706
            y := y + rH.
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   707
        ]
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   708
    ] ifFalse:[
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   709
        rendererType == #CheckToggle ifTrue:[
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   710
            y := yTop.
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   711
            start to:stop do:[:rowNr| |state|
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   712
                state := self at:rowNr.
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   713
                (self isRowVisible:rowNr) ifTrue:[
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   714
                    dataSet drawCheckToggleAtX:xLeft y:y w:width state:state.
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
   715
                ].
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   716
                y := y + rH.
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   717
            ]
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   718
        ]
1088
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   719
    ].
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   720
c2e474a7d0f2 add some comment
ca
parents: 1065
diff changeset
   721
 "/ DRAW SEPARATORS
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   722
 "/ ===============
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   723
    self drawSeparatorsAtX:xLeft y:yTop h:rH from:start to:stop
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   724
!
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   725
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   726
shownValueForRow:aRow rowNr:aRowNr
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   727
    |selector format value|
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   728
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   729
    rendererType == #CheckToggle ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   730
        ^ nil
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   731
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   732
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   733
    rendererType == #rowSelector ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   734
        ^ nil
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   735
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   736
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   737
    selector := description printSelector.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   738
    selector notNil ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   739
        ^ aRow 
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   740
            perform:selector 
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   741
            withOptionalArgument:dataSet and:columnNumber and:aRowNr and:dataSet.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   742
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   743
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   744
    value := self extractColFromRow:aRow rowNr:aRowNr.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   745
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   746
    selector := description formatSelector.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   747
    selector notNil ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   748
        format := aRow 
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   749
            perform:selector 
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   750
            withOptionalArgument:dataSet and:columnNumber and:aRowNr and:dataSet.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   751
    ] ifFalse:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   752
        format := description formatString.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   753
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   754
    format notNil ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   755
"/ cannot remember what this was used for ...
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   756
"/        (idx := format indexOf:$.) ~~ 0 ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   757
"/            idx := format size - idx
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   758
"/        ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   759
"/        format := '%0.', idx printString, 'f'.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   760
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   761
        value isLimitedPrecisionReal ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   762
            value := value asFloat.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   763
        ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   764
        value := value printfPrintString:format
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   765
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   766
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   767
    ^ value
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   768
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   769
614
8316c869d4df support of readSelector with arguments
ca
parents: 607
diff changeset
   770
!DataSetColumn methodsFor:'editing'!
8316c869d4df support of readSelector with arguments
ca
parents: 607
diff changeset
   771
833
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   772
editorAt:aRowNr
1268
37066c039eb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1226
diff changeset
   773
    |val row|
614
8316c869d4df support of readSelector with arguments
ca
parents: 607
diff changeset
   774
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   775
    row := (dataSet at:aRowNr).
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   776
    val := self extractColFromRow:row rowNr:aRowNr.
614
8316c869d4df support of readSelector with arguments
ca
parents: 607
diff changeset
   777
833
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   778
    val isText ifTrue:[val := val string].
1984
ccdfdf1c89af fetch editor from adaptor if not nil.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
   779
    ^ description editorOn:row column:self value:val usingAdaptor:columnAdaptor.
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   780
! !
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   781
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   782
!DataSetColumn methodsFor:'event handling'!
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   783
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   784
doesNotUnderstand:aMessage
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   785
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   786
    (description respondsTo:(aMessage selector)) ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   787
        ^ aMessage sendTo:description
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   788
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   789
    ^ super doesNotUnderstand:aMessage
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   790
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   791
! !
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   792
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   793
!DataSetColumn methodsFor:'grow & shrink'!
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   794
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   795
growWidth:n
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   796
    "grow the width for n pixels
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   797
    "
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   798
    width := self width + n.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   799
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   800
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   801
! !
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   802
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   803
!DataSetColumn methodsFor:'initialization'!
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   804
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   805
on:aDSVColumnView description:aDescription columnNumber:aNumber label:aLabel
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   806
    "instance creation; set attributes dependent on the description
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   807
    "
1089
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   808
    columnNumber     := aNumber.
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   809
    dataSet          := aDSVColumnView.
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   810
    label            := aLabel.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
   811
1089
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   812
    description      := aDescription.
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   813
    rendererType     := description rendererType.
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   814
    containsText     := (      rendererType ~~ #CheckToggle
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   815
                          and:[rendererType ~~ #rowSelector]
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   816
                        ).
1490
9c418c3aaf49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   817
    descWidth        := description width.
2424
576621beeacb Care for #longStringCompression
Stefan Vogel <sv@exept.de>
parents: 2420
diff changeset
   818
    longStringCompression := description longStringCompression.
1526
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   819
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   820
    description usePreferredWidth ifTrue:[
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   821
        descWidth := 0
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   822
    ].
a5dbe699323f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
   823
1565
ca
parents: 1559
diff changeset
   824
    width      := nil.
ca
parents: 1559
diff changeset
   825
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   826
    minValue := description minValue.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   827
    maxValue := description maxValue.
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   828
    rowSeparatorSelector := description rowSeparatorSelector.
1565
ca
parents: 1559
diff changeset
   829
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   830
    showColSeparator := description showColSeparator.
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   831
    showRowSeparator := description showRowSeparator.
1089
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   832
    columnAdaptor    := dataSet columnAdaptor.
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   833
    buttonExtent     := 0 @ 0.
931865a72ba7 make life easier to add new renderer
ca
parents: 1088
diff changeset
   834
    columnAlignment  := #left.
584
1426fe34f4e8 support of foreground and background colors
ca
parents: 568
diff changeset
   835
1132
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   836
    (backgroundColor := description backgroundColor) isNil ifTrue:[
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   837
        backgroundColor := dataSet backgroundColor
ce5f367af894 redraw changed for: separators and labels
ca
parents: 1115
diff changeset
   838
    ] ifFalse:[
1480
51dd0cc6ea11 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   839
        backgroundColor := backgroundColor onDevice:dataSet device
584
1426fe34f4e8 support of foreground and background colors
ca
parents: 568
diff changeset
   840
    ].
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   841
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   842
    (foregroundColor := description foregroundColor) isNil ifTrue:[
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   843
        foregroundColor := dataSet foregroundColor
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   844
    ] ifFalse:[
1480
51dd0cc6ea11 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   845
        foregroundColor := foregroundColor onDevice:dataSet device
584
1426fe34f4e8 support of foreground and background colors
ca
parents: 568
diff changeset
   846
    ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   847
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   848
    rendererType == #CheckToggle ifTrue:[
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
   849
        buttonExtent := dataSet checkToggleExtent.
2067
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   850
        ^ self
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   851
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   852
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   853
    rendererType == #rowSelector ifTrue:[
807
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   854
        buttonExtent := dataSet rowSelectorExtent.
2067
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   855
        ^ self
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   856
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   857
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   858
    (rendererType == #ComboBox or:[rendererType == #ComboList]) ifTrue:[
807
46863a1cdd80 access method to retrieve the description
ca
parents: 655
diff changeset
   859
        buttonExtent := dataSet comboButtonExtent.
883
0a790ad56286 add column justification
ca
parents: 882
diff changeset
   860
    ] ifFalse:[
0a790ad56286 add column justification
ca
parents: 882
diff changeset
   861
        columnAlignment := description columnAlignment
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   862
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   863
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
   864
    "Modified: / 25.2.2000 / 14:25:56 / cg"
2424
576621beeacb Care for #longStringCompression
Stefan Vogel <sv@exept.de>
parents: 2420
diff changeset
   865
! !
576621beeacb Care for #longStringCompression
Stefan Vogel <sv@exept.de>
parents: 2420
diff changeset
   866
621
620553e6a537 foreground & background selector (cell).
ca
parents: 614
diff changeset
   867
!DataSetColumn methodsFor:'private'!
620553e6a537 foreground & background selector (cell).
ca
parents: 614
diff changeset
   868
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   869
extractColFromRow:aRow rowNr:rowNr
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
   870
    |readSelector col|
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   871
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   872
    readSelector := description readSelector.
1226
877cadb5d798 allow for nil readSelector
Claus Gittinger <cg@exept.de>
parents: 1187
diff changeset
   873
    readSelector isNil ifTrue:[^ nil].
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   874
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   875
    columnAdaptor notNil ifTrue:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   876
        ^ columnAdaptor perform:readSelector withOptionalArgument:aRow and:columnNumber and:rowNr and:dataSet
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   877
    ].
2635
a8add4698dea care for nil rows when extracting columns
Claus Gittinger <cg@exept.de>
parents: 2613
diff changeset
   878
    aRow isNil ifTrue:[^ nil].
a8add4698dea care for nil rows when extracting columns
Claus Gittinger <cg@exept.de>
parents: 2613
diff changeset
   879
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
   880
    col := aRow perform:readSelector withOptionalArgument:columnNumber and:rowNr and:dataSet.
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
   881
    ^ col
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   882
!
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   883
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   884
storeCol:newValueArg inRow:aRow
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   885
    |writeSelector numArgs newValue min max|
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   886
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   887
    writeSelector := description writeSelector.
1226
877cadb5d798 allow for nil readSelector
Claus Gittinger <cg@exept.de>
parents: 1187
diff changeset
   888
    writeSelector isNil ifTrue:[^ aRow].
877cadb5d798 allow for nil readSelector
Claus Gittinger <cg@exept.de>
parents: 1187
diff changeset
   889
2693
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   890
    newValue := newValueArg.
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   891
    (newValue isNumber) ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   892
        (min := self minValue) notNil ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   893
            newValue < min ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   894
               newValue := min
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   895
            ]
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   896
        ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   897
        (max := self maxValue) notNil ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   898
            newValue > max ifTrue:[
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   899
               newValue := max
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   900
            ]
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   901
        ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   902
    ].
c67e66b4e3e3 formatSelector + color accessors
werner
parents: 2638
diff changeset
   903
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   904
    numArgs := writeSelector numArgs.
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   905
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   906
    columnAdaptor notNil ifTrue:[
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   907
        numArgs == 2 ifTrue:[
2419
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   908
            columnAdaptor perform:writeSelector with:aRow with:newValue.
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   909
            ^ self
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   910
        ].
2419
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   911
        columnAdaptor perform:writeSelector with:aRow with:columnNumber with:newValue.
e0121908fffe added longStringCompression flag
Claus Gittinger <cg@exept.de>
parents: 2222
diff changeset
   912
        ^ self
1007
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   913
    ].
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   914
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   915
    numArgs == 1 ifTrue:[
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   916
        aRow perform:writeSelector with:newValue
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   917
    ] ifFalse:[
4ea1ecf23596 added support for columndAdaptors
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   918
        aRow perform:writeSelector with:columnNumber with:newValue
1059
18f81ba4860d if there is a columnAdaptor,
tz
parents: 1043
diff changeset
   919
    ].
621
620553e6a537 foreground & background selector (cell).
ca
parents: 614
diff changeset
   920
! !
620553e6a537 foreground & background selector (cell).
ca
parents: 614
diff changeset
   921
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   922
!DataSetColumn methodsFor:'queries'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   923
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   924
canResize
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   925
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   926
    containsText ifTrue:[
2017
5cbe1d46c01d isReal -> isLimitedPrecisionReal
Claus Gittinger <cg@exept.de>
parents: 1984
diff changeset
   927
        ^ descWidth == 0 or:[self hasRelativeWidth]
1492
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   928
    ].
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   929
    ^ false
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   930
!
eefe55529016 support tabulators
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
   931
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   932
canSelect:aRowNr
2067
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   933
    "returns true if the cell in column is selectable
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   934
    "
2067
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   935
    |s row|
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   936
2067
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   937
    description canSelect ifFalse:[^ false].
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   938
    s := description selectSelector.
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   939
    s isNil ifTrue:[^ true].
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   940
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   941
    row := dataSet at:aRowNr.
cda10b41aa0f use new #perform:withOptionalArg
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   942
    columnAdaptor notNil ifTrue:[
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   943
        ^ columnAdaptor perform:s withOptionalArgument:row and:columnNumber and:aRowNr and:dataSet
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   944
    ].
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   945
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   946
    ^ row perform:s withOptionalArgument:columnNumber and:aRowNr and:dataSet
607
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   947
!
a5e0c2bf1370 support of multiple select:rows
ca
parents: 604
diff changeset
   948
647
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
   949
containsText
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
   950
    "returns true if text might exist
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
   951
    "
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   952
    ^ containsText
647
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
   953
!
ee98a1976972 support of different styles
ca
parents: 644
diff changeset
   954
2074
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   955
doubleClickOn:aRowNr
2694
82289374e92e dblCLickOn: multi-args
werner
parents: 2693
diff changeset
   956
    |sel row|
2074
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   957
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   958
    (sel := self doubleClickedSelector) notNil ifTrue:[
2694
82289374e92e dblCLickOn: multi-args
werner
parents: 2693
diff changeset
   959
        row := dataSet at:aRowNr.
2074
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   960
        columnAdaptor notNil ifTrue:[
2694
82289374e92e dblCLickOn: multi-args
werner
parents: 2693
diff changeset
   961
            ^ columnAdaptor perform:sel withOptionalArgument:row and:columnNumber and:aRowNr and:dataSet
2074
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   962
        ].
2694
82289374e92e dblCLickOn: multi-args
werner
parents: 2693
diff changeset
   963
        ^ row perform:sel withOptionalArgument:columnNumber and:aRowNr and:dataSet
2074
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   964
    ].
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   965
!
89565d366510 doubleClick and menu via columnAdaptor
martin
parents: 2067
diff changeset
   966
833
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   967
hasChoices:aRowNr
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   968
    ^ (description choicesFor:(dataSet at:aRowNr)) notNil
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   969
!
c4e3e579f8bd handle choices
ca
parents: 824
diff changeset
   970
1950
ps
parents: 1940
diff changeset
   971
hasPotentialNonConstantBackground
ps
parents: 1940
diff changeset
   972
    (backgroundColor notNil and:[backgroundColor isImageOrForm]) ifTrue:[^ true].
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   973
    description backgroundSelector notNil ifTrue:[^ true].
1950
ps
parents: 1940
diff changeset
   974
    ^ false.
ps
parents: 1940
diff changeset
   975
!
ps
parents: 1940
diff changeset
   976
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   977
hasRelativeWidth
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   978
    "returns true if width is relative
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   979
    "
2017
5cbe1d46c01d isReal -> isLimitedPrecisionReal
Claus Gittinger <cg@exept.de>
parents: 1984
diff changeset
   980
    ^ descWidth isLimitedPrecisionReal 
1484
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   981
!
52b16597ce48 support relative width
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   982
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   983
heightOfHighestRow
1725
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   984
    "returns the height of the highest row in pixels.
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   985
     Warning: 
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   986
        only the first numberOfRowsProbedForColumnSize are probed,
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   987
        in case the access is expensive (dataBase apps)
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   988
     If the descriptor defines a height, that is used, and the items
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
   989
     are not probed at all.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   990
    "
1559
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
   991
    |h end bE editor|
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   992
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   993
    (h := description height) == 0 ifTrue:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   994
        containsText ifTrue:[
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   995
            "/ search first none empty drawable object
2154
cb22be939082 split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   996
            end := description numberOfRowsProbedForColumnSize min:dataSet size.
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
   997
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   998
            1 to:end do:[:rowNr| |row|
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   999
                row := dataSet at:rowNr.
2444
e3488b6592cd refactored (do not overuse blocks)
penk
parents: 2443
diff changeset
  1000
                h := h max:(self heightOfLabel:(self shownValueForRow:row rowNr:rowNr))
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1001
            ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1002
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1003
    ].
1559
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1004
    (bE := buttonExtent y) = 0 ifTrue:[
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1005
        ((editor := description editorType) == #ComboList
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1006
        or:[ editor  == #ComboBox]) ifTrue:[
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1007
            bE := dataSet comboButtonExtent y.
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1008
        ].
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1009
    ].
1e7f30057e22 care for renderer==Text and editor==Comboxxx in
Claus Gittinger <cg@exept.de>
parents: 1558
diff changeset
  1010
    ^ h max:bE
1725
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
  1011
897453804fa8 made numberOfRowsProbedForSize a variable;
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
  1012
    "Modified: / 25.2.2000 / 14:29:20 / cg"
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
  1013
!
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
  1014
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1015
heightOfLabel:aLabel
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1016
    "returns the height of the label
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1017
    "
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1018
    |h|
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1019
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1020
    (aLabel isString or:[aLabel isImageOrForm]) ifTrue:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1021
        ^ aLabel heightOn:dataSet
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1022
    ].
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1023
    aLabel isNil ifTrue:[ ^ 0 ].
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1024
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1025
    aLabel isSequenceable ifFalse:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1026
        ^  aLabel perform:#heightOn: with:dataSet ifNotUnderstood:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1027
                aLabel displayString heightOn:dataSet
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1028
           ]
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1029
    ].
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1030
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1031
    h := 0.
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1032
    aLabel do:[:el|h := h + (el heightOn:dataSet)].
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1033
  ^ h
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1034
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1035
!
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1036
1937
1eb0ed685b71 enable/disable resizeability
ca
parents: 1928
diff changeset
  1037
isResizeable
1eb0ed685b71 enable/disable resizeability
ca
parents: 1928
diff changeset
  1038
    "returns true if the row is resizeable
1eb0ed685b71 enable/disable resizeability
ca
parents: 1928
diff changeset
  1039
    "
1eb0ed685b71 enable/disable resizeability
ca
parents: 1928
diff changeset
  1040
    ^ description isResizeable
1eb0ed685b71 enable/disable resizeability
ca
parents: 1928
diff changeset
  1041
!
1eb0ed685b71 enable/disable resizeability
ca
parents: 1928
diff changeset
  1042
2542
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
  1043
isRowVisible:rowNr
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
  1044
    ^ description rowIsVisible:(dataSet at:rowNr)
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
  1045
!
fc78c87abbd2 +visibilitySelector
penk
parents: 2502
diff changeset
  1046
1113
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
  1047
showColSeparator
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
  1048
    "returns true if column separator is on
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
  1049
    "
6b0513d33566 add new functionality
ca
parents: 1100
diff changeset
  1050
    ^ showColSeparator
1133
619b0afc557a checkin from browser
ca
parents: 1132
diff changeset
  1051
!
619b0afc557a checkin from browser
ca
parents: 1132
diff changeset
  1052
619b0afc557a checkin from browser
ca
parents: 1132
diff changeset
  1053
showSelectionHighLighted
619b0afc557a checkin from browser
ca
parents: 1132
diff changeset
  1054
    "returns true if selection is highLighted
619b0afc557a checkin from browser
ca
parents: 1132
diff changeset
  1055
    "
619b0afc557a checkin from browser
ca
parents: 1132
diff changeset
  1056
    ^ description showSelectionHighLighted ~~ false
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1057
!
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1058
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1059
widthOfLabel:aLabel
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1060
    "returns the width of the label
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1061
    "
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1062
    |w|
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1063
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1064
    (aLabel isString or:[aLabel isImageOrForm]) ifTrue:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1065
        ^ aLabel widthOn:dataSet
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1066
    ].
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1067
    aLabel isNil ifTrue:[ ^ 0 ].
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1068
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1069
    aLabel isSequenceable ifFalse:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1070
        ^  aLabel perform:#widthOn: with:dataSet ifNotUnderstood:[
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1071
                aLabel displayString widthOn:dataSet
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1072
           ]
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1073
    ].
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1074
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1075
    w := 0.
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1076
    aLabel do:[:el|w := w max:(el widthOn:dataSet)].
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1077
  ^ w
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1078
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1079
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1080
!DataSetColumn methodsFor:'searching'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1081
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1082
findRowNrStartingWithChar:aChar start:start stop:stop
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1083
    "find the first row starting at start to stop, which drawable label
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1084
     starts with the character, aChar. The index of the detected row is
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1085
     returned or if no row is found 0.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1086
    "
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1087
    |char|
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1088
1496
78d702c6c614 bugFix:
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
  1089
    containsText ifTrue:[
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1090
        char  := aChar asLowercase.
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1091
2211
f14db8e094b9 pass rowNr and dataSet as additional args to
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1092
        start to:stop do:[:eachNr| |row lbl|
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1093
            (dataSet isRowSelectable:eachNr) ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1094
                row := dataSet at:eachNr.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1095
                lbl := self shownValueForRow:row rowNr:eachNr.
1147
2d0b9fc2422c new feature:
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1096
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1097
                (lbl isSequenceable and:[lbl isString not]) ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1098
                    lbl := lbl at:1 ifAbsent:nil
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1099
                ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1100
2636
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1101
                (lbl respondsTo:#string) ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1102
                    lbl := lbl string.
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1103
                    (lbl size ~~ 0 and:[(lbl at:1) asLowercase == char]) ifTrue:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1104
                        ^ eachNr
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1105
                    ]
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1106
                ] ifFalse:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1107
                    lbl isNil ifFalse:[
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1108
                        ^ 0
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1109
                    ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1110
                ].
103067a67ff9 add selectConditionBlock: to enable the selection of a row
ca
parents: 2635
diff changeset
  1111
            ].
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1112
        ]
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1113
    ].
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1114
    ^ 0
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1115
! !
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1116
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1117
!DataSetColumn class methodsFor:'documentation'!
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1118
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1119
version
2694
82289374e92e dblCLickOn: multi-args
werner
parents: 2693
diff changeset
  1120
    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetColumn.st,v 1.96 2004-04-02 14:42:29 werner Exp $'
542
e22c45e26653 intitial checkin
ca
parents:
diff changeset
  1121
! !