UIBuilder.st
author Claus Gittinger <cg@exept.de>
Sun, 23 Feb 2020 16:01:31 +0100
changeset 4450 c07db2570587
parent 4331 8ce1534313cc
permissions -rw-r--r--
#REFACTORING by exept class: GIFReader comment/format in: #readImage: changed: #fromStream: #writeHeaderFor:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4331
8ce1534313cc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3944
diff changeset
     1
"{ Encoding: utf8 }"
8ce1534313cc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3944
diff changeset
     2
88
claus
parents: 86
diff changeset
     3
"
claus
parents: 86
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
     5
              All Rights Reserved
88
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
"
1389
a25d0cb347cf category only
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
    14
"{ Package: 'stx:libview2' }"
a25d0cb347cf category only
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
    15
3471
fa2a226e3022 class: UIBuilder
Claus Gittinger <cg@exept.de>
parents: 2551
diff changeset
    16
"{ NameSpace: Smalltalk }"
fa2a226e3022 class: UIBuilder
Claus Gittinger <cg@exept.de>
parents: 2551
diff changeset
    17
100
claus
parents: 96
diff changeset
    18
WindowBuilder subclass:#UIBuilder
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    19
	instanceVariableNames:'view currentMenuSelector spec specStack composite lastComponent
1324
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
    20
		compositeView menuBar isEditing showDefaults isSubBuilder'
1032
e2069e722736 move Verbose up
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
    21
	classVariableNames:''
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    22
	poolDictionaries:''
2361
3dad3198f1c4 category change
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
    23
	category:'Interface-Framework'
66
claus
parents:
diff changeset
    24
!
claus
parents:
diff changeset
    25
claus
parents:
diff changeset
    26
!UIBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    27
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    28
copyright
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    29
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    30
 COPYRIGHT (c) 1995 by Claus Gittinger
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    31
              All Rights Reserved
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    32
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    33
 This software is furnished under a license and may be used
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    34
 only in accordance with the terms of that license and with the
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    36
 be provided or otherwise made available to, or used by, any
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    37
 other person.  No title to or ownership of the software is
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    38
 hereby transferred.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    39
"
88
claus
parents: 86
diff changeset
    40
!
claus
parents: 86
diff changeset
    41
66
claus
parents:
diff changeset
    42
documentation
claus
parents:
diff changeset
    43
"
775
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    44
    this class allows parsing windowSpecs as created by ST/X's
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    45
    UIPainter and should be able to handle most of ST-80's specs.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    46
    (and thereby allow to run applications built with this tool).
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    47
    However, it is not guaranteed that all of ST-80's winSpecs are understood.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    48
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    49
    It also provides some rudimentary support for building interfaces
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    50
    programatically, by using #newComposite .. #add: .. #endComposite.
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    51
    This has been added for ST80-compatibility - we do not recommend using
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    52
    that for new ST/X programs.
775
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    53
    Those were added to allow execution of some PD applications.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    54
    The programatic building protocol is not complete and certainly not bug free.
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    55
373
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    56
    Notice: 
775
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    57
        some of this class was implemented using protocol information
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
    58
        from alpha testers, literature and by reading public domain code
373
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    59
        - it may not be complete or compatible to
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    60
        the corresponding ST-80 class. 
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    61
        If you encounter any incompatibilities, please forward a note 
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    62
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    63
775
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    64
    [instance variables:]
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    65
        view                    <View>  
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    66
                                        temporary - holds the view being built
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    67
                                        when creating components using the 
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    68
                                        programmatic building interface.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    69
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    70
        currentMenuSelector             not yet used
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    71
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    72
        spec                    <UISpec>        
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    73
                                        temporary - holds the spec being parsed
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    74
                                        when creating components using the 
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    75
                                        programmatic building interface.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    76
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    77
        specStack               <Collection>
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    78
                                        temporary - holds the spec-stack when
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    79
                                        creating composites using newComposite/
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    80
                                        endComposite,
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    81
                                        while creating components using the 
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    82
                                        programmatic building interface.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    83
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    84
        composite               <SpecCollection>
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    85
                                        temporary - holds the current composite
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    86
                                        when using newComposite/ endComposite,
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    87
                                        while creating components using the 
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    88
                                        programmatic building interface.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    89
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    90
        lastComponent           <View>
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    91
                                        temporary - holds the last component
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    92
                                        being built,
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    93
                                        when creating components using the 
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    94
                                        programmatic building interface.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    95
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    96
        compositeView           <View>
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    97
                                        temporary - holds the current composites
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    98
                                        view, when creating components using the 
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
    99
                                        programmatic building interface.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   100
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   101
        menuBar                         not yet used
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   102
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   103
        isEditing               <Boolean>
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   104
                                        flag which is set when an interface is built
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   105
                                        by the UIPainter (as opposed to being built
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   106
                                        for the application).
