AbstractBorder.st
author Claus Gittinger <cg@exept.de>
Tue, 23 Apr 2019 16:30:55 +0200
changeset 8674 e29a561c0fbe
parent 7383 3f283ca8c02a
permissions -rw-r--r--
#FEATURE by cg class: SimpleView added: #isDialogBox
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
7383
3f283ca8c02a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7236
diff changeset
    87
color
3f283ca8c02a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7236
diff changeset
    88
    "get the color; nil if there is no single color"
3f283ca8c02a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7236
diff changeset
    89
3f283ca8c02a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7236
diff changeset
    90
    ^ nil
3f283ca8c02a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7236
diff changeset
    91
!
3f283ca8c02a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7236
diff changeset
    92
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
    93
color:aColor
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
    94
    "set the color"
5407
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
    "/ self subclassResponsibility
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
level
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   100
    "get the 3D level"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   101
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   102
    ^ 0
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
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   106
    "get the width"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   107
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
   108
    ^ width ? 1
5407
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:aNumber
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   112
    "set the width"
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   113
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   114
    width := aNumber
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   115
!
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   116
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   117
width:aWidth color:aColor
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   118
     self width:aWidth.
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   119
     self color:aColor
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    "Created: 10.2.1997 / 15:21:27 / cg"
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!AbstractBorder methodsFor:'displaying'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
displayOn:aGC forDisplayBox:aRectangle
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "display the borders represented by the receiver in the specified rectangle.
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
     The gc is restored after the draw."
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   130
    "/ self subclassResponsibility
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   133
!AbstractBorder methodsFor:'initialization'!
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   134
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   135
initialize
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   136
    width := 1.
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   137
! !
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   138
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   139
!AbstractBorder methodsFor:'queries'!
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
allSidesEqual:aSmallInteger 
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   142
    "true if all four sides have the same border width;
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   143
     always true here - provided for compatibility"
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   145
    ^ true
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   146
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   147
    "Created: 10.2.1997 / 14:53:13 / cg"
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
7012
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   150
bottomMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   151
    "return the bottom inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   152
     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
   153
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   154
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   155
    ^ width
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   156
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   157
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   158
displayBoxFor:aRectangle
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   159
    "return a rectangle representing the overall display box of a component
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   160
     bordered by the receiver, which has bounds of aRectangle.
7236
6a4381fd555e #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7012
diff changeset
   161
     That is, the argument outset by the receiver's borders."
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   162
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   163
    |insetRectangle|
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   164
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   165
    insetRectangle := aRectangle copy.
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   166
    insetRectangle left:(insetRectangle left - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   167
    insetRectangle right:(insetRectangle right + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   168
    insetRectangle top:(insetRectangle top - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   169
    insetRectangle bottom:(insetRectangle bottom + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   170
    ^ insetRectangle
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   172
    "Created: 10.2.1997 / 15:43:00 / cg"
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
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   175
insetDisplayBoxFor:aRectangle
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   176
    "return a rectangle representing the display box of a component
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   177
     bordered by the receiver in the outer bounds, aRectangle.
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
   178
     That is, the argument inset by the receiver's borders."
5407
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   179
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   180
    |insetRectangle|
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   181
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   182
    insetRectangle := aRectangle copy.
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   183
    insetRectangle left:(insetRectangle left + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   184
    insetRectangle right:(insetRectangle right - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   185
    insetRectangle top:(insetRectangle top + width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   186
    insetRectangle bottom:(insetRectangle bottom - width).
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   187
    ^ insetRectangle
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   188
767945d3ad71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5392
diff changeset
   189
    "Created: 10.2.1997 / 15:42:06 / cg"
7012
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   190
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   191
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   192
leftMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   193
    "return the left inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   194
     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
   195
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   196
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   197
    ^ width
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   198
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   199
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   200
rightMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   201
    "return the right inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   202
     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
   203
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   204
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   205
    ^ width
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   206
!
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   207
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   208
topMargin
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   209
    "return the top inset.
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   210
     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
   211
     eg. the inset of the view's contents"
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   212
b39b300d4874 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 6939
diff changeset
   213
    ^ width
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
! !
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
!AbstractBorder class methodsFor:'documentation'!
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   218
version
6939
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
   219
    ^ '$Header$'
6717
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   220
!
6864a3975bed class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 6713
diff changeset
   221
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
version_CVS
6939
ea34372ee1a2 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6717
diff changeset
   223
    ^ '$Header$'
5374
fa6ec7dc8508 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
! !
6713
248ef6ff9725 class: AbstractBorder
Claus Gittinger <cg@exept.de>
parents: 5407
diff changeset
   225