SubCanvas.st
author ca
Tue, 08 Feb 2000 11:31:31 +0100
changeset 1686 bafa16adbf14
parent 1664 a8b97314f813
child 1702 ff202e263b9d
permissions -rw-r--r--
must release client first, otherwise a wrong masterApp is set in the subApp.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     1
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     3
              All Rights Reserved
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     4
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     5
 This software is furnished under a license and may be used
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     6
 only in accordance with the terms of that license and with the
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     8
 be provided or otherwise made available to, or used by, any
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
     9
 other person.  No title to or ownership of the software is
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    10
 hereby transferred.
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    11
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    12
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    13
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ScrollableView subclass:#SubCanvas
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
    15
	instanceVariableNames:'builder spec client clientHolder specHolder clientView
1548
299e14135d2d Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents: 1546
diff changeset
    16
		clientViewIsScrolled lateBuild'
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Views-Basic'
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    22
!SubCanvas class methodsFor:'documentation'!
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    23
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    24
copyright
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    25
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    26
 COPYRIGHT (c) 1998 by eXept Software AG
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    27
              All Rights Reserved
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    28
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    29
 This software is furnished under a license and may be used
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    30
 only in accordance with the terms of that license and with the
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    32
 be provided or otherwise made available to, or used by, any
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    33
 other person.  No title to or ownership of the software is
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    34
 hereby transferred.
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    35
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    36
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    37
!
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    38
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    39
documentation
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    40
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    41
    a view for a subApplication.
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    42
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    43
    [author:]
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    44
        Claus Atzkern
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    45
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    46
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    47
! !
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
1414
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    49
!SubCanvas class methodsFor:'defaults'!
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    50
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    51
defaultHorizontalScrollable
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    52
    ^ false
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    53
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    54
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    55
!
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    56
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    57
defaultVerticalScrollable
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    58
    ^ false
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    59
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    60
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    61
! !
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    62
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
!SubCanvas methodsFor:'accessing'!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    65
builder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    66
    "return the value of the instance variable 'builder' (automatically generated)"
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    68
    ^ builder!
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    70
client
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    71
    "return the value of the instance variable 'client' (automatically generated)"
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    73
    ^ client!
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    75
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "release existing components and generate new components from
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
     the given windowSpec, using the given builder."
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
    79
    |myApp|
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
    80
1686
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    81
    (client notNil and:[client ~~ anApplication]) ifTrue:[
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    82
        client releaseAsSubCanvas.
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    83
        client := nil.
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    84
    ].
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    85
1546
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    86
    (builder := aBuilder) isNil ifTrue:[
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    87
        builder := anApplication perform:#builder
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    88
                         ifNotUnderstood:[UIBuilder new]
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    89
    ].
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    90
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    91
    spec := aWindowSpecOrSpecSymbol.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    92
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    93
    "/ check for master application
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    94
    (anApplication notNil and:[anApplication masterApplication isNil]) ifTrue:[
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
    95
        myApp := self application.
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
    96
        myApp ~~ anApplication ifTrue:[
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
    97
            anApplication masterApplication:myApp
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    98
        ]
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    99
    ].
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   100
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   101
    client := anApplication.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   102
    self rebuild.
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   103
    ^ builder
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   104
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   105
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   106
makeClientViewScrollable:aBoolean
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   107
    |vs|
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   108
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   109
    aBoolean ~~ clientViewIsScrolled ifTrue:[
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   110
        clientView isNil ifTrue:[
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   111
            clientView := View new.
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   112
        ].
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   113
        aBoolean ifTrue:[
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   114
            self scrolledView:(vs := ViewScroller new).
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   115
            vs scrolledView:clientView.
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   116
        ] ifFalse:[
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   117
            self scrolledView:clientView.
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   118
        ].
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   119
        clientViewIsScrolled := aBoolean.
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   120
    ]
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   121
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   122
    "Modified: / 30.1.2000 / 21:36:29 / cg"
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   123
!
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   124
1450
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   125
setClient:anApplicationModel
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   126
    "set the client - do NOT rebuild"
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   127
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   128
    client := anApplicationModel 
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   129
!
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   130
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   131
spec
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   132
    "return the value of the instance variable 'spec' (automatically generated)"
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   133
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   134
    ^ spec!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   135
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   136
spec:something
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   137
    "set the value of the instance variable 'spec' (automatically generated)"
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   138
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   139
    spec := something.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   140
    self rebuild.
819
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   141
!
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   142
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   143
widget
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   144
    "ST80 compatibility. 
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   145
     I am my own widget"
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   146
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   147
    ^ self
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   148
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   149
    "Created: / 10.3.1998 / 16:20:52 / stefan"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   150
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   151
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   152
!SubCanvas methodsFor:'accessing channels'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   153
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   154
clientHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   155
    ^ clientHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   156
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   157
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   158
clientHolder:aValueHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   159
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   160
    clientHolder notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   161
        clientHolder removeDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   162
    ].
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   163
    (clientHolder := aValueHolder) notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   164
        clientHolder addDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   165
    ].
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   166
    self updateFromChannels
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   167
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   168
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   169
specHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   170
    ^ specHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   171
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   172
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   173
specHolder:aValueHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   174
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   175
    specHolder notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   176
        specHolder removeDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   177
    ].
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   178
    (specHolder := aValueHolder) notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   179
        specHolder addDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   180
    ].
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   181
    self updateFromChannels
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   182
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   183
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   184
!SubCanvas methodsFor:'building'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   185
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   186
XXrebuild
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   187
    "rebuild
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   188
    "
