SimpleDialog.st
author Claus Gittinger <cg@exept.de>
Tue, 03 Sep 2013 17:23:55 +0200
changeset 3228 187a4158a51a
parent 3208 bc25fa88a042
child 3259 901d67809da0
permissions -rw-r--r--
class: FlyByHelp changed: #initiateHelpFor:at:now: #showHelp:for: changed the flyBy suppression slightly: if the same text is to be shown again, do not show it except if the help is for another widget. (used to check for the text only previously)
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
"
1373
c04eea37d7db Fix typos in comment.
Stefan Vogel <sv@exept.de>
parents: 1346
diff changeset
    12
"{ Package: 'stx:libview2' }"
c04eea37d7db Fix typos in comment.
Stefan Vogel <sv@exept.de>
parents: 1346
diff changeset
    13
366
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
2500
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    16
		preBuildBlock closeAllowedChannel acceptedValue'
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
"
1589
2c0a2c71d775 Update docu
Stefan Vogel <sv@exept.de>
parents: 1551
diff changeset
    41
    Use SimpleDialog to specify Dialogs with a windowSpec built by the GUI Builder.
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    Notice: this class was implemented using protocol information
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    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
    45
    the corresponding ST-80 class. If you encounter any incompatibilities,
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    please forward a note to the ST/X team.
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [author:]
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        Claus Gittinger
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [see also:]
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
        StandardSystemView
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        WindowGroup DeviceWorkstation DialogBox
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
! !
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
906
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    57
!SimpleDialog class methodsFor:'queries'!
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    58
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    59
isVisualStartable
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
    60
    "return true, if this application can be started via #open.
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1397
diff changeset
    61
     (to allow start of a change browser via double-click in the browser)"
906
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    62
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    63
    self == SimpleDialog ifTrue:[^false].
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    64
    ^super isVisualStartable
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    65
! !
732822b19bc3 isVisualStartable
tz
parents: 905
diff changeset
    66
2019
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    67
!SimpleDialog methodsFor:'DialogBox compatibility'!
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    68
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    69
destroy
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    70
    self closeRequest
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    71
!
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    72
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    73
hide
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    74
    self window hide
7ad3dee35894 protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
    75
! !
976
dd0045c9fdd7 must create the builder ... (sigh)
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
    76
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    77
!SimpleDialog methodsFor:'accessing'!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    78
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    79
accept
2500
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    80
    "return the valueholder which gets set to true by the accept button.
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    81
     Also, when this valueHolder gets a true stuffed into it, the dialog is closed.
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    82
     This valueHolder is also set to true, if the acceptValue get a value stored into."
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    83
1640
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
    84
    accept isNil ifTrue:[
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
    85
        accept := false asValue.
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
    86
    ].
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
    87
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    88
    ^ accept
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
    89
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    90
    "Modified: / 20.5.1998 / 20:51:05 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    91
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
    92
2500
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    93
acceptValue:something
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    94
    "save something in acceptedValue (to be passed back to the opened of this dialog),
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    95
     and set the accept-holder to true, which closes the dialog window.
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    96
     This is similar to a regular accept, but allows for a particular return-value to be passed
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    97
     back."
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    98
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
    99
    acceptedValue := something.
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   100
    self closeAccept
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   101
!
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   102
1381
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   103
accepted
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   104
    "after the box has closed:
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   105
         return true if accepted, false if canceled"
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   106
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   107
    ^ self accept value
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   108
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   109
!
1035403e302e added #accepted
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   110
2500
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   111
acceptedValue
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   112
    "an additional value which can be passed back to the one who opened a dialog"
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   113
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   114
    ^ acceptedValue
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   115
!
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   116
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   117
bindings
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   118
    "return my builders bindings"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   119
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   120
    ^ builder bindings
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   121
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   122
    "Modified: / 20.5.1998 / 20:51:15 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   123
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   124
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   125
cancel
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   126
    "return the valueholder which gets set by the cancel button.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   127
     Also, when this valueHolder gets a true stuffed into it, the
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   128
     dialog is closed."
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   129
1640
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
   130
    cancel isNil ifTrue:[
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
   131
        cancel := false asValue.
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
   132
    ].
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   133
    ^ cancel
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   134
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   135
    "Modified: / 20.5.1998 / 20:51:02 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   136
!
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   137
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   138
closeAllowedChannel
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   139
    "return the value-provider which controls if close is allowed.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   140
     This is initialized to true."
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   141
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   142
    ^ closeAllowedChannel
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   143
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   144
    "Created: / 20.5.1998 / 21:52:32 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   145
    "Modified: / 20.5.1998 / 21:53:18 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   146
