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