WinBuilder.st
author Claus Gittinger <cg@exept.de>
Thu, 07 Dec 1995 11:34:06 +0100
changeset 134 f83c245371c2
parent 132 0a8fe342ed91
child 176 3890e2b312e0
permissions -rw-r--r--
checkin from browser
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
75
claus
parents: 69
diff changeset
    14
	 instanceVariableNames:'topView application bindings aspects focusSequence'
66
claus
parents:
diff changeset
    15
	 classVariableNames:''
claus
parents:
diff changeset
    16
	 poolDictionaries:''
80
claus
parents: 75
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).
claus
parents:
diff changeset
    43
"
claus
parents:
diff changeset
    44
! !
claus
parents:
diff changeset
    45
claus
parents:
diff changeset
    46
!WindowBuilder methodsFor:'accessing'!
claus
parents:
diff changeset
    47
100
claus
parents: 99
diff changeset
    48
application
claus
parents: 99
diff changeset
    49
    ^ application
66
claus
parents:
diff changeset
    50
!
claus
parents:
diff changeset
    51
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    52
application:anApplicationModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    53
    application := anApplicationModel
66
claus
parents:
diff changeset
    54
!
claus
parents:
diff changeset
    55
claus
parents:
diff changeset
    56
aspectAt:aSymbol
claus
parents:
diff changeset
    57
    aspects isNil ifTrue:[^ nil].
claus
parents:
diff changeset
    58
    ^ aspects at:aSymbol ifAbsent:nil
claus
parents:
diff changeset
    59
!
claus
parents:
diff changeset
    60
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    61
aspectAt:aSymbol put:aModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    62
    aspects isNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    63
	aspects := IdentityDictionary new
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    64
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    65
    ^ aspects at:aSymbol put:aModel
100
claus
parents: 99
diff changeset
    66
!
claus
parents: 99
diff changeset
    67
claus
parents: 99
diff changeset
    68
bindings
claus
parents: 99
diff changeset
    69
    ^ bindings
claus
parents: 99
diff changeset
    70
!
claus
parents: 99
diff changeset
    71
claus
parents: 99
diff changeset
    72
bindings:aDictionary
claus
parents: 99
diff changeset
    73
    bindings := aDictionary
claus
parents: 99
diff changeset
    74
!
claus
parents: 99
diff changeset
    75
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    76
componentAt:name
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    77
    bindings isNil ifTrue:[^ nil].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    78
    ^ bindings at:name ifAbsent:nil
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    79
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    80
100
claus
parents: 99
diff changeset
    81
componentAt:name put:aComponent
claus
parents: 99
diff changeset
    82
    bindings isNil ifTrue:[
claus
parents: 99
diff changeset
    83
	bindings := IdentityDictionary new.
claus
parents: 99
diff changeset
    84
    ].
claus
parents: 99
diff changeset
    85
    bindings at:name put:aComponent
claus
parents: 99
diff changeset
    86
!
claus
parents: 99
diff changeset
    87
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    88
focusSequence 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    89
    ^ focusSequence
66
claus
parents:
diff changeset
    90
!
claus
parents:
diff changeset
    91
86
claus
parents: 80
diff changeset
    92
namedComponents
claus
parents: 80
diff changeset
    93
    ^ bindings
claus
parents: 80
diff changeset
    94
!
claus
parents: 80
diff changeset
    95
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    96
source:anApplicationModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    97
    application := anApplicationModel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    98
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    99
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   100
window
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   101
    ^ topView
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
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   104
window:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   105
    topView := aView
66
claus
parents:
diff changeset
   106
!
claus
parents:
diff changeset
   107
claus
parents:
diff changeset
   108
windowGroup
claus
parents:
diff changeset
   109
    ^ topView windowGroup
claus
parents:
diff changeset
   110
! !
claus
parents:
diff changeset
   111
claus
parents:
diff changeset
   112
!WindowBuilder methodsFor:'operation'!
claus
parents:
diff changeset
   113
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   114
buildFromSpec:aSpec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   115
    self subclassResponsibility
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   116
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   117
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   118
closeRequest
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   119
    topView destroy
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
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   122
open
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   123
    "open my topView, as previously created"
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
    self openWithExtent:nil andType:#normal 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   126
!
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
openDialog
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   129
    "open my topView, as previously created as a modal view,
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   130
     blocking interaction to the currently active view."
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   131
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   132
    self openWithExtent:nil andType:#dialog
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   133
!
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
openDialogWithExtent:ext
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   136
    "open my topView, as previously created as a modal view,
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   137
     blocking interaction to the currently active view."
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   138
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   139
    self openWithExtent:ext andType:#dialog
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   140
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   141
80
claus
parents: 75
diff changeset
   142
openWithExtent:aPoint
claus
parents: 75
diff changeset
   143
    "open my topView, as previously created, but override
claus
parents: 75
diff changeset
   144
     the extent."
claus
parents: 75
diff changeset
   145
claus
parents: 75
diff changeset
   146
    self openWithExtent:aPoint andType:#normal 
claus
parents: 75
diff changeset
   147
!
claus
parents: 75
diff changeset
   148
66
claus
parents:
diff changeset
   149
openWithExtent:ext andType:type
80
claus
parents: 75
diff changeset
   150
    "open my topView, as previously created. The type argument
claus
parents: 75
diff changeset
   151
     may be #dialog or #normal, and specifies if the view should
claus
parents: 75
diff changeset
   152
     be opened as a modal view, blocking interaction to the currently 
claus
parents: 75
diff changeset
   153
     active view, or as a normal view."
claus
parents: 75
diff changeset
   154
66
claus
parents:
diff changeset
   155
    ext notNil ifTrue:[
claus
parents:
diff changeset
   156
	topView extent:ext
claus
parents:
diff changeset
   157
    ].
claus
parents:
diff changeset
   158
    type == #dialog ifTrue:[
claus
parents:
diff changeset
   159
	topView openModal.
claus
parents:
diff changeset
   160
	^ self
claus
parents:
diff changeset
   161
    ].
claus
parents:
diff changeset
   162
claus
parents:
diff changeset
   163
    type == #normal ifTrue:[
claus
parents:
diff changeset
   164
	topView open.
claus
parents:
diff changeset
   165
	^ self
claus
parents:
diff changeset
   166
    ].
80
claus
parents: 75
diff changeset
   167
    "
claus
parents: 75
diff changeset
   168
     if ST-80 supports more types - these may be added later
claus
parents: 75
diff changeset
   169
    "
66
claus
parents:
diff changeset
   170
    self halt:'unimplemented'
claus
parents:
diff changeset
   171
! !
100
claus
parents: 99
diff changeset
   172
claus
parents: 99
diff changeset
   173
!WindowBuilder methodsFor:'spec creation callbacks'!
claus
parents: 99
diff changeset
   174
claus
parents: 99
diff changeset
   175
createdComponent:aView forSpec:spec
claus
parents: 99
diff changeset
   176
claus
parents: 99
diff changeset
   177
    "Modified: 5.9.1995 / 21:42:54 / claus"
claus
parents: 99
diff changeset
   178
! !
claus
parents: 99
diff changeset
   179
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   180
!WindowBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   181
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   182
version
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   183
    ^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.11 1995-12-03 12:30:23 cg Exp $'
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   184
! !