!
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   147
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   148
closeAllowedChannel:aValueHolderOrBlock
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   149
    "set a value-provider which controls if close is allowed."
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   150
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   151
    ^ closeAllowedChannel
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   152
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   153
    "Created: / 20.5.1998 / 21:52:53 / cg"
431
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
closeChannel
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   157
    "return the closeChannel; If a true is stuffed into this valueHolder,
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   158
     I will close myself."
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   159
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   160
    ^ close
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   161
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   162
    "Modified: / 20.5.1998 / 20:52:29 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   163
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   164
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   165
escapeIsCancel
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   166
    "return the escapeIsCancel setting"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   167
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   168
    ^ escapeIsCancel
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   169
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   170
    "Modified: / 20.5.1998 / 20:52:44 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   171
!
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   172
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   173
escapeIsCancel:something
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   174
    "set/clear the escapeIsCancel option.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   175
     If on, an ESC-key will be treated like a cancel action."
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   176
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   177
    escapeIsCancel := something.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   178
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   179
    "Modified: / 20.5.1998 / 20:53:23 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   180
!
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   181
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   182
postBuildBlock:something
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   183
    "set postBuildBlock; if non-nil, this is evaluated after the build process"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   184
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   185
    postBuildBlock := something.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   186
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   187
    "Modified: / 20.5.1998 / 20:54:06 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   188
!
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   189
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   190
postOpenBlock:something
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   191
    "set the postBuildBlock; if non-nil, this is evaluated after the view is opened"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   192
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   193
    postOpenBlock := something.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   194
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   195
    "Modified: / 20.5.1998 / 20:54:23 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   196
!
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   197
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   198
preBuildBlock:something
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   199
    "set the preBuildBlock; if non-nil, this is evaluated before the view is constructed"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   200
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   201
    preBuildBlock := something.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   202
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   203
    "Modified: / 20.5.1998 / 20:54:41 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   204
!
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   205
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   206
source:anApplication
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   207
    "define the application which provides resources, aspects etc."
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   208
1067
5b39cef366fe also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   209
    builder source:anApplication.
5b39cef366fe also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   210
    masterApplication isNil ifTrue:[
1440
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   211
        anApplication ~~ self ifTrue:[
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   212
            masterApplication := anApplication
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   213
        ]
1067
5b39cef366fe also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   214
    ].
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   215
1067
5b39cef366fe also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
   216
    "Modified: / 8.9.1998 / 01:46:06 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   217
! !
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   218
1397
47ac1d3e1df1 category changes
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   219
!SimpleDialog methodsFor:'accessing-window'!
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   220
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   221
minWidth:nPixels
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   222
    |w box |
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   223
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   224
    w := builder window width.
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   225
    builder window width:(w max:nPixels).
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   226
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   227
"/    box := builder window displayBox.
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   228
"/    box width: (box width max: nPixels).
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   229
"/    builder window displayBox: box
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   230
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   231
    "Modified: 3.3.1997 / 21:56:27 / cg"
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   232
! !
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   233
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   234
!SimpleDialog methodsFor:'events'!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   235
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   236
closeAccept
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   237
    "accept was pressed. close the dialog"
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   238
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   239
    self requestForWindowClose ifTrue:[
1129
0d5fd9b819a9 autoAccept
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
   240
        builder keyboardProcessor requestGlobalAutoAccept ifTrue:[
1943
0cff3328cb36 set acceptChannels valueHolder to true in closeAccept.
Claus Gittinger <cg@exept.de>
parents: 1881
diff changeset
   241
            accept value:true.
1129
0d5fd9b819a9 autoAccept
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
   242
            self closeWindow
0d5fd9b819a9 autoAccept
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
   243
        ]
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   244
    ]
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   245
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   246
    "Modified: 17.6.1997 / 14:10:23 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   247
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   248
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   249
closeCancel
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   250
    "cancel was pressed. close the dialog"
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   251
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   252
    self requestForWindowClose ifTrue:[
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   253
        self closeWindow
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   254
    ]
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   255
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   256
    "Modified: 17.6.1997 / 14:10:29 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   257
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   258
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   259
closeWindow
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   260
    "close the dialog"
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   261
1053
0d77637f9d45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   262
    |c|
0d77637f9d45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   263
0d77637f9d45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   264
    c := self closeChannel.
0d77637f9d45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   265
    c retractInterestsFor:self.
0d77637f9d45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   266
    c value:true.