3703
ff56d68cc50d #OTHER by mawalch
mawalch
parents: 3471
diff changeset
   107
                                        Changes the way aspects are acquired,
775
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   108
                                        (actually, no models are created/set)
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   109
                                        to prevent false building when no
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   110
                                        real applicationModel is present.
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   111
                                        (as is the case when the painter builds
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   112
                                        components).
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   113
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
   114
    [author:]
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
   115
        Claus Gittinger
66
claus
parents:
diff changeset
   116
"
claus
parents:
diff changeset
   117
! !
claus
parents:
diff changeset
   118
claus
parents:
diff changeset
   119
!UIBuilder class methodsFor:'initialization'!
claus
parents:
diff changeset
   120
claus
parents:
diff changeset
   121
initialize
claus
parents:
diff changeset
   122
    Verbose := false    "/ debugging flag
claus
parents:
diff changeset
   123
! !
claus
parents:
diff changeset
   124
1763
fabe0b506e33 method category rename
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
   125
!UIBuilder methodsFor:'Compatibility-VW'!
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   126
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   127
wrapper
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   128
    "ST/X has no wrappers - return the view here"
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   129
1207
5ca42a599a49 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1204
diff changeset
   130
    ^ view ? window
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   131
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   132
    "Created: / 3.3.1997 / 18:28:31 / cg"
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   133
    "Modified: / 31.10.1997 / 18:42:52 / cg"
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   134
! !
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   135
86
claus
parents: 80
diff changeset
   136
!UIBuilder methodsFor:'accessing'!
claus
parents: 80
diff changeset
   137
751
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   138
isEditing
2368
45f52159c49c refactoring
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
   139
    "true if building from a GUI builder resource ( UIPainter, ... ),
45f52159c49c refactoring
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
   140
     false if building for the real thing.
45f52159c49c refactoring
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
   141
     If true, no models or actions should be set (no application is running)"
45f52159c49c refactoring
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
   142
751
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   143
    ^ isEditing ? false
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   144
!
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   145
3861
bab4837263c0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3740
diff changeset
   146
isEditing:aBoolean
751
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   147
    "true if build from a GUI builder resource ( UIPainter, ... ); if true, no
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   148
     models or actions should be set (no application is running)
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   149
    "
3861
bab4837263c0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3740
diff changeset
   150
    isEditing := aBoolean
bab4837263c0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3740
diff changeset
   151
bab4837263c0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3740
diff changeset
   152
    "Modified (format): / 04-02-2017 / 21:34:52 / cg"
751
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   153
!
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   154
1324
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   155
isSubBuilder
1325
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   156
    "return true, if this uiBuilder is for a subCanvas (i.e. a subApp)
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   157
     as opposed to a topApp builder"
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   158
1324
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   159
    ^ isSubBuilder ? false
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   160
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   161
    "Created: / 29.1.2000 / 16:31:31 / cg"
1325
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   162
    "Modified: / 31.1.2000 / 15:03:09 / cg"
1324
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   163
!
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   164
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   165
isSubBuilder:aBoolean
1325
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   166
    "set/clear the flag, which states that this uiBuilder is for a subCanvas (i.e. a subApp)
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   167
     as opposed to a topApp builder. The default is false."
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   168
1324
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   169
    isSubBuilder := aBoolean
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   170
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   171
    "Created: / 29.1.2000 / 16:31:19 / cg"
1325
dc5d9250e865 comments
Claus Gittinger <cg@exept.de>
parents: 1324
diff changeset
   172
    "Modified: / 31.1.2000 / 15:03:37 / cg"
1324
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   173
!
090574a07b89 added isSubBuilder flag
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
   174
721
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   175
menuBar
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   176
    "return the value of the instance variable 'menuBar' (automatically generated)"
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   177
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   178
    ^ menuBar
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   179
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   180
    "Created: / 27.10.1997 / 16:30:12 / cg"
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   181
!
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   182
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   183
menuBar:something
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   184
    "set the value of the instance variable 'menuBar' (automatically generated)"
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   185
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   186
    menuBar := something.
1246
48f23f3ffb28 delegate menuBar to keyboardProcessor
ca
parents: 1207
diff changeset
   187
    self keyboardProcessor menuBar:menuBar.
721
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   188
1889d708a951 provide a handle to the applications menuBar
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   189
    "Created: / 27.10.1997 / 16:30:13 / cg"