1577
04de18fd617c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   189
    |v subSpec savedView builderClass boundsOrLayout|
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
1548
299e14135d2d Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents: 1546
diff changeset
   191
    superView isNil ifTrue:[
299e14135d2d Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents: 1546
diff changeset
   192
        lateBuild := true.
299e14135d2d Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents: 1546
diff changeset
   193
        ^ self
299e14135d2d Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents: 1546
diff changeset
   194
    ].
299e14135d2d Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents: 1546
diff changeset
   195
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   196
    clientView notNil ifTrue:[
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   197
        clientView destroySubViews
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    ].
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    spec notNil ifTrue:[
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   201
        (subSpec := spec) isSymbol ifTrue:[
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   202
            client isNil ifTrue:[
1216
c9f8253a9e7c give a warning with nil client
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   203
                'SubCanvas [warning]: no client - cannot build spec' infoPrintCR.
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   204
                ^ self
553
3535a0682ac7 spec channel changed: if client is nil, try
ca
parents: 503
diff changeset
   205
            ].
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   206
            (subSpec := client class interfaceSpecFor:spec) isNil ifTrue:[
1216
c9f8253a9e7c give a warning with nil client
Claus Gittinger <cg@exept.de>
parents: 973
diff changeset
   207
                "/ Transcript showCR:'SubCanvas: nil spec'.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   208
                ^ self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   209
            ]
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   210
        ].
973
9114f57c9977 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   211
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   212
        builder isNil ifTrue:[
1383
1c0ffdda1a92 care for nil client.
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   213
            client isNil ifTrue:[
1c0ffdda1a92 care for nil client.
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   214
                builderClass := UIBuilder
1c0ffdda1a92 care for nil client.
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   215
            ] ifFalse:[
1c0ffdda1a92 care for nil client.
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   216
                builderClass := client builderClass
1c0ffdda1a92 care for nil client.
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   217
            ].
1c0ffdda1a92 care for nil client.
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   218
            builder := builderClass new.
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   219
        ].
973
9114f57c9977 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   220
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   221
        "/ old:
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   222
"/         builder buildFromSpec:subSpec in:clientView.
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   223
973
9114f57c9977 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   224
        "/ new (let app know (somehow) that this is a build
9114f57c9977 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   225
        "/ for a subcanvas (i.e. it can redefine the buildSubCanvase-method
9114f57c9977 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   226
        "/:
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   227
        savedView := builder window.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   228
        builder window:clientView.
1450
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   229
        [
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   230
            client buildSubCanvas:subSpec withBuilder:builder.
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   231
        ] valueNowOrOnUnwindDo:[
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   232
            builder window:savedView.
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   233
        ].
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   234
        clientViewIsScrolled ifTrue:[
1577
04de18fd617c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   235
            boundsOrLayout := builder spec window layout.
04de18fd617c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   236
            boundsOrLayout isNil ifTrue:[
04de18fd617c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   237
                 boundsOrLayout := builder spec window bounds
04de18fd617c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   238
            ].
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   239
            clientView
1577
04de18fd617c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   240
                extent:(boundsOrLayout rectangleRelativeTo:self bounds preferred:nil) extent.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   241
        ].
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   242
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   243
        self realized ifTrue:[
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   244
            clientView realizeAllSubViews
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   245
        ]
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   246
    ]
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   247
973
9114f57c9977 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   248
    "Modified: / 20.6.1998 / 14:29:00 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   249
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   250
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   251
container:aView
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   252
    super container:aView.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   253
    lateBuild == true ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   254
        lateBuild := false.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   255
        self rebuild
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   256
    ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   257
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   258
!
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   259
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   260
rebuild
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   261
    "rebuild
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   262
    "
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   263
    |v subSpec savedView builderClass|
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   264
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   265
    superView isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   266
        lateBuild := true.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   267
        ^ self
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   268
    ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   269
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   270
    clientView notNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   271
        clientView destroySubViews
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   272
    ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   273
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   274
    spec notNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   275
        (subSpec := spec) isSymbol ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   276
            client isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   277
                'SubCanvas [warning]: no client - cannot build spec' infoPrintCR.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   278
                ^ self
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   279
            ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   280
            (subSpec := client class interfaceSpecFor:spec) isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   281
                "/ Transcript showCR:'SubCanvas: nil spec'.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   282
                ^ self
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   283
            ]
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   284
        ].
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   285
        subSpec isArray ifTrue:[
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   286
            subSpec := subSpec decodeAsLiteralArray
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   287
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   288
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   289
        builder isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   290
            client isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   291
                builderClass := UIBuilder
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   292
            ] ifFalse:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   293
                builderClass := client builderClass
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   294
            ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   295
            builder := builderClass new.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   296
        ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   297
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   298
        "/ old:
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   299
        "/  builder buildFromSpec:subSpec in:clientView.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   300
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   301
        "/ new (let app know (somehow) that this is a build
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   302
        "/ for a subcanvas (i.e. it can redefine the buildSubCanvas-method):
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   303
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   304
        savedView := builder window.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   305
        builder window:clientView.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   306
        [
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   307
            client buildSubCanvas:subSpec withBuilder:builder.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   308
        ] valueNowOrOnUnwindDo:[
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   309
            savedView notNil ifTrue:[
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   310
                builder window:savedView.
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   311
            ]
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   312
        ].
