VisualPart.st
author Claus Gittinger <cg@exept.de>
Wed, 13 May 2009 13:24:43 +0200
changeset 2676 131b8d5bd5ef
parent 2675 a68038b7c4c3
child 2677 9bc1f9a75f63
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2376
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     1
"
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     3
              All Rights Reserved
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     4
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     5
 This software is furnished under a license and may be used
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     6
 only in accordance with the terms of that license and with the
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     8
 be provided or otherwise made available to, or used by, any
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
     9
 other person.  No title to or ownership of the software is
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    10
 hereby transferred.
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    11
"
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    12
"{ Package: 'stx:libview2' }"
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    13
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
VisualComponent subclass:#VisualPart
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    15
	instanceVariableNames:'container layout name visibilityChannel originChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    16
		extentChannel'
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    19
	category:'Compatibility-ST80-Graphics-Display Objects'
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
    22
!VisualPart class methodsFor:'documentation'!
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    23
2376
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    24
copyright
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    25
"
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    26
 COPYRIGHT (c) 2002 by eXept Software AG
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    27
              All Rights Reserved
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    28
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    29
 This software is furnished under a license and may be used
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    30
 only in accordance with the terms of that license and with the
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    32
 be provided or otherwise made available to, or used by, any
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    33
 other person.  No title to or ownership of the software is
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    34
 hereby transferred.
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    35
"
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    36
!
bd1615a0d2af copyright
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    37
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    38
documentation
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    39
"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    40
    abstract superclass for all kinds of visual components, which
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    41
    are containers for some other component.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    42
    This class and its subclasses (currently) exist mostly for
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    43
    ST-80 compatibility - to provide a home for ported PD classes,
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    44
    which depend on the VisualPart hierarchy.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    45
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    46
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    47
        this class was implemented using protocol information
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
    48
        from alpha testers, from reading PD programs and 
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
    49
        from the Hopkins/Horan book.
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    50
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    51
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    52
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    53
        This is still being constructed - not yet finished.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    54
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    55
    [author:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    56
        Claus Gittinger
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    57
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    58
    [see also:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    59
        GeometricWrapper
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    60
"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    61
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    62
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    63
! !
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
!VisualPart methodsFor:'accessing'!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
962
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    67
backgroundColor
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    68
    ^ container backgroundColor
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    69
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    70
    "Created: / 18.6.1998 / 15:58:34 / cg"
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    71
!
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    72
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
container
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    74
    "return my container"
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    ^ container
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    "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
    79
    "Modified: 5.6.1996 / 01:08:26 / cg"
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
container:something
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "set container"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    container := something.
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "Created: 9.5.1996 / 00:31:41 / cg"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    90
extentChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    91
    ^ extentChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    92
!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    93
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    94
extentChannel:something
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    95
    extentChannel removeDependent:self.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    96
    extentChannel := something.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    97
    extentChannel notNil ifTrue:[ extentChannel addDependent:self].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    98
!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
    99
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
graphicsContext
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "return the graphicsContext"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   103
    ^ container graphicsContext
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    "Created: 9.5.1996 / 00:32:12 / cg"
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   106
    "Modified: 9.5.1996 / 01:37:10 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   107
!
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   108
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   109
graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   110
    "return the graphicsContext"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   111
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   112
    ^ container graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   113
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   114
    "Created: 9.5.1996 / 00:32:12 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   115
    "Modified: 9.5.1996 / 01:37:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   116
!
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   117
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   118
name
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   119
    ^ name
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   120
!
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   121
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   122
name:something
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   123
    name := something.
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   124
!
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   125
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   126
originChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   127
    ^ originChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   128
!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   129
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   130
originChannel:something
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   131
    originChannel removeDependent:self.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   132
    originChannel := something.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   133
    originChannel notNil ifTrue:[ originChannel addDependent:self].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   134
!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   135
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   136
topComponent
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   137
    "return the top component - typically the topView"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   138
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   139
    ^ container topComponent
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   140
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   141
    "Modified: 9.5.1996 / 01:37:10 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
   142
    "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
   143
!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   144
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   145
view
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   146
    "return my view"
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   147
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   148
    container isNil ifTrue:[^ nil].
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   149
    ^ container view
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   150
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   151
    "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
   152
    "Modified: 5.6.1996 / 01:20:13 / cg"
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   153
!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   154
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   155
visibilityChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   156
    ^ visibilityChannel
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   157
!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   158
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   159
visibilityChannel:something
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   160
    visibilityChannel removeDependent:self.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   161
    visibilityChannel := something.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   162
    visibilityChannel notNil ifTrue:[ visibilityChannel addDependent:self].
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   163
! !
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   164
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   165
!VisualPart methodsFor:'accessing-dimensions'!
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   166
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   167
bounds:newBounds
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   168
"/    self assert:(newBounds left isInteger).
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   169
"/    self assert:(newBounds width isInteger).
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   170
"/    self assert:(newBounds top isInteger).
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   171
"/    self assert:(newBounds height isInteger).
2671
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   172
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   173
    frame := newBounds rounded.
2673
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   174
!
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   175
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   176
possiblyInvalidate
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   177
    container notNil ifTrue:[
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   178
        self computeBoundingBox.
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   179
        frame notNil ifTrue:[
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   180
            container invalidate:(frame insetBy:-2).
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   181
        ]
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   182
    ].
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   183
! !
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   184
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   185
!VisualPart methodsFor:'change & update'!
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   186
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   187
update:something with:aParameter from:changedObject
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   188
    "/ invalidate is always ok - however, it will redraw bg, fg and line
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   189
    "/ and therefore may produce flicker (unless double buffering)
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   190
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   191
    (changedObject == originChannel 
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   192
    or:[ changedObject == extentChannel ]) ifTrue:[
2676
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   193
        "/ invalidate old region
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   194
        self container 
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   195
            clearRectangle:self frame;
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   196
            invalidateRectangle:self frame repairNow:false.
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   197
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   198
        "/ flush cached frame info.   
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   199
        frame := nil.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   200
    ].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   201
    self invalidate.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   202
! !
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   203
294
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   204
!VisualPart methodsFor:'view protocol mimicri'!
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   205
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   206
bottomInset
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   207
    ^ 0
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   208
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   209
2671
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   210
computeBoundingBox
2675
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   211
    |newBounds newOrigin newExtent delta|
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   212
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   213
    container notNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   214
        layout notNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   215
            newBounds := layout 
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   216
                            rectangleRelativeTo:(0@0 extent:container extent "container bounds")
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   217
                            preferred:self preferredBounds.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   218
        ].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   219
        (newExtent := extentChannel value) notNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   220
            newBounds isNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   221
                newBounds := 0@0 extent:newExtent.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   222
            ] ifFalse:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   223
                newBounds extent:newExtent
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   224
            ]
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   225
        ].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   226
        (newOrigin := originChannel value) notNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   227
            newBounds isNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   228
                newBounds := newOrigin extent:(self preferredExtent).
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   229
            ].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   230
            delta := newOrigin - newBounds origin.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   231
            newBounds origin:newOrigin corner:(newBounds corner + delta).
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   232
        ].
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   233
        newBounds notNil ifTrue:[
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   234
            self bounds:newBounds.
a68038b7c4c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2674
diff changeset
   235
        ].
