138 lines
6.2 KiB
Plaintext
138 lines
6.2 KiB
Plaintext
Function NDW_Find_Lock_Owner_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 : NDW_Find_Lock_Owner_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/31/22 djs Cloned commuter module from NDW_Session_Manager_Events
|
|
|
|
***********************************************************************************************************************/
|
|
|
|
#pragma precomp SRP_PreCompiler
|
|
#Window NDW_FIND_LOCK_OWNER
|
|
|
|
$insert APP_INSERTS
|
|
$insert EVENT_SETUP
|
|
$insert MSG_EQUATES
|
|
|
|
Declare subroutine SRP_Show_Window, Messaging_Services
|
|
Declare function Database_Services, Messaging_Services, GetCurrentProcessId, SRP_Array
|
|
|
|
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)
|
|
|
|
Table = Field(CreateParam, @FM, 1)
|
|
Key = Field(CreateParam, @FM, 2)
|
|
Set_Property(@Window : '.EDL_TABLE_NAME', 'TEXT', Table)
|
|
Set_Property(@Window : '.EDL_KEY_ID', 'TEXT', Key)
|
|
GoSub Setup_OLE_Controls
|
|
|
|
Set_Property(@Window : '.PUB_CLOSE', 'NEXT', @Window : '.PUB_CLOSE')
|
|
|
|
SRP_Show_Window(@Window, 'SYSTEM', 'C', 'C', 1, '', False$, False$)
|
|
|
|
Set_Property(@Window : '.OLE_EDT_LOCK_INFORMATION', 'OLE.CellText[1;All]', '')
|
|
Messaging_Services('SendMessage', 'GetLockOwner', 'Request', '', 'All', Table : ',' : Key, 'EventHandler', @Window : ',OMNIEVENT,@MESSAGE,@ARGUMENTS')
|
|
|
|
end event
|
|
|
|
|
|
Event WINDOW.OMNIEVENT(Message, Param1, Param2, Param3, Param4)
|
|
|
|
Begin Case
|
|
|
|
Case Message _EQC 'GetLockOwner'
|
|
Transfer Param1 to LockInfo
|
|
AtSession = LockInfo<1>[-1, 'B ']
|
|
UserList = Get_Property(@Window : '.OLE_RPT_USER_SESSIONS', 'OLE.List')
|
|
UserArray = SRP_Array('Rotate', UserList, @FM, @VM)
|
|
Locate AtSession in UserArray<1> using @VM setting vPos then
|
|
Set_Property(@Window : '.OLE_RPT_USER_SESSIONS', 'OLE.SelPos', vPos)
|
|
end
|
|
Set_Property(@Window : '.OLE_EDT_LOCK_INFORMATION', 'OLE.CellText[1;1]', AtSession)
|
|
Set_Property(@Window : '.OLE_EDT_LOCK_INFORMATION', 'OLE.CellText[1;2]', LockInfo<2>[-1, 'B '])
|
|
Set_Property(@Window : '.OLE_EDT_LOCK_INFORMATION', 'OLE.CellText[1;3]', LockInfo<3>[-1, 'B '])
|
|
Set_Property(@Window : '.OLE_EDT_LOCK_INFORMATION', 'OLE.CellText[1;4]', LockInfo<4>[-1, 'B '])
|
|
Set_Property(@Window : '.OLE_EDT_LOCK_INFORMATION', 'OLE.CellText[1;5]', 'Lock owner found.')
|
|
|
|
End Case
|
|
|
|
end event
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Internal GoSubs
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
Setup_OLE_Controls:
|
|
|
|
Qualify = ''
|
|
Qualify<1> = 1
|
|
Qualify<4> = 0
|
|
|
|
Ctrl = @Window : '.OLE_EDT_LOCK_INFORMATION'
|
|
Set_Property(Ctrl, 'OLE.Dimension', 1 : @FM : 5)
|
|
Set_Property(Ctrl, 'OLE.HeaderColumn[1]', 80 : @FM : True$ : @FM : False$ : @FM : False$)
|
|
Set_Property(Ctrl, 'OLE.DataRow[All]', 23 : @FM : True$ : @FM : False$)
|
|
Set_Property(Ctrl, 'OLE.HeaderRow[1]', @FM : False$)
|
|
Set_Property(Ctrl, 'OLE.HeaderText[1;2]', '@Station')
|
|
Set_Property(Ctrl, 'OLE.HeaderText[1;3]', '@User4')
|
|
Set_Property(Ctrl, 'OLE.HeaderText[1;4]', '@UserName')
|
|
Set_Property(Ctrl, 'OLE.HeaderText[1;5]', 'Process ID')
|
|
Set_Property(Ctrl, 'OLE.HeaderText[1;6]', 'Message')
|
|
Set_Property(Ctrl, 'OLE.DataColumn[1]', 240 : @FM : True$ : @FM : False$ : @FM : True$)
|
|
Set_Property(Ctrl, 'OLE.HeaderFont[1;All]', 'Segoe UI' : @SVM : 9)
|
|
Set_Property(Ctrl, 'OLE.HeaderFont[1;6]', 'Segoe UI' : @SVM : 9 : @SVM : 700)
|
|
Set_Property(Ctrl, 'OLE.CellFont[1;All]', 'Segoe UI' : @SVM : 9)
|
|
Set_Property(Ctrl, 'OLE.CellFont[1;5]', 'Segoe UI' : @SVM : 9 : @SVM : 700)
|
|
Set_Property(Ctrl, 'OLE.ScrollBarsVisible', 'Never' : @FM : 'Never')
|
|
Set_Property(Ctrl, 'ENABLED', False$)
|
|
|
|
return
|