|
Smalltalk/X WebserverDocumentation of class 'SimpleView::AboutToOpenBoxNotificationSignal': |
|
|
Class: AboutToOpenBoxNotificationSignal (private in SimpleViewThis class is only visible from within SimpleView.Inheritance:Object | +--GenericException | +--Notification | +--ProceedingNotification | +--SimpleView::AboutToOpenBoxNotificationSignal
Description:
this is a hook notification, raised right before a dialog box is about to be opened.
This allows for standard dialogs (such as confirmers, choosers or notifiers) to
be customized by additional widgets.
i.e. its typical use is like:
|doNotShowHolder|
doNotShowHolder := false asValue.
DialogBox aboutToOpenBoxNotificationSignal handle:[:ex |
|box|
box := ex box.
box verticalPanel
add:(CheckBox label:('Do not show this information in the future.')
model:doNotShowHolder).
] do:[
Dialog information:'This is a standard information box.\(but has an additional check toggle in it)' withCRs.
].
Another application is to suppress dialogs, by returning #abort from the query
(of course, in real life, the Dialog call is deeply nested below the handler and done elsewhere):
DialogBox aboutToOpenBoxNotificationSignal
answer:#abort
do:[
Dialog information:'This box is not shown.'
].
or to automatically answer all dialogs by simulating user entering a return:
DialogBox aboutToOpenBoxNotificationSignal
handle:[:ex |
ex box windowGroup sensor
pushEvent:
(WindowEvent
keyPress:#Return
rawKey:#Return
hasShift:false ctrl:false alt:false meta:false
button1:false button2:false button3:false
x:1 y:1 view:ex box).
] do:[
Transcript showCR:(Dialog confirm:'Please confirm.')
].
or an escape:
DialogBox aboutToOpenBoxNotificationSignal
handle:[:ex |
ex box windowGroup sensor
pushEvent:
(WindowEvent
keyPress:#Escape
rawKey:#Escape
hasShift:false ctrl:false alt:false meta:false
button1:false button2:false button3:false
x:1 y:1 view:ex box).
] do:[
Transcript showCR:(Dialog confirm:'Please confirm.')
].
Finally, a recorder may want to keep track of which dialogs have been opened:
(of course, again, the Dialog calls are deeply nested below the handler and done elsewhere):
DialogBox aboutToOpenBoxNotificationSignal handle:[:ex |
Transcript showCR:ex box topView label
] do:[
Dialog information:'box #1.'.
Dialog information:'box #2.'.
Dialog confirm:'bla'.
].
Instance protocol:accessing |
|
|
ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 17 Dec 2025 10:02:25 GMT
|