DataSetLabel.st
author Claus Gittinger <cg@exept.de>
Thu, 30 Jun 2011 21:15:12 +0200
changeset 4043 532a328a9e0e
parent 3885 602f5ef8532a
child 4549 397584f3c72f
permissions -rw-r--r--
changed: #buttonMultiPress:x:y: common code for doubleClick !
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1716
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     1
"
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     3
              All Rights Reserved
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     4
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     5
 This software is furnished under a license and may be used
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     6
 only in accordance with the terms of that license and with the
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     8
 be provided or otherwise made available to, or used by, any
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
     9
 other person.  No title to or ownership of the software is
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    10
 hereby transferred.
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    11
"
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
    13
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#DataSetLabel
3772
7875f39d446d sendClick done by view
Claus Gittinger <cg@exept.de>
parents: 3768
diff changeset
    15
	instanceVariableNames:'label selector argument adjust font fgColor bgColor
7875f39d446d sendClick done by view
Claus Gittinger <cg@exept.de>
parents: 3768
diff changeset
    16
		preferredHeight preferredWidth description'
7875f39d446d sendClick done by view
Claus Gittinger <cg@exept.de>
parents: 3768
diff changeset
    17
	classVariableNames:''
7875f39d446d sendClick done by view
Claus Gittinger <cg@exept.de>
parents: 3768
diff changeset
    18
	poolDictionaries:''
7875f39d446d sendClick done by view
Claus Gittinger <cg@exept.de>
parents: 3768
diff changeset
    19
	category:'Views-DataSet'
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
1716
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    22
!DataSetLabel class methodsFor:'documentation'!
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    23
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    24
copyright
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    25
"
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    26
 COPYRIGHT (c) 1997 by eXept Software AG
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    27
              All Rights Reserved
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    28
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    29
 This software is furnished under a license and may be used
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    30
 only in accordance with the terms of that license and with the
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    32
 be provided or otherwise made available to, or used by, any
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    33
 other person.  No title to or ownership of the software is
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    34
 hereby transferred.
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    35
"
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    36
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    37
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    38
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
    39
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    40
!
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    41
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    42
documentation
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    43
"
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    44
    This class keeps some info about a label.
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    45
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    46
    [author:]
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    47
        Claus Atzkern
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    48
"
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    49
! !
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    50
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    51
!DataSetLabel class methodsFor:'image specs'!
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    52
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    53
sortIndicator
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    54
    "This resource specification was automatically generated
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    55
     by the ImageEditor of ST/X."
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    56
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    57
    "Do not manually edit this!! If it is corrupted,
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    58
     the ImageEditor may not be able to read the specification."
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    59
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    60
    "
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    61
     self sortIndicator inspect
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    62
     ImageEditor openOnClass:self andSelector:#sortIndicator
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    63
     Icon flushCachedIcons
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    64
    "
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    65
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    66
    <resource: #image>
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    67
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    68
    ^Icon
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    69
        constantNamed:'DataSetLabel class sortIndicator'
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    70
        ifAbsentPut:[(Depth1Image new) width: 7; height: 4; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@B@0 @a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 4; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'?''08D@@a') ; yourself); yourself]
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    71
!
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    72
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    73
sortIndicatorGrey
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    74
    "This resource specification was automatically generated
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    75
     by the ImageEditor of ST/X."
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    76
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    77
    "Do not manually edit this!! If it is corrupted,
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    78
     the ImageEditor may not be able to read the specification."
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    79
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    80
    "
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    81
     self sortIndicatorGrey inspect
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    82
     ImageEditor openOnClass:self andSelector:#sortIndicatorGrey
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    83
     Icon flushCachedIcons
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    84
    "
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    85
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    86
    <resource: #image>
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    87
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    88
    ^Icon
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    89
        constantNamed:#'DataSetLabel class sortIndicatorGrey'
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    90
        ifAbsentPut:[(Depth1Image new) width: 7; height: 5; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@A@(UJ(b') ; yourself); yourself]
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    91
!
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
    92
3768
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    93
sortIndicatorGreyIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    94
    ^ ToolbarIconLibrary sortIndicatorGreyIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    95
!
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    96
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    97
sortIndicatorIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    98
    "This resource specification was automatically generated
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
    99
     by the ImageEditor of ST/X."
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   100
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   101
    "Do not manually edit this!! If it is corrupted,
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   102
     the ImageEditor may not be able to read the specification."
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   103
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   104
    "
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   105
     self sortIndicatorIcon inspect
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   106
     ImageEditor openOnClass:self andSelector:#sortIndicatorIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   107
     Icon flushCachedIcons
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   108
    "
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   109
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   110
    <resource: #image>
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   111
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   112
    ^Icon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   113
        constantNamed:'DataSetLabel class sortIndicatorIcon'
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   114
        ifAbsentPut:[(Depth1Image new) width: 7; height: 4; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@B@0 @a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 4; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'?''08D@@a') ; yourself); yourself]
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   115
!
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   116
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   117
sortReverseIndicator
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   118
    "This resource specification was automatically generated
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   119
     by the ImageEditor of ST/X."
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   120
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   121
    "Do not manually edit this!! If it is corrupted,
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   122
     the ImageEditor may not be able to read the specification."
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   123
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   124
    "
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   125
     self sortReverseIndicator inspect
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   126
     ImageEditor openOnClass:self andSelector:#sortReverseIndicator
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   127
     Icon flushCachedIcons
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   128
    "
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   129
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   130
    <resource: #image>
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   131
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   132
    ^Icon
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   133
        constantNamed:'DataSetLabel class sortReverseIndicator'
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   134
        ifAbsentPut:[(Depth1Image new) width: 7; height: 4; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'0(@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 4; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'DC!!<? @a') ; yourself); yourself]
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   135
!
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   136
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   137
sortReverseIndicatorGrey
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   138
    "This resource specification was automatically generated
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   139
     by the ImageEditor of ST/X."
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   140
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   141
    "Do not manually edit this!! If it is corrupted,
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   142
     the ImageEditor may not be able to read the specification."
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   143
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   144
    "
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   145
     self sortReverseIndicatorGrey inspect
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   146
     ImageEditor openOnClass:self andSelector:#sortReverseIndicatorGrey
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   147
     Icon flushCachedIcons
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   148
    "
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   149
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   150
    <resource: #image>
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   151
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   152
    ^Icon
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   153
        constantNamed:#'DataSetLabel class sortReverseIndicatorGrey'
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   154
        ifAbsentPut:[(Depth1Image new) width: 7; height: 5; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'*%P(D@@b') ; yourself); yourself]
