SubCanvas.st
author Claus Gittinger <cg@exept.de>
Mon, 18 Jul 2011 09:55:19 +0200
changeset 4062 db9056656c2d
parent 3846 d786c6dba0a4
child 4579 273356d6578d
permissions -rw-r--r--
changed: #application
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
"
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
    13
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ScrollableView subclass:#SubCanvas
1912
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
    15
	instanceVariableNames:'builder spec client clientHolder specHolder clientView
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
    16
		clientViewIsScrolled lateBuild useApplicationSubView
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
    17
		keepClientView useOwnBuilder'
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
    18
	classVariableNames:''
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
    19
	poolDictionaries:''
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
    20
	category:'Views-Basic'
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    23
!SubCanvas class methodsFor:'documentation'!
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    24
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    25
copyright
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    26
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    27
 COPYRIGHT (c) 1998 by eXept Software AG
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    28
              All Rights Reserved
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    29
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    30
 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
    31
 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
    32
 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
    33
 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
    34
 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
    35
 hereby transferred.
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
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    40
documentation
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    41
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    42
    a view for a subApplication.
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    43
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
    44
    Made to be VW compatible as much as possible (try opening a RefactoringBrowser ...).
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
    45
    However, the default setup is not very useful to embed arbitrary applications
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
    46
    which are meant to be separate stand-alone applications.
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
    47
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
    48
    Use the settings:
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
    49
        keepClientView          (default: true)
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
    50
        useApplicationSubView   (default: false)
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
    51
        useOwnBuilder           (default: false)
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
    52
970
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    53
    [author:]
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    54
        Claus Atzkern
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    55
"
8cbadf2b9825 also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    56
! !
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
1414
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    58
!SubCanvas class methodsFor:'defaults'!
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
defaultHorizontalScrollable
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    61
    ^ false
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    62
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    63
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    64
!
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    65
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    66
defaultVerticalScrollable
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    67
    ^ false
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    68
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    69
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    70
! !
faf0465c333b defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1412
diff changeset
    71
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!SubCanvas methodsFor:'accessing'!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    74
builder
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
    75
    ^ builder
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
    76
!
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
    78
builder:aBuilder
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
    79
    builder := aBuilder 
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
    80
!
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
    81
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    82
client
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
    83
    ^ client
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
    84
!
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
    86
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "release existing components and generate new components from
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     the given windowSpec, using the given builder."
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
2427
43e68ab02e63 oops - undo last change (postOpen when client changes)
Claus Gittinger <cg@exept.de>
parents: 2426
diff changeset
    90
    |myApp|
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
    91
1686
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    92
    (client notNil and:[client ~~ anApplication]) ifTrue:[
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    93
        client releaseAsSubCanvas.
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    94
        client := nil.
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    95
    ].
bafa16adbf14 must release client first,
ca
parents: 1664
diff changeset
    96
1546
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    97
    (builder := aBuilder) isNil ifTrue:[
3846
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
    98
        anApplication notNil ifTrue:[
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
    99
            builder := anApplication perform:#builder ifNotUnderstood:[ nil ]
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
   100
        ].
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
   101
        builder isNil ifTrue:[ builder := UIBuilder new ].
1546
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
   102
    ].
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
   103
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
   104
    spec := aWindowSpecOrSpecSymbol.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   105
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   106
    "/ check for master application
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   107
    (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
   108
        myApp := self application.
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   109
        myApp ~~ anApplication ifTrue:[
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   110
            anApplication masterApplication:myApp
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   111
        ]
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   112
    ].
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   113
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   114
    client := anApplication.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   115
    self rebuild.
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   116
    ^ builder
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   117
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   118
3340
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   119
clientView
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   120
    ^ clientView
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   121
!
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   122
3499
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   123
clientViewIsScrolled
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   124
    ^ clientViewIsScrolled
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   125
!
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   126
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   127
isScrollWrapper
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   128
    ^ clientViewIsScrolled
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   129
!
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   130
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   131
makeClientViewScrollable:shouldBeScrollable
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   132
    |scroller|
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   133
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   134
    shouldBeScrollable ~~ clientViewIsScrolled ifTrue:[
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   135
        clientView isNil ifTrue:[
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   136
            useApplicationSubView ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   137
                clientView := ApplicationSubView new.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   138
            ] ifFalse:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   139
                clientView := View new.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   140
            ]
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   141
        ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   142
        shouldBeScrollable ifTrue:[
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   143
            scroller := ViewScroller new.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   144
            scroller viewBackground:self viewBackground.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   145
            self scrolledView:scroller.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   146
            scroller scrolledView:clientView.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   147
        ] ifFalse:[
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   148
            self scrolledView:clientView.
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   149
        ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   150
        clientViewIsScrolled := shouldBeScrollable.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   151
    ]
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   152
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   153
    "Modified: / 30.1.2000 / 21:36:29 / cg"
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   154
!
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   155
1450
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   156
setClient:anApplicationModel
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   157
    "set the client - do NOT rebuild"
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   158
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   159
    client := anApplicationModel 
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   160
!
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   161
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   162
spec
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   163
    ^ spec
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   164
!
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   165
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   166
spec:something
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   167
    spec := something.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   168
    self rebuild.