3204
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   267
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   268
    "/ must destroy instead of hide - otherwise there is no #release to
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   269
    "/ the controller (onChangeSend-dependency problem)
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   270
    "/     builder window destroy. "/ hide
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   271
3204
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   272
    "/ changed to use the general closeDownViews 
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   273
    "/ (some want to redefine it and expect it to be called; it eventually also does a window destroy)
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   274
    self closeDownViews.
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   275
c606e3239538 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3180
diff changeset
   276
    "Modified (comment): / 31-07-2013 / 18:02:55 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   277
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   278
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   279
requestForWindowClose
1373
c04eea37d7db Fix typos in comment.
Stefan Vogel <sv@exept.de>
parents: 1346
diff changeset
   280
    "the dialog is about to be closed - this method is invoked and may
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   281
     return false to suppress the close.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   282
     Here the value of closeAllowedChannel is returned, which is
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   283
     set to true initially.
1373
c04eea37d7db Fix typos in comment.
Stefan Vogel <sv@exept.de>
parents: 1346
diff changeset
   284
     You may redefined this in a special dialog, and/or provide a boolean
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   285
     valueHolder or a boolean block via the #closeAllowedChannel: method."
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   286
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   287
    ^ closeAllowedChannel value
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   288
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   289
    "Modified: / 20.5.1998 / 21:52:25 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   290
! !
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   291
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   292
!SimpleDialog methodsFor:'forced actions'!
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   293
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   294
doAccept
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   295
    "force accept"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   296
1640
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
   297
    self accept value:true
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   298
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   299
    "Created: / 18.10.1997 / 05:18:09 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   300
    "Modified: / 20.5.1998 / 21:53:35 / cg"
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   301
!
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   302
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   303
doCancel
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   304
    "force cancel"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   305
1640
5bd912083327 Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents: 1598
diff changeset
   306
    self cancel value:true
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   307
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   308
    "Created: / 18.10.1997 / 05:18:22 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   309
    "Modified: / 20.5.1998 / 21:53:40 / cg"
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   310
! !
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   311
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   312
!SimpleDialog methodsFor:'initialization'!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   313
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   314
initialize
935
ccb6caad1da0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   315
    accept := (ValueHolder with:false).
ccb6caad1da0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   316
    close := (ValueHolder with:false).
ccb6caad1da0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   317
    cancel := (ValueHolder with:false).
978
cd056a68d67a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   318
    self createBuilder.
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   319
    builder aspectAt:#accept put:accept.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   320
    builder aspectAt:#close put:close.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   321
    builder aspectAt:#cancel put:cancel.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   322
    escapeIsCancel := true.
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   323
    closeAllowedChannel := true
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   324
978
cd056a68d67a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   325
    "Modified: / 19.6.1998 / 03:35:48 / cg"
476
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   326
!
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   327
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   328
initializeBuilderFor:aView 
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   329
    aView notNil ifTrue:[
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   330
        builder window:aView.
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   331
    ]
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   332
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   333
    "Created: 3.3.1997 / 16:23:04 / cg"
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   334
!
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   335
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   336
initializeWindowFor:aView
679
0f94c493751c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   337
    |v|
476
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   338
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   339
    (v := aView) isNil ifTrue:[
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   340
        v := ModalBox new.
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   341
    ].
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   342
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   343
    builder setupWindowFor:v.
476
628766c580c3 added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   344
481
02d1db5d428a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
   345
    "Modified: 3.3.1997 / 20:39:46 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   346
! !
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   347
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   348
!SimpleDialog methodsFor:'opening-dialogInterface'!
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   349
2877
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   350
allButOpenFor:anApplication interfaceSpec:aSpec withBindings:bindings
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   351
    "open the dialog for some appModel from a given spec;
3099
90ad6c9bb1bd class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
   352
     the bindings argument may provide overwriting bindings for the dialog.
2877
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   353
     Return true if accepted, false if canceled"
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   354
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   355
    |app|
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   356
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   357
    builder isNil ifTrue:[ self createBuilder ].
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   358
2877
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   359
    builder addBindings:bindings.
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   360
    (app := anApplication) isNil ifTrue:[
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   361
        app := ApplicationModel new
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   362
    ].
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   363
    self source:app.
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   364
    ^ self allButOpenFrom:aSpec
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   365
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   366
    "Created: / 05-11-2010 / 11:27:26 / cg"
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   367
!
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   368
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   369
allButOpenFrom:aSpec
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   370
    "create my views but do not open the main window"
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   371
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   372
    super allButOpenFrom:aSpec.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   373
    self preOpen
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   374
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   375
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   376
openFor:anApplication interface:aSelector
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   377
    "open the dialog for some appModel from a given spec;
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   378
     Return true if accepted, false if canceled"
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   379
464
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   380
    ^ 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
   381
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   382
    "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
   383
