AbstractBorder.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Apr 2016 14:18:50 +0200
changeset 7319 a7aeb15d709f
parent 7236 6a4381fd555e
child 7383 3f283ca8c02a
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
 COPYRIGHT (c) 2009 by eXept Software AG
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
     4
	      All Rights Reserved
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 This software is furnished under a license and may be used
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 only in accordance with the terms of that license and with the
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 be provided or otherwise made available to, or used by, any
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 other person.  No title to or ownership of the software is
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 hereby transferred.
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libview' }"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
    15
"{ NameSpace: Smalltalk }"
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
    16
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
Object subclass:#AbstractBorder
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    18
	instanceVariableNames:'width'
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
5392
9cc77e8151a4 category
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
    21
	category:'Graphics-Support'
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!AbstractBorder class methodsFor:'documentation'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
copyright
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 COPYRIGHT (c) 1997 by eXept Software AG
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 2009 by eXept Software AG
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    30
	      All Rights Reserved
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
5392
9cc77e8151a4 category
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
    43
    Extracted from Border.
9cc77e8151a4 category
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
    44
    Common superclass for border-painters.
9cc77e8151a4 category
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
    45
    This will replace the mixture of window-system supported borders and manually
9cc77e8151a4 category
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
    46
    drawn 3D levels (which is ugly, but served me well for almost 20years now).
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [author:]
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    49
	Claus Gittinger
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!AbstractBorder class methodsFor:'instance creation'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
6939
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
    55
color:aColor
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
    56
    "create a new instance of the receiver with a border of the given color."
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
    57
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
    58
    ^ self width:1 color:aColor
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
    59
!
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
    60
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
    61
new
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
    62
    "return an initialized instance"
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
    63
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
    64
    ^ self basicNew initialize.
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
    65
!
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
    66
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
width:borderWidth
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    68
    "create a new instance of the receiver with a border of the given width
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
     (and default color)."
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    ^ self new width:borderWidth color:(Color black)
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "Modified: 10.2.1997 / 15:19:57 / cg"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
width:borderWidth color:aColor
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    77
    "create a new instance of the receiver with a border of the given width
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
     and color."
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    80
    ^ self new width:borderWidth color:aColor
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "Modified: 10.2.1997 / 15:20:32 / cg"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
!AbstractBorder methodsFor:'accessing'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    87
color:aColor
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
    88
    "set the color"
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    89
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    90
    "/ self subclassResponsibility
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    91
!
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    92
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    93
level
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    94
    "get the 3D level"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    95
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    96
    ^ 0
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    97
!
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    98
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    99
width
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   100
    "get the width"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   101
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
   102
    ^ width ? 1
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   103
!
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   104
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   105
width:aNumber
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   106
    "set the width"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   107
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   108
    width := aNumber
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   109
!
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   110
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   111
width:aWidth color:aColor
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   112
     self width:aWidth.
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   113
     self color:aColor
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    "Created: 10.2.1997 / 15:21:27 / cg"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!AbstractBorder methodsFor:'displaying'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
displayOn:aGC forDisplayBox:aRectangle
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    "display the borders represented by the receiver in the specified rectangle.
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
     The gc is restored after the draw."
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   124
    "/ self subclassResponsibility
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   127
!AbstractBorder methodsFor:'initialization'!
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   128
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   129
initialize
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   130
    width := 1.
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   131
! !
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   132
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   133
!AbstractBorder methodsFor:'queries'!
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   135
allSidesEqual:aSmallInteger 
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   136
    "true if all four sides have the same border width;
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   137
     always true here - provided for compatibility"
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   139
    ^ true
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   140
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   141
    "Created: 10.2.1997 / 14:53:13 / cg"
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
7012
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   144
bottomMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   145
    "return the bottom inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   146
     That is the number of pixels that an instance of me requires at the bottom,
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   147
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   148
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   149
    ^ width
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   150
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   151
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   152
displayBoxFor:aRectangle
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   153
    "return a rectangle representing the overall display box of a component
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   154
     bordered by the receiver, which has bounds of aRectangle.
7236
6a4381fd555e #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7012
diff changeset
   155
     That is, the argument outset by the receiver's borders."
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   156
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   157
    |insetRectangle|
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   158
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   159
    insetRectangle := aRectangle copy.
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   160
    insetRectangle left:(insetRectangle left - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   161
    insetRectangle right:(insetRectangle right + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   162
    insetRectangle top:(insetRectangle top - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   163
    insetRectangle bottom:(insetRectangle bottom + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   164
    ^ insetRectangle
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   166
    "Created: 10.2.1997 / 15:43:00 / cg"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   167
!
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   168
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   169
insetDisplayBoxFor:aRectangle
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   170
    "return a rectangle representing the display box of a component
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   171
     bordered by the receiver in the outer bounds, aRectangle.
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
   172
     That is, the argument inset by the receiver's borders."
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   173
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   174
    |insetRectangle|
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   175
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   176
    insetRectangle := aRectangle copy.
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   177
    insetRectangle left:(insetRectangle left + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   178
    insetRectangle right:(insetRectangle right - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   179
    insetRectangle top:(insetRectangle top + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   180
    insetRectangle bottom:(insetRectangle bottom - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   181
    ^ insetRectangle
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   182
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   183
    "Created: 10.2.1997 / 15:42:06 / cg"
7012
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   184
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   185
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   186
leftMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   187
    "return the left inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   188
     That is the number of pixels that an instance of me requires at the left,
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   189
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   190
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   191
    ^ width
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   192
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   193
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   194
rightMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   195
    "return the right inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   196
     That is the number of pixels that an instance of me requires at the right,
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   197
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   198
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   199
    ^ width
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   200
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   201
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   202
topMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   203
    "return the top inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   204
     That is the number of pixels that an instance of me requires at the top,
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   205
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   206
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   207
    ^ width
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
!AbstractBorder class methodsFor:'documentation'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   212
version
6939
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
   213
    ^ '$Header$'
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   214
!
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   215
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
version_CVS
6939
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
   217
    ^ '$Header$'
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
! !
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
   219