WindowBuilder.st
author Claus Gittinger <cg@exept.de>
Tue, 14 Jan 1997 18:02:37 +0100
changeset 365 47e0d48fd769
parent 223 b65dc250db8d
child 372 6d7718f3d298
permissions -rw-r--r--
commentary
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
89
claus
parents: 86
diff changeset
     1
"
claus
parents: 86
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
99
claus
parents: 89
diff changeset
     3
	      All Rights Reserved
89
claus
parents: 86
diff changeset
     4
claus
parents: 86
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    10
 hereby transferred.
claus
parents: 86
diff changeset
    11
"
claus
parents: 86
diff changeset
    12
100
claus
parents: 99
diff changeset
    13
Object subclass:#WindowBuilder
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    14
	instanceVariableNames:'topView application bindings aspects focusSequence'
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    15
	classVariableNames:''
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    16
	poolDictionaries:''
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    17
	category:'Interface-Support-UI'
66
claus
parents:
diff changeset
    18
!
claus
parents:
diff changeset
    19
claus
parents:
diff changeset
    20
!WindowBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    21
89
claus
parents: 86
diff changeset
    22
copyright
claus
parents: 86
diff changeset
    23
"
claus
parents: 86
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
99
claus
parents: 89
diff changeset
    25
	      All Rights Reserved
89
claus
parents: 86
diff changeset
    26
claus
parents: 86
diff changeset
    27
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
    28
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
    30
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
    31
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    32
 hereby transferred.
claus
parents: 86
diff changeset
    33
"
claus
parents: 86
diff changeset
    34
!
claus
parents: 86
diff changeset
    35
66
claus
parents:
diff changeset
    36
documentation
claus
parents:
diff changeset
    37
"
69
claus
parents: 66
diff changeset
    38
    a no-op class, for systems which do not use the UIBuilder.
66
claus
parents:
diff changeset
    39
    Concrete subclasses know how to create a view (with components) from
claus
parents:
diff changeset
    40
    some interface spec. Currently, an experimantal version of UIBuilder exists,
claus
parents:
diff changeset
    41
    and more may be added in the future (for example, to parse different UI
claus
parents:
diff changeset
    42
    specs - thinking of motifs UIL specs etc).
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    43
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    44
    [author:]
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    45
        Claus Gittinger
66
claus
parents:
diff changeset
    46
"
claus
parents:
diff changeset
    47
! !
claus
parents:
diff changeset
    48
claus
parents:
diff changeset
    49
!WindowBuilder methodsFor:'accessing'!
claus
parents:
diff changeset
    50
100
claus
parents: 99
diff changeset
    51
application
claus
parents: 99
diff changeset
    52
    ^ application
66
claus
parents:
diff changeset
    53
!
claus
parents:
diff changeset
    54
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    55
application:anApplicationModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    56
    application := anApplicationModel
66
claus
parents:
diff changeset
    57
!
claus
parents:
diff changeset
    58
claus
parents:
diff changeset
    59
aspectAt:aSymbol
claus
parents:
diff changeset
    60
    aspects isNil ifTrue:[^ nil].
claus
parents:
diff changeset
    61
    ^ aspects at:aSymbol ifAbsent:nil
claus
parents:
diff changeset
    62
!
claus
parents:
diff changeset
    63
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    64
aspectAt:aSymbol put:aModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    65
    aspects isNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    66
	aspects := IdentityDictionary new
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    67
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    68
    ^ aspects at:aSymbol put:aModel
100
claus
parents: 99
diff changeset
    69
!
claus
parents: 99
diff changeset
    70
claus
parents: 99
diff changeset
    71
bindings
claus
parents: 99
diff changeset
    72
    ^ bindings
claus
parents: 99
diff changeset
    73
!
claus
parents: 99
diff changeset
    74
claus
parents: 99
diff changeset
    75
bindings:aDictionary
claus
parents: 99
diff changeset
    76
    bindings := aDictionary
claus
parents: 99
diff changeset
    77
!
claus
parents: 99
diff changeset
    78
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    79
componentAt:name
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    80
    bindings isNil ifTrue:[^ nil].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    81
    ^ bindings at:name ifAbsent:nil
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    82
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    83
100
claus
parents: 99
diff changeset
    84
componentAt:name put:aComponent
claus
parents: 99
diff changeset
    85
    bindings isNil ifTrue:[
claus
parents: 99
diff changeset
    86
	bindings := IdentityDictionary new.
claus
parents: 99
diff changeset
    87
    ].
claus
parents: 99
diff changeset
    88
    bindings at:name put:aComponent
