TopView.st
author Claus Gittinger <cg@exept.de>
Sat, 16 Dec 1995 18:44:01 +0100
changeset 328 7bbe05da5769
parent 314 de706ed62d27
child 361 4ac325d9125b
permissions -rw-r--r--
activity notification added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
135
claus
parents:
diff changeset
     1
"
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents:
diff changeset
     3
	      All Rights Reserved
claus
parents:
diff changeset
     4
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    10
 hereby transferred.
claus
parents:
diff changeset
    11
"
claus
parents:
diff changeset
    12
claus
parents:
diff changeset
    13
View subclass:#TopView
314
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    14
	instanceVariableNames:'type'
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    15
	classVariableNames:''
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    16
	poolDictionaries:''
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    17
	category:'Views-Basic'
135
claus
parents:
diff changeset
    18
!
claus
parents:
diff changeset
    19
claus
parents:
diff changeset
    20
!TopView class methodsFor:'documentation'!
claus
parents:
diff changeset
    21
claus
parents:
diff changeset
    22
copyright
claus
parents:
diff changeset
    23
"
claus
parents:
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents:
diff changeset
    25
	      All Rights Reserved
claus
parents:
diff changeset
    26
claus
parents:
diff changeset
    27
 This software is furnished under a license and may be used
claus
parents:
diff changeset
    28
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    30
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    31
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    32
 hereby transferred.
claus
parents:
diff changeset
    33
"
claus
parents:
diff changeset
    34
!
claus
parents:
diff changeset
    35
claus
parents:
diff changeset
    36
documentation
claus
parents:
diff changeset
    37
"
claus
parents:
diff changeset
    38
    I am an abstract superclass of StandardSystemView and PopUpView;
claus
parents:
diff changeset
    39
    i.e. views which have no superview.
claus
parents:
diff changeset
    40
"
claus
parents:
diff changeset
    41
! !
claus
parents:
diff changeset
    42
claus
parents:
diff changeset
    43
!TopView class methodsFor:'defaults'!
claus
parents:
diff changeset
    44
claus
parents:
diff changeset
    45
defaultExtent
claus
parents:
diff changeset
    46
    "topviews extent is (0.6 @ 0.6) of screen by default"
claus
parents:
diff changeset
    47
153
claus
parents: 151
diff changeset
    48
    |display|
claus
parents: 151
diff changeset
    49
claus
parents: 151
diff changeset
    50
    display := Screen current.
