open-insight/LSL2/STPROC/SERVICES_EVENTS.txt
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

149 lines
4.8 KiB
Plaintext

Function Services_Events(CtrlEntId, Event, @PARAMS)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from Infineon.
Name : Services_Events
Description : This function acts as a commuter module for all events related to this window.
Notes : Commuter Modules are automatically called from the Promoted_Events function which is called by the
application-specific promoted event handler. This makes it possible to add QuickEvents that need to
execute Basic+ logic without having use the Form Designer to make the association, although this is
limited to the events which are currently promoted.
If the form needs to call the commuter module directly then the QuickEvent parameters should be
formatted like this:
'@SELF','@EVENT',['@PARAM1','@PARAMx']
Parameters :
CtrlEntId [in] -- The fully qualified name of the control calling the promoted event
Event [in] -- The event being executed. See the Notes section regarding "PRE" events
Param1-15 [in] -- Additional event parameter holders
EventFlow [out] -- Set to 1 or 0 so the calling event knows whether or not to chain forward. See comments in
EVENT_SETUP insert
History : (Date, Initials, Notes)
01/30/18 dmb Created initial commuter module.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
#Window SERVICES
$insert APP_INSERTS
$insert EVENT_SETUP
$insert SERVICES_EQUATES
$insert MSG_EQUATES
Declare subroutine SRP_EditTable_Manager, SRP_Show_Window
Declare function SRP_EditTable_Manager, Database_Services, Service_Services
SubclassInfo = Form_Services('FindSubclassControl')
Subclass = SubclassInfo<1>
// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
If Event EQ 'OLE' then
Transfer Event to OIEvent
Transfer Param1 to Event
Transfer Param2 to Param1
Transfer Param3 to Param2
* Transfer Param4 to Param3
* Transfer Param5 to Param4
* Transfer Param6 to Param5
* Transfer Param7 to Param6
* Transfer Param8 to Param7
end
GoToEvent Event for CtrlEntID
Return EventFlow else EVENT_CONTINUE$
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Event WINDOW.CREATE(CreateParam)
GoSub Setup_OLE_Controls
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$)
end event
Event WINDOW.READ()
SRP_EditTable_Manager('Read', @Window : '.OLE_EDT_PROCEDURES', Record)
end event
Event WINDOW.CLOSE(CancelFlag)
end event
Event WINDOW.CLEAR(bSaveKey, bSuppressWarning, bMaintainFocus, CtrlIDFocus)
SRP_EditTable_Manager('Clear')
end event
Event SAVE_BUTTON.CLICK()
Send_Event(@Window, 'WRITE')
end event
Event OLE_EDT_PROCEDURES.LostFocus()
SRP_EditTable_Manager('LostFocus', CtrlEntId)
end event
Event OLE_SUBCLASS.OnComboClick(CtrlId, Sel, Value)
Send_Event(CtrlId, 'LOSTFOCUS')
end event
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Setup_OLE_Controls:
Qualify = ''
Qualify<1> = 1
Qualify<4> = 0
Ctrl = @Window : '.NAME'
Handle = Get_Property(Ctrl, 'HANDLE')
Send_Message(Subclass, 'OLE.Subclass', Handle, Ctrl)
Convert '.' to ';' in Ctrl
ComboArray = ''
ComboArray<1> = True$
DropDownRecord = Service_Services('GetServiceKeys')
Convert @FM to @STM in DropDownRecord
ComboArray<2, 3> = DropDownRecord
ComboArray<2, 10> = False$
Set_Property(Subclass, 'OLE.Combo[' : Ctrl : ']', ComboArray)
Send_Message(Subclass, 'QUALIFY_EVENT', 'OLE.OnComboClick', Qualify)
Ctrl = @Window : '.OLE_EDT_PROCEDURES'
SRP_EditTable_Manager('Setup1', Ctrl, 2 : @FM : 1, 'Procedures' : @VM : 'Arguments', 200 : @FM : 'A', 'L' : @FM : 'L', 2 : @VM : 3, '', '', 1, 1)
Set_Property(@Window, '@EDITTABLES', Ctrl)
Send_Message(Subclass, 'QUALIFY_EVENT', 'OLE.LostFocus', Qualify)
return