WindowBuilder.st
author Claus Gittinger <cg@exept.de>
Sat, 11 Aug 2018 17:40:26 +0200
changeset 4167 3ebfb7658859
parent 4097 662d9ae4818f
child 4224 8ce4f91fb3ef
permissions -rw-r--r--
#QUALITY by cg class: ActiveHelp changed: #interestedIn:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4097
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
     1
"{ Encoding: utf8 }"
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
     2
89
claus
parents: 86
diff changeset
     3
"
claus
parents: 86
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
     5
	      All Rights Reserved
89
claus
parents: 86
diff changeset
     6
claus
parents: 86
diff changeset
     7
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
     8
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
    10
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
    11
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    12
 hereby transferred.
claus
parents: 86
diff changeset
    13
"
1395
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
    14
"{ Package: 'stx:libview2' }"
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
    15
3470
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    16
"{ NameSpace: Smalltalk }"
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    17
100
claus
parents: 99
diff changeset
    18
Object subclass:#WindowBuilder
2288
e0aae2de3794 focus handling: focusSequence removed
ca
parents: 2109
diff changeset
    19
	instanceVariableNames:'window application bindings visuals labels namedComponents
e0aae2de3794 focus handling: focusSequence removed
ca
parents: 2109
diff changeset
    20
		helpKeys componentCreationHook applicationClass keyboardProcessor
3470
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    21
		subCanvasSpecs componentToSpecMapping windowTitle'
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
    22
	classVariableNames:'StopOnError Verbose'
436
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
    23
	poolDictionaries:''
2362
4004473735b2 category change
Claus Gittinger <cg@exept.de>
parents: 2291
diff changeset
    24
	category:'Interface-Framework'
66
claus
parents:
diff changeset
    25
!
claus
parents:
diff changeset
    26
claus
parents:
diff changeset
    27
!WindowBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    28
89
claus
parents: 86
diff changeset
    29
copyright
claus
parents: 86
diff changeset
    30
"
claus
parents: 86
diff changeset
    31
 COPYRIGHT (c) 1995 by Claus Gittinger
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    32
	      All Rights Reserved
89
claus
parents: 86
diff changeset
    33
claus
parents: 86
diff changeset
    34
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
    35
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
    36
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
    37
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
    38
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    39
 hereby transferred.
claus
parents: 86
diff changeset
    40
"
claus
parents: 86
diff changeset
    41
!
claus
parents: 86
diff changeset
    42
66
claus
parents:
diff changeset
    43
documentation
claus
parents:
diff changeset
    44
"
69
claus
parents: 66
diff changeset
    45
    a no-op class, for systems which do not use the UIBuilder.
66
claus
parents:
diff changeset
    46
    Concrete subclasses know how to create a view (with components) from
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    47
    some interface spec.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    48
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    49
    The order of the lookup sequence to access an aspect is defined:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    50
	application
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    51
	application class
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    52
	additional  class (applicationClass).
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    53
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    54
    Methods to access any aspect are located in the category
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    55
    'spec creation aspect fetch'.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    56
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
    57
    Currently, an experimantal version of UIBuilder exists,
66
claus
parents:
diff changeset
    58
    and more may be added in the future (for example, to parse different UI
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
    59
    specs - thinking of motifs UIL specs, Windows DialogSpecs etc.).
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    60
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    61
    [instance variables:]
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    62
	window          <View>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    63
				the topView into which the components
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    64
				are (have been) created from the specification
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    65
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    66
	application     <ApplicationModel>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    67
				the application object (typically an instance
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    68
				of a subclass of ApplicationModel).
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    69
				That one is usually supposed to provide
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    70
				valueHolders for aspects, action methods
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    71
				menuSpecs and possibly more windowSpecs.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    72
				Usually means, that most of those can also be
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    73
				provided to the builder via a set of bindings,
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    74
				which overrides those.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    75
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    76
	bindings        <Dictionary>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    77
				can be set (or filled) with bindings for
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    78
				aspects to be used when setting up the models
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    79
				for components. Useful either to overwrite
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    80
				corresponding appModel aspects or if the appModel
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    81
				does not want to procide those.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    82
				(for example, to open a dialog and provide the
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    83
				 bindings in a dictionary - as opposed to
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    84
				 providing them via aspect methods)
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    85
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    86
	visuals                 not yet used - for compatibility
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    87
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    88
	focusSequence   <Collection>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    89
				maintained during the build process;
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    90
				contains tabable components.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    91
				This will be replaced by a more intelligent
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    92
				mechanism in the near future.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    93
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    94
	namedComponents <Dictionary>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    95
				contains name->component associations for
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    96
				all components which have a non-nil component
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    97
				name. Created during the build process.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    98
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
    99
	helpKeys                not yet used - for compatibility
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   100
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   101
	componentCreationHook <BlockOrNil>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   102
				can be set before the components are built
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   103
				from the spec, to provide an arbitrary
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   104
				callBacks-hook which will be invoked after
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   105
				a component has been created from a spec.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   106
				The UIPainter uses this to maintain its
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   107
				component<->spec assiciations.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   108
				Can be set by the app, to catch creation of
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   109
				components and fiddle around during the
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   110
				creation process (change extents, colors or whatever)
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   111
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   112
	applicationClass <ClassOrNil>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   113
				can be set to provide an additional class which
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   114
				is asked for aspects during the build process.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   115
				If not set, the app is asked, which itself asks
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   116
				its class.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   117
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   118
	keyboardProcessor       not yet used - for compatibility
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   119
				Will eventually takeover the functionality
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   120
				of the focusSequence, shortcuts & provide a hook
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   121
				for the app.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   122
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   123
	subCanvasSpecs <Dictionary>
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   124
				can be set by the app to provide subcanvas
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   125
				specs (much like the bindings dictionary)
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   126
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
   127
    [author:]
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   128
	Claus Gittinger
66
claus
parents:
diff changeset
   129
"
claus
parents:
diff changeset
   130
! !
claus
parents:
diff changeset
   131
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   132
!WindowBuilder class methodsFor:'debugging'!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   133
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   134
stopOnError:aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   135
    "enable/disable debug halt when aspects are missing.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   136
     Useful during development, to detect missing aspects.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   137
     The default is off."
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   138
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   139
    StopOnError := aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   140
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   141
    "Modified: / 4.8.1998 / 19:40:09 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   142
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   143
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   144
verbose:aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   145
    "enable/disable debug messages on the Transcript.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   146
     Useful during development, to detect missing aspects.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   147
     The default is off."
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   148
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   149
    Verbose := aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   150
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   151
    "Created: / 4.8.1998 / 19:39:37 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   152
    "Modified: / 4.8.1998 / 19:40:14 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   153
! !
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   154
1763
fabe0b506e33 method category rename
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
   155
!WindowBuilder methodsFor:'Compatibility-VW'!
974
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   156
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   157
source
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   158
    "same as #application, for ST-80 compatibility"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   159
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   160
    ^ application
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   161
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   162
    "Created: 17.1.1997 / 19:03:51 / cg"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   163
!
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   164
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   165
source:anApplicationModel
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   166
    "same as #application:, for ST-80 compatibility"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   167
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   168
    application := anApplicationModel
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   169
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   170
    "Modified: 17.1.1997 / 19:03:57 / cg"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   171
! !
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   172
66
claus
parents:
diff changeset
   173
!WindowBuilder methodsFor:'accessing'!
claus
parents:
diff changeset
   174
463
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   175
addBindings:moreBindings
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   176
    "used with subDialogs, which provide local bindings.
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   177
     All bindings from moreBindings overwrite any local bindings."
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   178
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   179
    moreBindings notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   180
	bindings isNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   181
	    bindings := IdentityDictionary new
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   182
	].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   183
	bindings addAll:moreBindings
463
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   184
    ]
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   185
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   186
    "Created: 28.2.1997 / 14:14:33 / cg"
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   187
!
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   188
100
claus
parents: 99
diff changeset
   189
application
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   190
    "return the application (an ApplicationModel),
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   191
     for which the view is built.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   192
     This one is supposed to provide the aspects, menus etc."
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   193
100
claus
parents: 99
diff changeset
   194
    ^ application
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   195
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   196
    "Modified: 17.1.1997 / 19:04:40 / cg"