1664
a8b97314f813 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1662
diff changeset
   313
        clientViewIsScrolled ifTrue:[
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   314
            clientView extent:((subSpec window layout) ? (subSpec window bounds)) extent.
1664
a8b97314f813 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1662
diff changeset
   315
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   316
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   317
        self realized ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   318
            clientView realizeAllSubViews
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   319
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   320
    ]
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   321
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   322
    "Modified: / 30.1.2000 / 21:36:40 / cg"
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   323
!
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   324
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   325
releaseAllComponents
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   326
    clientView destroySubViews.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   327
    builder := nil.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   328
    spec    := nil.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   329
    client  := nil.
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   330
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   331
    "Modified: / 31.1.2000 / 16:56:14 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   332
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   333
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   334
!SubCanvas methodsFor:'change & update'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   335
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   336
update:something with:aParameter from:changedObject
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   337
    "one of my models changed its value
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   338
    "
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   339
    (changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   340
        self updateFromChannels
7cf5f021983d add method:
ca
parents: 554
diff changeset
   341
    ] ifFalse:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   342
        super update:something with:aParameter from:changedObject.
7cf5f021983d add method:
ca
parents: 554
diff changeset
   343
    ]
7cf5f021983d add method:
ca
parents: 554
diff changeset
   344
7cf5f021983d add method:
ca
parents: 554
diff changeset
   345
!
7cf5f021983d add method:
ca
parents: 554
diff changeset
   346
7cf5f021983d add method:
ca
parents: 554
diff changeset
   347
updateFromChannels
7cf5f021983d add method:
ca
parents: 554
diff changeset
   348
    "update canvas from channel
7cf5f021983d add method:
ca
parents: 554
diff changeset
   349
    "
7cf5f021983d add method:
ca
parents: 554
diff changeset
   350
    |client spec|
7cf5f021983d add method:
ca
parents: 554
diff changeset
   351
7cf5f021983d add method:
ca
parents: 554
diff changeset
   352
    clientHolder isNil ifTrue:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   353
        client := self application
7cf5f021983d add method:
ca
parents: 554
diff changeset
   354
    ] ifFalse:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   355
        client := clientHolder value
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   356
    ].
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   357
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   358
    specHolder isNil ifTrue:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   359
        spec := #windowSpec
7cf5f021983d add method:
ca
parents: 554
diff changeset
   360
    ] ifFalse:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   361
        spec := specHolder value
7cf5f021983d add method:
ca
parents: 554
diff changeset
   362
    ].
7cf5f021983d add method:
ca
parents: 554
diff changeset
   363
    (client notNil and:[spec notNil]) ifTrue:[
7cf5f021983d add method:
ca
parents: 554
diff changeset
   364
        self client:client spec:spec
7cf5f021983d add method:
ca
parents: 554
diff changeset
   365
    ] ifFalse:[
1467
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   366
"/        spec notNil ifTrue:[
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   367
"/            self halt:'spec but no app'.
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   368
"/        ].
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   369
        self client:nil
7cf5f021983d add method:
ca
parents: 554
diff changeset
   370
    ]
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   371
1467
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   372
    "Modified: / 5.8.1999 / 13:35:26 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   373
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   374
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   375
!SubCanvas methodsFor:'initialization'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   376
609
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   377
destroy
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   378
    client notNil ifTrue:[
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   379
        client releaseAsSubCanvas.
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   380
    ].
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   381
609
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   382
    clientHolder notNil ifTrue:[
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   383
        clientHolder removeDependent:self.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   384
        clientHolder := nil.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   385
    ].
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   386
    specHolder notNil ifTrue:[
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   387
        specHolder removeDependent:self.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   388
        specHolder := nil.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   389
    ].
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   390
    super destroy.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   391
!
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   392
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   393
initialize
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   394
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   395
    super initialize.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   396
    self scrolledView:(clientView := View new).
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   397
    clientViewIsScrolled := false.
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   398
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   399
    spec := #windowSpec.
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   400
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   401
    "Modified: / 31.1.2000 / 16:56:31 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   402
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   403
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   404
!SubCanvas methodsFor:'queries'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   405
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   406
application
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   407
    "return the application, under which this view was opened,
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   408
    "
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   409
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   410
    client notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   411
        ^ client
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
    ].
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   413
    ^ super application
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   414
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
! !
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
!SubCanvas class methodsFor:'documentation'!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
version
1686
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
   420
    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.23 2000-02-08 10:31:31 ca Exp $'
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
! !