S_234F

LANSA

S_234F
* ===================================================================
*
* Component : S_234F
* Type : Form
* Ancestor : PRIM_FORM
*
* Description : This example contains various components such as
* Push Buttons, Radio buttons, a Grid and Edit Box. The reusable component
* S_234R is used to display the screen position of these components
* dynamically.
*
* 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) Height(589) Left(153) Top(117) Width(555)
Define_Com Class(#PRIM_PHBN) Name(#PUSH_BUTTON_1) Caption('Fixed Button') Displayposition(1) Left(152) Parent(#COM_OWNER) Tabposition(1) Top(40)
Define_Com Class(#PRIM_PHBN) Name(#PUSH_BUTTON_2) Caption('Fixed Button') Displayposition(2) Left(256) Parent(#COM_OWNER) Tabposition(2) Top(232)
Define_Com Class(#PRIM_RDBN) Name(#RADIO_BUTTON_1) Caption('Test Radio') Displayposition(3) Left(160) Parent(#COM_OWNER) Tabposition(3) Top(144) Width(81)

Define_Com Class(#PRIM_KCOL) Name(#TRACKER) Collects(#S_234R) Keyedby(#STD_NUM)
Define_Com Class(#PRIM_EDIT) Name(#EDIT_BOX_1) Displayposition(4) Height(57) Left(416) Parent(#COM_OWNER) Tabposition(4) Top(48)
Define_Com Class(#PRIM_GRID) Name(#GRID_1) Displayposition(5) Height(121) Left(152) Parent(#COM_OWNER) Showbuttonselection(True) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(5) Top(344) Width(257)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_1) Displayposition(1) Parent(#GRID_1) Source(#EMPNO) Width(40)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_2) Displayposition(2) Parent(#GRID_1) Source(#SURNAME) Width(50) Widthtype(Remainder)
Define_Com Class(#PRIM_PHBN) Name(#DRAG_BUTTON) Caption('Draggable Button') Displayposition(6) Dragstyle(Automatic) Left(160) Parent(#COM_OWNER) Tabposition(6) Top(512) Width(113)

* Create a collection of S_234R components and associate each one
* with the various push buttons, etc that are present on this form

EVTROUTINE Handling(#com_owner.Initialize)
SET Com(#Tracker<1>) PARENT(#Com_Owner) UCOMPONENT(#Push_Button_1)
SET Com(#Tracker<2>) PARENT(#Com_Owner) UCOMPONENT(#Push_Button_2)
SET Com(#Tracker<3>) PARENT(#Com_Owner) UCOMPONENT(#Radio_Button_1)
SET Com(#Tracker<4>) PARENT(#Com_Owner) UCOMPONENT(#Edit_Box_1)
SET Com(#Tracker<5>) PARENT(#Com_Owner) UCOMPONENT(#GRID_1)
SET Com(#Tracker<6>) PARENT(#Com_Owner) UCOMPONENT(#Drag_Button)
ENDROUTINE

* Handle dragging of the draggable button

EVTROUTINE Handling(#DRAG_BUTTON.StartDrag) Options(*NOCLEARMESSAGES *NOCLEARERRORS) CONTINUE(#Continue)
SET Com(#Continue) VALUE(True)
ENDROUTINE

* Only allow the draggable button named Drag_Button to be dragged and dropped

EVTROUTINE Handling(#COM_OWNER.DragOver) Options(*NOCLEARMESSAGES *NOCLEARERRORS) SOURCE(#Source) ACCEPTDROP(#AcceptDrop)
IF_REF Com(#Source) Is(*Equal_to #Drag_Button)
SET Com(#AcceptDrop) VALUE(True)
ELSE
SET Com(#AcceptDrop) VALUE(False)
ENDIF
ENDROUTINE

* Handle dropping of the draggable button

EVTROUTINE Handling(#COM_OWNER.DragDrop) Options(*NOCLEARMESSAGES *NOCLEARERRORS) DRAGRESULT(#DragResult) POSX(#PosX) POSY(#PosY)
SET Com(#Drag_Button) TOP(#PosY) LEFT(#PosX)
SET Com(#DragResult) VALUE(Accepted)
ENDROUTINE

END_COM