!
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   384
25e6380399c6 allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   385
openFor:anApplication interface:aSelector withBindings:bindings
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   386
    "open the dialog for some appModel from a given specSymbol;
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   387
     the application must provide an interfaceSpec for that symbol.
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   388
     The bindings argument may provide overwriting bindings for the
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   389
     dialog.
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   390
     Return true if accepted, false if canceled"
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   391
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   392
    ^ self
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   393
        openFor:anApplication 
2441
61d9292cdb41 interfaceSpecFor must go via the instance
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   394
        interfaceSpec:(anApplication interfaceSpecFor:aSelector)
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   395
        withBindings:bindings
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   396
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   397
    "Modified: 18.10.1997 / 04:43:13 / cg"
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   398
!
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   399
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   400
openFor:anApplication interfaceSpec:aSpec withBindings:bindings
465
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   401
    "open the dialog for some appModel from a given spec;
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   402
     the bindings argument may provide overwriting bindings for the
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   403
     dialog.
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   404
     Return true if accepted, false if canceled"
5df2fbe7275a comments
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   405
2877
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   406
    self allButOpenFor:anApplication interfaceSpec:aSpec withBindings:bindings.
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   407
    self openDialog.
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   408
    ^ accept value
1491
6a1c859f50da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1441
diff changeset
   409
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   410
    "Created: / 07-07-2011 / 16:52:04 / cg"
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   411
!
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   412
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   413
openFor:anApplication spec:aSpec withBindings:bindings
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   414
    "open the dialog for some appModel from a given spec.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   415
     The bindings argument may provide overwriting bindings for the
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   416
     dialog.
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   417
     Return true if accepted, false if canceled"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   418
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   419
    ^ self
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   420
        openFor:anApplication 
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   421
        interfaceSpec:aSpec
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   422
        withBindings:bindings
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   423
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   424
    "Modified: / 18.10.1997 / 04:43:13 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   425
    "Created: / 20.5.1998 / 20:28:29 / cg"
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   426
!
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   427
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   428
openFrom:anInterfaceSpec
466
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   429
    "open the dialog from a given spec;
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   430
     return true if accepted, false if canceled"
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   431
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   432
    self allButOpenFrom:anInterfaceSpec.
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   433
    self openDialog.
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   434
    ^ accept value
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   435
466
784ed480f4eb comments
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   436
    "Modified: 28.2.1997 / 16:40:36 / cg"
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   437
!
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   438
1441
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   439
openInterface:aSymbol
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   440
    "open a standard interface.
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   441
     Redefined to return the accept value instead of the builder."
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   442
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   443
    super openInterfaceModal:aSymbol.
2500
d146fa50819b allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents: 2441
diff changeset
   444
    acceptedValue notNil ifTrue:[^ acceptedValue].
1441
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   445
    ^ accept value.
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   446
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   447
    "Created: / 23.1.1998 / 18:19:57 / cg"
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   448
    "Modified: / 20.5.1998 / 20:21:28 / cg"
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   449
!
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   450
3180
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   451
openInterface:aSymbol at:position
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   452
    "open a standard interface.
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   453
     Redefined to return the accept value instead of the builder."
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   454
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   455
    super openInterfaceModal:aSymbol at:position.
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   456
    acceptedValue notNil ifTrue:[^ acceptedValue].
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   457
    ^ accept value.
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   458
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   459
    "Created: / 23.1.1998 / 18:19:57 / cg"
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   460
    "Modified: / 20.5.1998 / 20:21:28 / cg"
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   461
!
ddb23aad351e class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3099
diff changeset
   462
1441
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   463
openSpec:aWindowSpec
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   464
    "open a window spec.
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   465
     Redefned to open modal and to return the accept value instead 
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   466
     of the builder."
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   467
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   468
    super openSpecModal:aWindowSpec.
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   469
    ^ accept value.
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   470
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   471
    "Modified: / 22.4.1998 / 11:59:05 / cg"
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   472
    "Created: / 20.5.1998 / 20:21:17 / cg"
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   473
!
2777d3f49053 category changes
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
   474
