VisualComponent.st
author Claus Gittinger <cg@exept.de>
Mon, 13 May 1996 10:50:38 +0200
changeset 265 45c83acd7562
parent 250 40acd5bd28ef
child 266 e9d35cd74f64
permissions -rw-r--r--
comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by Claus Gittinger
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Object subclass:#VisualComponent
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:'bounds fgColor bgColor'
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Graphics-Display Objects'
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!VisualComponent class methodsFor:'documentation'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
 COPYRIGHT (c) 1996 by Claus Gittinger
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
              All Rights Reserved
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    42
    abstract superclass for all kinds of visual components.
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    43
    This class and its subclasses (currently) exist mostly for
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    44
    ST-80 compatibility - to provide a home for ported PD classes,
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    45
    which depend on the VisualComponent hierarchy.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    46
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    47
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    48
        this class was implemented using protocol information
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    49
        from alpha testers and from the Hopkins/Horan book.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    50
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    51
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    52
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    53
        This is still being constructed - not yet finished.
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    [author:]
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        Claus Gittinger
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    57
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    58
    [see also:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
    59
        GeometricWrapper
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
!VisualComponent class methodsFor:'instance creation'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
new
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    ^ self basicNew initialize
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
!VisualComponent methodsFor:'accessing'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
bounds
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    73
    "return my bounds"
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    74
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    ^ bounds
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    "Created: 8.5.1996 / 23:35:19 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    78
    "Modified: 9.5.1996 / 00:12:00 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    81
bounds:aRectangle
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    82
    "set my bounds"
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    83
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    84
    bounds := aRectangle
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "Created: 8.5.1996 / 23:36:07 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    87
    "Modified: 9.5.1996 / 00:13:12 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
250
40acd5bd28ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    90
container:someContainer
40acd5bd28ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    91
    "ignored here"
40acd5bd28ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    92
40acd5bd28ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    93
    "Created: 9.5.1996 / 00:48:54 / cg"
40acd5bd28ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    94
!
40acd5bd28ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    95
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
preferredBounds
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    97
    "return my preferredBounds"
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
    98
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    ^ 100@100
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "Created: 8.5.1996 / 23:36:29 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   102
    "Modified: 9.5.1996 / 00:13:22 / cg"
247
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   103
!
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   104
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   105
setParentViewIn:aView
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   106
    "ignored here - for now"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   107
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   108
    "Created: 9.5.1996 / 00:19:39 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
!VisualComponent methodsFor:'accessing - look'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
backgroundColor:aColor
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   114
    "set my backgroundColor"
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   115
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    bgColor := aColor
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    "Created: 8.5.1996 / 23:47:11 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   119
    "Modified: 9.5.1996 / 00:13:33 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
foregroundColor:aColor
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   123
    "set my foregroundColor"
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   124
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    fgColor := aColor
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "Created: 8.5.1996 / 23:47:05 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   128
    "Modified: 9.5.1996 / 00:13:39 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   131
!VisualComponent methodsFor:'displaying'!
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   132
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   133
displayOn:aGC x:x y:y
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   134
    |oldTranslation|
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   135
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   136
    oldTranslation := aGC translation.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   137
    aGC translation:(x @ y).
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   138
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   139
    self displayOn:aGC.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   140
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   141
    aGC translation:oldTranslation
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   142
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   143
    "Created: 13.5.1996 / 10:18:43 / cg"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   144
! !
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   145
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
!VisualComponent methodsFor:'event handling'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
buttonPress:button x:x y:y
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   149
    "button was pressed over me - ignored here"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   151
    "Modified: 9.5.1996 / 00:14:08 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
buttonRelease:button x:x y:y
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   155
    "button was released over me - ignored here"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "Created: 8.5.1996 / 23:38:30 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   158
    "Modified: 9.5.1996 / 00:14:04 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
keyPress:key x:x y:y
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   162
    "key was pressed over me - ignored here"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    "Created: 8.5.1996 / 23:46:03 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   165
    "Modified: 9.5.1996 / 00:14:14 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
keyRelease:key x:x y:y
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   169
    "key was released over me - ignored here"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "Created: 8.5.1996 / 23:46:07 / cg"
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   172
    "Modified: 9.5.1996 / 00:14:19 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
!VisualComponent methodsFor:'initialization'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
initialize
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    fgColor := Color black.
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    bgColor := Color white.
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    "Created: 8.5.1996 / 23:49:54 / cg"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   184
!VisualComponent methodsFor:'queries'!
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   185
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   186
heightOn:aGC
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   187
    "return my height, if displayed on aGC;
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   188
     I assume that my height is independent of the device, and return
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   189
     the bounds height"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   190
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   191
    ^ self bounds height
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   192
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   193
    "Modified: 13.5.1996 / 10:15:13 / cg"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   194
!
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   195
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   196
widthOn:aGC
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   197
    "return my width, if displayed on aGC;
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   198
     I assume that my width is independent of the device, and return
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   199
     the bounds width"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   200
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   201
    ^ self bounds width
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   202
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   203
    "Created: 13.5.1996 / 10:14:44 / cg"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   204
    "Modified: 13.5.1996 / 10:15:17 / cg"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   205
! !
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   206
247
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   207
!VisualComponent methodsFor:'testing'!
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   208
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   209
containsPoint:aPoint
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   210
    "return true, if the receiver contains aPoint"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   211
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   212
    ^ self bounds containsPoint:aPoint
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   213
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   214
    "Created: 9.5.1996 / 00:21:44 / cg"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   215
    "Modified: 9.5.1996 / 00:22:00 / cg"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   216
!
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   217
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   218
hasBorder
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   219
    "return true, if the receiver shows a border"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   220
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   221
    ^ false
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   222
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   223
    "Modified: 9.5.1996 / 00:21:29 / cg"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   224
!
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   225
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   226
intersects:aRectangle
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   227
    "return true, if the receivers bounds intersects aRectangle"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   228
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   229
    ^ self bounds intersects:aRectangle
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   230
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   231
    "Created: 9.5.1996 / 00:21:18 / cg"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   232
    "Modified: 9.5.1996 / 00:22:04 / cg"
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   233
! !
7b29d5a02e68 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   234
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
!VisualComponent class methodsFor:'documentation'!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
version
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 250
diff changeset
   238
    ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.5 1996-05-13 08:50:38 cg Exp $'
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
! !