ApplicationSubView.st
author frank
Tue, 13 Feb 2001 20:17:58 +0100
changeset 1460 58678f806f0a
parent 1433 527262f8f026
child 1715 4fa58bb9c615
permissions -rw-r--r--
send #release to app, when destroyed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1353
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     1
"
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     2
 COPYRIGHT (c) 1999 eXept Software AG
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     3
              All Rights Reserved
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     4
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     5
 This software is furnished under a license and may be used
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     6
 only in accordance with the terms of that license and with the
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     8
 be provided or otherwise made available to, or used by, any
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
     9
 other person.  No title to or ownership of the software is
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    10
 hereby transferred.
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    11
"
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    12
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    13
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    14
"{ Package: 'stx:libview2' }"
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    15
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    16
View subclass:#ApplicationSubView
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    17
	instanceVariableNames:'application'
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    18
	classVariableNames:''
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    19
	poolDictionaries:''
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    20
	category:'Views-Basic'
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    21
!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    22
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    23
!ApplicationSubView class methodsFor:'documentation'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    24
1353
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    25
copyright
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    26
"
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    27
 COPYRIGHT (c) 1999 eXept Software AG
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    28
              All Rights Reserved
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    29
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    30
 This software is furnished under a license and may be used
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    31
 only in accordance with the terms of that license and with the
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    33
 be provided or otherwise made available to, or used by, any
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    34
 other person.  No title to or ownership of the software is
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    35
 hereby transferred.
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    36
"
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    37
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    38
!
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    39
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    40
documentation
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    41
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    42
    needed sometimes, when a full application is embeded into an ExtendedComboBox
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    43
    or subcanvas AND you want to avoid, that this application accesses the outer
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    44
    applications aspects (by returning a private application instance).
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    45
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    46
    Notice: you may have to manually set this views application to be the embedded app
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    47
           (i.e. via #application:) unless it is set by #client:....
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    48
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    49
    see self-embedding example in CodingExamples_GUI::GUIDemoExtendedComboBox
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    50
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    51
!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    52
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    53
examples
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    54
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    55
    see self-embedding example in CodingExamples_GUI::GUIDemoExtendedComboBox
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    56
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    57
! !
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    58
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    59
!ApplicationSubView methodsFor:'accessing'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    60
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    61
application
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    62
    "return the value of the instance variable 'application' (automatically generated)"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    63
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    64
    ^ application
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    65
!
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    66
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    67
application:something
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    68
    "set the value of the instance variable 'application' (automatically generated)"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    69
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    70
    application := something.
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    71
!
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    72
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    73
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    74
    self application:anApplication.
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    75
    ^ super client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    76
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    77
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    78
! !
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    79
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    80
!ApplicationSubView methodsFor:'events'!
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    81
1460
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    82
destroy
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    83
    |app|
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    84
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    85
    (app := self application) notNil ifTrue:[
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    86
        app ~~ self topView application ifTrue:[
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    87
            app release
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    88
        ]
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    89
    ].
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    90
    super destroy.
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    91
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    92
!
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
    93
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    94
realize
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    95
    |app|
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    96
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    97
    super realize.
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    98
    (app := self application) notNil ifTrue:[
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    99
        app postOpenAsSubcanvasWith:app builder
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   100
    ]
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   101
! !
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   102
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   103
!ApplicationSubView class methodsFor:'documentation'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   104
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   105
version
1460
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   106
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationSubView.st,v 1.5 2001-02-13 19:17:58 frank Exp $'
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   107
! !