66
claus
parents:
diff changeset
   197
!
claus
parents:
diff changeset
   198
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   199
application:anApplicationModel
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   200
    "set the application (an ApplicationModel),
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   201
     for which the view is built.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   202
     This one is supposed to provide the aspects, menus etc."
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   203
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   204
    application := anApplicationModel
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   205
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   206
    "Modified: 17.1.1997 / 19:04:47 / cg"
66
claus
parents:
diff changeset
   207
!
claus
parents:
diff changeset
   208
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   209
applicationClass
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   210
    "return the value of the instance variable 'applicationClass' (automatically generated).
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   211
     WARNING:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   212
	This is a private interface for the UIPainter to pass down the app-class
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   213
	to the specs when editing."
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   214
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   215
    ^ applicationClass
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   216
!
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   217
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   218
applicationClass:something
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   219
    "set the value of the instance variable 'applicationClass' (automatically generated).
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   220
     WARNING:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   221
	 This is a private interface for the UIPainter to pass down the app-class
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   222
	 to the specs when editing."
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   223
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   224
    applicationClass := something.
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   225
!
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   226
66
claus
parents:
diff changeset
   227
aspectAt:aSymbol
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   228
    "return the aspect for a symbol or nil."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   229
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   230
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   231
	aspectAt:aSymbol
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   232
	ifAbsent:[self aspectNotFound:aSymbol error:'no aspect for:']
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   233
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   234
    "Modified: / 4.8.1998 / 19:29:36 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   235
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   236
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   237
aspectAt:aSymbol ifAbsent:exceptionBlock
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   238
    "return the aspect for a symbol or the value from exceptionBlock."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   239
433
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   240
    |b|
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   241
473
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   242
    aSymbol notNil ifTrue:[
2933
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   243
        bindings notNil ifTrue:[
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   244
            b := bindings at:aSymbol ifAbsent:nil.
4070
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   245
            b notNil ifTrue:[
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   246
                ^ b
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   247
            ].
2933
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   248
        ].
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   249
2933
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   250
        application notNil ifTrue:[
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   251
            MessageNotUnderstood
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   252
                ignoreNotUnderstoodOf:aSymbol
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   253
                in:[
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   254
                    ^ application aspectFor:aSymbol
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   255
                ].
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   256
            MessageNotUnderstood
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   257
                ignoreNotUnderstoodOf:aSymbol
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   258
                in:[
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   259
                    ^ application class aspectFor:aSymbol
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   260
                ].
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   261
        ]
433
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   262
    ].
4070
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   263
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   264
    ^ exceptionBlock value.
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   265
2933
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   266
    "Created: / 04-08-1998 / 19:28:30 / cg"
6e96dc9ee4dd changed: #aspectAt:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 2899
diff changeset
   267
    "Modified: / 25-07-2011 / 15:29:25 / cg"
4070
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   268
    "Modified (format): / 20-02-2018 / 11:36:07 / stefan"
66
claus
parents:
diff changeset
   269
!
claus
parents:
diff changeset
   270
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   271
aspectAt:aSymbol put:aModel
2499
8b652f5e5757 no change
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
   272
    "store an aspect identified by its symbol and its value.
8b652f5e5757 no change
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
   273
     Returns the stored aspect !!"
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   274
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   275
    bindings isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   276
	bindings := IdentityDictionary new
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   277
    ].
2499
8b652f5e5757 no change
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
   278
    bindings at:aSymbol put:aModel.
8b652f5e5757 no change
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
   279
    ^ aModel
100
claus
parents: 99
diff changeset
   280
!
claus
parents: 99
diff changeset
   281
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   282
bindingAt:aSymbol
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   283
    "return the binding for a symbol or nil if there is none"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   284
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   285
    bindings notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   286
	^ bindings at:aSymbol ifAbsent:nil.
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   287
    ].
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   288
    ^ nil
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   289
!
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   290
4070
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   291
bindingAt:aSymbol ifAbsentPut:anAspectOrBlock
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   292
    "return the binding for a symbol or nil if there is none"
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   293
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   294
    bindings isNil ifTrue:[
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   295
        bindings := IdentityDictionary new
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   296
    ].
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   297
    ^ bindings at:aSymbol ifAbsentPut:anAspectOrBlock.
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   298
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   299
    "Created: / 20-02-2018 / 09:59:56 / stefan"
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   300
!
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
   301
100
claus
parents: 99
diff changeset
   302
bindings
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   303
    "return my bindings"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   304
3415
99eb49319410 class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3336
diff changeset
   305
    bindings isNil ifTrue:[
99eb49319410 class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3336
diff changeset
   306
        bindings := IdentityDictionary new.
99eb49319410 class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3336
diff changeset
   307
    ].
100
claus
parents: 99
diff changeset
   308
    ^ bindings
2744
166029185d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2690
diff changeset
   309
166029185d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2690
diff changeset
   310
    "Modified: / 20-04-2005 / 18:59:28 / janfrog"
100
claus
parents: 99
diff changeset
   311
!
claus
parents: 99
diff changeset
   312
claus
parents: 99
diff changeset
   313
bindings:aDictionary
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   314
    "set bindings to a dictionary"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   315
100
claus
parents: 99
diff changeset
   316
    bindings := aDictionary
claus
parents: 99
diff changeset
   317
!
claus
parents: 99
diff changeset
   318
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   319
componentAt:name
1673
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   320
    "return a component identified by its name"
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   321
1673
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   322
    |widget|
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   323
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   324
    namedComponents notNil ifTrue:[
3776
3450a77da035 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3701
diff changeset
   325
        widget := namedComponents at:name asSymbol ifAbsent:nil.
3450a77da035 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3701
diff changeset
   326
        widget notNil ifTrue:[^ widget].
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   327
    ].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   328
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   329
    "/ cg the following code looks in any application-
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   330
    "/ or master applications builder for the component.
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   331
    "/ This has an effect, if a subcanvases builder is asked for
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   332
    "/ a component, which is actually held by the real-apps builder
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   333
    "/ (in case they have different builders).
3776
3450a77da035 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3701
diff changeset
   334
    "/ For now, this code is disabled, since I don't know what effect this
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   335
    "/ has to existing code ...
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   336
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   337
"/    application notNil ifTrue:[
1673
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   338
"/        |appBuilder masterApplication masterBuilder|
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   339
"/
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   340
"/        (appBuilder := application builder) notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   341
"/            appBuilder ~~ self ifTrue:[
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   342
"/                ^ appBuilder componentAt:name
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   343
"/            ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   344
"/        ].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   345
"/
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   346
"/        (masterApplication := application masterApplication) notNil ifTrue:[
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   347
"/            (masterBuilder := masterApplication builder) notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   348
"/                masterBuilder ~~ self ifTrue:[
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   349
"/                    ^ masterBuilder componentAt:name
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   350
"/                ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   351
"/            ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   352
"/        ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   353
"/    ].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   354
    ^ nil
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   355
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   356
100
claus
parents: 99
diff changeset
   357
componentAt:name put:aComponent
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   358
    "store a component identified by its name."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   359
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   360
    namedComponents isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   361
	namedComponents := IdentityDictionary new.
100
claus
parents: 99
diff changeset
   362
    ].
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   363
    namedComponents at:name asSymbol put:aComponent
100
claus
parents: 99
diff changeset
   364
!
claus
parents: 99
diff changeset
   365
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   366
componentCreationHook:something
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   367
    "set the value of the instance variable 'componentCreationHook' (automatically generated)"
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   368
1447
879dc0a647c2 checkin from browser
ps
parents: 1395
diff changeset
   369
    componentCreationHook := something.
879dc0a647c2 checkin from browser
ps
parents: 1395
diff changeset
   370
!
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   371
2460
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   372
componentToSpecMappingAt:aView
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   373
    componentToSpecMapping isNil ifTrue:[^ nil].
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   374
    ^ componentToSpecMapping at:aView ifAbsent:nil
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   375
!
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   376
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   377
componentToSpecMappingAt:aView put:aSpec
2462
0a33b3afa11a fixed componentToSpec mapping for uiSUBspecs;
sr
parents: 2460
diff changeset
   378