1440
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   475
openSpec:anInterfaceSpec withBindings:bindings
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   476
    "open the dialog with a given spec;
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   477
     The bindings argument is mandatory and provides aspect bindings for the
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   478
     dialog.
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   479
     Return true if accepted, false if canceled"
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   480
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   481
    ^ self
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   482
        openFor:self 
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   483
        interfaceSpec:anInterfaceSpec
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   484
        withBindings:bindings
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   485
!
7a0b8cc86e87 added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   486
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   487
postBuildWith:aBuilder
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   488
    "this is sent after the dialogs widgets have been created
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   489
     (but before the dialog is opened).
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   490
     If a postBuildBlock was set, evaluate it here."
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   491
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   492
    postBuildBlock notNil ifTrue:[
1551
f3428747591f use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents: 1491
diff changeset
   493
        postBuildBlock valueWithOptionalArgument:aBuilder
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   494
    ].
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   495
    builder source ~= self ifTrue:[
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   496
        "/ I was opened as dialogInterface for another application;
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   497
        "/ inform it that I am ready now
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   498
        builder source postBuildDialogWith:aBuilder
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   499
    ].
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   500
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   501
    super postBuildWith:aBuilder
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   502
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   503
    "Created: / 18-10-1997 / 05:17:12 / cg"
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   504
!
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   505
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   506
postOpenWith:aBuilder
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   507
    "this is sent after the dialogs main window is opened.
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   508
     If a postOpenBlock was set, evaluate it here."
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   509
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   510
    postOpenBlock notNil ifTrue:[
1551
f3428747591f use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents: 1491
diff changeset
   511
        postOpenBlock valueWithOptionalArgument:aBuilder
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   512
    ].
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   513
    builder source ~= self ifTrue:[
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   514
        "/ I was opened as dialogInterface for another application;
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   515
        "/ inform it that I am ready now
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   516
        builder source postOpenDialogWith:aBuilder
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   517
    ].
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   518
    super postOpenWith:aBuilder
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   519
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   520
    "Created: / 18-10-1997 / 05:15:48 / cg"
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   521
!
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   522
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   523
preBuildWith:aBuilder
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   524
    "this is sent before the dialogs widgets are created.
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   525
     If a preBuildBlock was set, evaluate it here."
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   526
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   527
    preBuildBlock notNil ifTrue:[
1551
f3428747591f use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents: 1491
diff changeset
   528
        preBuildBlock valueWithOptionalArgument:aBuilder
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   529
    ].
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   530
    builder source ~= self ifTrue:[
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   531
        "/ I was opened as dialogInterface for another application;
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   532
        "/ inform it that I am ready now
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   533
        builder source preBuildDialogWith:aBuilder
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   534
    ].
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   535
    super preBuildWith:aBuilder
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   536
2922
ff84e43f9c94 special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents: 2877
diff changeset
   537
    "Created: / 18-10-1997 / 15:02:27 / cg"
713
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   538
!
548898fdd1dc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   539
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   540
preOpen
605
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   541
    "arrange for #closeAccept & #closeCancel to be invoked when
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   542
     either accept or close is triggered
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   543
     (usually the models of corresponding buttons)"
9e9445252e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   544
431
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   545
    accept onChangeSend:#closeAccept to:self.
99a2737206a6 checkin from browser
ca
parents: 429
diff changeset
   546
    cancel onChangeSend:#closeCancel to:self.
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   547
    close  onChangeSend:#closeWindow to:self.
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   548
932
f7b0ce4cc1d1 allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   549
    "Modified: / 20.5.1998 / 20:49:26 / cg"
429
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   550
! !
3311c88f2a0e dialog opening stuff
ca
parents: 366
diff changeset
   551
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
!SimpleDialog methodsFor:'queries'!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
defaultWindowType
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
    "SimpleDialogs come up modal, by default"
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
    ^ #dialog
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
    "Modified: 14.2.1997 / 22:17:20 / cg"
3205
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   560
!
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   561
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   562
shouldRememberLastExtent
3208
bc25fa88a042 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   563
    (self accepted) ifFalse:[^ false].
bc25fa88a042 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   564
    ^ super shouldRememberLastExtent
3205
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   565
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   566
    "Created: / 31-07-2013 / 18:06:12 / cg"
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
! !
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
!SimpleDialog class methodsFor:'documentation'!
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
3205
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   571
version
3208
bc25fa88a042 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   572
    ^ '$Header: /cvs/stx/stx/libview2/SimpleDialog.st,v 1.53 2013-07-31 16:12:54 cg Exp $'
3205
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   573
!
88b0e4082379 class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 3204
diff changeset
   574
2877
2ab7a4fa2b3d added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2500
diff changeset
   575
version_CVS
3208
bc25fa88a042 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   576
    ^ '$Header: /cvs/stx/stx/libview2/SimpleDialog.st,v 1.53 2013-07-31 16:12:54 cg Exp $'
366
bde54cb70d97 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
! !
3099
90ad6c9bb1bd class: SimpleDialog
Claus Gittinger <cg@exept.de>
parents: 2922
diff changeset
   578