claus
parents: 151
diff changeset
    51
    ^ (display width // 3 * 2) @ (display height // 3 * 2)
135
claus
parents:
diff changeset
    52
! !
claus
parents:
diff changeset
    53
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    54
!TopView methodsFor:'accessing & queries'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    55
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    56
beMaster
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    57
    "make this a master-view. All slave views within the same
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    58
     windowGroup will be closed if any master is closed."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    59
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    60
    type := #master
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    61
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    62
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    63
     see example in TopView>>beSlave
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    64
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    65
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    66
    "Created: 10.12.1995 / 13:30:50 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    67
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    68
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    69
bePartner
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    70
    "make this a partner-view. Each partner-view will automatically 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    71
     close other partner views whenclosed."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    72
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    73
    type := #partner 
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    74
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    75
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    76
     create two topViews within the same group:
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    77
     if any of them is iconified/deiconified/closed, the other one is also
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    78
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    79
     |top1 top2|
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    80
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    81
     top1 := StandardSystemView new label:'top1'; extent:300@300.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    82
     top2 := StandardSystemView new label:'top2'; extent:200@200.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    83
     top1 bePartner.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    84
     top2 bePartner.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    85
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    86
     top1 open.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    87
     top2 openInGroup:(top1 windowGroup)
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    88
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    89
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    90
    "Created: 10.12.1995 / 13:29:59 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    91
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    92
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    93
beSlave
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    94
    "make this a slave-view. It will be closed automatically,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    95
     whenever any master of the group is closed."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    96
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    97
    type := #slave 
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    98
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    99
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   100
     create two topViews within the same group:
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   101
     the slave is allowed to be iconified/close independ of the master;
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   102
     but if the master is iconified, the slave is also.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   103
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   104
     |top1 top2|
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   105
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   106
     top1 := StandardSystemView new label:'top1'; extent:300@300.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   107
     top2 := StandardSystemView new label:'top2'; extent:200@200.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   108
     top1 beMaster.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   109
     top2 beSlave.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   110
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   111
     top1 open.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   112
     top2 openInGroup:(top1 windowGroup)
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   113
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   114
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   115
    "Created: 10.12.1995 / 13:29:10 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   116
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   117
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   118
heightIncludingBorder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   119
    "return the views overall-height"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   120
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   121
    ^ height
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   122
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   123
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   124
isCollapsed
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   125
    "ST80 compatibility: return true if the view is not shown (i.e. iconified)"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   126
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   127
    ^ shown not
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   128
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   129
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   130
preferredExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   131
    "return my preferred extent - this is the minimum size I would like to have.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   132
     The default here is the classes default extent,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   133
     however many subclasses redefine this to compute the actual value
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   134
     depending on the sizes of the contents or subcomponents."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   135
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   136
    ^ self class defaultExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   137
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   138
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   139
type
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   140
    "return the views type. This is one of #normal,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   141
     #master, #slave or #partner."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   142
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   143
    ^ type
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   144
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   145
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   146
widthIncludingBorder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   147
    "return the views overall-width"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   148
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   149
    ^ width
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   150
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   151
135
claus
parents:
diff changeset
   152
!TopView methodsFor:'initialization'!
claus
parents:
diff changeset
   153
claus
parents:
diff changeset
   154
initialize
claus
parents:
diff changeset
   155
    |screenCenter|
claus
parents:
diff changeset
   156
claus
parents:
diff changeset
   157
    super initialize.
claus
parents:
diff changeset
   158
claus
parents:
diff changeset
   159
    screenCenter := device center.
claus
parents:
diff changeset
   160
    left := screenCenter x - (width // 2).
claus
parents:
diff changeset
   161
    top := screenCenter y - (height // 2).
141
claus
parents: 135
diff changeset
   162
    type := #normal
135
claus
parents:
diff changeset
   163
! !
claus
parents:
diff changeset
   164
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   165
!TopView methodsFor:'misc'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   166
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   167
raiseDeiconified
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   168
    "deiconify & bring to front"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   169
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   170
    self isCollapsed ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   171
	self unrealize.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   172
	self realize.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   173
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   174
    self raise
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   175
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   176
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   177
     Transcript topView raiseDeiconified
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   178
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   179
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   180
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   181
showActivity:someMessage
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   182
    ^ self
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   183
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   184
    "Created: 16.12.1995 / 18:40:13 / cg"
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   185
!
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   186
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   187
withCursor:aCursor do:aBlock
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   188
    "evaluate aBlock while showing aCursor in all my views.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   189
     Return the value as returned by aBlock."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   190
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   191
    windowGroup notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   192
	^ windowGroup withCursor:aCursor do:aBlock
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   193
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   194
    ^ super withCursor:aCursor do:aBlock
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   195
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   196
314
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   197
withExecuteCursorDo:aBlock
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   198
    "evaluate aBlock while showing an execute cursor in all my views.
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   199
     Return the value as returned by aBlock."
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   200
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   201
    ^ self withCursor:(Cursor execute) do:aBlock
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   202
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   203
    "Created: 14.12.1995 / 20:57:22 / cg"
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   204
!
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   205
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   206
withReadCursorDo:aBlock
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   207
    "evaluate aBlock while showing a readCursor in all my views.
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   208
     Return the value as returned by aBlock."
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   209
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   210
    ^ self withCursor:(Cursor read) do:aBlock
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   211
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   212
    "Created: 14.12.1995 / 20:56:38 / cg"
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   213
    "Modified: 14.12.1995 / 20:57:40 / cg"
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   214
!
de706ed62d27 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   215
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   216
withWaitCursorDo:aBlock
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   217
    "evaluate aBlock while showing a waitCursor in all my views.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   218
     Return the value as returned by aBlock."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   219
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   220
    ^ self withCursor:(Cursor wait) do:aBlock
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   221
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   222
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   223
!TopView methodsFor:'startup'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   224
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   225
openInGroup:aGroup
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   226
    "special open within another windowGroup.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   227
     This allows a view to be realized in any windowgroup; 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   228
     for applications where multiple views act as a group
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   229
     (i.e. close and iconify together)."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   230
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   231
    self windowGroup:aGroup.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   232
    aGroup addTopView:self.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   233
    self realizeLeavingGroup:true
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   234
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   235
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   236
openWithExtent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   237
    "set extent and open. The given extent overrides the 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   238
     receivers preferredExtent.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   239
     Added for ST-80 compatibility"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   240
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   241
    self extent:anExtent; sizeFixed:true.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   242
    self open
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   243
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   244
157
claus
parents: 153
diff changeset
   245
!TopView methodsFor:'window events'!
claus
parents: 153
diff changeset
   246
claus
parents: 153
diff changeset
   247
destroy
claus
parents: 153
diff changeset
   248
    "the receiver is to be destroyed - look for partners and slaves"
claus
parents: 153
diff changeset
   249
claus
parents: 153
diff changeset
   250
    |wg|
claus
parents: 153
diff changeset
   251
claus
parents: 153
diff changeset
   252
    wg := windowGroup.                  "/ have to fetch windowGroup before;
claus
parents: 153
diff changeset
   253
    super destroy.                      "/ since destroy nils it
claus
parents: 153
diff changeset
   254
    wg notNil ifTrue:[
claus
parents: 153
diff changeset
   255
	"/
claus
parents: 153
diff changeset
   256
	"/ if I am a master or partner, close all slaves
claus
parents: 153
diff changeset
   257
	"/
claus
parents: 153
diff changeset
   258
	(type == #master or:[type == #partner]) ifTrue:[
claus
parents: 153
diff changeset
   259
	    wg slavesDo:[:v | v destroy].
claus
parents: 153
diff changeset
   260
	].
claus
parents: 153
diff changeset
   261
	"/
claus
parents: 153
diff changeset
   262
	"/ if I am a partner, close all partners
claus
parents: 153
diff changeset
   263
	"/
claus
parents: 153
diff changeset
   264
	type == #partner ifTrue:[
claus
parents: 153
diff changeset
   265
	    wg partnersDo:[:v | v ~~ self ifTrue:[v destroy]].
claus
parents: 153
diff changeset
   266
	].
claus
parents: 153
diff changeset
   267
    ].
claus
parents: 153
diff changeset
   268
!
claus
parents: 153
diff changeset
   269
claus
parents: 153
diff changeset
   270
mapped
claus
parents: 153
diff changeset
   271
    "the recevier was mapped (i.e. deiconified or just created);
claus
parents: 153
diff changeset
   272
     look for partners and slaves."
claus
parents: 153
diff changeset
   273
claus
parents: 153
diff changeset
   274
    realized := true.
claus
parents: 153
diff changeset
   275
    super mapped.
claus
parents: 153
diff changeset
   276
    windowGroup notNil ifTrue:[
claus
parents: 153
diff changeset
   277
	(type == #master or:[type == #partner]) ifTrue:[
claus
parents: 153
diff changeset
   278
	    windowGroup slavesDo:[:v | v rerealize].
claus
parents: 153
diff changeset
   279
	].
claus
parents: 153
diff changeset
   280
	type == #partner ifTrue:[
claus
parents: 153
diff changeset
   281
	    windowGroup partnersDo:[:v | v ~~ self ifTrue:[v rerealize]].
claus
parents: 153
diff changeset
   282
	]
claus
parents: 153
diff changeset
   283
    ].
claus
parents: 153
diff changeset
   284
!
claus
parents: 153
diff changeset
   285
claus
parents: 153
diff changeset
   286
unmapped 
claus
parents: 153
diff changeset
   287
    "the recevier was unmapped (i.e. iconified);
claus
parents: 153
diff changeset
   288
     look for partners and slaves."
claus
parents: 153
diff changeset
   289
claus
parents: 153
diff changeset
   290
    super unmapped.
claus
parents: 153
diff changeset
   291
    windowGroup notNil ifTrue:[
claus
parents: 153
diff changeset
   292
	(type == #master or:[type == #partner]) ifTrue:[
claus
parents: 153
diff changeset
   293
	    windowGroup slavesDo:[:v | v unrealize].
claus
parents: 153
diff changeset
   294
	].
claus
parents: 153
diff changeset
   295
	type == #partner ifTrue:[
claus
parents: 153
diff changeset
   296
	    windowGroup partnersDo:[:v | v ~~ self ifTrue:[v unrealize]].
claus
parents: 153
diff changeset
   297
	].
claus
parents: 153
diff changeset
   298
    ].
claus
parents: 153
diff changeset
   299
claus
parents: 153
diff changeset
   300
! !
claus
parents: 153
diff changeset
   301
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   302
!TopView class methodsFor:'documentation'!
135
claus
parents:
diff changeset
   303
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   304
version
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   305
    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.11 1995-12-16 17:43:38 cg Exp $'
135
claus
parents:
diff changeset
   306
! !