eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SimpleView::AboutToOpenBoxNotificationSignal':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: AboutToOpenBoxNotificationSignal (private in SimpleView

This class is only visible from within SimpleView.

Inheritance:

   Object
   |
   +--GenericException
      |
      +--Notification
         |
         +--ProceedingNotification
            |
            +--SimpleView::AboutToOpenBoxNotificationSignal

Package:
stx:libview
Category:
Views-Basic
Owner:
SimpleView

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
o  application

o  box

o  dialogBeingOpened



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:27:08 GMT