ApplicationSubView.st
author Claus Gittinger <cg@exept.de>
Tue, 03 Sep 2013 17:23:55 +0200
changeset 3228 187a4158a51a
parent 3007 3df2fbda9d7e
child 3298 9d82cfd4031c
permissions -rw-r--r--
class: FlyByHelp changed: #initiateHelpFor:at:now: #showHelp:for: changed the flyBy suppression slightly: if the same text is to be shown again, do not show it except if the help is for another widget. (used to check for the text only previously)
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
"
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    12
"{ Package: 'stx:libview2' }"
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    13
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    14
View subclass:#ApplicationSubView
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
    15
	instanceVariableNames:'application buildMenu'
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    16
	classVariableNames:''
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    17
	poolDictionaries:''
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    18
	category:'Views-Basic'
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    19
!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    20
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    21
!ApplicationSubView class methodsFor:'documentation'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    22
1353
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    23
copyright
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    24
"
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    25
 COPYRIGHT (c) 1999 eXept Software AG
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    26
              All Rights Reserved
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    27
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    28
 This software is furnished under a license and may be used
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    29
 only in accordance with the terms of that license and with the
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    31
 be provided or otherwise made available to, or used by, any
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    32
 other person.  No title to or ownership of the software is
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    33
 hereby transferred.
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    34
"
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    35
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    36
!
cb8d9c20dd51 copyrights
Claus Gittinger <cg@exept.de>
parents: 1288
diff changeset
    37
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    38
documentation
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    39
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    40
    needed sometimes, when a full application is embeded into an ExtendedComboBox
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    41
    or subcanvas AND you want to avoid, that this application accesses the outer
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    42
    applications aspects (by returning a private application instance).
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    43
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    44
    Notice: you may have to manually set this views application to be the embedded app
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
    45
           (i.e. via #application:) unless it is set by #client:....
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    46
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    47
    see self-embedding example in CodingExamples_GUI::GUIDemoExtendedComboBox
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    48
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    49
!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    50
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    51
examples
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    52
"
1715
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    53
    see self-embedding example in CodingExamples_GUI::GUIDemoExtendedComboBox.
2066
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    54
                                                                [exBegin]
1715
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    55
    |top sub app|
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    56
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    57
    top := StandardSystemView new.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    58
    sub := ApplicationSubView new.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    59
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    60
    app := FileBrowserV2 new.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    61
    app createBuilder.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    62
    app window:sub.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    63
    sub client:app.
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    64
4fa58bb9c615 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    65
    top addSubView:sub.
2066
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    66
    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
    67
    top open.
2066
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    68
                                                                [exEnd]
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    69
                                                                [exBegin]
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    70
    |top sub app|
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    71
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    72
    top := StandardSystemView new.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    73
    sub := ApplicationSubView new.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    74
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    75
    app := Tools::NewSystemBrowser new.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    76
    app createBuilder.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    77
    app window:sub.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    78
    sub client:app.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    79
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    80
    top addSubView:sub.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    81
    sub origin:(0.1@0.1) corner:(0.9@0.9).
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    82
    top open.
84580ba27f3c example
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
    83
                                                                [exEnd]
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    84
"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    85
! !
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    86
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    87
!ApplicationSubView methodsFor:'accessing'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    88
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    89
application
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    90
    "return the value of the instance variable 'application' (automatically generated)"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    91
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    92
    ^ application
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    93
!
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    94
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    95
application:something
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    96
    "set the value of the instance variable 'application' (automatically generated)"
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
    97
1433
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    98
    application := something.
527262f8f026 added postOpenAsSubcanvas stuff
tm
parents: 1353
diff changeset
    99
!
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   100
2105
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   101
buildMenu:aBoolean
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   102
    "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
   103
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   104
    buildMenu := aBoolean.
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
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   107
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
   108
    self 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   109
        client:anApplication 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   110
        spec:aWindowSpecOrSpecSymbol 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   111
        builder:aBuilder 
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   112
        withMenu:(buildMenu ? false).
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   113
!
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   114
e68fca357a3a can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents: 2066
diff changeset
   115
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenu
1288
7e2e44cea290 checkin from browser
ca
parents: 1287
diff changeset
   116
    self application:anApplication.
2934
67900dc06f4a added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
   117
    super client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenu.
67900dc06f4a added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
   118
2935
c23f73a4b72e changed: #client:spec:builder:withMenu:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   119
    "Modified: / 25-07-2011 / 17:51:22 / cg"
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
3007
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   145
!ApplicationSubView methodsFor:'testing'!
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   146
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   147
isApplicationSubView
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   148
    ^ true
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   149
! !
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   150
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   151
!ApplicationSubView class methodsFor:'documentation'!
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   152
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   153
version
3007
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   154
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationSubView.st,v 1.11 2012-05-11 16:20:53 vrany Exp $'
2935
c23f73a4b72e changed: #client:spec:builder:withMenu:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   155
!
c23f73a4b72e changed: #client:spec:builder:withMenu:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   156
c23f73a4b72e changed: #client:spec:builder:withMenu:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   157
version_CVS
3007
3df2fbda9d7e added: #isApplicationSubView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2935
diff changeset
   158
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationSubView.st,v 1.11 2012-05-11 16:20:53 vrany Exp $'
1287
ce62c90b3bfd initial checkin
ca
parents:
diff changeset
   159
! !