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