136 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			136 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| Function NDW_ADD_RDS_COMMENT_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_ADD_RDS_COMMENT_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)
 | |
|         10/14/20    jro     Created initial commuter module.
 | |
|         08/28/23	djm		Adapted from NDW_ADD_COMMENT_EVENTS for use with RDS comments.
 | |
| 
 | |
| ***********************************************************************************************************************/
 | |
| 
 | |
| #pragma precomp SRP_PreCompiler
 | |
| 
 | |
| 
 | |
| $insert APP_INSERTS
 | |
| $insert EVENT_SETUP
 | |
| $insert MSG_EQUATES
 | |
|  
 | |
| Declare subroutine  SRP_Show_Window
 | |
| 
 | |
| 
 | |
| // 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)
 | |
| 
 | |
|     If CreateParam EQ '' then CreateParam = False$
 | |
|     Set_Property(@Window, '@INGORELENGTH', CreateParam)
 | |
|     Result       = ''
 | |
|     GoSub Setup_OLE_Controls    
 | |
|             
 | |
|     SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$)
 | |
| 
 | |
| end event
 | |
| 
 | |
| 
 | |
| Event WINDOW.CLOSE(CancelFlag)
 | |
|     
 | |
|     Result      = ''
 | |
|     End_Dialog(@Window, Result)
 | |
|     
 | |
| end event
 | |
| 
 | |
| 
 | |
| Event EDB_COMMENT.CHAR(VirtCode, ScanCode, CtrlKey, ShiftKey, AltKey)
 | |
| 
 | |
|     Form_Services('CloseControlMessage', CtrlEntId)
 | |
|     IgnoreLength   = Get_Property(@Window, '@INGORELENGTH')
 | |
|     CommentText = Get_Property(CtrlEntId, 'TEXT')
 | |
|     
 | |
|     If ( (Len(CommentText) GT 255) and (IgnoreLength EQ False$) ) then
 | |
|         Set_Property(@Window : '.PUB_OK', 'ENABLED', False$)
 | |
|         Message = 'Comment cannot exceed 255 characters.'
 | |
|         Form_Services('DisplayControlMessage', Message, 'Comment Exceeds Max Length', @Window : '.EDB_REV_DET', 'VALIDATION', 'RGB(229,20,0)')       
 | |
|     end
 | |
|     
 | |
|     If ( (CommentText NE '') AND (Len(CommentText) LE 255) ) or ( (CommentText NE '') and (IgnoreLength EQ True$) ) then
 | |
|         Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
 | |
|     end
 | |
| 
 | |
| end event
 | |
| 
 | |
| 
 | |
| Event PUB_OK.CLICK()
 | |
|     
 | |
|     Result           = ''
 | |
|     CommentText   = Get_Property(@Window : '.EDB_COMMENT', 'TEXT')
 | |
|     Convert CRLF$ to ' ' in CommentText 
 | |
|     Result   = CommentText
 | |
|     
 | |
|     End_Dialog(@Window, Result)
 | |
|     
 | |
| end event
 | |
| 
 | |
| 
 | |
| Event PUB_CANCEL.CLICK()
 | |
| 
 | |
|     Result      = ''
 | |
|     End_Dialog(@Window, Result)
 | |
| 
 | |
| end event
 | |
| 
 | |
| 
 | |
| ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 | |
| // Internal GoSubs
 | |
| ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
| Setup_OLE_Controls:
 | |
| 
 | |
|     Qualify     = ''
 | |
|     Qualify<1>  = 1
 | |
|     Qualify<4>  = 0
 | |
| 
 | |
| return
 | |
| 
 |