0a33b3afa11a fixed componentToSpec mapping for uiSUBspecs;
sr
parents: 2460
diff changeset
   379
    "/ self assert:(aSpec isKindOf:UISpecification).
0a33b3afa11a fixed componentToSpec mapping for uiSUBspecs;
sr
parents: 2460
diff changeset
   380
2460
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   381
    componentToSpecMapping isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   382
	componentToSpecMapping := IdentityDictionary new.
2460
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   383
    ].
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   384
    componentToSpecMapping at:aView put:aSpec
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   385
!
95f06b540382 remember view - to - spec mapping during build.
sr
parents: 2434
diff changeset
   386
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   387
findComponentAt:name
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   388
    "recursively search for a component identified by its name in myself
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   389
     and all of my subApplications."
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   390
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   391
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   392
	findComponentAt:name
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   393
	forWhichViewConformsTo:[:v | true]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   394
	ignoringViews:(IdentitySet new).
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   395
!
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   396
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   397
findComponentAt:name forWhichViewConformsTo:viewCheck ignoringViews:triedViews
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   398
    "recursively search for a visible component identified by its name in myself
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   399
     and all of my subApplications.
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   400
     As a builders applications view might be different from the builders view,
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   401
     we must be careful to avoid endless recursion if a subview refers to the topviews builder,
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   402
     (sigh)"
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   403
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   404
    |comp "window" app b|
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   405
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   406
    (comp := self componentAt:name) notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   407
	^ comp
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   408
    ].
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   409
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   410
    window isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   411
	^ self
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   412
    ].
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   413
    "/ window := self application window.
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   414
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   415
    (triedViews includes:window) ifTrue:[^ nil].
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   416
    triedViews add:window.
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   417
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   418
    window allSubViewsDo:[:v |
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   419
	(triedViews includes:v) ifFalse:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   420
	    triedViews add:v.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   421
	    (viewCheck value:v) ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   422
		((app := v application) notNil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   423
		and:[(b := app builder) notNil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   424
		and:[b ~~ self]])
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   425
		ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   426
		    comp := b findComponentAt:name forWhichViewConformsTo:viewCheck ignoringViews:triedViews.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   427
		    comp notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   428
			^ comp
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   429
		    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   430
		]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   431
	    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   432
	]
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   433
    ].
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   434
    ^ nil
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   435
!
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   436
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   437
findVisibleComponentAt:name
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   438
    "recursively search for a visible component identified by its name in myself
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   439
     and all of my subApplications.
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   440
     Be careful: this also searches for components in unmapped canvases."
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   441
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   442
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   443
	findComponentAt:name
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   444
	forWhichViewConformsTo:[:v | v shown]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   445
	ignoringViews:(IdentitySet new).
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   446
!
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   447
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   448
helpKeyFor:aComponent
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   449
    "return the helpkey for a component or nil"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   450
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   451
    |v key|
885bd39df8df access help key
ca
parents: 598
diff changeset
   452
885bd39df8df access help key
ca
parents: 598
diff changeset
   453
    v := aComponent.
885bd39df8df access help key
ca
parents: 598
diff changeset
   454
    [v notNil] whileTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   455
	(key := v helpKey) notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   456
	    ^ key
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   457
	].
2077
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   458
"/        helpKeys notNil ifTrue:[
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   459
"/            (key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   460
"/                ^ key
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   461
"/            ].
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   462
"/        ].
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   463
	v := v superView
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   464
    ].
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   465
    ^ nil
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   466
!
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   467
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   468
helpKeyFor:aComponent put:aKey
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   469
    "assign a key for a component which is used to access the help text
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   470
     from the application."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   471
2077
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   472
    aComponent helpKey:aKey.
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   473
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   474
"/    aKey isNil ifTrue:[
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   475
"/        helpKeys isNil ifFalse:[
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   476
"/            helpKeys removeKey:aComponent ifAbsent:nil
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   477
"/        ]
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   478
"/    ] ifFalse:[
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   479
"/        helpKeys isNil ifTrue:[
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   480
"/            helpKeys := IdentityDictionary new
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   481
"/        ].
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   482
"/        helpKeys at:aComponent put:aKey
33117b22f7e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   483
"/    ]
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   484
!
15d80dd3d974 help text
ca
parents: 587
diff changeset
   485
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   486
keyboardProcessor
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   487
    "return my keyboard processor"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   488
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   489
    keyboardProcessor isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   490
	keyboardProcessor := KeyboardProcessor new
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   491
    ].
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   492
    ^ keyboardProcessor
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   493
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   494
    "Created: 3.3.1997 / 18:31:37 / cg"
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   495
    "Modified: 3.3.1997 / 18:32:27 / cg"
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   496
!
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   497
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   498
keyboardProcessor:aKeyboardProcessor
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   499
    "set my keyboard processor"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   500
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   501
    keyboardProcessor := aKeyboardProcessor
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   502
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   503
    "Created: / 18.6.1998 / 19:59:38 / cg"
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   504
!
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   505
855
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   506
labelAt:name
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   507
    labels isNil ifTrue:[^ nil].
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   508
    ^ labels at:name asSymbol ifAbsent:nil
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   509
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   510
    "Created: / 27.2.1998 / 13:52:28 / cg"
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   511
!
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   512
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   513
labelAt:name put:aLabelString
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   514
    labels isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   515
	labels := IdentityDictionary new.
855
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   516
    ].
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   517
    labels at:name asSymbol put:aLabelString
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   518
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   519
    "Created: / 27.2.1998 / 02:30:54 / cg"
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   520
!
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   521
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   522
menuAt:aKey
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   523
    "Find a binding for the menu named aKey, either in the bindings
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   524
     or from the source"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   525
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   526
    ^ self menuFor:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   527
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   528
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   529
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   530
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   531
menuAt:aSymbol put:someMenuOrHolder
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   532
    "add someMenuOrHolder as the binding for the menu named aSymbol to the bindings"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   533
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   534
    ^ self aspectAt:aSymbol put:someMenuOrHolder
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   535
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   536
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   537
86
claus
parents: 80
diff changeset
   538
namedComponents
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   539
    "return a list of named components"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   540
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   541
    ^ namedComponents
86
claus
parents: 80
diff changeset
   542
!
claus
parents: 80
diff changeset
   543
1971
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   544
namedComponentsDo: aBlock
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   545
    namedComponents notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   546
	namedComponents do:[:aView|
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   547
	    aBlock value: aView
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   548
	]
1971
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   549
    ]
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   550
!
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   551
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   552
resources
3035
f5bb484a1205 class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
   553
    "return the application's resources -
2610
4315c3f2ab4a comment only
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   554
     that's a ResourcePack containing national language strings"
4315c3f2ab4a comment only
Claus Gittinger <cg@exept.de>
parents: 2608
diff changeset
   555
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   556
    application notNil ifTrue:[
3035
f5bb484a1205 class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
   557
        ^ application resources
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   558
    ].
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   559
    ^ Dialog classResources.
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   560
!
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   561
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   562
subCanvasAt:majorKey at:minorKey
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   563
    "get the subCanvas or subSpec specification from major and minor key.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   564
     Here, we first look for a spec in the private subCanvasSpecs dictionary,
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   565
     which can be filled via #specificationAt:at:put: messages.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   566
     If not present, or none is found there, we bounce back trying
824
06de83e3fdee Fix comment.
Stefan Vogel <sv@exept.de>
parents: 774
diff changeset
   567
     #specificationFor: (if majorKey is nil) or by sending the minorKey
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   568
     message to the class named as majorKey.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   569
     Notice, that the class named majorKey is first searched in the
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   570
     application classes namespace - allowing private classes as majorKey."
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   571
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   572
    |spec cls dict dkey|
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   573
1351
42d9de8818bf care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   574
    minorKey isNil ifTrue:[^ nil].
