Border.st
author Claus Gittinger <cg@exept.de>
Tue, 29 Sep 2009 21:33:02 +0200
changeset 5353 9b83c512effa
parent 3149 c383247cb500
child 5373 44c47ff50380
permissions -rw-r--r--
added: #copyright
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
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
     3
              All Rights Reserved
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
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#Border
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'left right top bottom leftColor rightColor topColor bottomColor'
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:''
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Interface-Support'
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
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
    26
              All Rights Reserved
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
"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    a border holdes the values of a views (or components) border.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    It is (currently) not used by ST/X, but provided as a comatibility hook.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    (... however, ST/X is being rewritten to make use of it soon).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    Notice: 
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
        this class was implemented using protocol information
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
        from alpha testers, from reading PD programs and 
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        from the Hopkins/Horan book.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
        - it may not be complete or compatible to the corresponding ST-80 class. 
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        If you encounter any incompatibilities, please forward a note 
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [see also:]
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
        Wrapper SimpleView
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [author:]
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
        Claus Gittinger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    58
!
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    59
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    60
examples
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 b|
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    63
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    64
     v := StandardSystemView extent:10@10.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    65
     v openAndWait.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    66
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    67
     b := Border width:2 color:Color red.
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
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    70
     Delay waitForSeconds:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    71
     b setLeftColor:Color blue.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    72
     b displayOn:v forDisplayBox:(0@0 corner:9@9).
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    73
     Delay waitForSeconds:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    74
     b setTopColor:Color green.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    75
     b displayOn:v forDisplayBox:(0@0 corner:9@9).
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    76
     Delay waitForSeconds:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    77
     b setRightColor:Color magenta.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    78
     b displayOn:v forDisplayBox:(0@0 corner:9@9).
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
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    81
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    82
     |v b|
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    83
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    84
     v := StandardSystemView extent:100@100.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    85
     v openAndWait.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    86
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    87
     b := Border width:2 color:Color red.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    88
     b displayOn:v forDisplayBox:(0@0 corner:99@99).
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    89
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    90
     Delay waitForSeconds:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    91
     b setLeft:5.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    92
     v clear.   
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    93
     b displayOn:v forDisplayBox:(0@0 corner:99@99).
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    94
     Delay waitForSeconds:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    95
     b setTop:3.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    96
     v clear.   
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    97
     b displayOn:v forDisplayBox:(0@0 corner:99@99).
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    98
     Delay waitForSeconds:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    99
     b setRight:1.
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   100
     v clear.   
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   101
     b displayOn:v forDisplayBox:(0@0 corner:99@99).
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   102
"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
!Border class methodsFor:'instance creation'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
width:borderWidth
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    "create a new instance of the receiver with a border of the given width  
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
     (and default color)."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    ^ self width:borderWidth color:View defaultBorderColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    "Modified: 10.2.1997 / 15:19:57 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
width:borderWidth color:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    "create a new instance of the receiver with a border of the given width  
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
     and color."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    ^ self new
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
        setBorderWidth:borderWidth color:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "Modified: 10.2.1997 / 15:20:32 / cg"
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
bottom
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "return the bottom border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    ^ bottom
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
    "Modified: 10.2.1997 / 15:39:01 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
bottomColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    "return the value of the instance variable 'bottomColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    ^ bottomColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
color:newColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    "set all four colors"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    leftColor := rightColor := topColor := bottomColor := newColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    "Created: 10.2.1997 / 15:27:01 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
left
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    "return the left border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    ^ left
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    "Modified: 10.2.1997 / 15:39:05 / 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
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
right
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "return the right border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    ^ right
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    "Modified: 10.2.1997 / 15:39:08 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
rightColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "return the value of the instance variable 'rightColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    ^ rightColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
setBottom:aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    "set the bottom border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    bottom := aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    "Created: 10.2.1997 / 15:38:50 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
setBottomColor:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    "set the bottomColor"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    bottomColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    "Created: 10.2.1997 / 15:37:51 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
setLeft:aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    "set the left border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    left := aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    "Created: 10.2.1997 / 15:39:33 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
setLeftColor:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    "set the leftColor"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    leftColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    "Created: 10.2.1997 / 15:38:02 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
setRight:aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    "set the right border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    right := aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    "Created: 10.2.1997 / 15:39:44 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
setRightColor:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    "set the rightColor"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    rightColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    "Created: 10.2.1997 / 15:38:08 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
setTop:aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    "set the top border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
    top := aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    "Created: 10.2.1997 / 15:39:27 / cg"
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
setTopColor:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    "set the topColor"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    topColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    "Created: 10.2.1997 / 15:38:17 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
top
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    "return the top border width"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    ^ top
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    "Modified: 10.2.1997 / 15:39:11 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
topColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    "return the value of the instance variable 'topColor' (automatically generated)"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
    ^ topColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
    "Created: 10.2.1997 / 14:51:34 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
