Border.st
author Claus Gittinger <cg@exept.de>
Mon, 05 Jan 2015 21:34:51 +0100
changeset 6714 08b320104918
parent 5457 c763a1cd9286
child 7013 1b1f3144927a
permissions -rw-r--r--
class: Border comment/format in: #examples changed: #displayOn:forDisplayBox:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     1
"
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
     3
	      All Rights Reserved
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     4
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     5
 This software is furnished under a license and may be used
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     6
 only in accordance with the terms of that license and with the
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     9
 other person.  No title to or ownership of the software is
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    10
 hereby transferred.
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    11
"
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    12
"{ Package: 'stx:libview' }"
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    13
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    14
"{ NameSpace: Smalltalk }"
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    15
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    16
AbstractBorder subclass:#Border
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    17
	instanceVariableNames:'leftColor rightColor topColor bottomColor'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
5391
0ef0b272c283 category
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
    20
	category:'Graphics-Support'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!Border class methodsFor:'documentation'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    25
copyright
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    26
"
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    27
 COPYRIGHT (c) 1997 by eXept Software AG
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    28
	      All Rights Reserved
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    29
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    30
 This software is furnished under a license and may be used
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    31
 only in accordance with the terms of that license and with the
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    33
 be provided or otherwise made available to, or used by, any
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    34
 other person.  No title to or ownership of the software is
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    35
 hereby transferred.
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    36
"
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    37
!
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    38
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    41
    a border holds the values of a view's (or component's) border.
5457
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    42
    We have only recently started to change the system to use borders instead of separate
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    43
    borderWidth, borderColor, level, shadow- and lightColors.
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    44
    Expect more changes here in the near future..
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [see also:]
5457
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    47
        SimpleView
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [author:]
5457
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    50
        Claus Gittinger
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
"
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    52
!
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    53
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    54
examples
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    55
"
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    56
                                                        [exBegin]
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    57
     |v b|
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    58
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    59
     v := StandardSystemView extent:100@100.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    60
     v openAndWait.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    61
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    62
     b := Border width:10 color:Color red.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    63
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    64
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    65
     Delay waitForSeconds:1.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    66
     b leftColor:Color blue.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    67
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    68
     Delay waitForSeconds:1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    69
     b topColor:Color green.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    70
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    71
     Delay waitForSeconds:1.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    72
     b rightColor:Color yellow.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    73
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    74
                                                        [exEnd]
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    75
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    76
                                                        [exBegin]
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    77
     |v b|
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    79
     v := StandardSystemView extent:100@100.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    80
     v openAndWait.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    81
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    82
     b := Border width:10 color:Color red.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    83
     v border:b
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    84
                                                        [exEnd]
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    85
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    86
                                                        [exBegin]
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    87
     |v sub1 sub2 sub3|
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    89
     v := StandardSystemView extent:200@200.
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    90
     v openAndWait.
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    92
     sub1 := (View in:v) origin:10@10; corner:90@90.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    93
     sub1 border:(SimpleBorder width:10 color:Color red ).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    94
     sub1 realize.
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    95
     sub2 := (View in:v) origin:110@10; corner:190@90.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    96
     sub2 border:(Border new width:10; color:Color blue; leftColor:Color red; rightColor:Color red ).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    97
     sub2 realize.
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    98
     sub3 := (View in:v) origin:110@110; corner:190@190.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    99
     sub3 border:(SimpleBorder width:10 color:Color green ).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   100
     sub3 realize.
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   102
     Delay waitForSeconds:1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   103
     sub3 border:(Border new width:10; color:Color yellow; leftColor:Color red; rightColor:Color red ).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   104
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   105
                                                        [exEnd]
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   106
"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!Border methodsFor:'accessing'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
bottomColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    "return the value of the instance variable 'bottomColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    ^ bottomColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   119
bottomColor:aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   120
    "set the bottomColor"
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   121
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   122
    bottomColor := aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   123
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   124
    "Created: 10.2.1997 / 15:37:51 / cg"
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   125
!
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   126
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
color:newColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    "set all four colors"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   130
     leftColor := rightColor := topColor := bottomColor := newColor
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    "Created: 10.2.1997 / 15:27:01 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
leftColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    "return the value of the instance variable 'leftColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    ^ leftColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   143
leftColor:aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   144
    "set the leftColor"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   146
    leftColor := aColor
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   148
    "Created: 10.2.1997 / 15:38:02 / cg"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
rightColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    "return the value of the instance variable 'rightColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    ^ rightColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   159
rightColor:aColor
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    "set the rightColor"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    rightColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    "Created: 10.2.1997 / 15:38:08 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
topColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    "return the value of the instance variable 'topColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    ^ topColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    "Created: 10.2.1997 / 14:51:34 / cg"
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   173
!
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   174
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   175
topColor:aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   176
    "set the topColor"
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   177
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   178
    topColor := aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   179
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   180
    "Created: 10.2.1997 / 15:38:17 / cg"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
!Border methodsFor:'displaying'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   185
displayOn:aGC forDisplayBox:aRectangle
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   186
    "display the border represented by the receiver in the given rectangle.
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
     The gc's state is restored after the drawing."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   189
    |oldPaint rL rR rT rB rW rH|
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   191
    width == 0 ifTrue:[ ^ self ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    oldPaint := aGC paint.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    rL := aRectangle left.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    rT := aRectangle top.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    rR := aRectangle right.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    rB := aRectangle bottom.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    rH := aRectangle height.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    rW := aRectangle width.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   202
    leftColor notNil ifTrue:[
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   203
        aGC paint:leftColor.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   204
        width == 1 ifTrue:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   205
            aGC displayLineFromX:rL y:rT toX:rL y:rB-1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   206
        ] ifFalse:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   207
            aGC fillRectangleX:rL y:rT width:width height:rH
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   208
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   211
    topColor notNil ifTrue:[
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   212
        aGC paint:topColor.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   213
        width == 1 ifTrue:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   214
            aGC displayLineFromX:rL+1 y:rT toX:rR-1 y:rT.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   215
        ] ifFalse:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   216
            aGC fillRectangleX:(rL + width) y:rT width:rW - width height:width
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   217
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   220
    rightColor notNil ifTrue:[
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   221
        aGC paint:rightColor.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   222
        width == 1 ifTrue:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   223
            aGC displayLineFromX:rR-1 y:rT toX:rR-1 y:rB-1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   224
        ] ifFalse:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   225
            aGC fillRectangleX:(rR - width) y:(rT + width) width:width height:rH-width
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   226
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   229
    bottomColor notNil ifTrue:[
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   230
        aGC paint:bottomColor.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   231
        width == 1 ifTrue:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   232
            aGC displayLineFromX:rL y:rB-1 toX:rR-1 y:rB-1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   233
        ] ifFalse:[
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   234
            aGC fillRectangleX:rL y:(rB-width) width:rW - width height:width
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   235
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
    aGC paint: oldPaint
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   240
    "Modified: 10.2.1997 / 15:55:04 / cg"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
!Border class methodsFor:'documentation'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
version
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   246
    ^ '$Header: /cvs/stx/stx/libview/Border.st,v 1.10 2015-01-05 20:34:51 cg Exp $'
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   247
!
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   248
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   249
version_CVS
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   250
    ^ '$Header: /cvs/stx/stx/libview/Border.st,v 1.10 2015-01-05 20:34:51 cg Exp $'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
! !
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   252