2671
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   236
    ].
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   237
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   238
    ^ frame
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   239
!
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   240
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   241
computeCorner
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   242
    ^ self corner
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   243
!
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   244
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   245
computeExtent
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   246
    ^ self extent
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   247
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   248
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   249
computeOrigin
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   250
    ^ self origin
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   251
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   252
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   253
containerChangedSize
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   254
    "my container changed its size.
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   255
     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
   256
     to resize when this happens."
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   257
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   258
"/Transcript show:'container '; show:container; show:' of '; show:self; 
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   259
"/           show:' changed size to '; showCR:container viewRectangle.
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   260
2668
3f03a6f0157c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   261
    layout notNil ifTrue:[
3f03a6f0157c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   262
        self bounds:(layout 
2670
82dbebce194f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   263
                        rectangleRelativeTo:(0@0 extent:container extent "container bounds")
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   264
                        preferred:self preferredBounds).
2665
2e57436c3213 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
   265
    ].
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   266
    "/ self invalidate.
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   267
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   268
    "Created: 4.6.1996 / 21:27:58 / cg"
323
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   269
    "Modified: 19.7.1996 / 21:20:58 / cg"
962
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   270
!
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   271
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   272
cornerRule
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   273
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   274
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   275
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   276
create
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   277
    "want myself to be created."
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   278
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   279
    container create
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   280
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   281
    "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
   282
!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   283
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   284
destroy
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   285
    |c|
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   286
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   287
    (c := container) notNil ifTrue:[
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   288
        container := nil.
2671
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   289
        frame notNil ifTrue:[ c invalidate:frame ].
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   290
        c removeComponent:self.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   291
    ].
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   292
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   293
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   294
device
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   295
    ^ container device
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   296
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   297
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   298
extentRule
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   299
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   300
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   301
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   302
geometryLayout
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   303
    ^ layout 
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   304
!
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   305
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   306
geometryLayout:newLayoutOrNil
2673
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   307
    self possiblyInvalidate.