863
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   190
!
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   191
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   192
showDefaults
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   193
    "returns true if the builder is in editing mode and the building
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   194
     components will build a default contents
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   195
    "
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   196
    self isEditing ifTrue:[
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   197
        ^ showDefaults ? false
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   198
    ].
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   199
    ^ false
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   200
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   201
!
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   202
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   203
showDefaults:aBool
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   204
    "true if the builder is in editing mode and the building
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   205
     components will build a default contents
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   206
    "
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   207
    showDefaults := aBool
1145
93aade1b7265 remember the current spec;
tm
parents: 1121
diff changeset
   208
!
93aade1b7265 remember the current spec;
tm
parents: 1121
diff changeset
   209
93aade1b7265 remember the current spec;
tm
parents: 1121
diff changeset
   210
spec
93aade1b7265 remember the current spec;
tm
parents: 1121
diff changeset
   211
    "return the current spec"
93aade1b7265 remember the current spec;
tm
parents: 1121
diff changeset
   212
93aade1b7265 remember the current spec;
tm
parents: 1121
diff changeset
   213
    ^ spec
1204
a043422d0565 checkin from browser
tm
parents: 1145
diff changeset
   214
!
a043422d0565 checkin from browser
tm
parents: 1145
diff changeset
   215
a043422d0565 checkin from browser
tm
parents: 1145
diff changeset
   216
spec:aSpec
a043422d0565 checkin from browser
tm
parents: 1145
diff changeset
   217
    "set the current spec"
a043422d0565 checkin from browser
tm
parents: 1145
diff changeset
   218
a043422d0565 checkin from browser
tm
parents: 1145
diff changeset
   219
    spec := aSpec
1970
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   220
!
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   221
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   222
view
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   223
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   224
    ^view
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   225
!
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   226
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   227
view: something
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   228
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   229
    view := something
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   230
!
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   231
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   232
view:viewArg spec:specArg 
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   233
    "set instance variables (automatically generated)"
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   234
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   235
    view := viewArg.
0becfc45c6cb changes for werner (access to view instvar)
werner
parents: 1772
diff changeset
   236
    spec := specArg.
86
claus
parents: 80
diff changeset
   237
! !
claus
parents: 80
diff changeset
   238
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   239
!UIBuilder methodsFor:'building'!
66
claus
parents:
diff changeset
   240
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   241
buildFromSpec:aSpecOrSpecArray
2367
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   242
    ^ self buildWindowFromSpec:aSpecOrSpecArray
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   243
!
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   244
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   245
buildFromSpec:aSpecArray in:aView
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   246
    "build a window hierarchy according to my spec into an existing view"
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   247
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   248
    spec := UISpecification from:aSpecArray.
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   249
    ^ spec buildViewFor:self in:aView.
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   250
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   251
    "Modified: 3.3.1997 / 18:44:02 / cg"
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   252
!
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   253
2497
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   254
buildViewForSpec:aSpecOrSpecArray in:aView
2381
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   255
    "used when building a subSpec; moved from the UISPec class to here,
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   256
     to allow different behavior in WebBuilder..."
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   257
2497
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   258
    |spec windowSpec|
2381
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   259
2497
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   260
    spec := UISpecification from:aSpecOrSpecArray.
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   261
    spec class == FullSpec ifTrue:[
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   262
        spec component buildViewFor:self in:aView.
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   263
        (windowSpec := spec window) notNil ifTrue:[
2461
b5eebe78cf6e set subSpec attributes (backgroundColor)
sr
parents: 2381
diff changeset
   264
            aView preferredExtent:(windowSpec bounds extent).
b5eebe78cf6e set subSpec attributes (backgroundColor)
sr
parents: 2381
diff changeset
   265
            "/ notice: this assumes, that the embedded spec's attributes are
b5eebe78cf6e set subSpec attributes (backgroundColor)
sr
parents: 2381
diff changeset
   266
            "/ used (for example: bg-color).
b5eebe78cf6e set subSpec attributes (backgroundColor)
sr
parents: 2381
diff changeset
   267
            "/ it would be a good idea to add some overwrite mechanism in
b5eebe78cf6e set subSpec attributes (backgroundColor)
sr
parents: 2381
diff changeset
   268
            "/ the UISubspecification.
b5eebe78cf6e set subSpec attributes (backgroundColor)
sr
parents: 2381
diff changeset
   269
            windowSpec setAttributesIn:aView with:self.
2381
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   270
        ].
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   271
    ] ifFalse:[
2497
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   272
        spec buildViewFor:self in:aView.
2381
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   273
    ].
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   274
!
9be3a9bd23d0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   275
2367
cc70db1e6d78 allow for both a window and a webPage to be built from the same spec
Claus Gittinger <cg@exept.de>
parents: 2361
diff changeset
   276
