Skip to main content

[archive] Need a little help with the Screen Designer

  • August 26, 2008
  • 13 replies
  • 0 views

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz

13 replies

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
Hi,

I'm note sure I understand your problem completely.
But it sounds as though you want to do you own code inside the acubench generated code?

You can sort of do this, but you do not have control of what it generates as such.
We only have a handfull of "acubench generated" programs.
here an example of 1 in which I have amended because of a limitation/bug with acubench - it doesn't clean up after its finished.
So you 'll be able to see that I don't want it to execute whats behind "Acu-Exit-Rtn" and instead I do my own thing.

       Acu-Main-Logic.
      *{Bench}entry-befprg
      *    Before-Program
      *{Bench}end
           MOVE LINK-COMP-NO TO OCG-COMP-NO
           ACCEPT System-Information FROM System-Info
           ACCEPT Terminal-Abilities FROM Terminal-Info
           IF WS-FILES-OPEN-NO
      *       PERFORM Acu-Initial-Routine
              PERFORM Acu-Open-Files
              SET WS-FILES-OPEN-YES TO TRUE
           END-IF
      * run main screen
      *{Bench}run-mainscr
           PERFORM Acu-Screen1-Routine
      *{Bench}end
      *     PERFORM Acu-Exit-Rtn
           CALL "W$MENU" USING WMENU-DESTROY, Screen1-Mn-1-Handle
           EXIT PROGRAM
           STOP RUN
           .


Hopefully this helps.

Shaun

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
Hello and thank you for your answer


But it sounds as though you want to do you own code inside the acubench generated code?


yes, that?s correct.

but that sounds as it is not possible:


You can sort of do this, but you do not have control of what it generates as such.


of course I can generate code with the acubench and edit the code afterwards, but I?m looking for a hint how to force acubench to build my own code into generated paragraphs.
In this case my problem is, that AcuBench generates a paragraph which is executed before my own event-paragraph and I have no idea how to avoid that without editing the source-code directly. :(
(see code above)
Obviously all the changes in the source code are gone when you generate it again. So AcuBench degenerates to a "simple" compiler (that actually how it is used in my company) and this is what my supervisor like to change.

Greetings.

Moritz

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
Hello and thank you for your answer


But it sounds as though you want to do you own code inside the acubench generated code?


yes, that?s correct.

but that sounds as it is not possible:


You can sort of do this, but you do not have control of what it generates as such.


of course I can generate code with the acubench and edit the code afterwards, but I?m looking for a hint how to force acubench to build my own code into generated paragraphs.
In this case my problem is, that AcuBench generates a paragraph which is executed before my own event-paragraph and I have no idea how to avoid that without editing the source-code directly. :(
(see code above)
Obviously all the changes in the source code are gone when you generate it again. So AcuBench degenerates to a "simple" compiler (that actually how it is used in my company) and this is what my supervisor like to change.

Greetings.

Moritz

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
I use acubench 6.1, but I think 7 shoudl be the same... just highlight the window in the screen designer and click on the Event tab, find the event procedure called Msg-Close and then click on the ... in the value column and it will add a procedure that you can edit that will be called when the users click the X to close the window. Unless I don't quite understand what you are after...

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
just highlight the window in the screen designer and click on the Event tab, find the event procedure called Msg-Close and then click on the ... in the value column and it will add a procedure that you can edit that will be called when the users click the X to close the window.


I already did that (of course ;)), but my problem is, that the Msg-Close event is not called when I hit the "X".

see the code above:
AcuBench generates an "Acu-screen1-Event-Extra" paragraph which is executed before my Msg-Close Event paragraph is handled.
:confused:

Greetings,

Moritz

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
If you have the screen highlighted in AcuBench, in the property window for the screen you have access to the events or potential events for the screen including msg-close. See attached screen shot

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
If you have the screen highlighted in AcuBench, in the property window for the screen you have access to the events or potential events for the screen including msg-close. See attached screen shot

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
yes, I know and I already did that as you can see in my screenshot.
My problem is that AcuBench generates another paragraph which is executed before my paragraph. Just have a look at my code in the opening post.

edit: I uploaded a second jpeg. So I hope my problem is easier to understand...

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
This may be an in-elegant solution but it works.

Use a before procedure for the screen to reset (unset) the quit-mode value

Screen1-Bef-Procedure.
set environment "QUIT_MODE" to 13.

Screen1-Ev-Msg-Close.
perform my-close-routine
.

my-close-routine.
display message box "x was selected"
stop run.

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
that works! Thank you very much! :)