819
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   169
!
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   170
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   171
widget
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   172
    "ST80 compatibility. 
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   173
     I am my own widget"
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   174
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   175
    ^ self
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   176
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   177
    "Created: / 10.3.1998 / 16:20:52 / stefan"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   178
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   179
2404
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
   180
!SubCanvas methodsFor:'accessing-canvasView handling'!
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   181
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   182
keepClientView:aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   183
    keepClientView := aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   184
!
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   185
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   186
useApplicationSubView:aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   187
    useApplicationSubView := aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   188
!
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   189
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   190
useOwnBuilder:aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   191
    useOwnBuilder := aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   192
! !
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   193
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   194
!SubCanvas methodsFor:'accessing-channels'!
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   195
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   196
clientHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   197
    ^ clientHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   198
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   199
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   200
clientHolder:aValueHolder
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   201
    |oldClient|
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   202
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   203
    clientHolder notNil ifTrue:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   204
        oldClient := clientHolder value.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   205
        clientHolder removeDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   206
    ].
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   207
    (clientHolder := aValueHolder) notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   208
        clientHolder addDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   209
    ].
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   210
    oldClient ~~ clientHolder value ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   211
        self updateFromChannels
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   212
    ]
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   213
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   214
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   215
clientView:aView
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   216
    clientView notNil ifTrue:[
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   217
        clientView destroy
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   218
    ].
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   219
    clientView := aView
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   220
!
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   221
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   222
specHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   223
    ^ specHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   224
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   225
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   226
specHolder:aValueHolder
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   227
    |oldSpec|
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   228
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   229
    specHolder notNil ifTrue:[
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   230
        oldSpec := specHolder value.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   231
        specHolder removeDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   232
    ].
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   233
    (specHolder := aValueHolder) notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   234
        specHolder addDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   235
    ].
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   236
    oldSpec ~~ specHolder value ifTrue:[
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   237
        self updateFromChannels
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   238
    ]
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   239
!
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   240
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   241
specHolder:newSpecHolder clientHolder:newClientHolder
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   242
    |oldSpec oldClient|
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   243
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   244
    clientHolder notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   245
        oldClient := clientHolder value.
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   246
        clientHolder removeDependent:self
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   247
    ].
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   248
    specHolder notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   249
        oldSpec := specHolder value.
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   250
        specHolder removeDependent:self
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   251
    ].
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   252
    (specHolder := newSpecHolder) notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   253
        specHolder addDependent:self
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   254
    ].
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   255
    (clientHolder := newClientHolder) notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   256
        clientHolder addDependent:self
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   257
    ].
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   258
    ((oldSpec ~~ specHolder value) or:[oldClient ~~ clientHolder value]) ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   259
        self updateFromChannels
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   260
    ]
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   261
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   262
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   263
!SubCanvas methodsFor:'building'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   264
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   265
container:aView
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   266
    super container:aView.
1846
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   267
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   268
    "/ my builder can only build the components, when I have a container
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   269
    "/ lateBuild is set, if the spec was set some time ago, when I had no container
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   270
    "/ Now, we know where to build the GUI ...
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   271
    "/ ... and must hurry up to create the widgets.
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   272
    lateBuild == true ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   273
        lateBuild := false.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   274
        self rebuild
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   275
    ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   276
