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