SubCanvas.st
author Claus Gittinger <cg@exept.de>
Mon, 20 Oct 2008 16:47:34 +0200
changeset 3560 da82e25a9b0f
parent 3514 f90f271410dd
child 3846 d786c6dba0a4
permissions -rw-r--r--
changed #rebuild
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:[
1846
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
    98
        builder := anApplication perform:#builder ifNotUnderstood:[UIBuilder new]
1546
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
    99
    ].
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
   100
452132649648 Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents: 1471
diff changeset
   101
    spec := aWindowSpecOrSpecSymbol.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   102
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   103
    "/ check for master application
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   104
    (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
   105
        myApp := self application.
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   106
        myApp ~~ anApplication ifTrue:[
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   107
            anApplication masterApplication:myApp
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   108
        ]
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   109
    ].
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   110
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   111
    client := anApplication.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   112
    self rebuild.
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   113
    ^ builder
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   114
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   115
3340
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   116
clientView
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   117
    ^ clientView
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   118
!
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   119
3499
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   120
clientViewIsScrolled
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   121
    ^ clientViewIsScrolled
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   122
!
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   123
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   124
isScrollWrapper
c946d359208e mouseWheel handling fixed
Claus Gittinger <cg@exept.de>
parents: 3485
diff changeset
   125
    ^ clientViewIsScrolled
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
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   128
makeClientViewScrollable:shouldBeScrollable
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   129
    |scroller|
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   130
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   131
    shouldBeScrollable ~~ clientViewIsScrolled ifTrue:[
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   132
        clientView isNil ifTrue:[
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   133
            useApplicationSubView ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   134
                clientView := ApplicationSubView new.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   135
            ] ifFalse:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   136
                clientView := View new.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   137
            ]
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   138
        ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   139
        shouldBeScrollable ifTrue:[
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   140
            scroller := ViewScroller new.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   141
            scroller viewBackground:self viewBackground.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   142
            self scrolledView:scroller.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   143
            scroller scrolledView:clientView.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   144
        ] ifFalse:[
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   145
            self scrolledView:clientView.
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   146
        ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   147
        clientViewIsScrolled := shouldBeScrollable.
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   148
    ]
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   149
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   150
    "Modified: / 30.1.2000 / 21:36:29 / cg"
1412
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   151
!
b426fae6edcf fix ViewScroller in scrolledView
tm
parents: 1383
diff changeset
   152
1450
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   153
setClient:anApplicationModel
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   154
    "set the client - do NOT rebuild"
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   155
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   156
    client := anApplicationModel 
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   157
!
9994adae5c1c checkin from browser
tm
parents: 1414
diff changeset
   158
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   159
spec
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   160
    ^ spec
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   161
!
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   162
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   163
spec:something
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   164
    spec := something.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   165
    self rebuild.
819
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   166
!
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   167
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   168
widget
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   169
    "ST80 compatibility. 
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   170
     I am my own widget"
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   171
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   172
    ^ self
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   173
8450cb2ba595 Widget of SubCanvas is self
Stefan Vogel <sv@exept.de>
parents: 609
diff changeset
   174
    "Created: / 10.3.1998 / 16:20:52 / stefan"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   175
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   176
2404
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
   177
