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