42d9de8818bf care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   575
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   576
    subCanvasSpecs notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   577
	dkey := majorKey ? #NoMajorKey.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   578
	dict := subCanvasSpecs at:dkey ifAbsent:nil.
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   579
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   580
	dict notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   581
	    spec := dict at:minorKey ifAbsent:nil.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   582
	    spec notNil ifTrue:[^ spec].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   583
	].
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   584
    ].
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   585
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   586
    majorKey isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   587
	spec := self specificationFor:minorKey.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   588
	spec isNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   589
	    "fallback for UIPainter"
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   590
	    MessageNotUnderstood catch:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   591
		spec := applicationClass perform:minorKey.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   592
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   593
	].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   594
	^ spec
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   595
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   596
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   597
    application notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   598
	"/ look for class in applications namespace ...
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   599
	cls := application resolveName:majorKey.
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   600
    ] ifFalse:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   601
	"/ fallBack - use that global, if it exists
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   602
	cls := Smalltalk at:majorKey.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   603
	cls isNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   604
	    Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey).
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   605
	].
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   606
    ].
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   607
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   608
    cls notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   609
	MessageNotUnderstood catch:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   610
	    ^ cls specificationFor:minorKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   611
	].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   612
	MessageNotUnderstood catch:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   613
	    ^ cls perform:minorKey.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   614
	]
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   615
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   616
    ^ nil
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   617
!
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   618
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   619
subCanvasAt:majorKey at:minorKey put:aSpec
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   620
    "deposit an interfaceSpecification for major and minor key
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   621
     in my private subCanvasSpecs dictionary.
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   622
     This will be used later, when building,
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   623
     to provide an interfaceSpec for a subcanvas or subSpecification
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   624
     (or possibly override an application provided interfaceSpec).
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   625
     See #subCanvasAt:at:."
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   626
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   627
    |dict key|
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   628
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   629
    subCanvasSpecs isNil ifTrue:[
3683
0ae1b8e19d7c #OTHER by mawalch
mawalch
parents: 3620
diff changeset
   630
        "/ lazily initialize
0ae1b8e19d7c #OTHER by mawalch
mawalch
parents: 3620
diff changeset
   631
        subCanvasSpecs := IdentityDictionary new
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   632
    ].
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   633
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   634
    key := majorKey ? #NoMajorKey.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   635
    dict := subCanvasSpecs at:key ifAbsent:nil.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   636
    dict isNil ifTrue:[
3683
0ae1b8e19d7c #OTHER by mawalch
mawalch
parents: 3620
diff changeset
   637
        dict := IdentityDictionary new.
0ae1b8e19d7c #OTHER by mawalch
mawalch
parents: 3620
diff changeset
   638
        subCanvasSpecs at:key put:dict
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   639
    ].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   640
    dict at:minorKey put:aSpec
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   641
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   642
    "Modified: / 27.1.1998 / 12:21:27 / cg"
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   643
    "Modified: / 5.2.1998 / 12:05:32 / stefan"
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   644
!
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   645
475
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   646
visualAt:name
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   647
    visuals isNil ifTrue:[^ nil].
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   648
    ^ visuals at:name asSymbol ifAbsent:nil
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   649
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   650
    "Created: 3.3.1997 / 16:24:17 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   651
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   652
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   653
visualAt:name put:aVisual
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   654
    visuals isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   655
	visuals := IdentityDictionary new.
475
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   656
    ].
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   657
    visuals at:name asSymbol put:aVisual
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   658
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   659
    "Created: 3.3.1997 / 16:24:41 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   660
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   661
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   662
visuals
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   663
    ^ visuals
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   664
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   665
    "Created: 3.3.1997 / 16:24:00 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   666
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   667
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   668
visuals:aDictionary
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   669
    visuals := aDictionary
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   670
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   671
    "Created: 3.3.1997 / 16:24:06 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   672
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   673
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   674
window
1995
6b94d8ebe2c6 *** empty log message ***
ca
parents: 1993
diff changeset
   675
    "return the top window (view), for which an interface is (being) built"
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   676
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   677
    ^ window
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   678
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   679
    "Modified: 17.1.1997 / 19:30:00 / cg"
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   680
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   681
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   682
window:aView
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   683
    "set the top window (view), for which an interface
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   684
     is (being) built"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   685
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   686
    window := aView
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   687
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   688
    "Modified: 17.1.1997 / 19:30:22 / cg"
66
claus
parents:
diff changeset
   689
!
claus
parents:
diff changeset
   690
claus
parents:
diff changeset
   691
windowGroup
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   692
    ^ window windowGroup
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   693
608
1cd72d2d7e3b removed debugHalt
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   694
    "Modified: 17.6.1997 / 18:04:01 / cg"
3470
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   695
!
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   696
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   697
windowTitle:aString
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   698
    "if the window is already created, change its title.
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   699
     Otherwise, remember the title to be set when the window is created later"
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   700
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   701
    windowTitle := aString.
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   702
    window notNil ifTrue:[
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   703
        window label:aString
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   704
    ].
66
claus
parents:
diff changeset
   705
! !
claus
parents:
diff changeset
   706
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   707
!WindowBuilder methodsFor:'aspect access support'!
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   708
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   709
booleanValueAspectFor:aKey
674
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   710
    "helper (common code) to generate a boolean aspect if required.
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   711
     If no binding exists for aKey, a valueHolder holding false is
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   712
     created and added to the bindings.
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   713
     Otherwise, the existing binding is returned."
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   714
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   715
    ^ self valueAspectFor:aKey initialValue:false
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   716
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   717
    "Modified: 28.7.1997 / 12:53:57 / cg"
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   718
!
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   719
1198
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   720
listAspectFor:aKey
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   721
    "helper (common code) to generate a list model aspect if required.
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   722
     If no binding exists for aKey, a new List is
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   723
     created and added to the bindings.
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   724
     Otherwise, the existing binding is returned."
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   725
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   726
    |list|
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   727
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   728
    (list := self bindingAt:aKey) isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   729
	self aspectAt:aKey put:(list := List new).
1198
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   730
    ].
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   731
    ^ list
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   732
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   733
    "Created: 28.7.1997 / 12:53:45 / cg"
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   734
    "Modified: 28.7.1997 / 12:54:13 / cg"
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   735
!
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   736
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   737
nilValueAspectFor:aKey
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   738
    "helper (common code) to generate a valueHolder aspect if required.
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   739
     If no binding exists for aKey, a valueHolder holding nil is
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   740
     created and added to the bindings.
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   741
     Otherwise, the existing binding is returned."
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   742
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   743
    ^ self valueAspectFor:aKey initialValue:nil
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   744
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   745
    "Modified: 28.7.1997 / 12:54:06 / cg"
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   746
!
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   747
4097
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   748
valueAspectFor:aKey
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   749
    "helper (common code) to generate a valueHolder aspect if required.
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   750
     If no binding exists for aKey, a valueHolder holding nil is
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   751
     created and added to the bindings.
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   752
     Otherwise, the existing binding is returned."
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   753
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   754
    ^ self valueAspectFor:aKey initialValue:nil
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   755
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   756
    "Created: / 31-05-2018 / 08:43:56 / Claus Gittinger"
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   757
!
662d9ae4818f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4070
diff changeset
   758
2403
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   759
valueAspectFor:aKey computeInitialValueWith:initialValueBlock
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   760
    "helper (common code) to generate a valueHolder aspect if required.
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   761
     If no binding exists for aKey, a valueHolder holding initialValue is
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   762
     created and added to the bindings.
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   763
     Otherwise, the existing binding is returned.
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   764
     The initial value is computed by evaluating initialValueBlock"
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   765
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   766
    |holder|
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   767
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   768
    (holder := self bindingAt:aKey) isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   769
	self aspectAt:aKey put:(holder := initialValueBlock value asValue).
2403
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   770
    ].
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   771
    ^ holder
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   772
!
e9733679fa92 changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
   773
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   774
valueAspectFor:aKey initialValue:initialValue
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   775
    "helper (common code) to generate a valueHolder aspect if required.
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   776
     If no binding exists for aKey, a valueHolder holding initialValue is
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   777
     created and added to the bindings.
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   778
     Otherwise, the existing binding is returned."
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   779
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   780
    |holder|
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   781
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   782
    (holder := self bindingAt:aKey) isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   783
	self aspectAt:aKey put:(holder := initialValue asValue).
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   784
    ].
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   785
    ^ holder
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   786
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   787
    "Created: 28.7.1997 / 12:53:45 / cg"
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   788
    "Modified: 28.7.1997 / 12:54:13 / cg"
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   789
! !
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   790
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   791
!WindowBuilder methodsFor:'building'!
66
claus
parents:
diff changeset
   792
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   793
buildFromSpec:aSpec
176
3890e2b312e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   794
    ^ self subclassResponsibility
