Border.st
author Claus Gittinger <cg@exept.de>
Wed, 22 Aug 2018 12:58:11 +0200
changeset 8451 6eafe0433763
parent 7947 ccd0e325ddf8
permissions -rw-r--r--
#QUALITY by cg class: WindowSensor comment/format in: #basicAddDamage:view:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     1
"
7947
ccd0e325ddf8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7013
diff changeset
     2
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
ccd0e325ddf8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7013
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
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    17
	instanceVariableNames:'leftColor leftWidth rightColor rightWidth topColor topWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    18
		bottomColor bottomWidth'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
5391
0ef0b272c283 category
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
    21
	category:'Graphics-Support'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!Border class methodsFor:'documentation'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    26
copyright
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    27
"
7947
ccd0e325ddf8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7013
diff changeset
    28
 COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
ccd0e325ddf8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7013
diff changeset
    29
              All Rights Reserved
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    30
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    31
 This software is furnished under a license and may be used
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    32
 only in accordance with the terms of that license and with the
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    34
 be provided or otherwise made available to, or used by, any
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    35
 other person.  No title to or ownership of the software is
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    36
 hereby transferred.
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
!
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    39
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
    42
    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
    43
    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
    44
    borderWidth, borderColor, level, shadow- and lightColors.
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    45
    Expect more changes here in the near future..
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
    [see also:]
5457
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    48
        SimpleView
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [author:]
5457
c763a1cd9286 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
    51
        Claus Gittinger
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
1324
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
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    55
examples
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    56
"
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    57
                                                        [exBegin]
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    58
     |v b|
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
     v := StandardSystemView extent:100@100.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    61
     v openAndWait.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    62
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    63
     b := Border width:1 color:Color red.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    64
     v border:b
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    65
                                                        [exEnd]
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    66
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    67
                                                        [exBegin]
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    68
     |v b|
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    69
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    70
     v := StandardSystemView extent:100@100.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    71
     v openAndWait.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    72
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    73
     b := Border width:10 color:Color red.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    74
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    75
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    76
     Delay waitForSeconds:1.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    77
     b leftColor:Color blue.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    78
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    79
     Delay waitForSeconds:1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    80
     b topColor:Color green.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    81
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    82
     Delay waitForSeconds:1.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    83
     b rightColor:Color yellow.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    84
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    85
                                                        [exEnd]
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    86
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    87
                                                        [exBegin]
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    88
     |v b|
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    90
     v := StandardSystemView extent:100@100.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    91
     v openAndWait.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    92
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
    93
     b := Border width:10 color:Color red.
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    94
     b topColor:Color red.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    95
     b leftColor:Color blue.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    96
     b topColor:Color green.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    97
     b rightColor:Color yellow.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    98
     b leftWidth:10 rightWidth:20 topWidth:5 bottomWidth:15.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
    99
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   100
     b displayOn:v forDisplayBox:(0@0 corner:90@90).
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   101
                                                        [exEnd]
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   102
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   103
                                                        [exBegin]
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   104
     |v sub1 sub2 sub3|
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   106
     v := StandardSystemView extent:200@200.
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   107
     v openAndWait.
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   109
     sub1 := (View in:v) origin:10@10; corner:90@90.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   110
     sub1 border:(SimpleBorder width:10 color:Color red ).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   111
     sub1 realize.
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   112
     sub2 := (View in:v) origin:110@10; corner:190@90.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   113
     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
   114
     sub2 realize.
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   115
     sub3 := (View in:v) origin:110@110; corner:190@190.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   116
     sub3 border:(SimpleBorder width:10 color:Color green ).
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   117
     sub3 realize.
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   119
     Delay waitForSeconds:1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   120
     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
   121
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   122
                                                        [exEnd]
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   123
"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
!Border methodsFor:'accessing'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
bottomColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "return the value of the instance variable 'bottomColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    ^ bottomColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
!
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
bottomColor:aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   137
    "set the bottomColor"
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   138
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   139
    bottomColor := aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   140
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   141
    "Created: 10.2.1997 / 15:37:51 / cg"
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   142
!
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   143
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   144
bottomWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   145
    ^ bottomWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   146
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   147
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   148
bottomWidth:something
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   149
    bottomWidth := something.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   150
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   151
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
color:newColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "set all four colors"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   155
     leftColor := rightColor := topColor := bottomColor := newColor
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "Created: 10.2.1997 / 15:27:01 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
leftColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    "return the value of the instance variable 'leftColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    ^ leftColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   168
leftColor:aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   169
    "set the leftColor"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   171
    leftColor := aColor
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   173
    "Created: 10.2.1997 / 15:38:02 / cg"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   176
leftWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   177
    ^ leftWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   178
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   179
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   180
leftWidth:something
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   181
    leftWidth := something.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   182
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   183
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   184
leftWidth:leftWidthArg rightWidth:rightWidthArg topWidth:topWidthArg bottomWidth:bottomWidthArg 
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   185
    leftWidth := leftWidthArg.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   186
    rightWidth := rightWidthArg.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   187
    topWidth := topWidthArg.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   188
    bottomWidth := bottomWidthArg.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   189
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   190
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
rightColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    "return the value of the instance variable 'rightColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    ^ rightColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   199
rightColor:aColor
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    "set the rightColor"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    rightColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    "Created: 10.2.1997 / 15:38:08 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   207
rightWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   208
    ^ rightWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   209
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   210
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   211
rightWidth:something
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   212
    rightWidth := something.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   213
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   214
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
topColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    "return the value of the instance variable 'topColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    ^ topColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    "Created: 10.2.1997 / 14:51:34 / cg"
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   221
!
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   222
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   223
topColor:aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   224
    "set the topColor"
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   225
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   226
    topColor := aColor
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   227
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   228
    "Created: 10.2.1997 / 15:38:17 / cg"
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   229
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   230
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   231
topWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   232
    ^ topWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   233
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   234
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   235
topWidth:something
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   236
    topWidth := something.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   237
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   238
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   239
width:w
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   240
    leftWidth := rightWidth := topWidth := bottomWidth := width := w.
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 methodsFor:'displaying'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   245
displayOn:aGC forDisplayBox:aRectangle
5373
44c47ff50380 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5353
diff changeset
   246
    "display the border represented by the receiver in the given rectangle.
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
     The gc's state is restored after the drawing."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   249
    |oldPaint rL rR rT rB rW rH|
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   251
    width == 0 ifTrue:[ ^ self ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
    oldPaint := aGC paint.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
    rL := aRectangle left.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    rT := aRectangle top.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    rR := aRectangle right.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    rB := aRectangle bottom.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
    rH := aRectangle height.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    rW := aRectangle width.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   262
    leftColor notNil ifTrue:[
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   263
        aGC paint:leftColor.
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   264
        leftWidth == 1 ifTrue:[
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   265
            aGC displayLineFromX:rL y:rT toX:rL y:rB-1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   266
        ] ifFalse:[
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   267
            aGC fillRectangleX:rL y:rT width:leftWidth height:rH
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   268
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   271
    topColor notNil ifTrue:[
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   272
        aGC paint:topColor.
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   273
        topWidth == 1 ifTrue:[
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   274
            aGC displayLineFromX:rL+1 y:rT toX:rR-1 y:rT.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   275
        ] ifFalse:[
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   276
            aGC fillRectangleX:(rL + leftWidth) y:rT width:rW - leftWidth - rightWidth  height:topWidth
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   277
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   280
    rightColor notNil ifTrue:[
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   281
        aGC paint:rightColor.
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   282
        rightWidth == 1 ifTrue:[
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   283
            aGC displayLineFromX:rR-1 y:rT toX:rR-1 y:rB-1.
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   284
        ] ifFalse:[
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   285
            aGC fillRectangleX:(rR - rightWidth) y:rT width:rightWidth height:rH
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   286
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
5408
1eb5612a463a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   289
    bottomColor notNil ifTrue:[
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   290
        aGC paint:bottomColor.
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   291
        bottomWidth == 1 ifTrue:[
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   292
            aGC displayLineFromX:rL+1 y:rB-1 toX:rR-2 y:rB-1.
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   293
        ] ifFalse:[
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   294
            aGC fillRectangleX:rL+leftWidth y:(rB-bottomWidth) width:rW - leftWidth - rightWidth height:bottomWidth
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   295
        ].
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    aGC paint: oldPaint
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   300
    "Modified: 10.2.1997 / 15:55:04 / cg"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   303
!Border methodsFor:'initialization'!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   304
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   305
initialize
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   306
    width := 1.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   307
    leftWidth := rightWidth := topWidth := bottomWidth := 1.
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   308
! !
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   309
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   310
!Border methodsFor:'queries'!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   311
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   312
bottomMargin
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   313
    ^ bottomWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   314
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   315
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   316
leftMargin
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   317
    ^ leftWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   318
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   319
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   320
rightMargin
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   321
    ^ rightWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   322
!
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   323
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   324
topMargin
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   325
    ^ topWidth
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   326
! !
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   327
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
!Border class methodsFor:'documentation'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
version
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   331
    ^ '$Header$'
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   332
!
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   333
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   334
version_CVS
7013
1b1f3144927a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6714
diff changeset
   335
    ^ '$Header$'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
! !
6714
08b320104918 class: Border
Claus Gittinger <cg@exept.de>
parents: 5457
diff changeset
   337