but you also have now idea how to force AcuBench not to create this "Event-Extra" paragraph, right? :(

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
that works! Thank you very much! :)

but you also have now idea how to force AcuBench not to create this "Event-Extra" paragraph, right? :(

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
Do you know about External Paragraphs? see attachments.

On the Structure Tab right click on the program with the Screen and from the menu select External Paragraphs. It displays a list of Internal Paragraphs that AcuBench will create. Tick the one you want to create as your own.

Hope this helps.

[Migrated content. Thread originally posted on 26 August 2008]

Hello again,

I need some help with the Screen Designer of the AcuBench 7.2:

I like to perform a section/paragraph when someone hits the "X" on the window to exit the screen. I used the search function and found some helpful things like

In my config file I have quit-mode = to a -2 to get rid of the X.


or

msg-close is the event to look for, perhaps not all of your windows have an event procedure lloking for this, modify the programs so that they catche the msg-close event and moves an 'event-action-fail' to event-action if the msg-close happens.

Or consider executing the programs with the runtime -s option.


so it´s no problem for me to edit the source code directly but is there a way to change these settings via the screen designer?

In other words:

the screen designer creates a paragraph like the following to react on the "X".
The Problem is, that the "Acu-screen1-Msg-Close" paragraph is also created by the screen designer. I don´t know how to "access" the paragraph. Creating a Msg-Close Event does not help as you can see in the code below.


      * an event occurs: (in this case "X" is clicked)
      *
       Acu-screen1-Event.
      *
           PERFORM Acu-screen1-Event-Extra *> created by acubench
      *
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM screen1-Ev-Msg-Close *> my paragraph
           END-EVALUATE
           .
      *
      * created by AcuBench, I have no influence on that paragraph:
      *
       Acu-screen1-Event-Extra.
           EVALUATE Event-Type
           WHEN Msg-Close
              PERFORM Acu-screen1-Msg-Close
           END-EVALUATE
           .
       *
       Acu-screen1-Msg-Close.
           ACCEPT Quit-Mode-Flag FROM ENVIRONMENT "QUIT_MODE"
           IF Quit-Mode-Flag = ZERO
              PERFORM Acu-screen1-Exit
              IF Exit-Pushed
                 PERFORM Acu-Exit-Rtn
              ELSE
                 MOVE Event-Action-Fail TO Event-Action
              END-IF
           END-IF
           .
      *
       screen1-Ev-Msg-Close.
      * my code, not executed
       .


I hope you understand my problem and I'm happy about your help.
Thanks a lot. :-)

Moritz
Here's how we handle it in our software,
first I add the following line:
SET ENVIRONMENT "QUIT_MODE" TO "27".
Then in the accept statement, I add the code to validate or check different fields to see if the user has changed any data.

PERFORM UNTIL KEY-STATUS = 27
ACCEPT SCREEN1
ON EXCEPTION
IF KEY-STATUS = 27
PERFORM COMPARE-SCREEN-FIELDS
IF FIELDS-CHANGED
DISPLAY MESSAGE BOX
"Data has been changed, Are you sure you want to exit!"
TYPE MB-YES-NO
RETURNING PUSH-BUTTON-STATUS
END-DISPLAY
IF PUSH-BUTTON-STATUS = MB-NO
INITIALIZE KEY-STATUS
END-IF
END-IF
END-IF
END-ACCEPT
END-PERFORM

This allows you to perform any kind of funtion and also to stop then from exiting if necessary by resetting the key-status variable.