!
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   277
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   278
rebuild
2912
ac740f182061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2857
diff changeset
   279
    "rebuild my GUI from the spec."
ac740f182061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2857
diff changeset
   280
ac740f182061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2857
diff changeset
   281
    |subSpec savedView savedBuilder builderClass|
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   282
1856
8ecbdc69f11e comment
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
   283
    "/ if the superView is not yet created,
8ecbdc69f11e comment
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
   284
    "/ we MUST delay building... (sigh)
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   285
    superView isNil ifTrue:[          
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   286
        lateBuild := true.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   287
        ^ self
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
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   290
    clientView notNil ifTrue:[
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   291
        clientView destroySubViews.
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   292
    ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   293
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   294
    spec notNil ifTrue:[
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   295
        subSpec := spec.
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   296
        subSpec isSymbol ifTrue:[
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   297
            client isNil ifTrue:[
2394
c3984ea38fb5 only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents: 2156
diff changeset
   298
                clientHolder isNil ifTrue:[
2395
db8f819ae751 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2394
diff changeset
   299
                    ('SubCanvas [warning]: no client - cannot build spec: ' , spec) infoPrintCR.
2394
c3984ea38fb5 only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents: 2156
diff changeset
   300
                ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   301
                ^ self
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   302
            ].
3392
0d0461a20004 interfaceSpecFor: must go via the instance
Claus Gittinger <cg@exept.de>
parents: 3354
diff changeset
   303
            (subSpec := client interfaceSpecFor:spec) isNil ifTrue:[
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   304
                "/ Transcript showCR:'SubCanvas: nil spec'.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   305
                ^ self
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
        ].
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   308
        subSpec isArray ifTrue:[
3340
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   309
            subSpec := subSpec decodeAsLiteralArray.
3560
da82e25a9b0f changed #rebuild
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
   310
            subSpec isArray ifTrue:[self halt:'oops - decode failed'].
1662
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
        builder isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   313
            client isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   314
                builderClass := UIBuilder
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   315
            ] ifFalse:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   316
                builderClass := client builderClass
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   317
            ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   318
            builder := builderClass new.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   319
        ].
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
        "/ old:
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   322
        "/  builder buildFromSpec:subSpec in:clientView.
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
        "/ 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
   325
        "/ 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
   326
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   327
        keepClientView ifFalse:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   328
            (clientView notNil and:[clientView application ~~ client]) ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   329
                clientView destroy.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   330
                clientView := nil.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   331
            ].
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   332
        ].
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   333
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   334
        clientView isNil ifTrue:[
1927
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   335
            "/ create a new view
1925
6026af8498a5 if keepClientView is set, care for a view being already
Claus Gittinger <cg@exept.de>
parents: 1914
diff changeset
   336
1927
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   337
            useApplicationSubView ifTrue:[
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   338
                clientView := ApplicationSubView new.
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   339
            ] ifFalse:[
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   340
                clientView := View new.
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   341
            ].
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   342
            clientView viewBackground:self viewBackground.
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   343
        ].
3271
4a1efb576208 update application after rebuild new application
ca
parents: 2916
diff changeset
   344
        useApplicationSubView ifTrue:[
4a1efb576208 update application after rebuild new application
ca
parents: 2916
diff changeset
   345
            clientView application:client.
4a1efb576208 update application after rebuild new application
ca
parents: 2916
diff changeset
   346
        ].
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   347
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   348
        savedView := builder window.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   349
        builder window:clientView.
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   350
        useOwnBuilder ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   351
            savedBuilder := client builder.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   352
            client builder:builder.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   353
        ].
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   354
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   355
        [   
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   356
            |savedSuperView|
1912
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   357
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   358
            "/ kludge: need superView to be set correctly, in order for
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   359
            "/ postBuildAsSubCanvas to be invoked (instead of postBuild)
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   360
            "/ however, must unset the superView for code below ...
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   361
            savedSuperView := clientView superView.
1914
943f0551bf62 use #setContainer: (to avoid warning message)
penk
parents: 1913
diff changeset
   362
            savedSuperView isNil ifTrue:[clientView setContainer:self].
1912
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   363
            client buildSubCanvas:subSpec withBuilder:builder.
3485
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   364
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   365
            subSpec class == FullSpec ifTrue:[
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   366
                "/ mhmh - should we take the attributes from the windowSpec or from my spec ????
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   367
                subSpec window setBackgroundColorAttributesIn:clientView with:builder.
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   368
            ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   369
            savedSuperView isNil ifTrue:[
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   370
                clientView setContainer:nil. 
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   371
                self removeSubView:clientView.
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   372
            ].
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   373
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   374
            keepClientView ifFalse:[    
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   375
                self assert:(scrolledView isNil or:[(clientView isComponentOf:scrolledView) not]).
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   376
                self scrolledView:clientView.
1907
e8efd065dc2b oops - clientView again
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
   377
            ] ifTrue:[
1908
e86e34794e84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   378
                (clientView isComponentOf:self) ifFalse:[
1907
e8efd065dc2b oops - clientView again
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
   379
                    self scrolledView:clientView.
e8efd065dc2b oops - clientView again
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
   380
                ]
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   381
            ]
2083
d7b305aea776 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
   382
        ] ensure:[
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   383
            savedView notNil ifTrue:[
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   384
                builder window:savedView.
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   385
            ].
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   386
            useOwnBuilder ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   387
                savedBuilder notNil ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   388
                    client builder:savedBuilder.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   389
                ]
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   390
            ]
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   391
        ].
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   392
1664
a8b97314f813 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1662
diff changeset
   393
        clientViewIsScrolled ifTrue:[
3340
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   394
            subSpec window layout notNil ifTrue:[
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   395
                "/ mhmh - what should we base the size computation on ?
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   396
                "/ (I dont see any reason to look at the windows spec at all;
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   397
                "/  isn't the user of the spec the only one to control the size).
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   398
                clientView extent:(subSpec window bounds extent)
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   399
            ] ifFalse:[
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   400
                clientView extent:(subSpec window bounds extent)
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   401
            ].
3352
4ccd30154ced oops - forgot the comment:
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
   402
            self sizeChanged:nil.   "/ to force recomputation of the scrollbar
1664
a8b97314f813 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1662
diff changeset
   403
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   404
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   405
        self realized ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   406
            clientView realizeAllSubViews
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   407
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   408
    ]
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   409
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   410
    "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
   411
