Skip to main content

[Migrated content. Thread originally posted on 01 December 2005]

I've created a window in Acubench which contains a button and a few entry-fields.

I want to create controls dynamically on my screen!

When I push the button, the clicked event is executed.

The following code is in the event:

DISPLAY Check-Box UPON SCA1-handle,
COL 9,00,
LINE 5,60,
LINES 2,20 CELLS,
SIZE 21,50 CELLS,
FONT IS MS-Sans-Serif8,
TITLE "Check Box Generated",
ID 345, VALUE wwk-cb-val,
EVENT PROCEDURE IS R10-events,
HANDLE IN wwk-cb-handle,

A checkbox is showed on my screen but I can't do anything with it. I suppose something is wrong with the accept........

I want the checkbox working the same as the other controls on my screen. But how.......???

(ps When possible also with a before and after accept procedure)

Kind regards,

Stephan Boeder
BEVER Automatisering B.V.

[Migrated content. Thread originally posted on 01 December 2005]

I've created a window in Acubench which contains a button and a few entry-fields.

I want to create controls dynamically on my screen!

When I push the button, the clicked event is executed.

The following code is in the event:

DISPLAY Check-Box UPON SCA1-handle,
COL 9,00,
LINE 5,60,
LINES 2,20 CELLS,
SIZE 21,50 CELLS,
FONT IS MS-Sans-Serif8,
TITLE "Check Box Generated",
ID 345, VALUE wwk-cb-val,
EVENT PROCEDURE IS R10-events,
HANDLE IN wwk-cb-handle,

A checkbox is showed on my screen but I can't do anything with it. I suppose something is wrong with the accept........

I want the checkbox working the same as the other controls on my screen. But how.......???

(ps When possible also with a before and after accept procedure)

Kind regards,

Stephan Boeder
BEVER Automatisering B.V.
If you are accepting a screen section, it might be better to include all possible fields in the screen section and just make them invisible or visible (or enabled and disabled) based on your conditions. Then, you don't have to worry about accepting those fields separately.

Rob

[Migrated content. Thread originally posted on 01 December 2005]

I've created a window in Acubench which contains a button and a few entry-fields.

I want to create controls dynamically on my screen!

When I push the button, the clicked event is executed.

The following code is in the event:

DISPLAY Check-Box UPON SCA1-handle,
COL 9,00,
LINE 5,60,
LINES 2,20 CELLS,
SIZE 21,50 CELLS,
FONT IS MS-Sans-Serif8,
TITLE "Check Box Generated",
ID 345, VALUE wwk-cb-val,
EVENT PROCEDURE IS R10-events,
HANDLE IN wwk-cb-handle,

A checkbox is showed on my screen but I can't do anything with it. I suppose something is wrong with the accept........

I want the checkbox working the same as the other controls on my screen. But how.......???

(ps When possible also with a before and after accept procedure)

Kind regards,

Stephan Boeder
BEVER Automatisering B.V.
I think that's not a good solution for me, because, depending on properties (choosen by the customer) I like to show some checkboxes, some entryfields or some comboboxes, or in some situations a combination! With a maximum of 30!

When I use your solutions I need to place 30 comboboxes, 30 entryfields and 30 checkboxes. I understand that it's possible to make them invisible but I don't like such a solution.

Regards,

[Migrated content. Thread originally posted on 01 December 2005]

I've created a window in Acubench which contains a button and a few entry-fields.

I want to create controls dynamically on my screen!

When I push the button, the clicked event is executed.

The following code is in the event:

DISPLAY Check-Box UPON SCA1-handle,
COL 9,00,
LINE 5,60,
LINES 2,20 CELLS,
SIZE 21,50 CELLS,
FONT IS MS-Sans-Serif8,
TITLE "Check Box Generated",
ID 345, VALUE wwk-cb-val,
EVENT PROCEDURE IS R10-events,
HANDLE IN wwk-cb-handle,

A checkbox is showed on my screen but I can't do anything with it. I suppose something is wrong with the accept........

I want the checkbox working the same as the other controls on my screen. But how.......???

(ps When possible also with a before and after accept procedure)

Kind regards,

Stephan Boeder
BEVER Automatisering B.V.
Screen sections are static in nature, you don't "add" controls to them at run-time. For full dynamic screen control use DISPLAY and ACCEPT verbs for your controls. Refer to the acucobol-gt documentation.

[Migrated content. Thread originally posted on 01 December 2005]

I've created a window in Acubench which contains a button and a few entry-fields.

I want to create controls dynamically on my screen!

When I push the button, the clicked event is executed.

The following code is in the event:

DISPLAY Check-Box UPON SCA1-handle,
COL 9,00,
LINE 5,60,
LINES 2,20 CELLS,
SIZE 21,50 CELLS,
FONT IS MS-Sans-Serif8,
TITLE "Check Box Generated",
ID 345, VALUE wwk-cb-val,
EVENT PROCEDURE IS R10-events,
HANDLE IN wwk-cb-handle,

A checkbox is showed on my screen but I can't do anything with it. I suppose something is wrong with the accept........

I want the checkbox working the same as the other controls on my screen. But how.......???

(ps When possible also with a before and after accept procedure)

Kind regards,

Stephan Boeder
BEVER Automatisering B.V.
I've tried already something with display and accept, but I got some problems.

I did a display, and in the event procudure (key-status 96 cmd-goto I write

ACCEPT cb-handle

In the MSG-validate (after tab or clicking with your mouse somewhere) I want to stop the accept and return control to another control. Is this possible? How...?

I've a statement in the MSG-Validate like:
MOVE 4 TO accept-control
MOVE number TO control-id

But this statement went wrong! Because it returns control to my displayed checkbox!

[Migrated content. Thread originally posted on 01 December 2005]

I've created a window in Acubench which contains a button and a few entry-fields.

I want to create controls dynamically on my screen!

When I push the button, the clicked event is executed.

The following code is in the event:

DISPLAY Check-Box UPON SCA1-handle,
COL 9,00,
LINE 5,60,
LINES 2,20 CELLS,
SIZE 21,50 CELLS,
FONT IS MS-Sans-Serif8,
TITLE "Check Box Generated",
ID 345, VALUE wwk-cb-val,
EVENT PROCEDURE IS R10-events,
HANDLE IN wwk-cb-handle,

A checkbox is showed on my screen but I can't do anything with it. I suppose something is wrong with the accept........

I want the checkbox working the same as the other controls on my screen. But how.......???

(ps When possible also with a before and after accept procedure)

Kind regards,

Stephan Boeder
BEVER Automatisering B.V.
Performing an accept within an event procedure is not good practice, it can cause problems with event processing.
Instead, use the event procedure to simply store the event-status information in working storage and terminate the event procedure using(SET EVENT-ACTION TO EVENT-ACTION-TERMINATE. After the event procedure has exited, evaluate the stored event status data and perform your accepts as needed.
Once the accepts are done, you will be able to set accept-control and control-id as desired and loop back to your screen section accept with focus where you want it.