408
93582137e1c7 tabable
ca
parents: 374
diff changeset
   795
!
93582137e1c7 tabable
ca
parents: 374
diff changeset
   796
93582137e1c7 tabable
ca
parents: 374
diff changeset
   797
makeTabable:aComponent
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   798
    "add a component to the list of tabable components"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   799
1315
f2402458bf27 change makeTabable:
ca
parents: 1307
diff changeset
   800
    aComponent canTab:true
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   801
1123
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   802
!
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   803
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   804
setupWindowFor:aWindow
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   805
    self subclassResponsibility
66
claus
parents:
diff changeset
   806
! !
100
claus
parents: 99
diff changeset
   807
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   808
!WindowBuilder methodsFor:'error handling'!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   809
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   810
aspectNotFound:anAspect error:aString
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   811
    "show error message on transcript (if Verbose is true)
1825
19ccea76d6b3 Do not use #halt
Stefan Vogel <sv@exept.de>
parents: 1774
diff changeset
   812
     and/or stop (if StopOnError) is true"
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   813
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   814
    Verbose == true ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   815
	Transcript showCR:('WindowBuilder: %1 aspect: <%2>' bindWith:aString with:anAspect storeString).
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   816
	application notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   817
	     Transcript showCR:('WindowBuilder: (while building for %1)' bindWith:application class name).
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   818
	].
1028
4f3401b606bd better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents: 1010
diff changeset
   819
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   820
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   821
    StopOnError == true ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   822
	self halt:'aspect not found'        "/ set StopOnError to true to debug end-user apps
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   823
    ].
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   824
    ^ nil
1028
4f3401b606bd better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents: 1010
diff changeset
   825
1395
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
   826
    "Modified: / 18.8.2000 / 14:10:59 / cg"
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   827
! !
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   828
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   829
!WindowBuilder methodsFor:'message sending'!
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   830
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   831
safelyPerform:aSelector ifNone:aBlock
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   832
    "send the message aSelector to the application;
2558
1321c3147d10 changed #safelyPerform:ifNone:
Stefan Vogel <sv@exept.de>
parents: 2546
diff changeset
   833
     the result returned from the send or nil is returned"
1321c3147d10 changed #safelyPerform:ifNone:
Stefan Vogel <sv@exept.de>
parents: 2546
diff changeset
   834
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   835
    |handlerBlock|
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   836
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   837
    aSelector notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   838
	handlerBlock := [:ex|
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   839
			    (ex selector ~~ aSelector) ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   840
				ex reject
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   841
			    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   842
			].
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   843
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   844
	application notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   845
	    MessageNotUnderstood handle:handlerBlock do:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   846
		^ application perform:aSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   847
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   848
	    MessageNotUnderstood handle:handlerBlock do:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   849
		^ application class perform:aSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   850
	    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   851
	].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   852
	"
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   853
	 WARNING:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   854
	    This is a private interface for the UIPainter to pass down the app-class
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   855
	"
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   856
	applicationClass notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   857
	    MessageNotUnderstood handle:handlerBlock do:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   858
		^ applicationClass perform:aSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   859
	    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   860
	]
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   861
    ].
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   862
    ^ aBlock value
981
6a9c975543ad also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   863
6a9c975543ad also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   864
    "Modified: / 20.6.1998 / 11:52:19 / cg"
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   865
!
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   866
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   867
safelyPerform:aSelector with:anArgument ifNone:aBlock
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   868
    "send the one-arg-message aSelector to the application;
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   869
     the result returned from the send or nil is returned"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   870
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   871
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   872
	safelyPerform:aSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   873
	withArguments:(Array with:anArgument)
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   874
	ifNone:aBlock
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   875
!
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   876
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   877
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   878
    "send the two-arg-message aSelector to the application;
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   879
     the result returned from the send or nil is returned"
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   880
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   881
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   882
	safelyPerform:aSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   883
	withArguments:(Array with:arg1 with:arg2)
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   884
	ifNone:aBlock
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   885
!
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   886
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   887
safelyPerform:aSelector with:arg1 with:arg2 with:arg3 ifNone:aBlock
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   888
    "send the 3-arg-message aSelector to the application;
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   889
     the result returned from the send or nil is returned"
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   890
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   891
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   892
	safelyPerform:aSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   893
	withArguments:(Array with:arg1 with:arg2 with:arg3)
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   894
	ifNone:aBlock
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   895
!
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   896
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   897
safelyPerform:aSelector withArguments:arguments ifNone:aBlock
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   898
    "send the one-arg-message aSelector to the application;
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   899
     the result returned from the send or nil is returned"
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
   900
1587
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   901
    |handlerBlock|
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   902
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   903
    aSelector notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   904
	handlerBlock := [:ex| |badSel|
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   905
			    badSel := ex selector.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   906
			    (badSel ~~ aSelector and:[badSel ~~ arguments first]) ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   907
				ex reject
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   908
			    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   909
			].
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   910
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   911
	application notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   912
	    MessageNotUnderstood handle:handlerBlock do:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   913
		^ application perform:aSelector withArguments:arguments
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   914
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   915
	    MessageNotUnderstood handle:handlerBlock do:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   916
		^ application class perform:aSelector withArguments:arguments
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   917
	    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   918
	].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   919
	"
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   920
	 WARNING:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   921
	    This is a private interface for the UIPainter to pass down the app-class
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   922
	"
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   923
	applicationClass notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   924
	    MessageNotUnderstood handle:handlerBlock do:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   925
		^ applicationClass perform:aSelector withArguments:arguments
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   926
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   927
	]
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   928
    ].
1587
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   929
    ^ aBlock value
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   930
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   931
    "Modified: / 4.8.1998 / 19:33:52 / cg"
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   932
! !
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   933
2369
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   934
!WindowBuilder methodsFor:'queries'!
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   935
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   936
isEditing
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   937
    "true if building from a GUI builder resource ( UIPainter, ... ),
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   938
     false if building for the real thing.
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   939
     If true, no models or actions should be set (no application is running)"
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   940
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   941
    ^ false
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   942
! !
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
   943
2546
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   944
!WindowBuilder methodsFor:'resolving fonts'!
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   945
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   946
resolveFont:fontOrSymbolOrStyle
2546
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   947
    "resolve fontOrSymbol to a real font"
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   948
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   949
    |font txtAttribs charAttribs|
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   950
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   951
    fontOrSymbolOrStyle isSymbol ifTrue:[
3309
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   952
        self isEditing ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   953
            "special for UIPainter setup: check class for font"
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   954
            applicationClass notNil ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   955
                font := applicationClass fontFor:fontOrSymbolOrStyle.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   956
            ].
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   957
        ] ifFalse:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   958
            font := application fontFor:fontOrSymbolOrStyle.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   959
        ].
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   960
        font notNil ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   961
            ^ font.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   962
        ].
2546
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   963
3309
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   964
        "/ ST80 style textAttributes
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   965
        (TextAttributes notNil and:[TextAttributes isLoaded]) ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   966
            txtAttribs := TextAttributes styleNamed:fontOrSymbolOrStyle ifAbsent:nil.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   967
            txtAttribs notNil ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   968
                charAttribs := txtAttribs characterAttributes.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   969
                charAttribs notNil ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   970
                    font := charAttribs defaultFont.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   971
                ]
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   972
            ].
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   973
        ].
2546
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   974
3309
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   975
        font isNil ifTrue:[
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   976
            ('Missing font <1p> in <2p>' expandMacrosWith:fontOrSymbolOrStyle with:application class) errorPrintCR.
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   977
        ].
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   978
        ^ font.
2546
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   979
    ].
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   980
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
   981
    ^ Font
3309
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   982
        family:(fontOrSymbolOrStyle family)
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   983
        face:(fontOrSymbolOrStyle face)
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   984
        style:(fontOrSymbolOrStyle style)
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   985
        size:(fontOrSymbolOrStyle size)