!
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   412
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   413
releaseAllComponents
2916
27dd039c1cc7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   414
    clientView notNil ifTrue:[
27dd039c1cc7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   415
        clientView destroySubViews.
27dd039c1cc7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   416
    ].
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   417
    builder := nil.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   418
    spec    := nil.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   419
    client  := nil.
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   420
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   421
    "Modified: / 31.1.2000 / 16:56:14 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   422
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   423
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   424
!SubCanvas methodsFor:'change & update'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   425
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   426
update:something with:aParameter from:changedObject
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   427
    (changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[
2478
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   428
        self updateFromChannels.
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   429
        ^ self
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   430
    ].
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   431
    super update:something with:aParameter from:changedObject.
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   432
!
7cf5f021983d add method:
ca
parents: 554
diff changeset
   433
7cf5f021983d add method:
ca
parents: 554
diff changeset
   434
updateFromChannels
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   435
    "some of our channels (clientHolder, specHolder) changed"
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   436
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   437
    |newClient newSpec uiBuilder|
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   438
7cf5f021983d add method:
ca
parents: 554
diff changeset
   439
    clientHolder isNil ifTrue:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   440
        newClient := self application.
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   441
        uiBuilder := UIBuilder new.
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   442
        uiBuilder isSubBuilder:true.
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   443
    ] ifFalse:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   444
        newClient := clientHolder value
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   445
    ].
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   446
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   447
    specHolder isNil ifTrue:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   448
        newSpec := #windowSpec
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   449
    ] ifFalse:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   450
        newSpec := specHolder value
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   451
    ].
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   452
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   453
    (newClient notNil and:[newSpec notNil]) ifTrue:[
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   454
    ] ifFalse:[
1467
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   455
"/        spec notNil ifTrue:[
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   456
"/            self halt:'spec but no app'.
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   457
"/        ].
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   458
        newClient := nil.
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   459
        newSpec := #windowSpec.  "/ is that true ?
1894
f0469313b9f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
   460
    ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   461
    self client:newClient spec:newSpec builder:uiBuilder
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   462
1467
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   463
    "Modified: / 5.8.1999 / 13:35:26 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   464
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   465
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   466
!SubCanvas methodsFor:'delegation'!
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   467
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   468
viewBackground:aColor
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   469
    "convenient method: forward this to the scrolledView"
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   470
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   471
    super viewBackground:aColor.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   472
    (scrolledView notNil and:[scrolledView ~= clientView]) ifTrue:[
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   473
        scrolledView viewBackground:aColor
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   474
    ].
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   475
! !
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   476
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   477
!SubCanvas methodsFor:'initialization'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   478
2156
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   479
initialize
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   480
    super initialize.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   481
    clientViewIsScrolled := false.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   482
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   483
    "/ these defaults make subCanvas compatible with VW;
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   484
    "/ however, they make our life difficult sometimes.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   485
    keepClientView := true.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   486
    useApplicationSubView := true "false".
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   487
    useOwnBuilder := false.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   488
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   489
    spec := #windowSpec.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   490
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   491
    "Modified: / 31.1.2000 / 16:56:31 / cg"
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   492
!
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   493
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   494
release
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   495
    client notNil ifTrue:[
1702
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   496
        client == self application ifTrue:[
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   497
            client releaseAsSubCanvas.
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   498
        ] ifFalse:[
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   499
            client release
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   500
        ].
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   501
    ].
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   502
609
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   503
    clientHolder notNil ifTrue:[
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   504
        clientHolder removeDependent:self.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   505
        clientHolder := nil.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   506
    ].
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   507
    specHolder notNil ifTrue:[
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   508
        specHolder removeDependent:self.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   509
        specHolder := nil.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   510
    ].
2156
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   511
    super release.
1702
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   512
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   513
    "Modified: / 13.2.2000 / 23:31:12 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   514
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   515
1720
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   516
!SubCanvas methodsFor:'layout'!
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   517
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   518
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   519
    "return the horizontal margin around (outer margin).
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   520
     Redefined to avoid margin when no scrollers are present"
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   521
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   522
    ^ (hasV or:[hasH]) ifTrue:[scrolledViewHMargin] ifFalse:[0]
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   523
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   524
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   525
!
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   526
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   527
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   528
    "return the horizontal margin around (outer margin).
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   529
     Redefined to avoid margin when no scrollers are present"
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   530
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   531
    ^ (hasV or:[hasH]) ifTrue:[scrolledViewVMargin] ifFalse:[0]
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   532
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   533
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   534
! !
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   535
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   536
!SubCanvas methodsFor:'queries'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   537
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   538
application
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   539
    "return the application, under which this view was opened"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   540
4062
db9056656c2d changed: #application
Claus Gittinger <cg@exept.de>
parents: 3846
diff changeset
   541
    ^ client notNil ifTrue:[ client ] ifFalse:[ super application ]
db9056656c2d changed: #application
Claus Gittinger <cg@exept.de>
parents: 3846
diff changeset
   542
db9056656c2d changed: #application
Claus Gittinger <cg@exept.de>
parents: 3846
diff changeset
   543
    "Modified: / 18-07-2011 / 09:55:11 / cg"
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
! !
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
!SubCanvas class methodsFor:'documentation'!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
version
4062
db9056656c2d changed: #application
Claus Gittinger <cg@exept.de>
parents: 3846
diff changeset
   549
    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.67 2011-07-18 07:55:19 cg Exp $'
3846
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
   550
!
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
   551
d786c6dba0a4 changed: #client:spec:builder: check on unspecified application
ca
parents: 3560
diff changeset
   552
version_CVS
4062
db9056656c2d changed: #application
Claus Gittinger <cg@exept.de>
parents: 3846
diff changeset
   553
    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.67 2011-07-18 07:55:19 cg Exp $'
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
! !