3768
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   155
!
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   156
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   157
sortReverseIndicatorGreyIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   158
    "This resource specification was automatically generated
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   159
     by the ImageEditor of ST/X."
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   160
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   161
    "Do not manually edit this!! If it is corrupted,
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   162
     the ImageEditor may not be able to read the specification."
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   163
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   164
    "
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   165
     self sortReverseIndicatorGreyIcon inspect
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   166
     ImageEditor openOnClass:self andSelector:#sortReverseIndicatorGreyIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   167
     Icon flushCachedIcons
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   168
    "
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   169
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   170
    <resource: #image>
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   171
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   172
    ^Icon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   173
        constantNamed:#'DataSetLabel class sortReverseIndicatorGreyIcon'
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   174
        ifAbsentPut:[(Depth1Image new) width: 7; height: 5; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'*%P(D@@b') ; yourself); yourself]
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   175
!
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   176
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   177
sortReverseIndicatorIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   178
    "This resource specification was automatically generated
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   179
     by the ImageEditor of ST/X."
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   180
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   181
    "Do not manually edit this!! If it is corrupted,
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   182
     the ImageEditor may not be able to read the specification."
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   183
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   184
    "
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   185
     self sortReverseIndicatorIcon inspect
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   186
     ImageEditor openOnClass:self andSelector:#sortReverseIndicatorIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   187
     Icon flushCachedIcons
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   188
    "
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   189
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   190
    <resource: #image>
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   191
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   192
    ^Icon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   193
        constantNamed:'DataSetLabel class sortReverseIndicatorIcon'
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   194
        ifAbsentPut:[(Depth1Image new) width: 7; height: 4; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'0(@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 4; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'DC!!<? @a') ; yourself); yourself]
1716
0e31e721d4ab copyrights
Claus Gittinger <cg@exept.de>
parents: 1605
diff changeset
   195
! !
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
   197
!DataSetLabel methodsFor:'accessing-colors'!
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
backgroundColor
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   200
    "returns the background color or nil
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    "
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    ^ bgColor
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
2699
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   207
backgroundColor:aColor
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   208
    "set the background color or nil
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   209
    "
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   210
    bgColor := aColor
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   211
!
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   212
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
foregroundColor
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   214
    "returns the foreground color or nil
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
    "
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    ^ fgColor
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
2699
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   218
!
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   219
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   220
foregroundColor:aColor
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   221
    "set the foreground color or nil
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   222
    "
ffc569afbb18 WOs accessors
werner
parents: 2451
diff changeset
   223
    fgColor := aColor
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
! !
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
   226
!DataSetLabel methodsFor:'accessing-dimensions'!
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   228
preferredHeight
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   229
    "returns my preferred height
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    "
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   231
    ^ preferredHeight
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   234
preferredWidth
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   235
    "returns my preferred width
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    "
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   237
    ^ preferredWidth
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
! !
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
!DataSetLabel methodsFor:'drawing'!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   242
redrawX:xLeft w:width h:height inset:inset on:aLabelView
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    "redraw the label; the background is cleared and the paint is set
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    "
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   245
    |y0 x iconOffset gcFont labelWidth 
3768
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   246
     netWidth goodLookingVerticalSpacing colNr sortIcon|
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    label isNil ifTrue:[ ^ self ].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   250
    font notNil ifTrue:[
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   251
        gcFont := aLabelView font.    "save original font"
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   252
        aLabelView font:font.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   253
    ].
3582
2927b1b12e8f Get the label from a value holder
Stefan Vogel <sv@exept.de>
parents: 3553
diff changeset
   254
2927b1b12e8f Get the label from a value holder
Stefan Vogel <sv@exept.de>
parents: 3553
diff changeset
   255
    y0 := (height - preferredHeight) // 2.
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   256
    goodLookingVerticalSpacing := aLabelView font descent.
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   257
    y0 := y0 + goodLookingVerticalSpacing.
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
2144
29820901d223 shortened label, if it does not fit (i.e. O..)
penk
parents: 2068
diff changeset
   259
    netWidth := width-inset-inset.
29820901d223 shortened label, if it does not fit (i.e. O..)
penk
parents: 2068
diff changeset
   260
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   261
    iconOffset := 0.
3768
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   262
    description isSortable ifTrue:[
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   263
        iconOffset := 12.
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   264
        colNr := aLabelView columnIndexOfDescription:description.
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   265
        colNr == aLabelView indexOfSortColumn ifTrue:[
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   266
            aLabelView reverseSort ifTrue:[
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   267
                sortIcon := ToolbarIconLibrary sortIndicatorGreyIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   268
            ] ifFalse:[
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   269
                sortIcon := ToolbarIconLibrary sortReverseIndicatorGreyIcon
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   270
            ].
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   271
            sortIcon displayOn:aLabelView x:xLeft+inset y:y0.
3765
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   272
        ].
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   273
    ].
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   274
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   275
    label do:[:eachLabelLine|
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   276
        |restWidth xOffset shownLabel mustUndoClip prevClip|
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   277
3765
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   278
        shownLabel := eachLabelLine.
2144
29820901d223 shortened label, if it does not fit (i.e. O..)
penk
parents: 2068
diff changeset
   279
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   280
        mustUndoClip := false.
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   281
        labelWidth := shownLabel widthOn:aLabelView.
2144
29820901d223 shortened label, if it does not fit (i.e. O..)
penk
parents: 2068
diff changeset
   282
        labelWidth > netWidth ifTrue:[
3765
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   283
            shownLabel := DataSetColumn shortenedStringFor:eachLabelLine on:aLabelView maxWidth:netWidth.
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   284
            labelWidth := shownLabel widthOn:aLabelView.
2144
29820901d223 shortened label, if it does not fit (i.e. O..)
penk
parents: 2068
diff changeset
   285
        ].
29820901d223 shortened label, if it does not fit (i.e. O..)
penk
parents: 2068
diff changeset
   286
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   287
        adjust == #left ifTrue:[
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   288
            x := xLeft + iconOffset + inset.
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   289
        ] ifFalse:[
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   290
            restWidth := width - labelWidth - iconOffset.
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   292
            adjust == #right ifTrue:[
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   293
                xOffset := restWidth - inset
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   294
            ] ifFalse:[
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   295
                xOffset := restWidth // 2.    "/ center
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   296
            ].
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   297
            x := xLeft + xOffset.
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   298
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   299
           "/ cg: must clip left, if string is too large
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   300
            x < xLeft ifTrue:[
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   301
                "/ must clip ...
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   302
                prevClip := aLabelView clippingRectangleOrNil.
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   303
                mustUndoClip := true.
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   304
                aLabelView clippingRectangle:(Rectangle 
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   305
                                    left:xLeft top:y0 
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   306
                                    width:width height:height).
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   307
            ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   308
        ].
3582
2927b1b12e8f Get the label from a value holder
Stefan Vogel <sv@exept.de>
parents: 3553
diff changeset
   309
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   310
        shownLabel displayOn:aLabelView x:x y:y0 + (shownLabel ascentOn:aLabelView).
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   311
        y0 := y0 + (shownLabel heightOn:aLabelView) + goodLookingVerticalSpacing.
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   312
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   313
        mustUndoClip == true ifTrue:[
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   314
            aLabelView clippingRectangle:prevClip
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   315
        ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   316
    ].
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   317
3582
2927b1b12e8f Get the label from a value holder
Stefan Vogel <sv@exept.de>
parents: 3553
diff changeset
   318
    gcFont notNil ifTrue:[
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   319
        aLabelView font:gcFont     "/ restore font
2451
383fdea243d0 use new aspectOn: query
Claus Gittinger <cg@exept.de>
parents: 2443
diff changeset
   320
    ].       
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
! !
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
!DataSetLabel methodsFor:'instance creation'!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   325
description:aDescription builder:aBuilder on:aGC
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   326
    |device gcFont verticalSpace|
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
3649
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   328
    description := aDescription.
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   329
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   330
    "/ stupid code - could simply access things via the description.
88b3435ff257 preps for sort by column
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   331
    "/ I leave it here for subclasses which depend on it (for a while).
1605
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   332
    label           := self resolveLabelFromDescription:aDescription withBuilder:aBuilder.
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   333
    selector        := aDescription  labelActionSelector.
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   334
    argument        := (aDescription labelActionArgument) ? label.
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   335
    adjust          := (aDescription labelAlignment) ? #left.
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   336
    device          := aGC device.
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   337
    fgColor         := aDescription labelForegroundColor.
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   338
    bgColor         := aDescription labelBackgroundColor.
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
1480
51dd0cc6ea11 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1269
diff changeset
   340
    fgColor notNil ifTrue:[ fgColor := fgColor onDevice:device ].
51dd0cc6ea11 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1269
diff changeset
   341
    bgColor notNil ifTrue:[ bgColor := bgColor onDevice:device ].
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   343
    preferredHeight := preferredWidth := 0.
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   344
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   345
    (label isEmptyOrNil) ifTrue:[
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   346
        label := nil.
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   347
        ^ self
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    ].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
3553
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   350
    font := aDescription labelFont.
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   351
    font notNil ifTrue:[
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   352
        font := aBuilder resolveFont:font.
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   353
        font notNil ifTrue:[
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   354
            gcFont := aGC font.
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   355
            gcFont = font ifTrue:[
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   356
                font := nil
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   357
            ] ifFalse:[
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   358
                    font := font onDevice:device.
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   359
                    aGC font:font.
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   360
            ].
9387938a3c07 Resolve symbolic fonts
Stefan Vogel <sv@exept.de>
parents: 3490
diff changeset
   361
        ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   362
    ].
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   364
    label isString ifTrue:[
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   365
        label := Array with:label.
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   366
    ] ifFalse:[
3885
602f5ef8532a code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 3772
diff changeset
   367
        label isSequenceable ifFalse:[
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   368
            label := Array with:label.
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   369
        ]
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
    ].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
3490
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   372
    verticalSpace := aGC font descent. "/ goodLookingVerticalSpacing
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   373
    label := label 
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   374
                collect:[:el|
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   375
                    |lbl|
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   376
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   377
                    lbl := self label:el on:device.
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   378
                    preferredWidth  := (lbl widthOn:aGC) max:preferredWidth.
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   379
                    preferredHeight := preferredHeight + verticalSpace + (lbl heightOn:aGC) + verticalSpace.
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   380
                    lbl
f46a3c50dc15 preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents: 3468
diff changeset
   381
                ].
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   382
    font notNil ifTrue:[aGC font:gcFont].       "/ restore font
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
! !
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
!DataSetLabel methodsFor:'private'!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
label:aLabel on:aDevice
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
    "returns registered label on a device
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
    "
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
    |lbl img|
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
1487
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   392
    aLabel isNil ifTrue:[^ ''].
fd003e2156cc bug fixes + rework
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   393
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
    aLabel isString ifFalse:[
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
        aLabel isImageOrForm ifTrue:[
2291
c5e8140dd6ba #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   396
            aLabel device ~~ aDevice ifTrue:[
c5e8140dd6ba #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   397
                lbl := aLabel copy onDevice:aDevice
c5e8140dd6ba #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   398
            ] ifFalse:[
c5e8140dd6ba #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   399
                lbl := aLabel
c5e8140dd6ba #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   400
            ].
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
            lbl isImage ifTrue:[
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
                lbl clearMaskedPixels
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
            ].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
            ^ lbl
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
        ].
1588
e6039e46cae2 clip label on the left, if larger than columns width,
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
   406
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
        aLabel class == LabelAndIcon ifTrue:[
2291
c5e8140dd6ba #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   408
            lbl := aLabel onDevice:aDevice.
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
            (img := lbl image) isImage ifTrue:[img clearMaskedPixels].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
            (img := lbl icon)  isImage ifTrue:[img clearMaskedPixels].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
            ^ lbl
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
        ]
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
    ].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
    ^ aLabel
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
resolveLabelFromDescription:aDescription withBuilder:aBuilder
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   418
    "the rawLabel can be a string, icon, labelAndIcon or collection of strings.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   419
     if labelIsImage is true, the string is actually the appModel-labelFor-access key"
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   420
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   421
    |rawLabel appl resources lbl|
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
    aBuilder isNil ifTrue:[
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   424
        rawLabel := aDescription rawLabel.
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   425
    ] ifFalse:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   426
        rawLabel := aDescription label.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   427
        rawLabel isNil ifTrue:[^ nil ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   428
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   429
        aBuilder isEditing ifFalse:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   430
            appl := aBuilder application.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   431
            appl notNil ifTrue:[ resources := appl resources ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   432
        ].
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   433
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   434
        rawLabel isString ifTrue:[
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   435
            aDescription labelIsImage ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   436
                (aBuilder isEditing or:[(rawLabel := aBuilder labelFor:(rawLabel asSymbol)) isNil]) ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   437
                    rawLabel := aDescription class defaultIcon
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   438
                ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   439
                ^ rawLabel
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   440
            ] ifFalse:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   441
                aDescription translateLabel == true ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   442
                    lbl := (aBuilder labelAt:(rawLabel asSymbol)) value.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   443
                    lbl isNil ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   444
                        lbl := (aBuilder aspectAt:(rawLabel asSymbol)) value.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   445
                    ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   446
                    (lbl isNil and:[resources notNil]) ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   447
                        lbl := resources string:rawLabel default:nil.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   448
                    ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   449
                    lbl notNil ifTrue:[ rawLabel := lbl ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   450
                ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   451
            ].
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   452
        ] ifFalse:[
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   453
            (rawLabel isKindOf:LabelAndIcon) ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   454
                rawLabel := rawLabel copy string:(resources string:rawLabel string).
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
            ].
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   456
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   457
            rawLabel isSequenceable ifFalse:[^ rawLabel].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   458
            rawLabel isEmptyOrNil ifTrue:[^ nil ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   459
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   460
            resources notNil ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   461
                lbl := resources string:rawLabel default:nil.
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   462
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   463
                lbl notNil ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   464
                    rawLabel := lbl.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   465
                ] ifFalse:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   466
                    lbl := resources array:rawLabel.
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   467
                    lbl notEmptyOrNil ifTrue:[
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   468
                        lbl size == 1 ifTrue:[ rawLabel := lbl first ]
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   469
                                     ifFalse:[ rawLabel := lbl ].
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   470
                    ].
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   471
                ].
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   472
            ].
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
        ].
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
    ].
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   475
3468
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   476
    rawLabel isString ifTrue:[
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   477
        rawLabel isEmpty ifTrue:[ ^ nil ].
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   478
        lbl := rawLabel asStringCollection.
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   479
        lbl size > 1 ifTrue:[^ lbl ].
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   480
    ].