6022df917d8d class: WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 3262
diff changeset
   986
        encoding:(fontOrSymbolOrStyle encoding)
2546
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   987
! !
eba039ef14ba Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents: 2529
diff changeset
   988
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   989
!WindowBuilder methodsFor:'spec creation aspect fetch'!
100
claus
parents: 99
diff changeset
   990
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   991
actionFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   992
    "return an action for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   993
     (by the builder) to ask for an ActionButtons actionBlock.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   994
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   995
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   996
     The returned object is typically a block."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   997
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   998
    |b|
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   999
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1000
    bindings notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1001
	b := bindings at:aKey ifAbsent:nil.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1002
	b notNil ifTrue:[^ b].
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1003
    ].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1004
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1005
    ^ self safelyPerform:#actionFor:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1006
		    with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1007
		  ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ]
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
  1008
!
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
  1009
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1010
actionFor:aKey withValue:aValue
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1011
    "return an action for aKey/value combonation.
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1012
     This is invoked during window building
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1013
     (by the builder) to ask for an ActionButtons actionBlock if that button
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1014
     specified an action with an argument value.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1015
     Here, first the local bindings are searched, then the application and
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1016
     finally the applications class is asked for a corresponding action.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1017
     The returned object is typically a block."
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1018
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1019
    |b|
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1020
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1021
    bindings notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1022
	b := bindings at:aKey ifAbsent:nil.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1023
	b notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1024
	    (b isBlock and:[b numArgs == 1]) ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1025
		^ [b value:aValue]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1026
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1027
	    ^ b
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1028
	].
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1029
    ].
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1030
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1031
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1032
	safelyPerform:#actionFor:withValue:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1033
	withArguments:(Array with:aKey with:aValue)
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1034
	ifNone:[ self aspectNotFound:aKey error:'no action for:'.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1035
		 []
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1036
	       ]
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1037
!
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1038
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1039
actionFor:aKey withValue:arg1 withValue:arg2
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1040
    "return an action for aKey/value combination.
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1041
     This is invoked during window building
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1042
     (by the builder) to ask for an ActionButtons actionBlock if that button
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1043
     specified an action with an argument value.
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1044
     Here, first the local bindings are searched, then the application and
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1045
     finally the applications class is asked for a corresponding action.
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1046
     The returned object is typically a block."
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1047
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1048
    |b|
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1049
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1050
    bindings notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1051
	b := bindings at:aKey ifAbsent:nil.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1052
	b notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1053
	    (b isBlock and:[b numArgs == 2]) ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1054
		^ [b value:arg1 value:arg2]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1055
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1056
	    ^ b
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1057
	].
2363
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1058
    ].
e39cf8e7be84 fixed two-argument actions
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
  1059
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1060
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1061
	safelyPerform:#actionFor:withValue:withValue:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1062
	withArguments:(Array with:aKey with:arg1 with:arg2)
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1063
	ifNone:[ self aspectNotFound:aKey error:'no action for:'.  ]
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1064
!
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
  1065
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
  1066
aspectFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1067
    "return a model for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1068
     (by the builder) to ask for an Editfields, a Toggles etc. model.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1069
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1070
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1071
     The returned object is typically a valueHolder."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1072
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1073
    |b|
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1074
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1075
    bindings notNil ifTrue:[
4070
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1076
        b := bindings at:aKey ifAbsent:nil.
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1077
        b notNil ifTrue:[^ b].
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1078
    ].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
  1079
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1080
    ^ self
4070
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1081
        safelyPerform:#aspectFor:
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1082
        with:aKey
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1083
        ifNone:[ self aspectAt:aKey ]
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1084
54520fdc9e29 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3776
diff changeset
  1085
    "Modified: / 20-02-2018 / 12:43:57 / stefan"
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
  1086
!
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
  1087
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1088
aspectFor:aKey ifAbsent:exceptionBlock
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1089
    "return a model for aKey. This is invoked during window building
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1090
     (by the builder) to ask for an Editfields, a Toggles etc. model.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1091
     Here, first the local bindings are searched, then the application and
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1092
     finally the applications class is asked for a corresponding action.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1093
     The returned object is typically a valueHolder."
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1094
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1095
    |b|
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1096
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1097
    bindings notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1098
	b := bindings at:aKey ifAbsent:nil.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1099
	b notNil ifTrue:[^ b].
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1100
    ].
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1101
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1102
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1103
	safelyPerform:#aspectFor:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1104
	with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1105
	ifNone:[ self aspectAt:aKey ifAbsent:exceptionBlock ]
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1106
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1107
423
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
  1108
componentFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1109
    "return a component for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1110
     (by the builder) to ask for an ArbitraryComponents view.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1111
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1112
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1113
     The returned object is typically a view."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1114
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1115
    ^ self safelyPerform:#componentFor:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1116
		    with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1117
		  ifNone:[ self aspectAt:aKey ]
423
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
  1118
!
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
  1119
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1120
labelFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1121
    "return a label for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1122
     (by the builder) to ask for a ???'s label.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1123
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1124
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1125
     The returned object is typically a string."
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1126
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1127
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1128
	safelyPerform:#labelFor:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1129
	with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1130
	ifNone:[ self aspectAt:aKey ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1131
!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1132
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1133
listFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1134
    "return a list for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1135
     (by the builder) to ask for a ???'s label.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1136
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1137
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1138
     The returned object is typically a list."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1139
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1140
    ^ self safelyPerform:#listFor:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1141
		    with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1142
		  ifNone:[ self aspectAt:aKey ]
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1143
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1144
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1145
menuFor:aKey
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1146
    "Find a binding for the menu named aKey, either in the bindings
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1147
     or from the source"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1148
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1149
    |menu|
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1150
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1151
    aKey isNil ifTrue:[^ nil].
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1152
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1153
    (menu := self bindingAt:aKey) notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1154
	^ menu
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1155
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1156
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1157
    menu := self safelyPerform:#menuFor: with:aKey ifNone:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1158
		    self safelyPerform:aKey ifNone:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1159
			self aspectNotFound:aKey error:'no menu for:'.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1160
			nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1161
		    ]
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1162
		 ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1163
862
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
  1164
    menu isBlock ifFalse:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1165
	((menu := menu value) notNil and:[application notNil]) ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1166
	    menu isCollection ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1167
		menu := Menu decodeFromLiteralArray:menu.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1168
		"/ menu receiver:application. -- now done in findGuiResources ...
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1169
	    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1170
	    menu findGuiResourcesIn:application
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1171
	]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1172
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1173
    ^ menu
717
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
  1174
2291
6d46152b7548 no explicit class check
Claus Gittinger <cg@exept.de>
parents: 2288
diff changeset
  1175
    "Modified: / 27-03-2007 / 11:17:22 / cg"
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1176
!
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1177
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1178
specificationFor:aKey
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1179
    "return a specification for aKey. This is invoked during window building
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1180
     (by the builder) to ask for the interfaceSpec for a subCanvas or subSpecification.
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1181
     Here, first the local bindings are searched, then the application and
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1182
     finally the applications class is asked for a corresponding interfaceSPec.
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1183
     The returned object is typically an interfaceSpec array."
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1184
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1185
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1186
	safelyPerform:#specificationFor:
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1187
	with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1188
	ifNone:[ self aspectFor:aKey ]
