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