buildWindowFromSpec:aSpecOrSpecArray
2071
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   277
    spec := UISpecification from:aSpecOrSpecArray.
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   278
    window notNil ifTrue:[
2071
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   279
        spec buildViewFor:self in:window.
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   280
    ] ifFalse:[
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   281
        window := spec buildViewFor:self in:nil.
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   282
    ].
3944
4d859e0633c6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3861
diff changeset
   283
    (windowTitle notNil and:[window isTopView]) ifTrue:[
4d859e0633c6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3861
diff changeset
   284
        window label:windowTitle.
3471
fa2a226e3022 class: UIBuilder
Claus Gittinger <cg@exept.de>
parents: 2551
diff changeset
   285
    ].
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   286
    ^ window
3944
4d859e0633c6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3861
diff changeset
   287
4d859e0633c6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3861
diff changeset
   288
    "Modified: / 17-03-2017 / 17:03:12 / stefan"
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   289
!
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   290
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   291
doFinalHookup
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   292
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   293
    "Created: 14.2.1997 / 14:52:27 / cg"
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   294
!
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   295
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   296
newSubBuilder
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   297
    |builder|
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   298
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   299
    builder := UIBuilder new.
751
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   300
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   301
    builder isEditing:isEditing.
863
8e7411aa5697 show defaults widgets for the UISelectionPanel
tz
parents: 854
diff changeset
   302
    builder showDefaults:showDefaults.
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   303
    builder bindings:(self bindings).
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   304
    builder application:(self application).
854
f4d514d500ad a new builder retrieved by #newSubBuilder will
ca
parents: 848
diff changeset
   305
    "/ builder applicationClass:applicationClass.
751
56a83a3b210c add isEditing; set to true if running UIPainter
ca
parents: 734
diff changeset
   306
  ^ builder
2497
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   307
!
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   308
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   309
rebuildFromSpec:aSpecOrSpecArray
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   310
    "remove what I have and rebuild from a possibily different spec"
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   311
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   312
    |windowBefore|
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   313
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   314
    windowBefore := self window.
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   315
    windowBefore notNil ifTrue:[
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   316
        windowBefore destroySubViews
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   317
    ].
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   318
"/    self buildViewForSpec:aSpecOrSpecArray in:windowBefore.
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   319
    self buildFromSpec:aSpecOrSpecArray in:windowBefore.
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   320
    windowBefore notNil ifTrue:[
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   321
        windowBefore realizeAllSubViews
7efb31ff6de5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   322
    ]
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   323
! !
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   324
1772
cb41f5dbcdf4 method category rename
Claus Gittinger <cg@exept.de>
parents: 1763
diff changeset
   325
!UIBuilder methodsFor:'building-programatically'!
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   326
367
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   327
add:aSpec
4331
8ce1534313cc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3944
diff changeset
   328
    "ATTN: this adds a spec but returns the created view"
8ce1534313cc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3944
diff changeset
   329
1359
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   330
    |collectedComponents appWinClass|
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   331
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   332
    composite notNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   333
        (collectedComponents := composite collection) isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   334
            composite collection:(collectedComponents := OrderedCollection new).
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   335
        ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   336
        collectedComponents add:aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   337
        view := aSpec buildViewWithLayoutFor:self in:compositeView.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   338
    ] ifFalse:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   339
        spec isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   340
            spec := FullSpec new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   341
        ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   342
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   343
        (aSpec isMemberOf:WindowSpec) ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   344
            spec window:aSpec
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   345
        ] ifFalse:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   346
            ((aSpec isMemberOf:ComponentSpec)
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   347
            or:[(aSpec isMemberOf:SpecCollection)]) ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   348
                spec component:aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   349
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   350
                window isNil ifTrue:[
1359
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   351
                    application notNil ifTrue:[
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   352
                        appWinClass := application applicationWindowClass
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   353
                    ] ifFalse:[
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   354
                        appWinClass := ApplicationWindow
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   355
                    ].
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
   356
                    window := appWinClass new.
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   357
                    window extent:300@300.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   358
                ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   359
                aSpec buildViewWithLayoutFor:self in:window.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   360
"/ builder window displayBox
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   361
                composite := aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   362
                compositeView := window.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   363
            ] ifFalse:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   364
                spec component isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   365
                    spec component:SpecCollection new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   366
                    spec component collection:OrderedCollection new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   367
                ].
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   368
                composite := spec component.
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   369
                window isNil ifTrue:[
965
04cadbd21aac use new ApplicationWindow (instead of StandardSystemView)
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   370
                    window := ApplicationWindow new.
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   371
                    window extent:300@300.
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   372
                ].
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   373
                compositeView := window.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   374
                spec component collection add:aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   375
                view := aSpec buildViewWithLayoutFor:self in:compositeView.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   376
            ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   377
        ]
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   378
    ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   379
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   380
    lastComponent := view.
