SimpleDialog.st
author Claus Gittinger <cg@exept.de>
Thu, 06 Mar 1997 01:32:24 +0100
changeset 493 d6392d88c552
parent 485 9326c85fdf6f
child 605 9e9445252e25
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by eXept Software AG
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ApplicationModel subclass:#SimpleDialog
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    15
	instanceVariableNames:'accept cancel close escapeIsCancel postBuildBlock postOpenBlock
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    16
		preBuildBlock'
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Interface-Framework'
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!SimpleDialog class methodsFor:'documentation'!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
 COPYRIGHT (c) 1996 by eXept Software AG
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
              All Rights Reserved
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    Since many ST-80 classes are subclasses of SompleDialog, this class
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    is provided here to allow easier porting of ST-80 code.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    It does not (currently) provide much functionality and is NOT
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    compatible to the corresponding ST80 class; therefore, manual
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    changes have to be made to get those applications to run under ST/X.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    (but at least, this enables you to fileIn that code and have a superclass
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
     for them)
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    However, as time goes by, ST/X applications may be converted to use the
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    ApplicationModel / SimpleDialog framework as well.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    Notice: this class was implemented using protocol information
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    from alpha testers and PD code - it may not be complete or compatible to
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    the corresponding ST-80 class. If you encounter any incompatibilities,
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    please forward a note to the ST/X team.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    [author:]
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
        Claus Gittinger
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    [see also:]
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
        StandardSystemView
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
        WindowGroup DeviceWorkstation DialogBox
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
! !
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    69
!SimpleDialog methodsFor:'accessing'!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    70
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    71
accept
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    72
    "return the value of the instance variable 'accept' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    73
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    74
    ^ accept
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    75
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    76
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    77
bindings
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    78
    ^ builder bindings
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    79
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    80
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    81
cancel
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    82
    "return the value of the instance variable 'cancel' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    83
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    84
    ^ cancel
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    85
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    86
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    87
closeChannel
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    88
    "return the value of the instance variable 'close' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    89
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    90
    ^ close
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    91
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    92
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    93
escapeIsCancel
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    94
    "return the value of the instance variable 'escapeIsCancel' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    95
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    96
    ^ escapeIsCancel!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    97
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    98
escapeIsCancel:something
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    99
    "set the value of the instance variable 'escapeIsCancel' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   100
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   101
    escapeIsCancel := something.!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   102
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   103
postBuildBlock:something
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   104
    "set the value of the instance variable 'postBuildBlock' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   105
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   106
    postBuildBlock := something.!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   107
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   108
postOpenBlock:something
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   109
    "set the value of the instance variable 'postOpenBlock' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   110
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   111
    postOpenBlock := something.!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   112
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   113
preBuildBlock:something
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   114
    "set the value of the instance variable 'preBuildBlock' (automatically generated)"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   115
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   116
    preBuildBlock := something.!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   117
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   118
source:anApplication
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   119
    builder source:anApplication
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   120
! !
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   121
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   122
!SimpleDialog methodsFor:'accessing - window'!
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   123
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   124
minWidth:nPixels
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   125
    |w box |
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   126
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   127
    w := builder window width.
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   128
    builder window width:(w max:nPixels).
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   129
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   130
"/    box := builder window displayBox.
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   131
"/    box width: (box width max: nPixels).
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   132
"/    builder window displayBox: box
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   133
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   134
    "Modified: 3.3.1997 / 21:56:27 / cg"
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   135
! !
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   136
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   137
!SimpleDialog methodsFor:'events'!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   138
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   139
closeAccept
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   140
    self requestForWindowClose ifTrue:[
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   141
        self closeWindow
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   142
    ]
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   143
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   144
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   145
closeCancel
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   146
    self requestForWindowClose ifTrue:[
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   147
        self closeWindow
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   148
    ]
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   149
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   150
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   151
closeWindow
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   152
    self closeChannel value:true.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   153
    builder window hide
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   154
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   155
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   156
requestForWindowClose
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   157
    ^ true
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   158
! !
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   159
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   160
!SimpleDialog methodsFor:'initialization'!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   161
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   162
initialize
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   163
    accept := false asValue.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   164
    close := false asValue.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   165
    cancel := false asValue.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   166
    builder aspectAt:#accept put:accept.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   167
    builder aspectAt:#close put:close.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   168
    builder aspectAt:#cancel put:cancel.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   169
    escapeIsCancel := true.
476
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   170
!
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   171
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   172
initializeBuilderFor:aView 
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   173
    aView notNil ifTrue:[
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   174
        builder window:aView.
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   175
    ]
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   176
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   177
    "Created: 3.3.1997 / 16:23:04 / cg"
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   178
!
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   179
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   180
initializeWindowFor:aView
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   181
    |v ext|
476
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   182
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   183
    (v := aView) isNil ifTrue:[
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   184
        v := ModalBox new.
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   185
    ].
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   186
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   187
    builder setupWindowFor:v.
476
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   188
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   189
    "Modified: 3.3.1997 / 20:39:46 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   190
! !
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   191
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   192
!SimpleDialog methodsFor:'interface opening'!
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   193
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   194
allButOpenFrom:aSpec
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   195
    "create my views but do not open the main window"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   196
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   197
    super allButOpenFrom:aSpec.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   198
    self preOpen
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   199
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   200
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   201
openFor:anApplication interface:aSelector
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   202
    "open the dialog for some appModel from a given spec;
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   203
     Return true if accepted, false if canceled"
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   204
464
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   205
    ^ self openFor:anApplication interface:aSelector withBindings:nil
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   206
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   207
    "Modified: 28.2.1997 / 16:22:08 / cg"
464
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   208
!
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   209
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   210
openFor:anApplication interface:aSelector withBindings:bindings
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   211
    "open the dialog for some appModel from a given spec;
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   212
     the bindings argument may provide overwriting bindings for the
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   213
     dialog.
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   214
     Return true if accepted, false if canceled"
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   215
464
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   216
    builder addBindings:bindings.
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   217
    self source:anApplication.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   218
    ^ self openFrom:(anApplication class interfaceSpecFor:aSelector)
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   219
464
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   220
    "Created: 28.2.1997 / 14:09:06 / cg"
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   221
    "Modified: 28.2.1997 / 16:22:00 / cg"
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   222
!
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   223
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   224
openFrom:anInterfaceSpec
466
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   225
    "open the dialog from a given spec;
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   226
     return true if accepted, false if canceled"
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   227
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   228
    self allButOpenFrom:anInterfaceSpec.
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   229
    self openDialog.
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   230
    ^ accept value
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   231
466
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   232
    "Modified: 28.2.1997 / 16:40:36 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   233
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   234
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   235
preOpen
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   236
    accept onChangeSend:#closeAccept to:self.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   237
    cancel onChangeSend:#closeCancel to:self.
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   238
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   239
! !
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   240
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
!SimpleDialog methodsFor:'queries'!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
defaultWindowType
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    "SimpleDialogs come up modal, by default"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    ^ #dialog
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    "Modified: 14.2.1997 / 22:17:20 / cg"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
! !
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!SimpleDialog class methodsFor:'documentation'!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
version
485
9326c85fdf6f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   254
    ^ '$Header: /cvs/stx/stx/libview2/SimpleDialog.st,v 1.10 1997-03-04 01:00:20 cg Exp $'
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
! !