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