S_230FB

LANSA

S_230FB
* ===================================================================
*
* Component : S_230FB
* Type : Form
* Ancestor : PRIM_FORM
*
* Description : This is a second example of a form that uses #S_230RH1
* to manage the display of it's help text.
*
* Disclaimer : The following material is supplied as example material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
FUNCTION OPTIONS(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Caption('CHM Help Secondary Example Form') Formstyle(NormalChild) Height(170) Left(53) Top(406) Visualstyle(#VS_NORM) Width(474)

* ========================
* Define this forms layout
* ========================

Define_Com Class(#PRIM_PHBN) Name(#OK_BUTTON) Caption('OK') Displayposition(1) Left(376) Parent(#COM_OWNER) Tabposition(1) Top(15)
Define_Com Class(#PRIM_PHBN) Name(#CANCEL_BUTTON) Caption('Cancel') Displayposition(2) Left(376) Parent(#COM_OWNER) Tabposition(2) Top(45)
Define_Com Class(#POSTCODE.Visual) Name(#POSTCODE) Displayposition(3) Height(19) Left(32) Parent(#COM_OWNER) Tabposition(3) Top(23) Width(216)
Define_Com Class(#SALARY.Visual) Name(#SALARY) Displayposition(4) Height(19) Left(30) Parent(#COM_OWNER) Tabposition(4) Top(61) Width(278)
Define_Com Class(#PRIM_PHBN) Name(#ONLINE_GUIDE_BUTTON) Caption('Online Guide') Displayposition(5) Left(376) Parent(#COM_OWNER) Tabposition(5) Top(78)
Define_Com Class(#PRIM_PHBN) Name(#HELP_BUTTON) Caption('Help') Displayposition(6) Left(376) Parent(#COM_OWNER) Tabposition(6) Top(109)

* =======================================
* Define S_230RH1 as the "Help Interface"
* =======================================

Define_Com Class(#S_230RH1) Name(#HELP_INTERFACE)

* =================
* Handle Initialize
* =================

Evtroutine Handling(#Com_Owner.Initialize) Options(*NOCLEARERRORS *NOCLEARMESSAGES)

* Register for help management. Tell the interface what this form is
* and about any help or guide buttons that are to be automatically
* managed. In this a help button and an online guide button exist.

Invoke #Help_Interface.uRegisterforHelp uForm(#Com_Owner) uHelpButton(#Help_Button) uGuideButton(#Online_Guide_Button)

Endroutine

* ==================
* Handle Termination
* ==================

Evtroutine Handling(#Com_Owner.Closing) Options(*NOCLEARERRORS *NOCLEARMESSAGES)

* Unregister for help management

Invoke #Help_Interface.uUnRegisterforHelp

Endroutine

* ====================
* Handle Cancel Button
* ====================

Evtroutine Handling(#Cancel_Button.Click) Options(*NOCLEARERRORS *NOCLEARMESSAGES)
Invoke #Com_Owner.CloseForm
Endroutine

* =======================================================================
* When any of major controls that has help text receives focus, tell
* the help interface which control now defines the current help topic
* =======================================================================

Evtroutine Handling(#Salary.GotFocus #PostCode.GotFocus #OK_Button.GotFocus #Cancel_Button.GotFocus) Com_Sender(#SenderComponent) Options(*NOCLEARERRORS *NOCLEARMESSAGES)
Invoke #Help_Interface.uSetCurrentTopic uForComponent(#SenderComponent)
Endroutine

END_COM