ApplicationSubView.st
author Claus Gittinger <cg@exept.de>
Wed, 15 Feb 2006 22:01:33 +0100
changeset 2105 e68fca357a3a
parent 2066 84580ba27f3c
child 2934 67900dc06f4a
permissions -rw-r--r--
can now control if specs menu is wanted or not
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
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
    17
	instanceVariableNames:'application buildMenu'
1287
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
"
1715
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    55
    see self-embedding example in CodingExamples_GUI::GUIDemoExtendedComboBox.
2066
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    56
                                                                [exBegin]
1715
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    57
    |top sub app|
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    58
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    59
    top := StandardSystemView new.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    60
    sub := ApplicationSubView new.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    61
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    62
    app := FileBrowserV2 new.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    63
    app createBuilder.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    64
    app window:sub.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    65
    sub client:app.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    66
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    67
    top addSubView:sub.
2066
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    68
    sub origin:(0.1@0.1) corner:(0.9@0.9).
1715
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    69
    top open.
2066
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    70
                                                                [exEnd]
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    71
                                                                [exBegin]
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    72
    |top sub app|
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    73
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    74
    top := StandardSystemView new.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    75
    sub := ApplicationSubView new.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    76
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    77
    app := Tools::NewSystemBrowser new.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    78
    app createBuilder.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    79
    app window:sub.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    80
    sub client:app.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    81
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    82
    top addSubView:sub.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    83
    sub origin:(0.1@0.1) corner:(0.9@0.9).
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    84
    top open.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    85
                                                                [exEnd]
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    86
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    87
! !
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    88
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    89
!ApplicationSubView methodsFor:'accessing'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    90
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    91
application
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    92
    "return the value of the instance variable 'application' (automatically generated)"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    93
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    94
    ^ application
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    95
!
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    96
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    97
application:something
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    98
    "set the value of the instance variable 'application' (automatically generated)"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    99
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   100
    application := something.
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   101
!
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   102
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   103
buildMenu:aBoolean
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   104
    "if true, the main menu is also built. Default is false"
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   106
    buildMenu := aBoolean.
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   107
!
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   108
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   109
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   110
    self 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   111
        client:anApplication 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   112
        spec:aWindowSpecOrSpecSymbol 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   113
        builder:aBuilder 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   114
        withMenu:(buildMenu ? false).
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   115
!
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   116
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   117
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenu
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   118
    self application:anApplication.
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   119
    ^ super client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenu
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   120
! !
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   121
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   122
!ApplicationSubView methodsFor:'events'!
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   123
1460
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   124
destroy
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   125
    |app|
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   126
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   127
    (app := self application) notNil ifTrue:[
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   128
        app ~~ self topView application ifTrue:[
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   129
            app release
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   130
        ]
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   131
    ].
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   132
    super destroy.
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   133
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   134
!
58678f806f0a send #release to app, when destroyed
frank
parents: 1433
diff changeset
   135
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   136
realize
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   137
    |app|
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   138
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   139
    super realize.
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   140
    (app := self application) notNil ifTrue:[
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   141
        app postOpenAsSubcanvasWith:app builder
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   142
    ]
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   143
! !
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
   144
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   145
!ApplicationSubView class methodsFor:'documentation'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   146
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   147
version
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   148
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationSubView.st,v 1.8 2006-02-15 21:01:33 cg Exp $'
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   149
! !