VisualPart.st
author Claus Gittinger <cg@exept.de>
Mon, 22 Jul 1996 11:02:58 +0200
changeset 323 ee2f4da361a6
parent 294 f44534fc18e4
child 365 47e0d48fd769
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
VisualComponent subclass:#VisualPart
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
	instanceVariableNames:'container'
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	classVariableNames:''
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	poolDictionaries:''
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	category:'Graphics-Display Objects'
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
     8
!VisualPart  class methodsFor:'documentation'!
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
     9
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    10
documentation
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    11
"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    12
    abstract superclass for all kinds of visual components, which
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    13
    are containers for some other component.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    14
    This class and its subclasses (currently) exist mostly for
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    15
    ST-80 compatibility - to provide a home for ported PD classes,
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    16
    which depend on the VisualPart hierarchy.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    17
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    18
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    19
        this class was implemented using protocol information
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    20
        from alpha testers and from the Hopkins/Horan book.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    21
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    22
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    23
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    24
        This is still being constructed - not yet finished.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    25
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    26
    [author:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    27
        Claus Gittinger
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    28
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    29
    [see also:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    30
        GeometricWrapper
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    31
"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    32
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    33
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    34
! !
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!VisualPart methodsFor:'accessing'!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
container
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    39
    "return my container"
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    ^ container
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    "Created: 9.5.1996 / 00:31:41 / cg"
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    44
    "Modified: 5.6.1996 / 01:08:26 / cg"
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
container:something
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    "set container"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    container := something.
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    "Created: 9.5.1996 / 00:31:41 / cg"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
graphicsContext
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "return the graphicsContext"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    58
    ^ container graphicsContext
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "Created: 9.5.1996 / 00:32:12 / cg"
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    61
    "Modified: 9.5.1996 / 01:37:10 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    62
!
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    63
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    64
graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    65
    "return the graphicsContext"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    66
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    67
    ^ container graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    68
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    69
    "Created: 9.5.1996 / 00:32:12 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    70
    "Modified: 9.5.1996 / 01:37:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    71
!
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    72
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    73
topComponent
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    74
    "return the top component - typically the topView"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    75
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    76
    ^ container topComponent
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    77
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    78
    "Modified: 9.5.1996 / 01:37:10 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    79
    "Created: 9.5.1996 / 01:39:15 / cg"
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    80
!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    81
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    82
view
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    83
    "return my view"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    84
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    85
    container isNil ifTrue:[^ nil].
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    86
    ^ container view
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    87
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    88
    "Created: 4.6.1996 / 21:32:34 / cg"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    89
    "Modified: 5.6.1996 / 01:20:13 / cg"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    90
! !
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    91
294
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
    92
!VisualPart methodsFor:'view protocol mimicri'!
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    93
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    94
containerChangedSize
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    95
    "my container changed its size.
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    96
     The default here is to ignore this, but some wrappers like
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    97
     to resize when this happens."
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    98
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    99
"/Transcript show:'container '; show:container; show:' of '; show:self; 
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   100
"/           show:' changed size to '; showCR:container viewRectangle.
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   101
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   102
    self bounds:container viewRectangle
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   103
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   104
    "Created: 4.6.1996 / 21:27:58 / cg"
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   105
    "Modified: 19.7.1996 / 21:20:58 / cg"
294
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   106
! !
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   107
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   108
!VisualPart ignoredMethodsFor:'view protocol mimicri'!
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   109
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   110
create
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   111
    "want myself to be created."
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   112
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   113
    container create
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   114
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   115
    "Created: 4.6.1996 / 21:30:25 / cg"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   116
!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   117
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   118
realize
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   119
    "my container realized itself.
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   120
     The default here is to ignore this, but some wrappers like
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   121
     to do something when this happens."
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   122
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   123
    ^ self
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   124
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   125
    "Created: 4.6.1996 / 21:28:31 / cg"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   126
! !
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   127
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   128
!VisualPart methodsFor:'view protocol mimicri'!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   129
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   130
subViewChangedSize
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   131
    ^ self
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   132
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   133
    "Created: 4.6.1996 / 21:35:57 / cg"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   134
!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   135
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   136
windowGroup
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   137
    ^ container windowGroup
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   138
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   139
    "Created: 5.6.1996 / 00:49:19 / cg"
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
! !
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   142
!VisualPart  class methodsFor:'documentation'!
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
version
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   145
    ^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.6 1996-07-22 09:02:16 cg Exp $'
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
! !