075b137a1e67 support carriage return in title labels
ca
parents: 2932
diff changeset
   481
    ^ rawLabel
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
! !
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
!DataSetLabel methodsFor:'queries'!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
1605
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   486
hasSeparator
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   487
    |l|
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   488
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   489
    label size == 1 ifTrue:[
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   490
"/        ^ (label at:1) ~= 'Alarm'
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   491
        ^ (label at:1) ~= 'Area'
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   492
    ].
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   493
    ^ true
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   494
!
3eb7d3e78e08 checkin from browser
ca
parents: 1591
diff changeset
   495
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
isSelectable
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
    "returns true if the item is selectable; a valid selector
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
     to notify the receiver for a release button event exists
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
    "
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
    ^ selector notNil
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
3765
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   503
!
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   504
3768
5fd0a628d63f added:5 methods
Claus Gittinger <cg@exept.de>
parents: 3765
diff changeset
   505
isSortable
3765
6df5fd15903e added: #isSortable
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   506
    ^ description isSortable
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
! !
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
!DataSetLabel class methodsFor:'documentation'!
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
version
3885
602f5ef8532a code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 3772
diff changeset
   512
    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetLabel.st,v 1.29 2010-03-09 12:08:18 cg Exp $'
3763
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   513
!
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   514
f31244b93a13 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   515
version_CVS
3885
602f5ef8532a code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 3772
diff changeset
   516
    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetLabel.st,v 1.29 2010-03-09 12:08:18 cg Exp $'
1150
d0530983c4f6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
! !