2690
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1189
!
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1190
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1191
visualFor:aKey
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1192
    "return a visual (icon, image) for aKey. This is invoked during window building
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1193
     (by the builder) to ask for some graphical labels.
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1194
     Here, first the local bindings are searched, then the application and
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1195
     finally the applications class is asked for a corresponding action.
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1196
     The returned object is typically an image or form."
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1197
b42670756688 visualFor fixed
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1198
    ^ self safelyPerform:#visualFor:
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1199
		    with:aKey
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1200
		  ifNone:[ self aspectAt:aKey ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1201
! !
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1202
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1203
!WindowBuilder methodsFor:'spec creation callbacks'!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1204
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1205
createdComponent:aView forSpec:spec named:name
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1206
    "callback from the UISpec after a view has been
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1207
     created for a spec.
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1208
     If it has a name, add it to the namedComponents dictionary;
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1209
     if I have a creationHook (application callBack), evaluate it."
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1210
2369
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1211
    |createCallBackSelector app|
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1212
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1213
    name notNil ifTrue:[
1993
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1214
"/        "/ debugging ...
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1215
"/        (namedComponents notNil and:[namedComponents includesKey:name asSymbol]) ifTrue:[
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1216
"/            Transcript showCR:'WARNING multiple UI-build of: ',name asSymbol
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1217
"/        ].
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1218
	self componentAt:name put:aView.
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1219
    ].
2462
0a33b3afa11a fixed componentToSpec mapping for uiSUBspecs;
sr
parents: 2460
diff changeset
  1220
    spec addView:aView toMappingOfBuilder:self.
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
  1221
    componentCreationHook notNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1222
	componentCreationHook value:aView value:spec value:self
2369
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1223
    ].
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1224
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1225
    self isEditing ifFalse:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1226
	(createCallBackSelector := spec postBuildCallback) notNil ifTrue:[
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1227
	    app := self application.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1228
	    app
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1229
		perform:createCallBackSelector
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1230
		withOptionalArgument:aView
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1231
		and:spec
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1232
		and:self.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1233
	].
2369
d64788a5db31 refactoring
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1234
    ].
100
claus
parents: 99
diff changeset
  1235
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1236
    "Modified: / 5.9.1995 / 21:42:54 / claus"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1237
    "Created: / 31.10.1997 / 18:47:01 / cg"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1238
    "Modified: / 31.10.1997 / 18:51:22 / cg"
100
claus
parents: 99
diff changeset
  1239
! !
claus
parents: 99
diff changeset
  1240
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1241
!WindowBuilder methodsFor:'startup'!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1242
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1243
closeRequest
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1244
    window destroy
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1245
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1246
    "Modified: 17.1.1997 / 19:30:32 / cg"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1247
!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1248
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1249
open
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1250
    "open my topView, as previously created"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1251
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1252
    |type|
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1253
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1254
    application isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1255
	type := #normal
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1256
    ] ifFalse:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1257
	type := application defaultWindowType
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1258
    ].
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1259
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1260
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1261
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1262
	andType:type
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1263
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1264
!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1265
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1266
openAt:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1267
    "open my topView at some location"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1268
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1269
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1270
	openAt:aPoint
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1271
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1272
	andType:(application defaultWindowType)
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1273
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1274
    "Created: 14.2.1997 / 20:21:57 / cg"
467
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
  1275
    "Modified: 28.2.1997 / 22:50:29 / cg"
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1276
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1277
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1278
openDialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1279
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1280
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1281
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1282
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1283
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1284
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1285
	andType:#dialog
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1286
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1287
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1288
openDialogAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1289
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1290
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1291
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1292
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1293
	openAt:aPoint
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1294
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1295
	andType:#dialog
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1296
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1297
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1298
    "Created: 14.2.1997 / 20:24:19 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1299
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1300
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1301
openDialogAt:aPoint withExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1302
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1303
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1304
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1305
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1306
	openAt:aPoint
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1307
	withExtent:ext
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1308
	andType:#dialog
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1309
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1310
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1311
    "Created: 14.2.1997 / 20:24:19 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1312
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1313
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1314
openDialogWithExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1315
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1316
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1317
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1318
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1319
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1320
	withExtent:ext
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1321
	andType:#dialog
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1322
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1323
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1324
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1325
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1326
openModal
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1327
    "open my topView as a modal dialog, as previously created,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1328
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1329
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1330
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1331
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1332
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1333
	andType:#dialog
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1334
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1335
    "Modified: 3.3.1997 / 19:43:57 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1336
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1337
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1338
openPopUpAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1339
    "open my topView, as previously created as a popUp view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1340
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1341
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1342
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1343
	openAt:aPoint
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1344
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1345
	andType:#popUp
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1346
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1347
    "Modified: 17.1.1997 / 19:59:29 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1348
    "Created: 14.2.1997 / 20:24:38 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1349
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1350
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1351
openPopUpIn:aRectangle
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1352
    "open my topView, as previously created as a popUp view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1353
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1354
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1355
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1356
	openAt:aRectangle origin
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1357
	withExtent:aRectangle extent
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1358
	andType:#popUp
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1359
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1360
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1361
openWindow
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1362
    "open my topView"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1363
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1364
    ^ self
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1365
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1366
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1367
	andType:(application defaultWindowType)
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1368
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1369
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1370
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1371
openWindowAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1372
    "open my topView at some location"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1373
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1374
    ^ self
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1375
	openAt:aPoint
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1376
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1377
	andType:(application defaultWindowType)
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1378
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1379
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1380
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1381
openWindowAt:origin withExtent:ext andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1382
    "open my window, as previously created, optionally defining the
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1383
     windows origin and/or extent.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1384
     The type argument may be #dialog or #normal, and specifies if the view
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1385
     should be opened as a modal view, blocking interaction to the currently
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1386
     active view, or as a normal view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1387
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1388
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1389
	openAt:origin
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1390
	withExtent:ext
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1391
	andType:type
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1392
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1393
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1394
openWindowCenter
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1395
    "open my topView centered on the screen (dialog & normal only)"
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1396
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1397
    ^ self
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1398
	openAt:#center
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1399
	withExtent:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1400
	andType:(application defaultWindowType)
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1401
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1402
!
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1403
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1404
openWithExtent:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1405
    "open my topView, as previously created, but override
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1406
     the extent."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1407
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1408
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1409
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1410
	withExtent:aPoint
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1411
	andType:(application defaultWindowType)
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1412
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1413
    "Modified: 17.1.1997 / 19:58:48 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1414
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1415
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1416
openWithExtent:ext andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1417
    "open my window, as previously created. The type argument
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1418
     may be #dialog or #normal, and specifies if the view should
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1419
     be opened as a modal view, blocking interaction to the currently
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1420
     active view, or as a normal view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1421
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1422
    ^ self
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1423
	openAt:nil
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1424
	withExtent:ext
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1425
	andType:type
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1426
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1427
    "Modified: 14.2.1997 / 20:22:47 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1428
! !
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1429
1766
7e15dd50e11a method category rename
Claus Gittinger <cg@exept.de>
parents: 1763
diff changeset
  1430
!WindowBuilder methodsFor:'startup-basic'!
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1431
436
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
  1432
openAt:origin withExtent:ext andType:type
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1433
    "open my window, as previously created, optionally defining the
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1434
     windows origin and/or extent.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1435
     The type argument may be #dialog, #popup or #normal,
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1436
     and specifies if the view should be opened as a
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1437
        modal view (blocking interaction to the currently active view),
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1438
        as popUp (also blocking)
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1439
        or as a normal view."
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1440
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1441
    |appWinClass windowsDevice wg mainWin x y monitorBounds newOrigin|