claus
parents: 99
diff changeset
    89
!
claus
parents: 99
diff changeset
    90
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    91
focusSequence 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    92
    ^ focusSequence
66
claus
parents:
diff changeset
    93
!
claus
parents:
diff changeset
    94
86
claus
parents: 80
diff changeset
    95
namedComponents
claus
parents: 80
diff changeset
    96
    ^ bindings
claus
parents: 80
diff changeset
    97
!
claus
parents: 80
diff changeset
    98
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    99
source:anApplicationModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   100
    application := anApplicationModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   101
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   102
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   103
window
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   104
    ^ topView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   105
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   106
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   107
window:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   108
    topView := aView
66
claus
parents:
diff changeset
   109
!
claus
parents:
diff changeset
   110
claus
parents:
diff changeset
   111
windowGroup
claus
parents:
diff changeset
   112
    ^ topView windowGroup
claus
parents:
diff changeset
   113
! !
claus
parents:
diff changeset
   114
claus
parents:
diff changeset
   115
!WindowBuilder methodsFor:'operation'!
claus
parents:
diff changeset
   116
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   117
buildFromSpec:aSpec
176
3890e2b312e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   118
    ^ self subclassResponsibility
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   119
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   120
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   121
closeRequest
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   122
    topView destroy
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   123
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   124
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   125
open
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   126
    "open my topView, as previously created"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   127
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   128
    self openWithExtent:nil andType:#normal 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   129
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   130
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   131
openDialog
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   132
    "open my topView, as previously created as a modal view,
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   133
     blocking interaction to the currently active view."
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   134
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   135
    self openWithExtent:nil andType:#dialog
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   136
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   137
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   138
openDialogWithExtent:ext
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   139
    "open my topView, as previously created as a modal view,
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   140
     blocking interaction to the currently active view."
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   141
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   142
    self openWithExtent:ext andType:#dialog
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   143
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   144
80
claus
parents: 75
diff changeset
   145
openWithExtent:aPoint
claus
parents: 75
diff changeset
   146
    "open my topView, as previously created, but override
claus
parents: 75
diff changeset
   147
     the extent."
claus
parents: 75
diff changeset
   148
claus
parents: 75
diff changeset
   149
    self openWithExtent:aPoint andType:#normal 
claus
parents: 75
diff changeset
   150
!
claus
parents: 75
diff changeset
   151
66
claus
parents:
diff changeset
   152
openWithExtent:ext andType:type
80
claus
parents: 75
diff changeset
   153
    "open my topView, as previously created. The type argument
claus
parents: 75
diff changeset
   154
     may be #dialog or #normal, and specifies if the view should
claus
parents: 75
diff changeset
   155
     be opened as a modal view, blocking interaction to the currently 
claus
parents: 75
diff changeset
   156
     active view, or as a normal view."
claus
parents: 75
diff changeset
   157
66
claus
parents:
diff changeset
   158
    ext notNil ifTrue:[
claus
parents:
diff changeset
   159
	topView extent:ext
claus
parents:
diff changeset
   160
    ].
claus
parents:
diff changeset
   161
    type == #dialog ifTrue:[
claus
parents:
diff changeset
   162
	topView openModal.
claus
parents:
diff changeset
   163
	^ self
claus
parents:
diff changeset
   164
    ].
claus
parents:
diff changeset
   165
claus
parents:
diff changeset
   166
    type == #normal ifTrue:[
claus
parents:
diff changeset
   167
	topView open.
claus
parents:
diff changeset
   168
	^ self
claus
parents:
diff changeset
   169
    ].
80
claus
parents: 75
diff changeset
   170
    "
claus
parents: 75
diff changeset
   171
     if ST-80 supports more types - these may be added later
claus
parents: 75
diff changeset
   172
    "
66
claus
parents:
diff changeset
   173
    self halt:'unimplemented'
claus
parents:
diff changeset
   174
! !
100
claus
parents: 99
diff changeset
   175
claus
parents: 99
diff changeset
   176
!WindowBuilder methodsFor:'spec creation callbacks'!
claus
parents: 99
diff changeset
   177
claus
parents: 99
diff changeset
   178
createdComponent:aView forSpec:spec
claus
parents: 99
diff changeset
   179
claus
parents: 99
diff changeset
   180
    "Modified: 5.9.1995 / 21:42:54 / claus"
claus
parents: 99
diff changeset
   181
! !
claus
parents: 99
diff changeset
   182
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   183
!WindowBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   184
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   185
version
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
   186
    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.13 1996-04-25 16:43:54 cg Exp $'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   187
! !