Skip to main content

Demo - Disabling the controls on a tab page in Dialog System

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

This example illustrates how to turn controls on tab pages off (disable-object). You cannot disable a tab page. You can, however, disable the controls on a tab page.

Resolution:

INTRODUCTION

==========

This example illustrates how to turn controls on tab pages off (disable-object). You cannot disable a tab page. You can, however, disable the controls on a tab page.

SOURCE FILES:

==========

Program Files           Description

--------------------     -----------------------------------------------------------

NewSet.cbl              Generated Dialog System program with additional initialization of a data block                                   variable to disable the controls on tab pages.

Copy Files:

--------------------     -----------------------------------------------------------

NetSet.cpb              Generated Dialog System Data Block copybook.

Screenset:

--------------------     -----------------------------------------------------------

NewSet.gs               Dialog System screenset with tab pages and controls that are disabled via

                                the tab page dialog.

OPERATION:

==========

Check and Animate the application. The following three items have been added to the Dialog System Data Block:

     TAB-CONTROLS-OFF

     TAB2-DATA TAB1-DATA

The NewSet.cpb copy book contains the following definitions

for these items:

     03 TAB-CONTROLS-OFF                PIC 9.

         88 TAB-CONTROLS-OFF-TRUE        VALUE 1.

     03 TAB2-DATA                       PIC X(5).

     03 TAB1-DATA                       PIC X(5).

The COBOL program initializes TAB-CONTROLS-OFF to a numeric 1:

     set TAB-CONTROLS-OFF-TRUE to TRUE

indicating that tab pages controls are to be disabled. The

TAB2-DATA and TAB1-DATA items are intended to receive any

data value entered by the user via the tab page controls.

Each of the tab page dialogs contains this code:

     WINDOW-CREATED

          IF= TAB-CONTROLS-OFF 1 SETCONTROLOFF

       SETCONTROLOFF

          DISABLE-OBJECT EF1

The dialog code tests TAB-CONTROLS-OFF equal to 1 and when

true branches to the procedure SETCONTROLOFF to disable the

control on the tab page. The only difference between the

two dialogs is the control name.

REFERENCES:

========

Dialog System Help: Click Index (tab) and type "if" into window 1, select "IF dialog function" in window 2 and click "Display (button)". Follow the same procedure to locate information describing the Dialog System Data Block.

==========================================================

Keywords: demonstration, sample, example, demo, Dialog System, controlpanel.zip

demo.ex

demo.ne

Attachments:

DisableTabs.zip

Old KB# 4216