1359
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1442
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1443
    windowsDevice := window device.
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1444
2873
835095080d19 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  1445
    "/ ********* MULTI SCREEN
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1446
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1447
    wg := WindowGroup activeGroup.
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1448
    wg notNil ifTrue:[
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1449
        |mainGroup focusView|
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1450
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1451
        mainGroup := wg mainGroup ? wg.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1452
        focusView := mainGroup focusView.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1453
        focusView notNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1454
            mainWin := focusView topView
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1455
        ] ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1456
            mainGroup notNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1457
                mainWin := (mainGroup topViews ? #())  firstIfEmpty:nil
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1458
            ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1459
        ].
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1460
    ].
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1461
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1462
    origin isPoint ifTrue:[
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1463
        monitorBounds := windowsDevice monitorBoundsAt:origin.
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1464
        window origin:origin.
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1465
    ] ifFalse:[
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1466
        mainWin isNil ifTrue:[
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1467
            monitorBounds := windowsDevice monitorBoundsAt:(windowsDevice pointerPosition).
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1468
        ] ifFalse:[
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1469
            monitorBounds := windowsDevice monitorBoundsAt:(mainWin origin).
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1470
        ].
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1471
    ].
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1472
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1473
    ext notNil ifTrue:[
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1474
        window extent:ext.
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1475
    ] ifFalse:[
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1476
        ((type == #dialog) or:[type == #toolDialog]) ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1477
            window fixSize
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1478
        ]
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1479
    ].
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1480
2896
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1481
    ((type == #dialog) or:[type == #toolDialog or:[ type == #popUp or:[type == #popUpWithFrame]] ]) ifTrue:[
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1482
        ((origin isNil and:[window class forceModalBoxesToOpenAtCenter])
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1483
         or:[origin == #center]) ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1484
            newOrigin := nil.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1485
        ] ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1486
            origin isPoint ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1487
                newOrigin := origin
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1488
            ] ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1489
                mainWin notNil ifTrue:[
2899
807ebeb72418 comment/format in: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2897
diff changeset
  1490
                    "/ newOrigin := device pointerPosition
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1491
                    newOrigin := mainWin bounds center rounded - (window extent // 2).
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1492
                ]
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1493
            ]
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1494
        ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1495
        newOrigin isNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1496
            newOrigin := monitorBounds center rounded - (window extent // 2).
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1497
        ].
2873
835095080d19 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  1498
835095080d19 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  1499
        UserPreferences current forceWindowsIntoMonitorBounds ifTrue:[
3701
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1500
            |usableHeight|
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1501
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1502
            (newOrigin x + window width) > monitorBounds right ifTrue:[
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1503
                x := monitorBounds right - window width - 20.
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1504
                newOrigin := x @ newOrigin y.
3262
74842f3b79eb class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
  1505
            ].
3701
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1506
            (newOrigin y + window height) > monitorBounds bottom ifTrue:[
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1507
                y := monitorBounds bottom - window height - 20.
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1508
                newOrigin := newOrigin x @ y.
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1509
            ].
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1510
            usableHeight := windowsDevice usableHeightAt:newOrigin+window extent.
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1511
            (newOrigin y + window height) > usableHeight ifTrue:[
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1512
                y := usableHeight - window height - 20.
85982bace9f7 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3683
diff changeset
  1513
                newOrigin := newOrigin x @ y.
2873
835095080d19 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  1514
            ].
835095080d19 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  1515
        ].
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1516
        window origin:newOrigin.
2894
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1517
        type == #toolDialog ifTrue:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1518
            window beToolDialog
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1519
        ] ifFalse:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1520
            type == #popUp ifTrue:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1521
                window bePopUpView.
2896
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1522
            ] ifFalse:[
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1523
                type == #popUpWithFrame ifTrue:[
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1524
                    "/ window windowType:type.
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1525
                    window beUndecorated.
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1526
                ]
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1527
            ].
2894
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1528
        ].
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1529
        ^ window openModal.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1530
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1531
2897
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1532
    (type == #normal 
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1533
    or:[type = #slave or:[type = #partner 
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1534
    or:[type = #popUpNotModal 
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1535
    or:[type = #undecorated
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1536
    or:[type = #undecoratedResizable]]]]]) ifTrue:[
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1537
        window isNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1538
            application notNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1539
                appWinClass := application applicationWindowClass
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1540
            ] ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1541
                appWinClass := ApplicationWindow
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1542
            ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1543
            self setupWindowFor:appWinClass new.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1544
        ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1545
        origin isPoint ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1546
            |windowExtent newOrg|
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1547
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1548
            windowExtent := window extent.
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1549
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1550
            mainWin notNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1551
                (windowExtent x > mainWin extent x or:[windowExtent y > mainWin extent y]) ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1552
                    newOrg := mainWin bounds center - (windowExtent // 2).
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1553
                ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1554
            ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1555
            newOrg isNil ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1556
                newOrg := monitorBounds center - (windowExtent // 2).
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1557
            ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1558
            window origin:newOrg rounded.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1559
        ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1560
        y := window origin y.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1561
        x := window origin x.
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1562
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1563
        window corner y > monitorBounds bottom ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1564
            y := (monitorBounds bottom - window height) max:(monitorBounds top).
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1565
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1566
        ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1567
        window corner x > monitorBounds right ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1568
            x := (monitorBounds right - window width) max:(monitorBounds left).
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1569
        ].
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1570
        window origin:(x @ y ).
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1571
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1572
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1573
        "/ the following code creates a master-slave relationship, if
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1574
        "/ the masterApplication is not nil.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1575
        "/ Disabled, because: the masterApplication is used to fulfill missing aspects,
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1576
        "/ which has nothing to do with a window master-slave relationship.
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1577
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1578
"/        application masterApplication notNil ifTrue:[
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1579
"/            masterWindow := application masterApplication window.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1580
"/            (masterWindow isMaster or:[masterWindow isSlave or:[masterWindow isPartner]])
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1581
"/            ifFalse:[
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1582
"/                "/ master is neutral - make him a master
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1583
"/                masterWindow beMaster
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1584
"/            ].
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1585
"/            window beSlave.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1586
"/        ].
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1587
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1588
        "/ must be done explicit, by passing an appropriate windowType
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1589
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1590
        type = #slave ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1591
            window beSlave.
2894
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1592
        ] ifFalse:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1593
            type = #partner ifTrue:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1594
                window bePartner.
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1595
            ] ifFalse:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1596
                type == #popUpNotModal ifTrue:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1597
                    window bePopUpView.
2896
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1598
                ] ifFalse:[
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1599
                    type == #undecorated ifTrue:[
96d5a0b6fc56 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  1600
                        window beUndecorated.
2897
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1601
                    ] ifFalse:[
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1602
                        type == #undecoratedResizable ifTrue:[
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1603
                            window beUndecoratedResizable.
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1604
                        ]
ea76bd971a64 changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  1605
                    ].
2894
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1606
                ]
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1607
            ].
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1608
        ].
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1609
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1610
        ((type = #slave or:[type = #partner])
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1611
        and:[ window windowGroup isNil ])
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1612
        ifTrue:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1613
            window openInGroup:(WindowGroup activeGroup).
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1614
        ] ifFalse:[
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1615
            window open.
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1616
        ].
1725
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1617
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1618
"/ the following automatism is probably too cryptic and has too much of a side effect.
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1619
"/ I prefer to leave things as they are: i.e. enforce the programmer to
3470
02a03a835c4f class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
  1620
"/ do things explicit.
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1621
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1622
"/        type = #slave ifTrue:[
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1623
"/            window windowGroup topViews first beMaster
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1624
"/        ].
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1625
        ^ self
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1626
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1627
2894
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1628
"/    type == #popUp ifTrue:[
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1629
"/        window fixPosition:(device pointerPosition).
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1630
"/        ^ window openAsPopUp.
4380670e758e changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
  1631
"/    ].
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1632
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1633
    "
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1634
     if ST-80 supports more types - these may be added later
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1635
    "
1825
19ccea76d6b3 Do not use #halt
Stefan Vogel <sv@exept.de>
parents: 1774
diff changeset
  1636
    self shouldImplement
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1637
2871
e9df4227a57d changed: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
  1638
    "Created: / 14-02-1997 / 20:22:24 / cg"
2899
807ebeb72418 comment/format in: #openAt:withExtent:andType:
Claus Gittinger <cg@exept.de>
parents: 2897
diff changeset
  1639
    "Modified: / 22-03-2011 / 13:31:52 / cg"
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1640
! !
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1641
2529
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1642
!WindowBuilder methodsFor:'translating'!
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1643
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1644
translateString:aString
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1645
    "translate aString to the current language.
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1646
     If there is an application, it knows best what to do"
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1647
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1648
    application isNil ifTrue:[
2870
7ba0a201bbc6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 2822
diff changeset
  1649
	^ self resources string:aString
2529
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1650
    ].
2608
bab5badc2870 formatting only
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
  1651
    ^ application translateString:aString
2529
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1652
! !
c22b95752b7b New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2499
diff changeset
  1653
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1654
!WindowBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1655
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1656
version
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1657
    ^ '$Header$'
2784
a0cdac50e04b comment/format in: #labelFor:
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
  1658
!
a0cdac50e04b comment/format in: #labelFor:
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
  1659
a0cdac50e04b comment/format in: #labelFor:
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
  1660
version_CVS
3620
5c564fa13cb8 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
  1661
    ^ '$Header$'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1662
! !
3262
74842f3b79eb class: WindowBuilder
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
  1663