!Border methodsFor:'displaying'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
displayOn:aGC forDisplayBox:aRectangle
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
    "display the borders represented by the receiver in the specified rectangle.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
     The gc is restored after the draw."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    self displayOn:aGC forDisplayBox:aRectangle using:nil
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    "Modified: 10.2.1997 / 14:56:10 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
displayOn:aGC forDisplayBox:aRectangle using:colorSource
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    "display the borders represented by the receiver borders in the given rectangle.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
     colorSource is ignored here, but subclasses (i.e. 3D-borders) may use
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
     it to ask for shadow/lightColors.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
     The gc's state is restored after the drawing."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
    |clipRectangle paint oldPaint 
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
     t r l b rL rR rT rB rW rH|
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
"/    clipRectangle := aGC clippingBounds.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
"/    ((self insetDisplayBoxFor: aRectangle) contains: clipRectangle) ifTrue: [^self].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
    oldPaint := aGC paint.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    r := aRectangle copy.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    t := self top.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
    l := self left.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    r := self right.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    b := self bottom.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    rL := aRectangle left.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    rT := aRectangle top.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
    rR := aRectangle right.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    rB := aRectangle bottom.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    rH := aRectangle height.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
    rW := aRectangle width.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    (l ~~ 0 and: [(paint := self leftColor) notNil]) ifTrue:[
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
        aGC paint:paint.
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   308
        aGC fillRectangleX:rL
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   309
                         y:rT
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   310
                     width:l
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   311
                    height:rH + 1 - b
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    (t ~~ 0 and: [(paint := self topColor) notNil]) ifTrue:[
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
        aGC paint:paint.
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   316
        aGC fillRectangleX:(rL + l)
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   317
                         y:rT
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   318
                     width:rW - l
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   319
                    height:t
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
    (r ~~ 0 and: [(paint := self rightColor) notNil]) ifTrue:[
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
        aGC paint:paint.
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   324
        aGC fillRectangleX:(rR - r)
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   325
                         y:(rT + t)
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   326
                     width:r
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   327
                    height:rH + 1 - t
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
    (b ~~ 0 and: [(paint := self bottomColor) notNil]) ifTrue:[
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
        aGC paint:paint.
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   332
        aGC fillRectangleX:(rL)
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   333
                         y:(rB + 1 - b)
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   334
                     width:rW - r
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   335
                    height:b
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
    ].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
    aGC paint: oldPaint
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
1324
c2feab00b045 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   340
    "Modified: 10.2.1997 / 15:55:04 / cg"
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
!Border methodsFor:'private accessing'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
3149
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   345
setBorderColor:aColor
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   346
     leftColor := rightColor := topColor := bottomColor := aColor
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   347
!
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   348
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   349
setBorderWidth:aWidth
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   350
     left := right := top := bottom := aWidth.
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   351
!
c383247cb500 added accessors (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   352
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
setBorderWidth:aWidth color:aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
     left := right := top := bottom := aWidth.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
     leftColor := rightColor := topColor := bottomColor := aColor
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
    "Created: 10.2.1997 / 15:21:27 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
!Border methodsFor:'queries'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
allSidesEqual:aSmallInteger
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
    left ~~ aSmallInteger ifTrue:[^ false].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
    top ~~ aSmallInteger ifTrue:[^ false].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
    right ~~ aSmallInteger ifTrue:[^ false].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
    bottom ~~ aSmallInteger ifTrue:[^ false].
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
    ^ true
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
    "Created: 10.2.1997 / 14:53:13 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
displayBoxFor:aRectangle
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    "return a rectangle representing the overall display box of a component
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
     bordered by the receiver, which has bounds of aRectangle.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
     That is, the argument outset by the receivers borders."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
    |insetRectangle|
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
    insetRectangle := aRectangle copy.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
    insetRectangle left:(insetRectangle left - self left).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
    insetRectangle right:(insetRectangle right + self right).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
    insetRectangle top:(insetRectangle top - self top).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
    insetRectangle bottom:(insetRectangle bottom + self bottom).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
    ^ insetRectangle
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
    "Created: 10.2.1997 / 15:43:00 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
insetDisplayBoxFor:aRectangle
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
    "return a rectangle representing the display box of a component
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
     bordered by the receiver in the outer bounds, aRectangle.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
     That is, the argument inset by the receivers borders."
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
    |insetRectangle|
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
    insetRectangle := aRectangle copy.
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    insetRectangle left:(insetRectangle left + self left).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
    insetRectangle right:(insetRectangle right - self right).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
    insetRectangle top:(insetRectangle top + self top).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
    insetRectangle bottom:(insetRectangle bottom - self bottom).
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
    ^ insetRectangle
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
    "Created: 10.2.1997 / 15:42:06 / cg"
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
! !
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
!Border class methodsFor:'documentation'!
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
version
5353
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   409
    ^ '$Header: /cvs/stx/stx/libview/Border.st,v 1.5 2009-09-29 19:33:02 cg Exp $'
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   410
!
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   411
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   412
version_CVS
9b83c512effa added: #copyright
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   413
    ^ '$Header: /cvs/stx/stx/libview/Border.st,v 1.5 2009-09-29 19:33:02 cg Exp $'
1321
b87667a37eef intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
! !