2671
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   308
2670
82dbebce194f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   309
    frame := nil.
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   310
    layout := newLayoutOrNil.
2671
3e8b7f22722e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
   311
2673
fb475750ed7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   312
    self possiblyInvalidate.
2666
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   313
!
01b3cb9faa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   314
962
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   315
invalidate
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   316
    container notNil ifTrue:[
2672
5d7fd9552774 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2671
diff changeset
   317
        (layout notNil or:[frame notNil]) ifTrue:[
5d7fd9552774 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2671
diff changeset
   318
            container invalidate:self bounds
5d7fd9552774 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2671
diff changeset
   319
        ]
962
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   320
    ]
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   321
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   322
    "Modified: / 18.6.1998 / 16:12:15 / cg"
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   323
!
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   324
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   325
isComponentOf:aViewOrComponent
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   326
    "return true, if I am a (direct or indirect) component of aViewOrComponent"
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   327
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   328
    |sview|
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   329
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   330
    sview := self.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   331
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   332
    [ (sview := sview container) notNil ] whileTrue:[
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   333
        sview == aViewOrComponent ifTrue:[^ true].
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   334
    ].
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   335
    ^ false
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   336
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   337
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   338
leftInset
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   339
    ^ 0
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   340
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   341
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   342
originRelativeTo:aContainer
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   343
    "return the origin (in pixels) relative to a superView,
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   344
     or relative to the rootView (if the aView argument is nil).
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   345
     If the receiver is nonNil and not a subview of aView, return nil."
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   346
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   347
    |currentPart
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   348
     bw   "{ Class: SmallInteger }"
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   349
     sumX "{ Class: SmallInteger }"
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   350
     sumY "{ Class: SmallInteger }"|
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   351
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   352
    currentPart := self.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   353
    sumX := 0.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   354
    sumY := 0.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   355
    [currentPart notNil] whileTrue:[
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   356
        (currentPart == aContainer) ifTrue:[
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   357
            ^ (sumX @ sumY)
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   358
        ].
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   359
        bw := currentPart borderWidth.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   360
        sumX := sumX + (currentPart left) + bw.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   361
        sumY := sumY + (currentPart top) + bw.
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   362
        currentPart := currentPart superView
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   363
    ].
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   364
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   365
    (aContainer isNil or:[aContainer == self graphicsDevice rootView]) ifTrue:[
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   366
        "return relative to screen ..."
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   367
        ^ (sumX @ sumY)
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   368
    ].
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   369
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   370
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   371
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   372
originRule
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   373
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   374
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   375
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   376
realize
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   377
    "my container realized itself.
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   378
     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
   379
     to do something when this happens."
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   380
998
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   381
    self realizeAllSubViews
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   382
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   383
    "Created: / 4.6.1996 / 21:28:31 / cg"
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   384
    "Modified: / 6.7.1998 / 18:38:28 / cg"
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   385
!
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   386
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   387
realizeAllSubViews
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   388
    "realize all my subviews - but not myself."
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   389
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   390
    ^ self
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   391
998
4a76a5a9a3cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   392
    "Created: / 6.7.1998 / 18:37:08 / cg"
962
e6ccfc7fb22e added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   393
!
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   394
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   395
relativeCorner
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   396
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   397
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   398
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   399
relativeExtent
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   400
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   401
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   402
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   403
relativeOrigin
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   404
    ^ nil
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   405
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   406
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   407
rightInset
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   408
    ^ 0
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   409
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   410
1220
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   411
shown
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   412
    container isNil ifTrue:[^ false].
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   413
    ^ container shown
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   414
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   415
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   416
!
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   417
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   418
subViewChangedSize
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   419
    ^ self
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   420
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   421
    "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
   422
!
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   423
2668
3f03a6f0157c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   424
subViews
3f03a6f0157c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   425
    ^ #()
3f03a6f0157c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   426
!
3f03a6f0157c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   427
2660
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   428
topInset
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   429
    ^ 0
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   430
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   431
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   432
topView
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   433
    ^ container topView
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   434
!
87d554e2590f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   435
289
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   436
windowGroup
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   437
    ^ container windowGroup
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   438
5620dcc0c5f6 prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   439
    "Created: 5.6.1996 / 00:49:19 / cg"
1220
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   440
!
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   441
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   442
withAllSubViewsDo:aBlock
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   443
    aBlock value:self
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
! !
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   446
!VisualPart class methodsFor:'documentation'!
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
version
2676
131b8d5bd5ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
   449
    ^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.23 2009-05-13 11:24:43 cg Exp $'
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
! !