Object Controls

ODC Server

 

The primary purpose of an ODC Server is to provide a means to re-host all or part of your application in another environment. When used, it allows the application designer to map existing graphical and other operating system related functions to your own objects, thereby giving the application developer the ability to handle his/her own presentation independent of platform.

The following syntax can be used to define an ODC Server to the system:

DEFCTL OBJECT SERVER objectid

Where:

objectid

Handle of your ODC Server object

Note:
The handle of the currently defined ODC Server can be found in TCB(510), which will be 0 if a non-ODC Server is present.

Whenever the system executes a control creation directive such as BUTTON or LIST_BOX, the ODC Server can create and define an ODC to service the request. In addition, the ODC Server can also intercept a wide variety of graphical related commands and functions to process these based on the target environment.

For each type of control created, the system will invoke the following methods within the ODC Server:

 

Button(option$)

Chart(option$)

Check_box(option$)

 

Drop_box(option$)

Grid(option$)

List_box(option$)

 

List_view(option$)

Multi_line(option$)

Radio_button(option$)

 

Tree_view(option$)

Tristate_box(option$)

VarDrop_box(option$)

 

VarList_box(option$)

 

 

For each of these control types, the option$ value will contain the values for the various directive creation values.

Example:

The following example shows a typical Button create method Call:

button 11,@(4,5,10,1.5)="Test",fnt="Arial"

This would invoke the 'Button( ) method in the ODC Server, passing it the option$ of:

Ctlno=11,Col=4,Line=5,Cols=10,Lines=1.5,Text$="Test",Font$="Arial"

Note:
The value contained in option$ is designed to be passed directly to an EXECUTE directive to simplify the loading of the values into object properties.

Control Creation Values

This table contains the list of variables provided on a control creation command:

Variable

Contents Derived From …

Altkey$

Contains the value specified in the KEY= option.

Col

Contains the column number as defined in the @(…).

Cols

Contains the width of the control.

Ctlno 

Contains the control number assigned to the control.

Delim$

Contains the SEP= character.

Font$

Contains the FNT= specification.

Format$

Contains the format specification from the FMT= option.

Help$

Contains the HLP= specification. (build 9201)

Id

Contains the Radio_Button ID (1 through 255).

Line

Contains the line number as defined in the @(…).

Lines

Contains the height of the control.

MaxLen 

Contains the maximum input length as given in the LEN= option.

MenuCtl 

Contains the right mouse click CTL value as given in the CTL= option.

Message$

Contains the message bar text as given in the MSG= option.

NullText$

Contains the null value text for the Multi_Line as given in the NUL= option.

Options$

Contains the options string as given in the OPT= option.

Text$

Contains the text associated with the Button/Check box

Tip$

Contains the floating tip associated with the control in the TIP= option.

Xlate$

Contains the translation table value as given in the TBL= option.

Non-Create Functions

In addition to the control creation functions, the system invokes the ODC Server on the following conditions:

Condition

Processing within ODC Server

Wait for INPUT

If present, the method 'Input(len, echo, line, col) will be called whenever the application request input.

MSE Variable

If present, the method 'GetMse$( ) will be called to return the MSE variable value.

MSGBOX Directive

If present, the method 'MsgBox(params) is passed the parameters from the MSGBOX directive.

POPUP_MENU Directive

If present, the method 'Popup_Menu(params) is passed the parameters from the POPUP_MENU directive.

PREINPUT Directive

If present, the method 'Pre_Input(params) is passed the parameters from the PREINPUT directive. (build 9201) 

CLIP_BOARD Directive

If present, the property 'Clip_Board will be used as a reference to an object to process the various Clip_Board related directives. Within the object, the methods 'Read and 'Write are called to process READ and WRITE functions.

MENU_BAR Directive

If present, the property 'Menu_Bar will be used as a reference to an object to process the various Menu_Bar related directives.

DROP n ON n Directive

If present, the property 'DragDrop will be used as a reference to an object to process the various Drag and Drop related directives.

GET_FILE_BOX Directive

If present, the property 'GetFile will be used as a reference to an object to process the various Get_File_Box related directives.

Graphical, 'CS' and 'DO' Mnemonics

If present, the property 'Mnemonics will be used as a reference to an object to process the various the graphic mnemonics. See Mnemonic Processing.

Foundation Classes

The *plus/ctls directory contains the following foundation classes:

addclip.pvc

This sub-class can be used by your own application to add a CLIP_BOARD emulation class to your ODC server.

adddragdrop.pvc

This sub-class can be used by your own application to add a DRAG and DROP emulation class to your ODC server.

addgetfile.pvc

This sub-class can be used by your own application to add a GET_FILE_BOX emulation class to your ODC server.

addmenu.pvc

This sub-class can be used by your own application to add a MENU_BAR emulation class to your ODC server.

addmnem.pvc

This sub-class can be used by your own application to add a MNEMONIC processing class to your ODC server.

clipboard.pvc

This class supplies CLIP_BOARD directive emulation.

dragdrop.pvc

This class defines the methods required to handle DRAG and DROP functionality. The actual class does little other than provide the required method prototypes.

getfile.pvc

This class defines the methods required to emulate the GET_FILE_BOX directive. It effectively calls the UNIX Get File Box emulator subroutine.

input.pvc

This class can be used within an ODC server to intercept all INPUT/OBTAIN requests on the system.

menubar.pvc

This class defines the methods required to emulate the MENU_BAR directive. The actual class does little other than provide the required method prototypes.

mnemonics.pvc

This class is used to handle all the Graphical mnemonics as routed to the ODC server. The actual class does little other than provide the required method prototypes.

mse.pvc

This class defines the methods required to emulate access to the MSE system variable. The actual class simply returns a dummy MSE variable based on the current structured string definition.

msgbox.pvc

This class defines the methods required to emulate the MSGBOX directive. It calls the text-based MSGBOX emulator subroutine.

popup.pv

This class defines the methods required to emulate the POPUP_MENU directive. The actual class does little other than provide the required method prototypes.

server.pvc

This class provides the foundation logic for an ODC server object. It includes common functionality needed to handle multiple windows.

window.pvc

This sub-class provides the structure and window methods needed within an ODC server.

 

Note:
These foundation classes provide details regarding the methods and properties that are generally required by the system. Review their source coding for additional details on their usage.