!SubCanvas methodsFor:'accessing-canvasView handling'!
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   178
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   179
keepClientView:aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   180
    keepClientView := aBoolean
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
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   183
useApplicationSubView:aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   184
    useApplicationSubView := aBoolean
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
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   187
useOwnBuilder:aBoolean
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   188
    useOwnBuilder := aBoolean
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
1818
fe99c5c721e9 category changes
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   191
!SubCanvas methodsFor:'accessing-channels'!
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   192
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   193
clientHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   194
    ^ clientHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   195
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   196
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   197
clientHolder:aValueHolder
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   198
    |oldClient|
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   199
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   200
    clientHolder notNil ifTrue:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   201
        oldClient := clientHolder value.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   202
        clientHolder removeDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   203
    ].
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   204
    (clientHolder := aValueHolder) notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   205
        clientHolder addDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   206
    ].
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   207
    oldClient ~~ clientHolder value ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   208
        self updateFromChannels
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   209
    ]
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   210
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   211
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   212
clientView:aView
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   213
    clientView notNil ifTrue:[
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   214
        clientView destroy
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   215
    ].
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   216
    clientView := aView
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   217
!
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   218
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   219
specHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   220
    ^ specHolder
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   221
!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   222
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   223
specHolder:aValueHolder
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   224
    |oldSpec|
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   225
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   226
    specHolder notNil ifTrue:[
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   227
        oldSpec := specHolder value.
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   228
        specHolder removeDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   229
    ].
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   230
    (specHolder := aValueHolder) notNil ifTrue:[
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   231
        specHolder addDependent:self
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   232
    ].
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   233
    oldSpec ~~ specHolder value ifTrue:[
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   234
        self updateFromChannels
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   235
    ]
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   236
!
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   237
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   238
specHolder:newSpecHolder clientHolder:newClientHolder
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   239
    |oldSpec oldClient|
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
    clientHolder notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   242
        oldClient := clientHolder value.
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   243
        clientHolder removeDependent:self
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   244
    ].
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   245
    specHolder notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   246
        oldSpec := specHolder value.
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   247
        specHolder removeDependent:self
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   248
    ].
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   249
    (specHolder := newSpecHolder) notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   250
        specHolder addDependent: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
    (clientHolder := newClientHolder) notNil ifTrue:[
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   253
        clientHolder 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
    ((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
   256
        self updateFromChannels
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   257
    ]
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   258
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   259
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   260
!SubCanvas methodsFor:'building'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   261
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   262
container:aView
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   263
    super container:aView.
1846
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   264
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   265
    "/ my builder can only build the components, when I have a container
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   266
    "/ 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
   267
    "/ Now, we know where to build the GUI ...
e90341acd040 comment
Claus Gittinger <cg@exept.de>
parents: 1818
diff changeset
   268
    "/ ... 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
   269
    lateBuild == true ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   270
        lateBuild := false.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   271
        self rebuild
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
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   275
rebuild
2912
ac740f182061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2857
diff changeset
   276
    "rebuild my GUI from the spec."
ac740f182061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2857
diff changeset
   277
ac740f182061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2857
diff changeset
   278
    |subSpec savedView savedBuilder builderClass|
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   279
1856
8ecbdc69f11e comment
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
   280
    "/ if the superView is not yet created,
8ecbdc69f11e comment
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
   281
    "/ we MUST delay building... (sigh)
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   282
    superView isNil ifTrue:[          
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   283
        lateBuild := true.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   284
        ^ self
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   285
    ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   286
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   287
    clientView notNil ifTrue:[
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   288
        clientView destroySubViews.
1584
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
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   291
    spec notNil ifTrue:[
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   292
        subSpec := spec.
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   293
        subSpec isSymbol ifTrue:[
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   294
            client isNil ifTrue:[
2394
c3984ea38fb5 only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents: 2156
diff changeset
   295
                clientHolder isNil ifTrue:[
2395
db8f819ae751 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2394
diff changeset
   296
                    ('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
   297
                ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   298
                ^ self
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   299
            ].
3392
0d0461a20004 interfaceSpecFor: must go via the instance
Claus Gittinger <cg@exept.de>
parents: 3354
diff changeset
   300
            (subSpec := client interfaceSpecFor:spec) isNil ifTrue:[
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   301
                "/ Transcript showCR:'SubCanvas: nil spec'.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   302
                ^ self
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
        ].
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   305
        subSpec isArray ifTrue:[
3340
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   306
            subSpec := subSpec decodeAsLiteralArray.
3560
da82e25a9b0f changed #rebuild
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
   307
            subSpec isArray ifTrue:[self halt:'oops - decode failed'].
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   308
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   309
        builder isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   310
            client isNil ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   311
                builderClass := UIBuilder
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   312
            ] ifFalse:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   313
                builderClass := client builderClass
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   314
            ].
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   315
            builder := builderClass new.
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
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   318
        "/ old:
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   319
        "/  builder buildFromSpec:subSpec in:clientView.
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
        "/ 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
   322
        "/ 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
   323
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   324
        keepClientView ifFalse:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   325
            (clientView notNil and:[clientView application ~~ client]) ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   326
                clientView destroy.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   327
                clientView := nil.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   328
            ].
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   329
        ].
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   330
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   331
        clientView isNil ifTrue:[
1927
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   332
            "/ 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
   333
1927
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   334
            useApplicationSubView ifTrue:[
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   335
                clientView := ApplicationSubView new.
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   336
            ] ifFalse:[
4cb8e4ecc425 previous behavior
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
   337
                clientView := View new.
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   338
            ].
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   339
            clientView viewBackground:self viewBackground.
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   340
        ].
3271
4a1efb576208 update application after rebuild new application
ca
parents: 2916
diff changeset
   341
        useApplicationSubView ifTrue:[
4a1efb576208 update application after rebuild new application
ca
parents: 2916
diff changeset
   342
            clientView application:client.
4a1efb576208 update application after rebuild new application
ca
parents: 2916
diff changeset
   343
        ].
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   344
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   345
        savedView := builder window.
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   346
        builder window:clientView.
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   347
        useOwnBuilder ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   348
            savedBuilder := client builder.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   349
            client builder:builder.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   350
        ].
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   351
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   352
        [   
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   353
            |savedSuperView|
1912
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   354
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   355
            "/ kludge: need superView to be set correctly, in order for
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   356
            "/ postBuildAsSubCanvas to be invoked (instead of postBuild)
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   357
            "/ however, must unset the superView for code below ...
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   358
            savedSuperView := clientView superView.
1914
943f0551bf62 use #setContainer: (to avoid warning message)
penk
parents: 1913
diff changeset
   359
            savedSuperView isNil ifTrue:[clientView setContainer:self].
1912
dc3652682529 superView setting.
martin
parents: 1911
diff changeset
   360
            client buildSubCanvas:subSpec withBuilder:builder.
3485
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   361
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   362
            subSpec class == FullSpec ifTrue:[
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   363
                "/ 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
   364
                subSpec window setBackgroundColorAttributesIn:clientView with:builder.
d3eaa466fc23 care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   365
            ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   366
            savedSuperView isNil ifTrue:[
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   367
                clientView setContainer:nil. 
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   368
                self removeSubView:clientView.
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   369
            ].
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   370
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   371
            keepClientView ifFalse:[    
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   372
                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
   373
                self scrolledView:clientView.
1907
e8efd065dc2b oops - clientView again
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
   374
            ] ifTrue:[
1908
e86e34794e84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   375
                (clientView isComponentOf:self) ifFalse:[
1907
e8efd065dc2b oops - clientView again
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
   376
                    self scrolledView:clientView.
e8efd065dc2b oops - clientView again
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
   377
                ]
1905
20ff18462cc6 care for keepClientView setting
tm
parents: 1895
diff changeset
   378
            ]
2083
d7b305aea776 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
   379
        ] ensure:[
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   380
            savedView notNil ifTrue:[
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   381
                builder window:savedView.
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   382
            ].
1895
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   383
            useOwnBuilder ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   384
                savedBuilder notNil ifTrue:[
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   385
                    client builder:savedBuilder.
a1b2502c91d7 went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
   386
                ]
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   387
            ]
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   388
        ].
1893
6456c11a1307 View -> ApplicationSubView
tm
parents: 1856
diff changeset
   389
1664
a8b97314f813 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1662
diff changeset
   390
        clientViewIsScrolled ifTrue:[
3340
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   391
            subSpec window layout notNil ifTrue:[
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   392
                "/ mhmh - what should we base the size computation on ?
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   393
                "/ (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
   394
                "/  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
   395
                clientView extent:(subSpec window bounds extent)
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   396
            ] ifFalse:[
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   397
                clientView extent:(subSpec window bounds extent)
1276fa7e42f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3271
diff changeset
   398
            ].
3352
4ccd30154ced oops - forgot the comment:
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
   399
            self sizeChanged:nil.   "/ to force recomputation of the scrollbar
1664
a8b97314f813 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1662
diff changeset
   400
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   401
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   402
        self realized ifTrue:[
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   403
            clientView realizeAllSubViews
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   404
        ].
1584
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   405
    ]
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   406
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   407
    "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
   408
!
f020416e00ae LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents: 1577
diff changeset
   409
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   410
releaseAllComponents
2916
27dd039c1cc7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   411
    clientView notNil ifTrue:[
27dd039c1cc7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   412
        clientView destroySubViews.
27dd039c1cc7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   413
    ].
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   414
    builder := nil.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   415
    spec    := nil.
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   416
    client  := nil.
1662
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   417
b5ab432da3b9 subApp-channel support;
Claus Gittinger <cg@exept.de>
parents: 1584
diff changeset
   418
    "Modified: / 31.1.2000 / 16:56:14 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   419
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   420
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   421
!SubCanvas methodsFor:'change & update'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   422
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   423
update:something with:aParameter from:changedObject
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   424
    (changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[
2478
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   425
        self updateFromChannels.
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   426
        ^ self
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   427
    ].
654d6ffde1f8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
   428
    super update:something with:aParameter from:changedObject.
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   429
!
7cf5f021983d add method:
ca
parents: 554
diff changeset
   430
7cf5f021983d add method:
ca
parents: 554
diff changeset
   431
updateFromChannels
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   432
    "some of our channels (clientHolder, specHolder) changed"
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   433
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   434
    |newClient newSpec uiBuilder|
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   435
7cf5f021983d add method:
ca
parents: 554
diff changeset
   436
    clientHolder isNil ifTrue:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   437
        newClient := self application.
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   438
        uiBuilder := UIBuilder new.
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   439
        uiBuilder isSubBuilder:true.
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   440
    ] ifFalse:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   441
        newClient := clientHolder value
554
c32ed45bfc6e bug fixes for spec derived from channel
ca
parents: 553
diff changeset
   442
    ].
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   443
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   444
    specHolder isNil ifTrue:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   445
        newSpec := #windowSpec
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   446
    ] ifFalse:[
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   447
        newSpec := specHolder value
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   448
    ].
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   449
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   450
    (newClient notNil and:[newSpec notNil]) ifTrue:[
557
7cf5f021983d add method:
ca
parents: 554
diff changeset
   451
    ] ifFalse:[
1467
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   452
"/        spec notNil ifTrue:[
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   453
"/            self halt:'spec but no app'.
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   454
"/        ].
2857
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   455
        newClient := nil.
8bfa2eebfd2e avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents: 2735
diff changeset
   456
        newSpec := #windowSpec.  "/ is that true ?
1894
f0469313b9f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
   457
    ].
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   458
    self client:newClient spec:newSpec builder:uiBuilder
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   459
1467
2d85bd1a8267 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
   460
    "Modified: / 5.8.1999 / 13:35:26 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   461
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   462
3514
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   463
!SubCanvas methodsFor:'delegation'!
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   464
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   465
viewBackground:aColor
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   466
    "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
   467
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   468
    super viewBackground:aColor.
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   469
    (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
   470
        scrolledView viewBackground:aColor
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   471
    ].
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   472
! !
f90f271410dd When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents: 3499
diff changeset
   473
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   474
!SubCanvas methodsFor:'initialization'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   475
2156
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   476
initialize
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   477
    super initialize.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   478
    clientViewIsScrolled := false.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   479
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   480
    "/ these defaults make subCanvas compatible with VW;
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   481
    "/ however, they make our life difficult sometimes.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   482
    keepClientView := true.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   483
    useApplicationSubView := true "false".
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   484
    useOwnBuilder := false.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   485
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   486
    spec := #windowSpec.
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   487
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   488
    "Modified: / 31.1.2000 / 16:56:31 / cg"
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   489
!
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
release
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   492
    client notNil ifTrue:[
1702
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   493
        client == self application ifTrue:[
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   494
            client releaseAsSubCanvas.
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   495
        ] ifFalse:[
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   496
            client release
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   497
        ].
1471
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   498
    ].
09a5803325e4 when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents: 1467
diff changeset
   499
609
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   500
    clientHolder notNil ifTrue:[
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   501
        clientHolder removeDependent:self.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   502
        clientHolder := nil.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   503
    ].
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   504
    specHolder notNil ifTrue:[
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   505
        specHolder removeDependent:self.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   506
        specHolder := nil.
ad75d5f13ca1 implement destroy:
ca
parents: 557
diff changeset
   507
    ].
2156
e16dc409ecf2 destroy - release
Claus Gittinger <cg@exept.de>
parents: 2121
diff changeset
   508
    super release.
1702
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   509
ff202e263b9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1686
diff changeset
   510
    "Modified: / 13.2.2000 / 23:31:12 / cg"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   511
! !
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   512
1720
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   513
!SubCanvas methodsFor:'layout'!
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   514
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   515
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   516
    "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
   517
     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
   518
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   519
    ^ (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
   520
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
!
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
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   525
    "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
   526
     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
   527
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   528
    ^ (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
   529
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
! !
d855968ce342 redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
   532
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   533
!SubCanvas methodsFor:'queries'!
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   534
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   535
application
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   536
    "return the application, under which this view was opened"
503
0a3ef2d34d9d add application holder
ca
parents: 455
diff changeset
   537
3354
1f993ecf2265 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3352
diff changeset
   538
    ^ client ? super application
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
! !
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
!SubCanvas class methodsFor:'documentation'!
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
version
3560
da82e25a9b0f changed #rebuild
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
   544
    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.65 2008-10-20 14:47:34 cg Exp $'
455
860d66c9f047 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
! !