367
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   381
    ^ view
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   382
965
04cadbd21aac use new ApplicationWindow (instead of StandardSystemView)
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   383
    "Modified: / 18.6.1998 / 19:09:38 / cg"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   384
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   385
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   386
endComposite
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   387
    |entry finishedComposite finishedView|
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   388
2083
e49e0761e827 notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
   389
    (specStack notEmptyOrNil) ifTrue:[
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   390
        finishedComposite := composite.
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   391
        finishedView := compositeView.  
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   392
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   393
        "/ pop
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   394
        entry := specStack removeLast.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   395
        composite := entry key.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   396
        compositeView := entry value.
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   397
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   398
        lastComponent := finishedView.
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   399
        ^ finishedComposite
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   400
    ].
2551
9e73083f6ea5 leftOver halt
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
   401
    self breakPoint:#cg.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   402
    ^ composite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   403
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   404
    "Created: / 3.3.1997 / 17:17:43 / cg"
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   405
    "Modified: / 30.10.1997 / 23:28:04 / cg"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   406
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   407
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   408
endCompositeLayout:layout
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   409
    composite compositeSpec isNil ifTrue:[
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   410
        composite compositeSpec:(CompositeSpec new).
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   411
    ].
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   412
    composite compositeSpec layout:layout.
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   413
    compositeView layout:layout.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   414
    self endComposite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   415
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   416
    "Modified: / 30.10.1997 / 23:10:10 / cg"
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   417
!
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   418
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   419
endCompositeLayout:layout properties:props
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   420
    self endCompositeLayout:layout
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   421
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   422
    "Created: 3.3.1997 / 22:15:17 / cg"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   423
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   424
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   425
newComposite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   426
    |newComposite|
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   427
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   428
    "/ push the composite being built ...
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   429
    specStack isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   430
        specStack := OrderedCollection new
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   431
    ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   432
    specStack addLast:(composite->compositeView).
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   433
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   434
    "/ start creating a new one ...
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   435
    newComposite := CompositeSpecCollection new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   436
    newComposite compositeSpec:(CompositeSpec new).
4331
8ce1534313cc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3944
diff changeset
   437
    "ATTN: here, add returns the created view"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   438
    compositeView := self add:newComposite.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   439
    composite := newComposite.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   440
    ^ compositeView
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   441
734
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   442
    "Created: / 3.3.1997 / 17:15:36 / cg"
f1079f443a75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   443
    "Modified: / 1.11.1997 / 02:48:44 / cg"
100
claus
parents: 96
diff changeset
   444
! !
86
claus
parents: 80
diff changeset
   445
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   446
!UIBuilder methodsFor:'initialization'!
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   447
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   448
setupWindowFor:aView
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   449
    |ext|
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   450
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   451
    window notNil ifTrue:[
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   452
        ext := window extent.
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   453
3471
fa2a226e3022 class: UIBuilder
Claus Gittinger <cg@exept.de>
parents: 2551
diff changeset
   454
        ((window isMemberOf:View) or:[window isMemberOf:SimpleView]) ifTrue:[
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   455
            aView addSubView:window.
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   456
        ].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   457
    ].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   458
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   459
    window := aView.
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   460
3740
ad60f51a17cd #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3703
diff changeset
   461
    (aView container isNil and:[spec notNil]) ifTrue:[
ad60f51a17cd #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3703
diff changeset
   462
        spec window setupView:window for:self
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   463
    ].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   464
775
9d9995bf31a3 added commentary
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   465
    "Modified: / 27.1.1998 / 12:27:45 / cg"
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   466
! !
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   467
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   468
!UIBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   469
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   470
version
3703
ff56d68cc50d #OTHER by mawalch
mawalch
parents: 3471
diff changeset
   471
    ^ '$Header$'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   472
! !
1763
fabe0b506e33 method category rename
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
   473
3471
fa2a226e3022 class: UIBuilder
Claus Gittinger <cg@exept.de>
parents: 2551
diff changeset
   474
100
claus
parents: 96
diff changeset
   475
UIBuilder initialize!